feat(phase9): ability system gap fixes -- pause propagation, handlers, chooser, aura actions

- Fix pause propagation: ExecuteActions for-loop breaks on HasPendingInteraction();
  effect loop in ExecuteSingleAction also stops when any pending state is set
- Add HasPendingInteraction() helper to GameState covering all 7 pending types
- Create 4 missing handlers: GameCostGroupPickHandler, GameActionGroupPickHandler,
  GameBranchPickHandler, GameRevealChoicePickHandler + register in ServiceRegistration
- Add corresponding request/response records to GameMessages.cs
- Fix ActionNeedsClientTargets: short-circuit false when Chooser == Random
- Add ChooserActorId to PendingTriggeredTarget; FireTrigger sets it to opponent/ally
  when Chooser.Opponent/Ally; GameHandlerBase pushes to ChooserActorId
- ResumeTriggeredAbility validates against ChooserActorId (falls back to ActorId)
- Fix ApplyOnEventEffect: Action[] -> ActionGroup?; PendingDeferredEffect gains
  ActionGroupJson field; deferred firing uses ResolveActionGroup + ExecuteActions
- Wire OnEnterAuraActions / OnLeaveAuraActions into FireAuraTransition (one-shot,
  restricted to the entering/leaving unit)

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-04-21 06:09:32 -04:00
co-authored by Claude Happy
parent 80b92b17b9
commit 95c01cffb5
11 changed files with 411 additions and 15 deletions
@@ -465,8 +465,8 @@ public sealed class ApplyOnEventEffect : Effect
{
public TriggerEvent Trigger { get; set; } = null!;
/// <summary>
/// Full action tree executed when the trigger fires. Supports chained targeting and
/// nested ActionGroups. Replaces the old flat Effect[] for recursive ability trees.
/// Action tree executed when the trigger fires. Supports chained targeting and
/// nested ActionGroups via recursive ActionGroup.
/// </summary>
public Action[] Actions { get; set; } = [];
public ActionGroup? ActionGroup { get; set; }
}
@@ -10,9 +10,16 @@ public sealed class PendingTriggeredTarget
/// <summary>Correlation ID sent to the client so responses can be matched.</summary>
public string RequestId { get; set; } = Guid.NewGuid().ToString("N");
/// <summary>AccountId of the player who must pick the target.</summary>
/// <summary>AccountId of the player whose ability triggered (the ability owner).</summary>
public string ActorId { get; set; } = string.Empty;
/// <summary>
/// AccountId of the player who must actually pick the targets.
/// Equals <see cref="ActorId"/> when <c>Chooser == Self</c>;
/// set to an opponent or ally ID when <c>Chooser == Opponent/Ally</c>.
/// </summary>
public string ChooserActorId { get; set; } = string.Empty;
/// <summary>InstanceId of the unit whose triggered ability is paused.</summary>
public string SourceInstanceId { get; set; } = string.Empty;