From b20fa81e7d1aa079a890b411a0e90921c44d87f5 Mon Sep 17 00:00:00 2001 From: FoxxoTrystan Date: Tue, 12 Nov 2024 20:38:01 +0100 Subject: [PATCH] Stun on full mana drain. --- Content.Shared/Shadowkin/SharedEtherealSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Shared/Shadowkin/SharedEtherealSystem.cs b/Content.Shared/Shadowkin/SharedEtherealSystem.cs index 6fc30f31cc2..4d9a5e47b0d 100644 --- a/Content.Shared/Shadowkin/SharedEtherealSystem.cs +++ b/Content.Shared/Shadowkin/SharedEtherealSystem.cs @@ -14,6 +14,8 @@ using Robust.Shared.Configuration; using Content.Shared.Abilities.Psionics; using Content.Shared.Tag; +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; namespace Content.Shared.Shadowkin; @@ -24,6 +26,7 @@ public abstract class SharedEtherealSystem : EntitySystem [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly TagSystem _tag = default!; + [Dependency] private readonly StaminaSystem _stamina = default!; public override void Initialize() { @@ -99,6 +102,9 @@ private void OnManaUpdate(EntityUid uid, EtherealComponent component, ref OnMana if (magic.Mana <= 0) { + if (TryComp(uid, out var stamina)) + _stamina.TakeStaminaDamage(uid, stamina.CritThreshold, stamina, uid); + SpawnAtPosition("ShadowkinShadow", Transform(uid).Coordinates); SpawnAtPosition("EffectFlashShadowkinDarkSwapOff", Transform(uid).Coordinates); RemComp(uid, component);