Improvements to save and loading
Improvements to Chinthe animation logic Fix broken Godot Tool system and just use a more manual approach to setting map nodes Remove ItemDatabase from individual room scenes
This commit is contained in:
@@ -25,11 +25,29 @@ public partial class DungeonFloor : Node3D, IDungeonFloor
|
||||
_playerSpawnPoint = RandomizePlayerSpawnPoint();
|
||||
}
|
||||
|
||||
public void SpawnEnemies(Godot.Collections.Dictionary<EnemyType, float> enemyInfo)
|
||||
public void SpawnEnemies(DungeonFloorNode floorNode)
|
||||
{
|
||||
var enemyOdds = new Godot.Collections.Dictionary<EnemyType, float>
|
||||
{
|
||||
{ EnemyType.Sproingy, floorNode.Sproingy },
|
||||
{ EnemyType.Michael, floorNode.Michael },
|
||||
{ EnemyType.FilthEater, floorNode.FilthEater },
|
||||
{ EnemyType.Sara, floorNode.Sara },
|
||||
{ EnemyType.Ballos, floorNode.Ballos },
|
||||
{ EnemyType.Chariot, floorNode.Chariot },
|
||||
{ EnemyType.Chinthe, floorNode.Chinthe },
|
||||
{ EnemyType.AmbassadorGreen, floorNode.GreenAmbassador },
|
||||
{ EnemyType.AmbassadorRed, floorNode.RedAmbassador },
|
||||
{ EnemyType.AmbassadorSteel, floorNode.SteelAmbassador },
|
||||
{ EnemyType.AgniDemon, floorNode.AgniDemon },
|
||||
{ EnemyType.AqueousDemon, floorNode.AqueosDemon },
|
||||
{ EnemyType.Palan, floorNode.Palan },
|
||||
{ EnemyType.ShieldOfHeaven, floorNode.ShieldOfHeaven },
|
||||
{ EnemyType.GoldSproingy, floorNode.GoldSproingy },
|
||||
};
|
||||
var monsterRooms = Rooms.OfType<MonsterRoom>();
|
||||
foreach (var room in monsterRooms)
|
||||
room.SpawnEnemies(enemyInfo);
|
||||
room.SpawnEnemies(enemyOdds);
|
||||
}
|
||||
|
||||
public Transform3D GetPlayerSpawnPoint() => new Transform3D(_playerSpawnPoint.Basis, new Vector3(_playerSpawnPoint.Origin.X, 0f, _playerSpawnPoint.Origin.Z));
|
||||
|
||||
@@ -2,7 +2,6 @@ using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
using Zennysoft.Game.Implementation;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
@@ -18,8 +17,6 @@ public partial class MonsterRoom : DungeonRoom
|
||||
|
||||
[Node] public Marker3D PlayerSpawn { get; set; } = default!;
|
||||
|
||||
[Node] public ItemDatabase ItemDatabase { get; set; } = default!;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
SpawnItems();
|
||||
@@ -27,6 +24,9 @@ public partial class MonsterRoom : DungeonRoom
|
||||
|
||||
public void SpawnEnemies(Godot.Collections.Dictionary<EnemyType, float> enemyInfo)
|
||||
{
|
||||
if (enemyInfo == null || enemyInfo.Count == 0)
|
||||
return;
|
||||
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
var enemySpawnPoints = EnemySpawnPoints.GetChildren();
|
||||
|
||||
Reference in New Issue
Block a user