Move files and folders to new repo format to enable multi-project format
This commit is contained in:
53
Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs
Normal file
53
Zennysoft.Game.Ma/src/map/dungeon/code/BossRoomA.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class BossRoomA : Node3D, IBossRoom
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node] public Marker3D PlayerSpawn { get; set; } = default!;
|
||||
|
||||
[Node] public Node3D HorseHeadStatue { get; set; } = default!;
|
||||
|
||||
[Node] public Node3D OxFaceStatue { get; set; } = default!;
|
||||
|
||||
[Node] public Boss OxFace { get; set; } = default!;
|
||||
|
||||
[Node] public Boss HorseFace { get; set; } = default!;
|
||||
|
||||
[Node] public Area3D ActivateTrap { get; set; } = default!;
|
||||
|
||||
[Node] public Node3D GateCollision { get; set; } = default!;
|
||||
|
||||
public void Setup()
|
||||
{
|
||||
ActivateTrap.BodyEntered += ActivateTrap_BodyEntered;
|
||||
OxFace.IsDefeated.Sync += BossStatusUpdate;
|
||||
HorseFace.IsDefeated.Sync += BossStatusUpdate;
|
||||
}
|
||||
|
||||
private void ActivateTrap_BodyEntered(Node3D body) => StartBossFight();
|
||||
|
||||
public void StartBossFight()
|
||||
{
|
||||
OxFaceStatue.Hide();
|
||||
HorseHeadStatue.Hide();
|
||||
OxFace.Activate();
|
||||
HorseFace.Activate();
|
||||
}
|
||||
|
||||
public void OnBossFightEnded()
|
||||
{
|
||||
GateCollision.CallDeferred(MethodName.QueueFree);
|
||||
}
|
||||
|
||||
private void BossStatusUpdate(bool obj)
|
||||
{
|
||||
if (OxFace.IsDefeated.Value && HorseFace.IsDefeated.Value)
|
||||
OnBossFightEnded();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user