Floor 0 stuff

This commit is contained in:
2024-10-10 23:05:30 -07:00
parent 6d29e41f3a
commit 9bbceba973
12 changed files with 745 additions and 643 deletions

View File

@@ -30,10 +30,20 @@ namespace GameJamDungeon
[Node] public Area3D ActivateTrap { get; set; } = default!;
[Node] public StaticBody3D GateCollision { get; set; } = default!;
public void Setup()
{
SpawnItems();
ActivateTrap.BodyEntered += StartBossFight;
OxFace.CurrentHP.Sync += BossHPUpdate;
HorseFace.CurrentHP.Sync += BossHPUpdate;
}
private void BossHPUpdate(double obj)
{
if (OxFace.CurrentHP.Value <= 0 && HorseFace.CurrentHP.Value <= 0)
GateCollision.Hide();
}
private void SpawnItems()
@@ -55,5 +65,10 @@ namespace GameJamDungeon
OxFace.Activate();
HorseFace.Activate();
}
private void EndBossFight()
{
GateCollision.Hide();
}
}
}

View File

@@ -0,0 +1,27 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
[Meta(typeof(IAutoNode))]
public partial class Floor0 : Node3D, IDungeonFloor
{
public override void _Notification(int what) => this.Notify(what);
[Node] public Marker3D PlayerSpawnPoint { get; set; } = default!;
[Node] public Marker3D ExitSpawnPoint { get; set; } = default!;
public Transform3D GetPlayerSpawnPoint()
{
return PlayerSpawnPoint.GlobalTransform;
}
public Vector3 GetTeleportSpawnPoint()
{
return ExitSpawnPoint.GlobalPosition;
}
public void InitializeDungeon()
{
}
}

View File

@@ -17,6 +17,7 @@ public partial class Overworld : Node3D, IDungeonFloor
public void InitializeDungeon()
{
Show();
}
public Transform3D GetPlayerSpawnPoint()

File diff suppressed because one or more lines are too long