feat(phase10): ChannelCardFromZone, ObstructMovementType, and pause-model completions
- Implement ChannelCardFromZoneEffect: zone lookup, dest-player resolution (Self/Target/Opponent/Ally/Random/Choice), channel-range tile selection, affinity check, cost deduction, KeepInZone, TargetTile pause, board placement with aura/passive hooks and Channeled trigger - Add PendingPlayerPick.EffectType="ChannelCardFromZone" dispatch in ResumePlayerPick: random-tile path + chained PendingTilePick for TargetTile=true - Add ResumeTilePick case "ChannelCardFromZone": place card at chosen tile under DestPlayerAccountId, affinity/cost/KeepInZone-aware - Implement ObstructMovementTypeEffect: stores ActiveEffect marker; ApplyReversal is no-op (duration:null guard); BuildBlockedSet extended via AbilitySystem.GetUnitsObstructingMovementType to honour obstructors for pathfinding (e.g. Walk unit blocking Flight paths) - Add PendingTilePick.DestPlayerAccountId and .EffectJson fields - Add PendingPlayerPick.EffectJson field - Thread ctx.ContinuationActions + ctx.ActivationRange through AbilityContext so ExecuteEffect can populate pause models without an extra method parameter 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:
@@ -28,9 +28,16 @@ public sealed class PendingActionGroupPick
|
||||
/// </summary>
|
||||
public string ActionGroupJson { get; set; } = "{}";
|
||||
|
||||
/// <summary>JSON-serialized Action[] — the full action list to execute AFTER the picked branch finishes.</summary>
|
||||
/// <summary>JSON-serialized Action[] — the full action list to execute AFTER the picked branch and all remaining groups finish.</summary>
|
||||
public string ContinuationActionsJson { get; set; } = "[]";
|
||||
|
||||
/// <summary>
|
||||
/// JSON-serialized ActionGroup[]? — remaining sibling groups (in the parent AND group)
|
||||
/// to process sequentially after the chosen branch executes.
|
||||
/// Null when the paused group was not nested inside an AND group.
|
||||
/// </summary>
|
||||
public string? RemainingGroupsJson { get; set; }
|
||||
|
||||
/// <summary>JSON-serialized AbilityRange? — passed through to ExecuteActions on resume.</summary>
|
||||
public string? RangeJson { get; set; }
|
||||
|
||||
|
||||
@@ -22,6 +22,18 @@ public sealed class PendingPlayerPick
|
||||
/// <summary>Account IDs of the valid choices (populated by engine at pause time).</summary>
|
||||
public List<string> ValidPlayerIds { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// InstanceId of the primary target that was already resolved before the pick
|
||||
/// (e.g. the card to channel for ChannelCardFromZoneEffect). Empty when not applicable.
|
||||
/// </summary>
|
||||
public string TargetInstanceId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Serialized Effect JSON — used when the resume handler needs the original effect's parameters
|
||||
/// (e.g. ChannelCardFromZoneEffect flags). Null when not needed.
|
||||
/// </summary>
|
||||
public string? EffectJson { get; set; }
|
||||
|
||||
// ── Continuation ─────────────────────────────────────────────────────────
|
||||
|
||||
public string ContinuationActionsJson { get; set; } = "[]";
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace SOR.Game.Abilities.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Stored in GameState when a leaf Action has <c>TargetSelector.Chooser = Opponent</c> or
|
||||
/// <c>Ally</c> during active ability execution, requiring the non-activating player to pick
|
||||
/// the targets before the action's effects can execute.
|
||||
///
|
||||
/// The game is paused until the chooser submits a <c>game.target_pick</c> response.
|
||||
/// </summary>
|
||||
public sealed class PendingTargetPick
|
||||
{
|
||||
/// <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 activated the ability.</summary>
|
||||
public string ActorId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// AccountId of the player who must submit the target picks.
|
||||
/// May differ from <see cref="ActorId"/> for Chooser=Opponent/Ally actions.
|
||||
/// </summary>
|
||||
public string ChooserActorId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>InstanceId of the source unit (may be empty for card-triggered abilities).</summary>
|
||||
public string SourceInstanceId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// JSON-serialized <see cref="Action"/> — the action awaiting target picks.
|
||||
/// The full TargetSelector (Scope/Type/Ownership/Count/Filters) is embedded so the
|
||||
/// client can present the correct picker UI.
|
||||
/// </summary>
|
||||
public string ActionJson { get; set; } = "{}";
|
||||
|
||||
/// <summary>JSON-serialized Action[] — remaining actions to execute after this one resolves.</summary>
|
||||
public string ContinuationActionsJson { get; set; } = "[]";
|
||||
|
||||
/// <summary>JSON-serialized AbilityRange? — passed through to ExecuteActions on resume.</summary>
|
||||
public string? RangeJson { get; set; }
|
||||
|
||||
/// <summary>JSON-serialized DurationModel? — forceDuration applied on resume.</summary>
|
||||
public string? ForceDurationJson { get; set; }
|
||||
}
|
||||
@@ -26,6 +26,25 @@ public sealed class PendingTilePick
|
||||
/// <summary>Max tiles from source; 0 = unlimited.</summary>
|
||||
public int MaxRange { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// InstanceId of the primary target that was already resolved before the pick
|
||||
/// (e.g. the Spirit to clone for CloneSpiritAsToken). Empty when not applicable.
|
||||
/// </summary>
|
||||
public string TargetInstanceId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// For ChannelCardFromZone: AccountId of the player who will control the channeled card.
|
||||
/// Empty when not applicable.
|
||||
/// </summary>
|
||||
public string DestPlayerAccountId { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Serialized Effect JSON — used when the resume handler needs the original effect's parameters
|
||||
/// (e.g. ChannelCardFromZoneEffect flags like IgnoreAffinity, KeepInZone).
|
||||
/// Null when not needed.
|
||||
/// </summary>
|
||||
public string? EffectJson { get; set; }
|
||||
|
||||
// ── Continuation ─────────────────────────────────────────────────────────
|
||||
|
||||
public string ContinuationActionsJson { get; set; } = "[]";
|
||||
|
||||
Reference in New Issue
Block a user