change Player.cs to emit PlayerHurt on receiving damage

issue-templates
John Montagu, the 4th Earl of Sandvich 2024-03-01 21:58:44 -08:00
parent 0cd13d5b5b
commit 2fb3bf34fa
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
1 changed files with 5 additions and 0 deletions

View File

@ -174,6 +174,11 @@ public sealed partial class Player : Character
GetNode<GpuParticles2D>("Effects/HurtParticles") GetNode<GpuParticles2D>("Effects/HurtParticles")
.SetDirection(knockbackDir); .SetDirection(knockbackDir);
Events.EventBus.Instance.EmitSignal(
Events.EventBus.SignalName.PlayerHurt,
new Events.HurtArgs { Attacker = inflictor, Weapon = weapon }
);
base.OnReceivedDamage(damage, base.OnReceivedDamage(damage,
inflictor, inflictor,
knockback, knockback,