fun stuff
This commit is contained in:
@@ -18,45 +18,45 @@ public partial class GodCircuit : Node3D
|
||||
|
||||
private void OnHit(Node3D node)
|
||||
{
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, node);
|
||||
}
|
||||
else
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
if (hpComponent.CurrentHP > 0)
|
||||
{
|
||||
GD.Print("Hit");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(800000);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, node);
|
||||
}
|
||||
else
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
if (hpComponent.CurrentHP > 0)
|
||||
{
|
||||
GD.Print("Hit");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(800000);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
{
|
||||
EmitSignal(SignalName.DestroyRemainingOrbs);
|
||||
_animationPlayer.Play("OnDeath");
|
||||
_animationPlayer.AnimationFinished += OnGameFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
{
|
||||
EmitSignal(SignalName.DestroyRemainingOrbs);
|
||||
_animationPlayer.Play("OnDeath");
|
||||
_animationPlayer.AnimationFinished += OnGameFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBossOrbDestroyed()
|
||||
{
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(30000000);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
var hpComponent = GetNode<HealthPoints>("HP Component");
|
||||
_animationPlayer.Play("OnHit");
|
||||
hpComponent.TakeDamage(30000000);
|
||||
EmitSignal(SignalName.OnEnemyBossHit, hpComponent.CurrentHP);
|
||||
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
hpComponent.CurrentHP = 1;
|
||||
if (hpComponent.CurrentHP <= 0)
|
||||
hpComponent.CurrentHP = 1;
|
||||
}
|
||||
|
||||
private void OnGameFinished(StringName animationName)
|
||||
{
|
||||
QueueFree();
|
||||
EmitSignal(SignalName.OnGameEnding);
|
||||
QueueFree();
|
||||
EmitSignal(SignalName.OnGameEnding);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user