Enforce CanMove and CanUseAbility suppression in game flow

This commit is contained in:
Shard
2026-03-19 22:55:04 +00:00
parent 2c08868fa2
commit 7ca86ce858
2 changed files with 5 additions and 1 deletions
@@ -177,6 +177,9 @@ public static class AbilitySystem
var units = player.Field.OfType<FieldCard>().ToList(); // snapshot
foreach (var unit in units)
{
// SetCanUseAbility(false) suppresses triggered ability firing for this unit.
if (!unit.CanUseAbility) continue;
var abilities = ParseAbilities(unit.AbilitiesJson);
for (int i = 0; i < abilities.Length; i++)
{
+2 -1
View File
@@ -554,7 +554,8 @@ public static class GameEngine
var unit = GetFieldCard(player, unitInstanceId);
if (unit.Position is null) throw new GameException("UNIT_NOT_ON_BOARD");
if (unit.CurrentMp <= 0) throw new GameException("NO_MP");
if (!unit.CanMove) throw new GameException("UNIT_CANNOT_MOVE");
if (unit.CurrentMp <= 0) throw new GameException("NO_MP");
var from = unit.Position.Value;
var targetTile = board.GetTile(targetPos) ?? throw new GameException("TILE_OUT_OF_BOUNDS");