Add BlockedDamage, RequiresLos, and LinearOnly to ability schema + builder UI

- PushUnitEffect and PullUnitEffect gain BlockedDamage (int): deals direct HP
  damage to the displaced unit if it cannot complete the full tile distance
  (blocked by a boundary or another unit)
- AbilityRange gains RequiresLos (bool): engine validates line of sight before
  allowing ability activation
- AbilityRange gains LinearOnly (bool): restricts targeting to cardinal/diagonal
  straight lines only (suitable for Push/Pull/beam abilities)
- AbilityBuilder UI exposes RequiresLos and LinearOnly as inline checkboxes in
  the Active ability range row
- PushUnit/PullUnit effect templates auto-populate with BlockedDamage: 0

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-02-27 11:01:03 -05:00
co-authored by Claude Happy
parent c493b1b50b
commit 487f84d084
3 changed files with 75 additions and 23 deletions
+12 -2
View File
@@ -121,6 +121,16 @@ public sealed class CostEntry
public sealed class AbilityRange
{
public int Min { get; set; } = 1;
public int Max { get; set; } = 1;
public int Min { get; set; } = 1;
public int Max { get; set; } = 1;
/// <summary>
/// When true, the engine validates that a clear line of sight exists between the
/// caster and the target tile/unit before allowing the ability to be used.
/// </summary>
public bool RequiresLos { get; set; } = false;
/// <summary>
/// When true, only targets that lie on a straight cardinal or diagonal line from
/// the caster are valid (e.g. Push, Pull, beam-style abilities).
/// </summary>
public bool LinearOnly { get; set; } = false;
}
@@ -196,8 +196,25 @@ public sealed class HOTEffect : Effect { public ValueExpr Amount {
// ── §5.9 Displacement ─────────────────────────────────────────────────────────
public sealed class PushUnitEffect : Effect { public int Tiles { get; set; } = 1; }
public sealed class PullUnitEffect : Effect { public int Tiles { get; set; } = 1; }
public sealed class PushUnitEffect : Effect
{
public int Tiles { get; set; } = 1;
/// <summary>
/// Direct HP damage dealt to the pushed unit if it cannot complete the full push
/// (blocked by a boundary or another unit). 0 = no knockback damage.
/// </summary>
public int BlockedDamage { get; set; } = 0;
}
public sealed class PullUnitEffect : Effect
{
public int Tiles { get; set; } = 1;
/// <summary>
/// Direct HP damage dealt to the pulled unit if it cannot complete the full pull
/// (blocked by a boundary or another unit). 0 = no knockback damage.
/// </summary>
public int BlockedDamage { get; set; } = 0;
}
public sealed class DisplaceUnitEffect : Effect { public int Tiles { get; set; } = 1; public string Direction { get; set; } = "North"; }
// ── §5.10 Control effects ─────────────────────────────────────────────────────