Floor 0 stuff
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
27
src/map/dungeon/code/Floor0.cs
Normal file
27
src/map/dungeon/code/Floor0.cs
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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
Reference in New Issue
Block a user