Files
tbd-station-14/Content.Client/Revenant/RevenantSystem.cs
Nemanja 3c3ee60dd2 Revenant 2: Electric Boogaloo (#11510)
* revenant 2: electric boogaloo

* revevent

* oversights

* Update RevenantSystem.Abilities.cs

* names

* no shoote stouhg walls
2022-09-28 21:30:48 -05:00

38 lines
1.2 KiB
C#

using Content.Shared.Revenant;
using Content.Shared.Revenant.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Revenant;
public sealed class RevenantSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RevenantComponent, AppearanceChangeEvent>(OnAppearanceChange);
}
private void OnAppearanceChange(EntityUid uid, RevenantComponent component, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
return;
if (args.Component.TryGetData(RevenantVisuals.Harvesting, out bool harvesting) && harvesting)
{
args.Sprite.LayerSetState(0, component.HarvestingState);
}
else if (args.Component.TryGetData(RevenantVisuals.Stunned, out bool stunned) && stunned)
{
args.Sprite.LayerSetState(0, component.StunnedState);
}
else if (args.Component.TryGetData(RevenantVisuals.Corporeal, out bool corporeal))
{
if (corporeal)
args.Sprite.LayerSetState(0, component.CorporealState);
else
args.Sprite.LayerSetState(0, component.State);
}
}
}