♻️ Implemented FightersFormation to keep track of the fight entered state of the fighters

This commit is contained in:
jonathan
2025-10-07 18:08:53 +02:00
parent 0de3bcae22
commit 83dc6bfd56
13 changed files with 127 additions and 54 deletions
@@ -1,10 +1,11 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using Babushka.scripts.CSharp.Common.Fight;
using Babushka.scripts.CSharp.Common.Fight.ActionDetails;
using Babushka.scripts.CSharp.Common.Util;
using Godot;
namespace Babushka.scripts.CSharp.Common.Fight;
public partial class AllFightersVisual : Node
{
@@ -57,7 +58,7 @@ public partial class AllFightersVisual : Node
if (from == FightHappening.FightState.ActionAnim)
{
_fighterVisuals.Values.ForEach(fv=>fv.UpdateHealthBar());
_fighterVisuals.Values.ForEach(fv => fv.UpdateHealthBar());
}
}
@@ -112,10 +113,14 @@ public partial class AllFightersVisual : Node
private void ShowTargetSelect(TargetSelectActionDetail targetDetail)
{
if (targetDetail.selectEnemy)
_fighterVisuals.Where(kv => kv.Key.isEnemy).ForEach(kv => kv.Value.SetTargetSelectionActive(true));
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.enemyFighterFormation))
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
if (targetDetail.selectAlly)
_fighterVisuals.Where(kv => !kv.Key.isEnemy).ForEach(kv => kv.Value.SetTargetSelectionActive(true));
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.allyFighterFormation))
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
}
private void HideTargetSelect()