using Content.Shared.Ninja.Components; using Content.Shared.Weapons.Melee.Events; using Robust.Shared.GameStates; using Robust.Shared.Network; namespace Content.Shared.Ninja.Systems; public abstract class SharedNinjaSystem : EntitySystem { [Dependency] protected readonly SharedNinjaSuitSystem _suit = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnNinjaAttacked); } /// /// Sets the station grid entity that the ninja was spawned near. /// public void SetStationGrid(NinjaComponent comp, EntityUid? grid) { comp.StationGrid = grid; } /// /// Set the ninja's worn suit entity /// public void AssignSuit(NinjaComponent comp, EntityUid? suit) { comp.Suit = suit; } /// /// Set the ninja's worn gloves entity /// public void AssignGloves(NinjaComponent comp, EntityUid? gloves) { comp.Gloves = gloves; } /// /// Bind a katana entity to a ninja, letting it be recalled and dash. /// public void BindKatana(NinjaComponent comp, EntityUid? katana) { comp.Katana = katana; } /// /// Drain power from a target battery into the ninja's suit battery. /// Serverside only. /// public virtual void TryDrainPower(EntityUid user, NinjaDrainComponent drain, EntityUid target) { } /// /// Gets the user's battery and tries to use some charge from it, returning true if successful. /// Serverside only. /// public virtual bool TryUseCharge(EntityUid user, float charge) { return false; } private void OnNinjaAttacked(EntityUid uid, NinjaComponent comp, AttackedEvent args) { if (comp.Suit != null && TryComp(comp.Suit, out var suit) && suit.Cloaked) { _suit.RevealNinja(comp.Suit.Value, suit, uid, true); } } }