29 lines
589 B
C#
29 lines
589 B
C#
using Godot;
|
|
|
|
public partial class BossOrbs : RigidBody3D
|
|
{
|
|
[Signal]
|
|
public delegate void OnBossOrbExplodedEventHandler();
|
|
|
|
[Export]
|
|
private float _rotationSpeed = Mathf.Pi;
|
|
[Export]
|
|
private HealthPoints _hp;
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
GetParentNode3D().Rotate(Vector3.Up, _rotationSpeed * (float)delta);
|
|
}
|
|
|
|
public void OnOrbHit(Node3D node)
|
|
{
|
|
_hp.TakeDamage(50000);
|
|
GD.Print(_hp.CurrentHP);
|
|
if (_hp.CurrentHP <= 0)
|
|
{
|
|
EmitSignal(SignalName.OnBossOrbExploded);
|
|
QueueFree();
|
|
}
|
|
}
|
|
}
|