mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 16:55:54 +00:00
Dialogue System
This commit is contained in:
parent
77765a581e
commit
1fa77f0c03
690 changed files with 46698 additions and 14 deletions
|
|
@ -4,11 +4,13 @@ using Godot.Collections;
|
|||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
public partial class Boss : Enemy
|
||||
public partial class Boss : Enemy, IActivable
|
||||
{
|
||||
[Export] private Array<BossPhase> Phases;
|
||||
private int currentPhaseIndex = 0;
|
||||
|
||||
private bool _started = false;
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
private Vector2 _homePosition;
|
||||
|
|
@ -25,12 +27,14 @@ public partial class Boss : Enemy
|
|||
|
||||
_homePosition = this.GlobalPosition;
|
||||
|
||||
StartPhase(CurrentPhase);
|
||||
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
base._Process(delta);
|
||||
|
||||
if (!_started) return;
|
||||
|
||||
CurrentPhase.UpdatePhase(delta);
|
||||
if (_currentHealth <= CurrentPhase.Threshold && currentPhaseIndex + 1 < Phases.Count)
|
||||
|
|
@ -48,7 +52,14 @@ public partial class Boss : Enemy
|
|||
|
||||
public void TakeDamage(int amount)
|
||||
{
|
||||
if (!_started) return;
|
||||
|
||||
_currentHealth -= amount;
|
||||
}
|
||||
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
_started = true;
|
||||
StartPhase(CurrentPhase);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue