Make siphon entropy work on crit people... with a twist (#4178)
* Change stuff * Fixes * Replace bibleUsers with command staff * Change stuff * Блять * Блять 2 * Kill * Today I learned how ternary operators work. Yay.
This commit is contained in:
parent
cbe7d309fa
commit
7cd8fffc17
|
|
@ -3,10 +3,14 @@ using Content.Server.Light.Components;
|
|||
using Content.Shared._DV.CosmicCult;
|
||||
using Content.Shared._DV.CosmicCult.Components;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Mindshield.Components;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.StatusEffect;
|
||||
|
|
@ -26,6 +30,8 @@ public sealed class CosmicSiphonSystem : EntitySystem
|
|||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
|
||||
[Dependency] private readonly CosmicCultSystem _cosmicCult = default!;
|
||||
[Dependency] private readonly DamageableSystem _damageable = default!;
|
||||
[Dependency] private readonly MobStateSystem _mobState = default!;
|
||||
|
||||
private readonly HashSet<Entity<PoweredLightComponent>> _lights = [];
|
||||
|
||||
|
|
@ -44,7 +50,7 @@ public sealed class CosmicSiphonSystem : EntitySystem
|
|||
_popup.PopupEntity(Loc.GetString("cosmicability-siphon-full"), uid, uid);
|
||||
return;
|
||||
}
|
||||
if (HasComp<ActiveNPCComponent>(args.Target) || TryComp<MobStateComponent>(args.Target, out var state) && state.CurrentState != MobState.Alive)
|
||||
if (HasComp<ActiveNPCComponent>(args.Target) || _mobState.IsDead(args.Target))
|
||||
{
|
||||
_popup.PopupEntity(Loc.GetString("cosmicability-siphon-fail", ("target", Identity.Entity(args.Target, EntityManager))), uid, uid);
|
||||
return;
|
||||
|
|
@ -77,8 +83,20 @@ public sealed class CosmicSiphonSystem : EntitySystem
|
|||
if (TryComp<ActorComponent>(uid, out var actor))
|
||||
RaiseNetworkEvent(new CosmicSiphonIndicatorEvent(GetNetEntity(target)), actor.PlayerSession);
|
||||
|
||||
uid.Comp.EntropyStored += uid.Comp.CosmicSiphonQuantity;
|
||||
uid.Comp.EntropyBudget += uid.Comp.CosmicSiphonQuantity;
|
||||
var siphonQuantity = uid.Comp.CosmicSiphonQuantity;
|
||||
|
||||
if (_mobState.IsCritical(target)) // If the target is in crit, we get much more entropy from them, but kill them in the process.
|
||||
{
|
||||
siphonQuantity = HasComp<MindShieldComponent>(target) ? uid.Comp.SiphonQuantityCritMindshield : uid.Comp.SiphonQuantityCrit;
|
||||
|
||||
_damageable.TryChangeDamage(target, uid.Comp.SiphonCritDamage);
|
||||
_popup.PopupEntity(Loc.GetString("cosmicability-siphon-crit", ("user", Identity.Entity(uid, EntityManager)), ("target", Identity.Entity(target, EntityManager))), uid, PopupType.MediumCaution);
|
||||
}
|
||||
if (siphonQuantity + uid.Comp.EntropyStored > uid.Comp.EntropyStoredCap)
|
||||
siphonQuantity = uid.Comp.EntropyStoredCap - uid.Comp.EntropyStored;
|
||||
|
||||
uid.Comp.EntropyStored += siphonQuantity;
|
||||
uid.Comp.EntropyBudget += siphonQuantity;
|
||||
Dirty(uid, uid.Comp);
|
||||
_statusEffects.TryAddStatusEffect<CosmicEntropyDebuffComponent>(target, "EntropicDegen", TimeSpan.FromSeconds(_random.Next(21) + 40), true); //40-60 seconds, 4-6 cold damage per siphon
|
||||
if (_cosmicCult.EntityIsCultist(target))
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Content.Shared.StatusIcon;
|
|||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Audio;
|
||||
using Content.Shared._DV.CosmicCult.Prototypes;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Alert;
|
||||
using Robust.Shared.Serialization;
|
||||
|
|
@ -107,6 +108,24 @@ public sealed partial class CosmicCultComponent : Component
|
|||
[DataField] public int CosmicSiphonQuantity = 1;
|
||||
public static readonly int DefaultCosmicSiphonQuantity = 1;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of Entropy generated by Siphon Entropy when used on a person in critical condition
|
||||
/// </summary>
|
||||
[DataField] public int SiphonQuantityCrit = 6;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of Entropy generated by Siphon Entropy when used on a mindshielded person in critical condition
|
||||
/// </summary>
|
||||
[DataField] public int SiphonQuantityCritMindshield = 10;
|
||||
|
||||
/// <summary>
|
||||
/// The amount of damage dealt by Siphon Entropy when used on a person in critical condition
|
||||
/// </summary>
|
||||
[DataField] public DamageSpecifier SiphonCritDamage = new() {
|
||||
DamageDict = new() {
|
||||
{ "Cold", 200 }
|
||||
}
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region Misc Data
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ cosmicability-siphon-cultist-success = Your attempts to draw entropy chill {CAPI
|
|||
cosmicability-siphon-success = You silently draw Entropy from {CAPITALIZE(THE($target))}.
|
||||
cosmicability-siphon-fail = You can't seem to siphon Entropy from {CAPITALIZE(THE($target))}.
|
||||
cosmicability-siphon-full = You can't hold any more Entropy!
|
||||
cosmicability-siphon-crit = {CAPITALIZE(THE($user))}'s eyes flash with energy, and {THE($target)} drops dead!
|
||||
|
||||
cosmicability-blank-begin = {CAPITALIZE(THE($target))} attempts to grab hold of you!
|
||||
cosmicability-blank-success = You shunt {CAPITALIZE(THE($target))}'s mind unto the cosmic dark.
|
||||
|
|
|
|||
Loading…
Reference in New Issue