Sync weapon equip to hitbox damage

This commit is contained in:
2024-09-01 16:34:33 -07:00
parent 5b110845e9
commit dc3639ad6e
8 changed files with 49 additions and 27 deletions

View File

@@ -106,12 +106,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
public void OnPlayerHitboxEntered(Area3D body)
{
if (body.GetParent() is IPlayer)
if (body is IHitbox hitBox)
{
if (CurrentHP > 0)
{
GD.Print("Enemy Hit");
EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer());
EnemyLogic.Input(new EnemyLogic.Input.HitByPlayer(hitBox.Damage));
}
}
}