fun stuff

This commit is contained in:
GameJammer
2023-09-14 14:17:27 -07:00
parent 568eb9e6e0
commit 54b044142d
22 changed files with 532 additions and 257 deletions

View File

@@ -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);
}
}