Merge pull request 'Made attack selection only select alive enemies' (#45) from bug/attack_dead_enemy into develop

Reviewed-on: #45
Reviewed-by: kziolkowski <katharina.ziolkowski@gmail.com>
This commit was merged in pull request #45.
This commit is contained in:
2025-12-16 19:30:33 +01:00
3 changed files with 5 additions and 1 deletions
@@ -12,6 +12,7 @@ public class TargetSelectActionDetail : FighterAction.FighterActionDetail
// settings
public required bool selectEnemy;
public required bool selectAlly;
public required bool aliveOnly;
public VisualRange visualRange = VisualRange.Single;
// result
@@ -13,7 +13,8 @@ public class AllyAttackAction : FighterAction
public TargetSelectActionDetail targetSelect = new()
{
selectEnemy = true,
selectAlly = false
selectAlly = false,
aliveOnly = true
};
public MinigameActionDetail minigameDetail = new();
@@ -117,11 +117,13 @@ public partial class AllFightersVisual : Node
if (targetDetail.selectEnemy)
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.enemyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
if (targetDetail.selectAlly)
_fighterVisuals
.Where(kv => kv.Key.IsInFormation(HappeningData.allyFighterFormation))
.Where(kv => !targetDetail.aliveOnly || kv.Key.IsAlive())// if aliveOnly: take where IsAlive
.ForEach(kv => kv.Value.SetTargetSelectionActive(true));
}