fix(abilities): pause/resume ordering and continuation correctness
Issue 1 — ActionGroup AND continuation ordering: The old code prepended `all` (preceding AND-group actions) into ContinuationActionsJson, so resume ran [chosen, preceding, outer] instead of the correct [preceding, chosen, outer]. Fix: add PrecedingActionsJson to PendingActionGroupPick; AND-case stores preceding there (prepending to any inner-group preceding); ResumeActionGroupPick reads it and uses preceding.Concat(chosen).Concat(continuation) for final execution. Nested remaining-group pauses also accumulate preceding correctly. Issue 2 — Effect-level pause terminal contract: Documented as a design constraint: pausing effects (CloneSpiritAsToken TargetTile, ChannelCardFromZone TargetTile/Choice) must be last in their action's Effects list. Remaining effects / remaining targets are silently dropped on pause. No functional change; constraint is now explicit in code. Issue 3 — StackDeck pause loses continuation: PendingRevealChoicePick already had ContinuationActionsJson/RangeJson/ ForceDurationJson fields but StackDeckEffect never populated them and ResumeRevealChoicePick never executed them. Both are now fixed: pause stores ctx.ContinuationActions + ctx.ActivationRange + duration; resume runs ExecuteActions on the stored continuation after ordering the deck. Issue 4 — ResumeTargetPick ActionIndex=0 contract: Added a clear CONTRACT comment: the paused action replays at index 0, so the client must submit targets with ActionIndex=0 in its response. 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:
@@ -38,6 +38,14 @@ public sealed class PendingActionGroupPick
|
||||
/// </summary>
|
||||
public string? RemainingGroupsJson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// JSON-serialized Action[]? — actions from the parent AND group that were already
|
||||
/// flattened BEFORE the paused child group. These must execute BEFORE the chosen
|
||||
/// branch, so resume computes: preceding + chosen + remaining-groups + continuation.
|
||||
/// Null when there are no such preceding actions.
|
||||
/// </summary>
|
||||
public string? PrecedingActionsJson { get; set; }
|
||||
|
||||
/// <summary>JSON-serialized AbilityRange? — passed through to ExecuteActions on resume.</summary>
|
||||
public string? RangeJson { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user