2022-08-13 09:49:41 -04:00
|
|
|
using Content.Shared.Revenant;
|
2022-09-28 22:30:48 -04:00
|
|
|
using Content.Shared.Revenant.Components;
|
2022-08-13 09:49:41 -04:00
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|