mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 10:55:54 +00:00
Patterns tweaks
This commit is contained in:
parent
4be64cf7ec
commit
a430554e27
7 changed files with 69 additions and 22 deletions
|
|
@ -21,6 +21,11 @@ public partial class Boss : Enemy, IActivable
|
|||
public Vector2 HomePosition => _homePosition;
|
||||
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
||||
|
||||
private Marker2D _cameraMarker;
|
||||
|
||||
[Export]
|
||||
public Vector2 CameraOffset = Vector2.Zero;
|
||||
|
||||
// [Export]
|
||||
// private PackedScene _bossPhaseAnimationPrefab;
|
||||
|
||||
|
|
@ -37,12 +42,17 @@ public partial class Boss : Enemy, IActivable
|
|||
_gameManager = this.GetGameManager();
|
||||
|
||||
_homePosition = this.GlobalPosition;
|
||||
|
||||
_cameraMarker = new Marker2D();
|
||||
_gameManager.CallDeferred("add_child", _cameraMarker);
|
||||
_cameraMarker.GlobalPosition = _homePosition + CameraOffset;
|
||||
|
||||
if (BossHudPrefab is not null)
|
||||
{
|
||||
_bossHud = BossHudPrefab.Instantiate<BossHud>();
|
||||
_gameManager.CallDeferred("add_child", _bossHud);
|
||||
|
||||
|
||||
_bossHud.Visible = false;
|
||||
_bossHud.BossName = BossName;
|
||||
_bossHud.BossMaxHealth = this.Health;
|
||||
_bossHud.BossHealth = this._currentHealth;
|
||||
|
|
@ -117,6 +127,11 @@ public partial class Boss : Enemy, IActivable
|
|||
public void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
_started = true;
|
||||
if (_bossHud is not null)
|
||||
{
|
||||
_bossHud.Visible = true;
|
||||
}
|
||||
_gameManager.CameraTargetObject(_cameraMarker);
|
||||
StartPhase(CurrentPhase);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue