mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Fix for phase switch animation
This commit is contained in:
parent
bfdb71dd84
commit
95979bd3b8
7 changed files with 21 additions and 14 deletions
|
|
@ -14,6 +14,7 @@ public partial class Boss : Enemy, IActivable
|
|||
private int currentPhaseIndex = 0;
|
||||
|
||||
private bool _started = false;
|
||||
private bool _waiting = false;
|
||||
|
||||
private GameManager _gameManager;
|
||||
public GameManager GameManager => _gameManager;
|
||||
|
|
@ -22,7 +23,7 @@ public partial class Boss : Enemy, IActivable
|
|||
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
||||
|
||||
private Marker2D _cameraMarker;
|
||||
|
||||
|
||||
[Export]
|
||||
public Vector2 CameraOffset = Vector2.Zero;
|
||||
|
||||
|
|
@ -94,6 +95,7 @@ public partial class Boss : Enemy, IActivable
|
|||
base._Process(delta);
|
||||
|
||||
if (!_started) return;
|
||||
if (_waiting) return;
|
||||
|
||||
CurrentPhase.UpdatePhase(delta);
|
||||
if (_currentHealth <= CurrentPhase.Threshold && currentPhaseIndex + 1 < Phases.Count)
|
||||
|
|
@ -108,6 +110,8 @@ public partial class Boss : Enemy, IActivable
|
|||
{
|
||||
if (phase.PlayAnimation)
|
||||
{
|
||||
_waiting = true;
|
||||
_invulnerable = true;
|
||||
_ = Switchphase(phase);
|
||||
}
|
||||
else
|
||||
|
|
@ -138,6 +142,8 @@ public partial class Boss : Enemy, IActivable
|
|||
{
|
||||
await PlayAnimation();
|
||||
|
||||
_waiting = false;
|
||||
_invulnerable = false;
|
||||
phase.Start(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue