Make adjustments to bad end map

Modify debug menu slightly to pause while open (need to close the menu to load floors, etc)
Clear map when game over screen appears
This commit is contained in:
2026-06-08 00:08:25 -07:00
parent 19bf9563b6
commit 2ab6158849
12 changed files with 208 additions and 78 deletions
File diff suppressed because one or more lines are too long
@@ -3,33 +3,61 @@ using Chickensoft.Introspection;
using Godot;
using System.Linq;
using Zennysoft.Game.Ma;
using Zennysoft.Ma.Adapter;
[Meta(typeof(IAutoNode))]
public partial class BadEnd : SpecialFloor
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] protected IPlayer _player => this.DependOn(() => GetParent().GetChildren().OfType<IPlayer>().Single());
[Dependency] protected IGame _game => this.DependOn<IGame>();
[Export] public float ShakeAmount = 50;
[Node] public Node3D EnemySpawnPoints { get; set; } = default!;
[Node] public Marker3D PlayerSpawnPoint { get; set; } = default!;
[Node] public ShakeCamera Camera3D { get; set; } = default!;
public void OnReady()
{
SpawnEnemies();
var tweener = GetTree().CreateTween();
tweener.TweenMethod(Callable.From((float x) => SetShakeValue(x)), ShakeAmount, 1f, 700f).SetDelay(30);
}
public void StartEndGameCutscene()
{
_player.Deactivate();
_player.ShowCamera(false);
Camera3D.Current = true;
}
public void EndGame()
{
SfxDatabase.Instance.Play(SoundEffect.Death);
_game.GameOver();
}
private void SetShakeValue(float shakeAmount)
{
_player.ShakePlayerCamera(shakeAmount, 1f);
}
public void SpawnEnemies()
{
var enemySpawnPoints = EnemySpawnPoints.GetChildren().OfType<Marker3D>();
foreach (var spawnPoint in enemySpawnPoints)
{
var instantiatedEnemy = EnemyTypeToEnemyConverter.Convert(EnemyType.Michael);
AddChild(instantiatedEnemy);
instantiatedEnemy.GlobalPosition = new Vector3(spawnPoint.GlobalPosition.X, 2.4f, spawnPoint.GlobalPosition.Z);
ResetPhysicsInterpolation();
var enemyWithFollowBehavior = (IHaveFollowBehavior)instantiatedEnemy;
enemyWithFollowBehavior.FollowBehavior.StartFollow(enemyWithFollowBehavior.NavigationAgent);
}
var enemySpawnPoints = EnemySpawnPoints.GetChildren().OfType<Marker3D>();
foreach (var spawnPoint in enemySpawnPoints)
{
var instantiatedEnemy = EnemyTypeToEnemyConverter.Convert(EnemyType.Michael);
AddChild(instantiatedEnemy);
instantiatedEnemy.GlobalPosition = new Vector3(spawnPoint.GlobalPosition.X, 2.4f, spawnPoint.GlobalPosition.Z);
ResetPhysicsInterpolation();
var enemyWithFollowBehavior = (IHaveFollowBehavior)instantiatedEnemy;
enemyWithFollowBehavior.FollowBehavior.StartFollow(enemyWithFollowBehavior.NavigationAgent);
}
}
public override (Vector3 Rotation, Vector3 Position) GetPlayerSpawnPoint() { return (PlayerSpawnPoint.Rotation, new Vector3(PlayerSpawnPoint.GlobalPosition.X, 2.4f, PlayerSpawnPoint.GlobalPosition.Z)); }