♻️ Implemented FightersFormation to keep track of the fight entered state of the fighters
This commit is contained in:
@@ -20,14 +20,16 @@ public partial class FightWorld : Node
|
||||
|
||||
public class FighterGroup
|
||||
{
|
||||
public required List<Fighter> enemies;
|
||||
public required List<Fighter> fighters;
|
||||
}
|
||||
|
||||
public class FightHappeningData
|
||||
{
|
||||
public FightHappening.FightState fightState = FightHappening.FightState.None;
|
||||
public FighterStack fighterStack = new();
|
||||
public required FighterGroup enemyGroup;
|
||||
public FightHappening.FightState fightState = FightHappening.FightState.None;
|
||||
public readonly FighterTurn fighterTurn = new();
|
||||
public readonly FighterFormation allyFighterFormation = new();
|
||||
public readonly FighterFormation enemyFighterFormation = new();
|
||||
public FightHappening.FightersEnterStaging? fightersEnterStaging;
|
||||
public FighterAction? actionStaging;
|
||||
}
|
||||
@@ -46,11 +48,9 @@ public partial class FightWorld : Node
|
||||
|
||||
public required Type type;
|
||||
public required int maxHealth;
|
||||
public required bool isEnemy;
|
||||
public required List<FighterAction> availableActions;
|
||||
public int maxActionPoints = 1;
|
||||
public const int MaxActionPoints = 1;
|
||||
public int? health = null; // null => initialize to full health on spawn
|
||||
public bool entered = false;
|
||||
public int actionPointsLeft;
|
||||
|
||||
public FighterAction AutoSelectAction()
|
||||
@@ -147,14 +147,14 @@ public partial class FightWorld : Node
|
||||
{
|
||||
var enemyGroup = new FighterGroup
|
||||
{
|
||||
enemies = []
|
||||
fighters = []
|
||||
};
|
||||
|
||||
var enemyCount = GD.RandRange(1, 3);
|
||||
|
||||
for (var i = 0; i < enemyCount; i++)
|
||||
{
|
||||
enemyGroup.enemies.Add(GenerateSingleEnemy());
|
||||
enemyGroup.fighters.Add(GenerateSingleEnemy());
|
||||
}
|
||||
|
||||
return enemyGroup;
|
||||
@@ -177,7 +177,6 @@ public partial class FightWorld : Node
|
||||
{
|
||||
type = type,
|
||||
health = null,
|
||||
isEnemy = true,
|
||||
maxHealth = 12,
|
||||
availableActions =
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user