diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 88404c4aa960..18893468fd97 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -220,7 +220,7 @@ public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid, _appearance.SetData(uid, ElectrifiedVisuals.IsPowered, true); siemens *= electrified.SiemensCoefficient; - if (!DoCommonElectrocutionAttempt(targetUid, uid, ref siemens) || siemens <= 0) + if (!DoCommonElectrocutionAttempt(targetUid, uid, ref siemens, electrified.IgnoreInsulation) || siemens <= 0) //SS220 Add ignore insulation return false; // If electrocution would fail, do nothing. var targets = new List<(EntityUid entity, int depth)>(); @@ -237,7 +237,8 @@ public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid, (int) (electrified.ShockDamage * MathF.Pow(RecursiveDamageMultiplier, depth)), TimeSpan.FromSeconds(electrified.ShockTime * MathF.Pow(RecursiveTimeMultiplier, depth)), true, - electrified.SiemensCoefficient + electrified.SiemensCoefficient, + ignoreInsulation: electrified.IgnoreInsulation //SS220 Add ignore insulation ); } return lastRet; @@ -266,7 +267,8 @@ public bool TryDoElectrifiedAct(EntityUid uid, EntityUid targetUid, (int) (electrified.ShockDamage * MathF.Pow(RecursiveDamageMultiplier, depth) * damageScalar), TimeSpan.FromSeconds(electrified.ShockTime * MathF.Pow(RecursiveTimeMultiplier, depth) * timeScalar), true, - electrified.SiemensCoefficient); + electrified.SiemensCoefficient, + ignoreInsulation: electrified.IgnoreInsulation); //SS220 Add ignore insulation } return lastRet; } @@ -313,9 +315,10 @@ private bool TryDoElectrocutionPowered( bool refresh, float siemensCoefficient = 1f, StatusEffectsComponent? statusEffects = null, - TransformComponent? sourceTransform = null) + TransformComponent? sourceTransform = null, + bool ignoreInsulation = false) //SS220 Add ignore insulation { - if (!DoCommonElectrocutionAttempt(uid, sourceUid, ref siemensCoefficient)) + if (!DoCommonElectrocutionAttempt(uid, sourceUid, ref siemensCoefficient, ignoreInsulation)) //SS220 Add ignore insulation return false; if (!DoCommonElectrocution(uid, sourceUid, shockDamage, time, refresh, siemensCoefficient, statusEffects)) diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index f972865509ed..b89c6ad010fa 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -5,6 +5,7 @@ using Content.Shared.Tag; using Content.Server.Storage.Components; using Content.Server.Light.Components; +using Content.Server.Light.EntitySystems; using Content.Server.Ghost; using Robust.Shared.Physics; using Content.Shared.Throwing; @@ -43,6 +44,7 @@ public sealed partial class RevenantSystem [Dependency] private readonly TileSystem _tile = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!; + [Dependency] private readonly PoweredLightSystem _poweredLight = default!; //ss220 revenant buff private void InitializeAbilities() { @@ -241,6 +243,7 @@ private void OnDefileAction(EntityUid uid, RevenantComponent component, Revenant } var lookup = _lookup.GetEntitiesInRange(uid, component.DefileRadius, LookupFlags.Approximate | LookupFlags.Static); + var entities = _lookup.GetEntitiesInRange(uid, component.DefileRadius); //ss220 revenant buff //new one for lights breaking var tags = GetEntityQuery(); var entityStorage = GetEntityQuery(); var items = GetEntityQuery(); @@ -253,7 +256,7 @@ private void OnDefileAction(EntityUid uid, RevenantComponent component, Revenant { //hardcoded damage specifiers til i die. var dspec = new DamageSpecifier(); - dspec.DamageDict.Add("Structural", 60); + dspec.DamageDict.Add("Structural", 55); //ss220 Revenant buff //that isn't buff, but.. Uhh, balance? _damage.TryChangeDamage(ent, dspec, origin: uid); } @@ -269,10 +272,23 @@ private void OnDefileAction(EntityUid uid, RevenantComponent component, Revenant TryComp(ent, out var phys) && phys.BodyType != BodyType.Static) _throwing.TryThrow(ent, _random.NextAngle().ToWorldVec()); + //ss220 Revenant buff start //flicker lights - if (lights.HasComponent(ent)) - _ghost.DoGhostBooEvent(ent); + //if (lights.HasComponent(ent)) + // _ghost.DoGhostBooEvent(ent); } + //break lights in defile radius + foreach (var entity in entities) + { + if (!_random.Prob(component.DefileEffectChance + 0.3f)) //slightly bigger chance to destroy a light, 80% + continue; + + if (!lights.TryGetComponent(entity, out var lightComp)) + continue; + + _poweredLight.TryDestroyBulb(entity, lightComp); + } + //ss220 Revenant buff end } private void OnOverloadLightsAction(EntityUid uid, RevenantComponent component, RevenantOverloadLightsActionEvent args) diff --git a/Content.Shared/Electrocution/Components/ElectrifiedComponent.cs b/Content.Shared/Electrocution/Components/ElectrifiedComponent.cs index 52eb76ca5413..9b9c19b76f6d 100644 --- a/Content.Shared/Electrocution/Components/ElectrifiedComponent.cs +++ b/Content.Shared/Electrocution/Components/ElectrifiedComponent.cs @@ -126,6 +126,16 @@ public sealed partial class ElectrifiedComponent : Component [DataField, AutoNetworkedField] public float Probability = 1f; + + //SS220 Add ignore insulation begin + + /// + /// When true - ignores insulated gloves/etc and applies shock to the entity + /// + [DataField] + public bool IgnoreInsulation = false; + //SS220 Add ignore insulation end + [DataField, AutoNetworkedField] public bool IsWireCut = false; } diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml index 3f8190a48fe5..99782f1bd4a0 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml @@ -83,3 +83,20 @@ - Alive - Dead #ss220 spec fix end + #ss220 revenant buff start + - type: DamageOnAttacked + damage: + types: + Cold: 10 + ignoreResistances: true + - type: DamageContacts + damage: + types: + Cold: 5 #may be painful if spammed, but doesnt ignores protection. + - type: Electrified #idk this seems lame but it works fine + shockTime: 8 #4 seconds of stun + shockDamage: 2 + requirePower: false + ignoreInsulation: true + #ss220 revenant buff end +