Damage visualizer for simple mobs (#1332)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
metalgearsloth
2020-07-23 10:04:03 +10:00
committed by GitHub
parent 9585c7b82d
commit 56737b635f
11 changed files with 146 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.Mobs;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
@@ -25,6 +27,8 @@ namespace Content.Server.GameObjects
{
public void EnterState(IEntity entity)
{
entity.TryGetComponent(out AppearanceComponent appearanceComponent);
appearanceComponent?.SetData(DamageStateVisuals.State, DamageStateVisualData.Normal);
}
public void ExitState(IEntity entity)
@@ -104,6 +108,8 @@ namespace Content.Server.GameObjects
if(entity.TryGetComponent(out StunnableComponent stun))
stun.CancelAll();
entity.TryGetComponent(out AppearanceComponent appearanceComponent);
appearanceComponent?.SetData(DamageStateVisuals.State, DamageStateVisualData.Crit);
StandingStateHelper.Down(entity);
}
@@ -186,6 +192,8 @@ namespace Content.Server.GameObjects
stun.CancelAll();
StandingStateHelper.Down(entity);
entity.TryGetComponent(out AppearanceComponent appearanceComponent);
appearanceComponent?.SetData(DamageStateVisuals.State, DamageStateVisualData.Dead);
if (entity.TryGetComponent(out ICollidableComponent collidable))
{