|
|
|
@ -14,8 +14,14 @@ public partial class FightWorld : Node
|
|
|
|
|
|
|
|
|
|
|
|
public class Room
|
|
|
|
public class Room
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
public enum Special
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
None,
|
|
|
|
|
|
|
|
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 class FighterGroup
|
|
|
|
public class FighterGroup
|
|
|
|
@ -66,7 +72,6 @@ public partial class FightWorld : Node
|
|
|
|
public override void _EnterTree()
|
|
|
|
public override void _EnterTree()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Instance = this;
|
|
|
|
Instance = this;
|
|
|
|
MyEnterTree();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
@ -76,7 +81,7 @@ public partial class FightWorld : Node
|
|
|
|
public FightHappeningData? fightHappeningData = null;
|
|
|
|
public FightHappeningData? fightHappeningData = null;
|
|
|
|
public AllyFighters allyFighters = new();
|
|
|
|
public AllyFighters allyFighters = new();
|
|
|
|
|
|
|
|
|
|
|
|
public void MyEnterTree()
|
|
|
|
public void ResetFightWorld()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Generate();
|
|
|
|
Generate();
|
|
|
|
currentRoom = world!.rooms[0];
|
|
|
|
currentRoom = world!.rooms[0];
|
|
|
|
@ -108,6 +113,13 @@ public partial class FightWorld : Node
|
|
|
|
{
|
|
|
|
{
|
|
|
|
rooms.Add(GenerateDisconnectedRoom());
|
|
|
|
rooms.Add(GenerateDisconnectedRoom());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rooms.Add(new Room
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
paths = [],
|
|
|
|
|
|
|
|
enemyGroups = [],
|
|
|
|
|
|
|
|
specialRoom = Room.Special.EndOfNight
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Connect rooms linearly
|
|
|
|
// Connect rooms linearly
|
|
|
|
for (var i = 0; i < rooms.Count - 1; i++)
|
|
|
|
for (var i = 0; i < rooms.Count - 1; i++)
|
|
|
|
@ -133,7 +145,7 @@ public partial class FightWorld : Node
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var enemyGroups = new List<FighterGroup>();
|
|
|
|
var enemyGroups = new List<FighterGroup>();
|
|
|
|
|
|
|
|
|
|
|
|
var enemyGroupCount = GD.RandRange(1, 3);
|
|
|
|
var enemyGroupCount = GD.RandRange(1, 2);
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < enemyGroupCount; i++)
|
|
|
|
for (var i = 0; i < enemyGroupCount; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -150,7 +162,7 @@ public partial class FightWorld : Node
|
|
|
|
fighters = []
|
|
|
|
fighters = []
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var enemyCount = GD.RandRange(1, 3);
|
|
|
|
var enemyCount = GD.RandRange(2, 3);
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < enemyCount; i++)
|
|
|
|
for (var i = 0; i < enemyCount; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -178,10 +190,10 @@ public partial class FightWorld : Node
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type = type,
|
|
|
|
type = type,
|
|
|
|
health = null,
|
|
|
|
health = null,
|
|
|
|
maxHealth = 12,
|
|
|
|
maxHealth = GD.RandRange(8, 20),
|
|
|
|
availableActions =
|
|
|
|
availableActions =
|
|
|
|
[
|
|
|
|
[
|
|
|
|
new BlobAttackAction()
|
|
|
|
new BlobAttackAction(GD.RandRange(2, 5))
|
|
|
|
]
|
|
|
|
]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|