Files
GameJam2023/Enemies/Scripts/GodCircuit.cs
2023-09-10 12:18:02 -07:00

20 lines
470 B
C#

using Godot;
public partial class GodCircuit : Node3D
{
[Export]
private AnimationPlayer _animationPlayer;
[Signal]
public delegate void OnEnemyBossHitEventHandler(long damage);
private void OnHit(Node3D node)
{
GD.Print("Hit");
_animationPlayer.Play("OnHit");
var hpComponent = GetNode<HealthPoints>("HP Component");
hpComponent.TakeDamage(800000);
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
}
}