Release Candidate v0.1

This commit is contained in:
2023-09-14 19:13:54 -07:00
parent 54b044142d
commit 7bf559a800
44 changed files with 1257 additions and 476 deletions

View File

@@ -4,8 +4,6 @@ public partial class GodCircuit : Node3D
{
[Export]
private AnimationPlayer _animationPlayer;
[Export]
private Timer _attackTimer;
[Signal]
public delegate void OnEnemyBossHitEventHandler(long damage);
@@ -18,45 +16,46 @@ 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(1);
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(60);
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);
GD.Print("On game ending");
EmitSignal(SignalName.OnGameEnding);
QueueFree();
}
}