Add event publishing for inventory and combat interactions
This commit is contained in:
@@ -34,5 +34,8 @@ public class DamageSystem : ISystem
|
||||
{
|
||||
var targetAttributes = _world.GetComponent<AttributeComponent>(e.Target);
|
||||
targetAttributes?.ModifyValue(Attribute.Health, -e.Amount);
|
||||
|
||||
var newHealth = targetAttributes?.GetValue(Attribute.Health) ?? 0f;
|
||||
_world.PublishEvent(new EntityDamagedEvent(e.Target, newHealth, e.Amount));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user