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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user