Feature: ability-level Duration override + WhileSourceOnBattlefield in duration list

AbilityDefinition gains an optional Duration property. When set it is used
as forceDuration for every ExecuteActions call that resolves that ability,
overriding whatever per-action Duration individual effects specify.

- Active abilities: def.Duration is threaded through as forceDuration
- Triggered abilities: same
- Passive abilities: def.Duration ?? WhileSourceOnBattlefield (both
  ApplyPassivesForSource and ApplyPassivesToNewTarget paths)

AbilityBuilder admin panel:
- Duration row added after type-specific fields (dropdown + N input for ForNTurns)
- "WhileSourceOnBattlefield" added to the DurationTypeValues list
- Parse and compile paths updated for the new Duration field

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-03-17 23:15:05 -04:00
co-authored by Claude Happy
parent 8bcacc29d2
commit 4f0f0e9c0f
3 changed files with 58 additions and 7 deletions
@@ -51,6 +51,15 @@ public sealed class AbilityDefinition
/// </summary>
public string? Description { get; set; }
/// <summary>
/// Optional ability-level duration that overrides per-action Duration for every effect
/// this ability produces. When null, each Action's own Duration is used instead.
///
/// For Passive abilities this defaults to WhileSourceOnBattlefield when left null;
/// set it explicitly to choose a different lifespan (e.g. UntilEndOfTurn).
/// </summary>
public DurationModel? Duration { get; set; }
/// <summary>
/// Optional client-side animation and sound metadata.
/// Not used by server game logic. Null means the client uses its default effect.