using Content.Server.Bible.Components; using Content.Server.Guardian; using Content.Shared._DV.Psionics.Events; using Content.Shared._DV.Psionics.Systems.PsionicPowers; namespace Content.Server._DV.Psionics.Systems.PsionicPowers; public sealed class DispelPowerSystem : SharedDispelPowerSystem { [Dependency] private readonly GuardianSystem _guardian = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGuardianDispelled); SubscribeLocalEvent(OnFamiliarDispelled); } private void OnGuardianDispelled(Entity guardian, ref DispelledEvent args) { if (TryComp(guardian.Comp.Host, out var host)) _guardian.ToggleGuardian(guardian.Comp.Host.Value, host); DealDispelDamage(guardian, dispeller: args.Dispeller); args.Handled = true; } private void OnFamiliarDispelled(Entity familiar, ref DispelledEvent args) { if (familiar.Comp.Source != null) EnsureComp(familiar.Comp.Source.Value); args.Handled = true; } }