|
|
|
@ -1,5 +1,6 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Babushka.scripts.CSharp.Common.Fight.Actions;
|
|
|
|
using Babushka.scripts.CSharp.Common.Fight.Actions;
|
|
|
|
|
|
|
|
using Babushka.scripts.CSharp.Common.Inventory;
|
|
|
|
using Babushka.scripts.CSharp.Common.Util;
|
|
|
|
using Babushka.scripts.CSharp.Common.Util;
|
|
|
|
using Godot;
|
|
|
|
using Godot;
|
|
|
|
|
|
|
|
|
|
|
|
@ -19,6 +20,7 @@ public partial class FightWorld : Node
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
EndOfNight
|
|
|
|
EndOfNight
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public required Dictionary<int, Room> paths;
|
|
|
|
public required Dictionary<int, Room> paths;
|
|
|
|
public required List<FighterGroup> enemyGroups;
|
|
|
|
public required List<FighterGroup> enemyGroups;
|
|
|
|
public Special specialRoom = Special.None;
|
|
|
|
public Special specialRoom = Special.None;
|
|
|
|
@ -27,6 +29,7 @@ public partial class FightWorld : Node
|
|
|
|
public class FighterGroup
|
|
|
|
public class FighterGroup
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public required List<Fighter> fighters;
|
|
|
|
public required List<Fighter> fighters;
|
|
|
|
|
|
|
|
public ItemInstance? lootToDrop = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class FightHappeningData
|
|
|
|
public class FightHappeningData
|
|
|
|
@ -81,6 +84,9 @@ public partial class FightWorld : Node
|
|
|
|
public FightHappeningData? fightHappeningData = null;
|
|
|
|
public FightHappeningData? fightHappeningData = null;
|
|
|
|
public AllyFighters allyFighters = new();
|
|
|
|
public AllyFighters allyFighters = new();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// settings
|
|
|
|
|
|
|
|
[Export] private ItemResource? _itemToDropByEnemyGroup;
|
|
|
|
|
|
|
|
|
|
|
|
public void ResetFightWorld()
|
|
|
|
public void ResetFightWorld()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Generate();
|
|
|
|
Generate();
|
|
|
|
@ -89,10 +95,10 @@ public partial class FightWorld : Node
|
|
|
|
|
|
|
|
|
|
|
|
public void Generate()
|
|
|
|
public void Generate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
world = new Generator().GenerateWorld();
|
|
|
|
world = new Generator(this).GenerateWorld();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private class Generator
|
|
|
|
private class Generator(FightWorld fightWorld)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public World GenerateWorld()
|
|
|
|
public World GenerateWorld()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -113,7 +119,7 @@ public partial class FightWorld : Node
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rooms.Add(GenerateDisconnectedRoom());
|
|
|
|
rooms.Add(GenerateDisconnectedRoom());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rooms.Add(new Room
|
|
|
|
rooms.Add(new Room
|
|
|
|
{
|
|
|
|
{
|
|
|
|
paths = [],
|
|
|
|
paths = [],
|
|
|
|
@ -162,6 +168,11 @@ public partial class FightWorld : Node
|
|
|
|
fighters = []
|
|
|
|
fighters = []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (fightWorld._itemToDropByEnemyGroup != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
enemyGroup.lootToDrop = new ItemInstance { blueprint = fightWorld._itemToDropByEnemyGroup };
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var enemyCount = GD.RandRange(2, 3);
|
|
|
|
var enemyCount = GD.RandRange(2, 3);
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < enemyCount; i++)
|
|
|
|
for (var i = 0; i < enemyCount; i++)
|
|
|
|
|