Skip to content

Commit

Permalink
Revenant buff (#1905)
Browse files Browse the repository at this point in the history
* damage attacker and stun them

При атаке ревенанта атакующий получает 10 урона холодом, и стан на 4 секунды.

* Update lmgs.yml

forgot to clear shit

* cold damage ignore resistanses, shock do 0

гарантированно наносит 10 холода, электрошок не наносит урона

* Add IgnoreInsulation vatiable

* ignore insuls  component add

+small tweak so it works just fine

* added summary for IgnoresInsulation

* cold damage on contact

Когда ревенант в телесной форме, при контакте с ним получаете 5 урона холодом. Бойтесь ревы!!

* break lights via defile ability

Теперь ревенант не просто моргает лампочками, а бьет их!

* Update revenant.yml

check fix

* balanced structural damage

теперь ревенант ломает новое целое окно за 4 прожима абилки. Если окно было прежде хоть чуть повреждено, ломает за три

* Update RevenantSystem.Abilities.cs

---------

Co-authored-by: Кирилл Хилювчиц <[email protected]>
  • Loading branch information
lexaSvarshik and Kirus59 authored Oct 9, 2024
1 parent 1bd22e0 commit eb1c447
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
13 changes: 8 additions & 5 deletions Content.Server/Electrocution/ElectrocutionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)>();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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))
Expand Down
22 changes: 19 additions & 3 deletions Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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<TagComponent>();
var entityStorage = GetEntityQuery<EntityStorageComponent>();
var items = GetEntityQuery<ItemComponent>();
Expand All @@ -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);
}

Expand All @@ -269,10 +272,23 @@ private void OnDefileAction(EntityUid uid, RevenantComponent component, Revenant
TryComp<PhysicsComponent>(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)
Expand Down
10 changes: 10 additions & 0 deletions Content.Shared/Electrocution/Components/ElectrifiedComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ public sealed partial class ElectrifiedComponent : Component
[DataField, AutoNetworkedField]
public float Probability = 1f;


//SS220 Add ignore insulation begin

/// <summary>
/// When true - ignores insulated gloves/etc and applies shock to the entity
/// </summary>
[DataField]
public bool IgnoreInsulation = false;
//SS220 Add ignore insulation end

[DataField, AutoNetworkedField]
public bool IsWireCut = false;
}
17 changes: 17 additions & 0 deletions Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit eb1c447

Please sign in to comment.