@champions-digital-game/mod-sdk 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/build.js +1 -1
- package/dist/chunks/{chunk-3ZP7JFBM.js → chunk-3SR23UJ7.js} +1 -1
- package/dist/chunks/{chunk-STQU5RJP.js → chunk-3YMCANI3.js} +1 -1
- package/dist/chunks/{chunk-GIPUMXZ5.js → chunk-ACT4TJXC.js} +5 -5
- package/dist/chunks/{chunk-XDNO5DKC.js → chunk-D5S6EHFQ.js} +1 -1
- package/dist/chunks/{chunk-DH3FUEOQ.js → chunk-DX44O32N.js} +1 -1
- package/dist/chunks/{chunk-KWTX5B5J.js → chunk-S3JH4WL4.js} +1 -1
- package/dist/chunks/{chunk-RRZU6F4D.js → chunk-WFEXO5DU.js} +1 -1
- package/dist/import.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mc-pack.js +7 -5
- package/dist/testing.js +1 -1
- package/package.json +3 -2
- package/types/cards/src/dsl/abilities.d.ts +15 -9
- package/types/cards/src/wave11/luke_cage/leadership.d.ts +2 -1
- package/types/content/src/index.d.ts +1 -1
- package/types/content/src/schema/sets.d.ts +6 -0
- package/types/engine/src/choices.d.ts +6 -0
- package/types/engine/src/events.d.ts +4 -2
- package/types/engine/src/index.d.ts +2 -1
- package/types/engine/src/legal.d.ts +2 -0
- package/types/engine/src/query.d.ts +3 -3
- package/types/engine/src/resolve/discarded-card.d.ts +84 -0
- package/types/engine/src/resolve/target-validity.d.ts +14 -1
- package/types/engine/src/resolve/triggers.d.ts +1 -1
- package/types/engine/src/search-findable.d.ts +41 -0
- package/types/engine/src/select.d.ts +5 -0
- package/types/engine/src/trigger-events.d.ts +6 -5
- package/types/mod-sdk/src/typecheck.d.ts +23 -0
|
@@ -2917,7 +2917,9 @@ export declare const on: {
|
|
|
2917
2917
|
* "After you discard a card from the top of your deck" (The Painted Lady, `next_evol` 40045; docs/phase7-wave7.md
|
|
2918
2918
|
* §3.55), on a card in play: each card discarded from its controller's deck, by any card's effect or cost (§4.1
|
|
2919
2919
|
* Q31). "That card" is `eventTarget`, in the discard pile, or in the new deck when its discard emptied the deck.
|
|
2920
|
-
* Once another response has moved that card (its own "add it to your hand")
|
|
2920
|
+
* Once another response has moved that card (its own "add it to your hand") a response whose every part acts on that
|
|
2921
|
+
* card is no longer offered for it; one that does something else ("draw 1 card") still is (issue #928). Nothing to
|
|
2922
|
+
* mark: the engine reads it from the effects.
|
|
2921
2923
|
*/
|
|
2922
2924
|
readonly youDiscardFromYourDeck: () => EventPattern;
|
|
2923
2925
|
/**
|
|
@@ -2944,8 +2946,8 @@ export declare const on: {
|
|
|
2944
2946
|
* A response only, on a card in play. The cards one effect or cost discarded share one response window (RRG 1.8
|
|
2945
2947
|
* "Triggering Condition", p. 45), which resolves before the discarding ability's next effect, or before its effects
|
|
2946
2948
|
* for a cost. A card the response moves is no longer among that ability's cards "discarded this way" (wave 7 §4.1
|
|
2947
|
-
* Q32), and no
|
|
2948
|
-
* the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
2949
|
+
* Q32), and no response whose every part needs it is offered for it (issue #928). The card whose discard emptied
|
|
2950
|
+
* the deck is in the new deck when the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
2949
2951
|
*/
|
|
2950
2952
|
/**
|
|
2951
2953
|
* "When a card is put into Damnation from a player's deck" (Exposing Intentions, community pack `mephisto-nep` 14):
|
|
@@ -3877,7 +3879,9 @@ export declare const when: {
|
|
|
3877
3879
|
* "After you discard a card from the top of your deck" (The Painted Lady, `next_evol` 40045; docs/phase7-wave7.md
|
|
3878
3880
|
* §3.55), on a card in play: each card discarded from its controller's deck, by any card's effect or cost (§4.1
|
|
3879
3881
|
* Q31). "That card" is `eventTarget`, in the discard pile, or in the new deck when its discard emptied the deck.
|
|
3880
|
-
* Once another response has moved that card (its own "add it to your hand")
|
|
3882
|
+
* Once another response has moved that card (its own "add it to your hand") a response whose every part acts on that
|
|
3883
|
+
* card is no longer offered for it; one that does something else ("draw 1 card") still is (issue #928). Nothing to
|
|
3884
|
+
* mark: the engine reads it from the effects.
|
|
3881
3885
|
*/
|
|
3882
3886
|
readonly youDiscardFromYourDeck: () => EventPattern;
|
|
3883
3887
|
/**
|
|
@@ -3904,8 +3908,8 @@ export declare const when: {
|
|
|
3904
3908
|
* A response only, on a card in play. The cards one effect or cost discarded share one response window (RRG 1.8
|
|
3905
3909
|
* "Triggering Condition", p. 45), which resolves before the discarding ability's next effect, or before its effects
|
|
3906
3910
|
* for a cost. A card the response moves is no longer among that ability's cards "discarded this way" (wave 7 §4.1
|
|
3907
|
-
* Q32), and no
|
|
3908
|
-
* the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
3911
|
+
* Q32), and no response whose every part needs it is offered for it (issue #928). The card whose discard emptied
|
|
3912
|
+
* the deck is in the new deck when the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
3909
3913
|
*/
|
|
3910
3914
|
/**
|
|
3911
3915
|
* "When a card is put into Damnation from a player's deck" (Exposing Intentions, community pack `mephisto-nep` 14):
|
|
@@ -4837,7 +4841,9 @@ export declare const after: {
|
|
|
4837
4841
|
* "After you discard a card from the top of your deck" (The Painted Lady, `next_evol` 40045; docs/phase7-wave7.md
|
|
4838
4842
|
* §3.55), on a card in play: each card discarded from its controller's deck, by any card's effect or cost (§4.1
|
|
4839
4843
|
* Q31). "That card" is `eventTarget`, in the discard pile, or in the new deck when its discard emptied the deck.
|
|
4840
|
-
* Once another response has moved that card (its own "add it to your hand")
|
|
4844
|
+
* Once another response has moved that card (its own "add it to your hand") a response whose every part acts on that
|
|
4845
|
+
* card is no longer offered for it; one that does something else ("draw 1 card") still is (issue #928). Nothing to
|
|
4846
|
+
* mark: the engine reads it from the effects.
|
|
4841
4847
|
*/
|
|
4842
4848
|
readonly youDiscardFromYourDeck: () => EventPattern;
|
|
4843
4849
|
/**
|
|
@@ -4864,8 +4870,8 @@ export declare const after: {
|
|
|
4864
4870
|
* A response only, on a card in play. The cards one effect or cost discarded share one response window (RRG 1.8
|
|
4865
4871
|
* "Triggering Condition", p. 45), which resolves before the discarding ability's next effect, or before its effects
|
|
4866
4872
|
* for a cost. A card the response moves is no longer among that ability's cards "discarded this way" (wave 7 §4.1
|
|
4867
|
-
* Q32), and no
|
|
4868
|
-
* the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
4873
|
+
* Q32), and no response whose every part needs it is offered for it (issue #928). The card whose discard emptied
|
|
4874
|
+
* the deck is in the new deck when the response resolves (RRG 1.8 "Encounter Deck", p. 17), and is taken from there.
|
|
4869
4875
|
*/
|
|
4870
4876
|
/**
|
|
4871
4877
|
* "When a card is put into Damnation from a player's deck" (Exposing Intentions, community pack `mephisto-nep` 14):
|
|
@@ -24,7 +24,8 @@ import type { AbilityRegistry } from "../../../../engine/src/index.js";
|
|
|
24
24
|
*
|
|
25
25
|
* **62015 Take a Stand**: "until the end of the player phase" is `endOfPlayerPhase`. Owner question Q104 = B (the owner,
|
|
26
26
|
* 2026-10-18), RRG 1.8 "Lasting Effects" (p. 26): such an effect "can only be initiated during that time period", so
|
|
27
|
-
*
|
|
27
|
+
* after a villain-phase defense it would give nothing and is not offered (RRG 1.8 "Initiating Abilities", p. 24, step 2;
|
|
28
|
+
* `lastingPeriodClosed`, issue #970); used in a player phase it lasts to that phase's end. A live
|
|
28
29
|
* query, so allies that arrive later in that phase get the bonus too.
|
|
29
30
|
*/
|
|
30
31
|
export declare const LUKE_CAGE_LEADERSHIP: AbilityRegistry;
|
|
@@ -3,7 +3,7 @@ export declare const CONTENT_VERSION = "0.0.0";
|
|
|
3
3
|
* Schema version for the card data shape itself (independent of how many
|
|
4
4
|
* cards/cycles have been ingested). Bump when a breaking shape change lands.
|
|
5
5
|
*/
|
|
6
|
-
export declare const SCHEMA_VERSION = "0.
|
|
6
|
+
export declare const SCHEMA_VERSION = "0.53.0";
|
|
7
7
|
export * from "./schema/index.js";
|
|
8
8
|
export * from "./data/index.js";
|
|
9
9
|
export * from "./import/index.js";
|
|
@@ -593,6 +593,12 @@ export interface Scenario {
|
|
|
593
593
|
* is restricted.
|
|
594
594
|
*/
|
|
595
595
|
readonly setAsideModularSetCount?: number | PerPlayerCount;
|
|
596
|
+
/**
|
|
597
|
+
* The modular sets a scenario's authors set aside by default, as `recommendedModularSetIds` names the shuffled-in ones
|
|
598
|
+
* (#943: The Rose sets aside Running Interference, its mini-boss Tombstone). Only with a fixed-number
|
|
599
|
+
* `setAsideModularSetCount`, and exactly that many; the table may still choose others. Absent: chosen at random.
|
|
600
|
+
*/
|
|
601
|
+
readonly recommendedSetAsideModularSetIds?: readonly EncounterSetId[];
|
|
596
602
|
/** Where the modular sets (and set-aside modular sets) come from. Absent: any modular set. See `ModularSetPool`. */
|
|
597
603
|
readonly modularSetPool?: ModularSetPool;
|
|
598
604
|
/**
|
|
@@ -653,6 +653,12 @@ export interface ChoiceOption {
|
|
|
653
653
|
* zone (a villain, a main scheme).
|
|
654
654
|
*/
|
|
655
655
|
readonly zone?: ZoneId;
|
|
656
|
+
/**
|
|
657
|
+
* A resource ability's option whose cost picks "any number" (or "up to N", N > 1) of cards in play: one option per
|
|
658
|
+
* set (Enhanced Combat Sense: "exhaust any number of Weapon or Tech upgrades"), which a payment sheet shows as one
|
|
659
|
+
* card per candidate (issue #966). Absent for a single pick (Sync Ratio) and every other option.
|
|
660
|
+
*/
|
|
661
|
+
readonly picksMany?: true;
|
|
656
662
|
}
|
|
657
663
|
/**
|
|
658
664
|
* Why this player is the one deciding. There is no villain player: the
|
|
@@ -1920,7 +1920,9 @@ export type GameEvent = {
|
|
|
1920
1920
|
}
|
|
1921
1921
|
/**
|
|
1922
1922
|
* An optional interrupt or response on a player's card in play answered `event` but was not offered: it has no valid
|
|
1923
|
-
* target (`noTarget`)
|
|
1923
|
+
* target (`noTarget`), its cost cannot be paid (`cannotPay`; RRG 1.8 "Initiating Abilities", p. 24, step 2), or all
|
|
1924
|
+
* it gives would last to the end of a turn or player phase not in progress (`period`; RRG 1.8 "Lasting Effects",
|
|
1925
|
+
* p. 26; `lastingPeriodClosed`, #970). Said
|
|
1924
1926
|
* so the client can tell its player why nothing was asked (#431; `unofferedAbilities`). It changes nothing.
|
|
1925
1927
|
*/
|
|
1926
1928
|
| {
|
|
@@ -1929,7 +1931,7 @@ export type GameEvent = {
|
|
|
1929
1931
|
readonly abilityId: AbilityId;
|
|
1930
1932
|
readonly playerId: PlayerId;
|
|
1931
1933
|
readonly timing: "interrupt" | "response";
|
|
1932
|
-
readonly reason: "noTarget" | "cannotPay";
|
|
1934
|
+
readonly reason: "noTarget" | "cannotPay" | "period";
|
|
1933
1935
|
readonly event: TriggerEvent;
|
|
1934
1936
|
}
|
|
1935
1937
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const ENGINE_VERSION = "0.
|
|
1
|
+
export declare const ENGINE_VERSION = "0.53.0";
|
|
2
2
|
export type { PlayerId, InstanceId, ChoiceId, EncounterDeckId, FrameId, GroupId, TeamId } from "./ids.js";
|
|
3
3
|
export { playerId, instanceId, choiceId, encounterDeckId, frameId, groupId, teamId } from "./ids.js";
|
|
4
4
|
export type { GroupRef, PodNeutralArea, PodNeutralSetup, PodSetup, PodState, SharedEvent, SharedPodState, SharedResult, SharedThreatCause, } from "./pod.js";
|
|
@@ -121,3 +121,4 @@ export { collectionCandidates } from "./resolve/collection.js";
|
|
|
121
121
|
export { scenarioDeckCards, scenarioDeckWithTop } from "./resolve/scenario-deck-top.js";
|
|
122
122
|
export { REPORT_NO, REPORT_YES, REPORTED_FACT_ANSWER, reportedNumberOf, type OutsideFacts, type ReportedFact, type ReportedFactAnswer, type SetupOutsideFact, } from "./outside-facts.js";
|
|
123
123
|
export { generatedResources, handCardResources, paymentOptionsPool, resourcesNotFor } from "./actions.js";
|
|
124
|
+
export { searchFindableIfSpent, type SearchFindableIfSpent } from "./search-findable.js";
|
|
@@ -310,6 +310,8 @@ export interface PaymentSource {
|
|
|
310
310
|
* (`SpentCardAbilityUse.costSelection`); the option id holds it too ("#damageSelf=<n>").
|
|
311
311
|
*/
|
|
312
312
|
readonly costSelection?: CostSelection;
|
|
313
|
+
/** Its ability's cost picks a set of cards, one source per set (`ChoiceOption.picksMany`, issue #966). */
|
|
314
|
+
readonly picksMany?: true;
|
|
313
315
|
/**
|
|
314
316
|
* This `resourceAbility` source is a card in hand spent with its own "Interrupt: When you spend this card, [cost] →
|
|
315
317
|
* generate …" (`Payment.whenSpent`; option id "hand:<id>:<abilityId>…"): `instanceId` is the hand card, choosing it
|
|
@@ -495,8 +495,8 @@ export declare function encounterDeckDiscardAt(state: GameState, deckId: Encount
|
|
|
495
495
|
/**
|
|
496
496
|
* Whether a card discarded from a player's deck is still where the discard left it: in that player's discard pile, or,
|
|
497
497
|
* when the discard emptied the deck, in the new deck its reset shuffled it into (`at: "deck"`). False once a response
|
|
498
|
-
* moved it:
|
|
499
|
-
* §3.55, §4.1 Q32 and Q33).
|
|
498
|
+
* moved it: no response that needs the card answers its discard any more (`lostWithDiscardedCard`, issue #928), and
|
|
499
|
+
* the discarding ability no longer counts it (docs/phase7-wave7.md §3.55, §4.1 Q32 and Q33).
|
|
500
500
|
*/
|
|
501
501
|
export declare function deckDiscardStillThere(state: GameState, discard: {
|
|
502
502
|
readonly instanceId: InstanceId;
|
|
@@ -506,7 +506,7 @@ export declare function deckDiscardStillThere(state: GameState, discard: {
|
|
|
506
506
|
}): boolean;
|
|
507
507
|
/**
|
|
508
508
|
* Whether a card discarded from a hand is still in a discard pile (`TriggerEvent cardDiscardedFromHand`, issue #922): a
|
|
509
|
-
* response that took it away leaves nothing for another response
|
|
509
|
+
* response that took it away leaves nothing for another response that needs the card (`lostWithDiscardedCard`).
|
|
510
510
|
*/
|
|
511
511
|
export declare function handDiscardStillThere(state: GameState, discard: {
|
|
512
512
|
readonly instanceId: InstanceId;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A response to a card's discard once another response has moved that card (issue #928): a discard from a deck
|
|
3
|
+
* (`cardDiscardedFromDeck`, docs/phase7-wave7.md §3.55) or from a hand (`cardDiscardedFromHand`, issue #922).
|
|
4
|
+
*
|
|
5
|
+
* The discard happened, so every response to it is still offered (RRG 1.8 "Response", p. 38; "Triggering Condition",
|
|
6
|
+
* p. 45: the condition was met by the occurrence). Only interrupts lose a trigger that did not happen ("Interrupt",
|
|
7
|
+
* p. 25). A response is dropped in two cases only:
|
|
8
|
+
*
|
|
9
|
+
* - **its own card left the zone it works from**: the discarded card answering its own discard (Jackpot!, White Fox,
|
|
10
|
+
* `activeIn: "discard"`), taken out of the pile first. RRG 1.8 FAQ "Honey Badger" (p. 64);
|
|
11
|
+
* - **every part of it needs that card**, and the card is gone: "attach that card facedown here" (The Painted Lady),
|
|
12
|
+
* "tuck that card under here" (Don't Make Me Angry!), "deal that card as an encounter card" (Serpent Solutions).
|
|
13
|
+
* RRG 1.8 "Ability" (p. 4: it "can only be initiated if it has at least one valid target"), "Choose" (p. 12) and the FAQ
|
|
14
|
+
* "Redwing" (p. 65).
|
|
15
|
+
*
|
|
16
|
+
* A response that does something else ("draw 1 card", "deal 1 damage to an enemy") keeps it, as ruling June 2, 2026 -
|
|
17
|
+
* Ruling 4 (Energy Channel) reads a response whose triggering card is gone.
|
|
18
|
+
*
|
|
19
|
+
* The cards of a `together` answer are read the same way: the frame binds only those still where their discard left
|
|
20
|
+
* them (`stillDiscardedTargets`, `resolve/frames.ts`), so a kept response does not follow a moved card either. A
|
|
21
|
+
* mission attempt's card a response took "does not count" for it (April 30, 2026 - Ruling 4, answer 1), so Mikhail
|
|
22
|
+
* Rasputin (45183a) no longer counts a card Abyss took.
|
|
23
|
+
*
|
|
24
|
+
* Which parts need the card is read from the ability's effects (`needsDiscardedCard`), so a card script or a community
|
|
25
|
+
* pack marks nothing: an effect needs the card when it names the discarded card (`eventTarget`, or the cards of an
|
|
26
|
+
* `EventPattern.together` answer), or a card a choice of the ability picked from among them.
|
|
27
|
+
*/
|
|
28
|
+
import type { AbilityDefinition, EngineDeps } from "../abilities.js";
|
|
29
|
+
import type { InstanceId, PlayerId } from "../ids.js";
|
|
30
|
+
import { type EffectContext } from "../select.js";
|
|
31
|
+
import type { EffectSpec, Predicate } from "../spec.js";
|
|
32
|
+
import type { GameState } from "../state.js";
|
|
33
|
+
import { type TriggerEvent } from "../trigger-events.js";
|
|
34
|
+
/** A discard whose card a response has since taken out of where the discard left it; false for any other event. */
|
|
35
|
+
export declare function discardedCardGone(state: GameState, event: TriggerEvent): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether this response to a discard can no longer be initiated because the discarded card has gone: it answers only
|
|
38
|
+
* discards whose cards are gone (`together`: every discard of the occurrence it answers once), and either it is the
|
|
39
|
+
* discarded card's own ability or every part of it needs that card (`needsDiscardedCard`).
|
|
40
|
+
*/
|
|
41
|
+
export declare function lostWithDiscardedCard(state: GameState, deps: EngineDeps, candidate: {
|
|
42
|
+
readonly instanceId: InstanceId;
|
|
43
|
+
readonly abilityId: string;
|
|
44
|
+
readonly controllerId?: PlayerId | null;
|
|
45
|
+
readonly forced?: boolean;
|
|
46
|
+
readonly together?: readonly TriggerEvent[];
|
|
47
|
+
}, event: TriggerEvent): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether every part of an ability acts on the discarded card it answers, so it can do nothing once that card has
|
|
50
|
+
* gone. Its parts are its effects after its printed cost (`costEffects`), sentences read inline. Not parts: a choice
|
|
51
|
+
* (it does nothing until an effect uses what it chose), post-"then" text (it resolves only if the text before it did,
|
|
52
|
+
* RRG 1.8 "'Then'", p. 44). A part needs the card when it names it (`eventTarget`, the `together` targets) or the slot
|
|
53
|
+
* of a choice that does, wherever in it. A branch or a "choose one" needs it when each of its branches or options with
|
|
54
|
+
* effects does (`partNeedsCard`). An ability with no part is kept. Without `judge`, read from the effects alone and
|
|
55
|
+
* remembered per definition; `lostWithDiscardedCard` passes one, to read a condition on the card as the game stands.
|
|
56
|
+
*
|
|
57
|
+
* An amount read from the card does not make a part need it (`AMOUNT_KINDS`): the part resolves with the amount
|
|
58
|
+
* left. So The Shadow King (45180a) and Sugar Man (45182a) still resolve after Abyss (45181a) took a card, counting
|
|
59
|
+
* nothing for it: a mission attempt's card a response took "does not count" (April 30, 2026 - Ruling 4, answer 1).
|
|
60
|
+
*/
|
|
61
|
+
export declare function needsDiscardedCard(definition: AbilityDefinition | undefined, judge?: Judge, gone?: readonly string[]): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Reads a branch's condition on the game as it stands, once the card has gone. Without one (`needsDiscardedCard`'s
|
|
64
|
+
* remembered reading) a condition on the card could pick either branch.
|
|
65
|
+
*/
|
|
66
|
+
export type Judge = (condition: Predicate) => boolean | undefined;
|
|
67
|
+
/** In a list of slots that hold nothing: "that card" itself (`eventTarget`) names nothing either. */
|
|
68
|
+
export declare const EVENT_TARGET = "event.target";
|
|
69
|
+
/**
|
|
70
|
+
* Whether a condition reads a binding the ability has not made yet: a var, a slot or a payment `context` does not hold.
|
|
71
|
+
* At an option (`executeChooseOne`) the ability's earlier choices are known and read; one made inside the option is not.
|
|
72
|
+
*/
|
|
73
|
+
export declare function readsUnbound(value: unknown, context: EffectContext): boolean;
|
|
74
|
+
/** The targets of the discards a `together` answer answers, without those whose cards have since gone (#928). */
|
|
75
|
+
export declare function stillDiscardedTargets(state: GameState, events: readonly TriggerEvent[]): readonly InstanceId[];
|
|
76
|
+
/**
|
|
77
|
+
* Whether every part of a "choose one" option acts on the discarded card (`everyPartNeedsCard`): once another response
|
|
78
|
+
* has moved it before this ability was initiated, `executeChooseOne` does not offer the option (#928). `slots`: the
|
|
79
|
+
* slots that hold nothing now (a choice made among "that card" before the option, the `together` targets once all have
|
|
80
|
+
* gone). `judge`: reads a condition at the start of the option on the game as it stands.
|
|
81
|
+
*/
|
|
82
|
+
export declare function optionNeedsDiscardedCard(option: {
|
|
83
|
+
readonly effects: readonly EffectSpec[];
|
|
84
|
+
}, slots: readonly string[], judge?: Judge): boolean;
|
|
@@ -231,7 +231,7 @@ export declare function divisionCanRemoveThreat(state: GameState, deps: EngineDe
|
|
|
231
231
|
* could take the threat from (`moveThreatLacksSource`); `tuckFull`, the card it tucks under holds its maximum
|
|
232
232
|
* (`tuckUnderFullHost`).
|
|
233
233
|
*/
|
|
234
|
-
export type TargetFault = "target" | "moveSource" | "tuckFull";
|
|
234
|
+
export type TargetFault = "target" | "moveSource" | "tuckFull" | "period";
|
|
235
235
|
/**
|
|
236
236
|
* Why this player-initiated ability cannot be initiated for want of a valid target, or null: RRG 1.8 "Target" (p. 42),
|
|
237
237
|
* "If an ability or game function requires one or more targets, that ability or game function can only be initiated
|
|
@@ -249,6 +249,19 @@ export type TargetFault = "target" | "moveSource" | "tuckFull";
|
|
|
249
249
|
* interrupts and responses): an encounter card or a forced ability resolves as far as it can.
|
|
250
250
|
*/
|
|
251
251
|
export declare function abilityTargetFault(state: GameState, deps: EngineDeps, definition: AbilityDefinition | undefined, sourceId: InstanceId, playerId: PlayerId | null, event?: TriggerEvent | null): TargetFault | null;
|
|
252
|
+
/**
|
|
253
|
+
* Why an optional ability a player initiates cannot be initiated now: every part of its effect is a lasting effect
|
|
254
|
+
* whose period is not in progress (issue #970, Take a Stand used after a villain-phase defense). RRG 1.8 "Lasting
|
|
255
|
+
* Effects" (p. 26): "A lasting effect that expires at the end of a specified time period can only be initiated during
|
|
256
|
+
* that time period", so such an effect is not made (`apply-effect.ts`), and an ability made only of them would change
|
|
257
|
+
* nothing; it is not offered rather than played for nothing. "Until the end of the player phase" outside one follows
|
|
258
|
+
* owner answer Q104 = B (`endOfPlayerPhaseCanStart`). The card is not played either (p. 24, step 2: "can the card be
|
|
259
|
+
* played, or the ability initiated, at this time?"); older FFG rulings agree that an ability that cannot change the game
|
|
260
|
+
* state cannot be initiated (Flow Like Water; Boggs on War Machine's Gauntlet). A forced ability resolves as far as it
|
|
261
|
+
* can and is not judged.
|
|
262
|
+
* Returns the period, or null when the ability can be initiated.
|
|
263
|
+
*/
|
|
264
|
+
export declare function lastingPeriodClosed(state: GameState, definition: AbilityDefinition | undefined): "endOfTurn" | "endOfPlayerPhase" | null;
|
|
252
265
|
/**
|
|
253
266
|
* Whether one option of a "choose one" cannot be chosen for want of a valid target, read as the option would resolve
|
|
254
267
|
* (`context`: the resolving ability's, with what it has bound so far). RRG 1.8 "Choose (Option)" (p. 12): "When a
|
|
@@ -25,7 +25,7 @@ export declare function defenseBarredCandidates(state: GameState, deps: EngineDe
|
|
|
25
25
|
readonly reason: DefenseBar;
|
|
26
26
|
}[];
|
|
27
27
|
/** Why an optional ability that answered an event was not offered (`unofferedAbilities`). */
|
|
28
|
-
export type UnofferedReason = "noTarget" | "cannotPay";
|
|
28
|
+
export type UnofferedReason = "noTarget" | "cannotPay" | "period";
|
|
29
29
|
/** An optional interrupt or response that answered an event but could not be initiated (`unofferedAbilities`). */
|
|
30
30
|
export interface UnofferedAbility {
|
|
31
31
|
readonly instanceId: InstanceId;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a card's search of the discard pile could find if the player paid with a card from hand: a read-only query for
|
|
3
|
+
* the payment step (#966). "Search your deck and discard pile for a Team-Up card …" (Dynamic Duo) is legal to play with
|
|
4
|
+
* nothing to find (RRG 1.8 "Target", p. 43: a search is not a target), and a card spent to pay is in its owner's
|
|
5
|
+
* discard pile before the effect resolves (RRG 1.8 "Initiating Abilities", p. 24, steps 3 and 5; "Resources", p. 36),
|
|
6
|
+
* so paying with the card the search wants lets the search find it. The engine already resolves that; this tells the
|
|
7
|
+
* client which cards in hand it applies to, so the payment can say so.
|
|
8
|
+
*
|
|
9
|
+
* Only the ability's first card choice over its player's discard pile is read: later choices usually depend on what
|
|
10
|
+
* the first one chose ("an ally named by that card's Team-Up keyword"), and cannot be judged before it. Any deterministic
|
|
11
|
+
* card choice over the discard pile counts, not only text that says "Search" ("choose an ally in your discard pile"):
|
|
12
|
+
* paying with the card it wants is the same advice. Only hand cards are tried; a card spent from under its host
|
|
13
|
+
* (`spendableFromTucked`) is not.
|
|
14
|
+
*/
|
|
15
|
+
import type { EngineDeps } from "./abilities.js";
|
|
16
|
+
import type { AbilityId } from "../../content/src/index.js";
|
|
17
|
+
import type { InstanceId, PlayerId } from "./ids.js";
|
|
18
|
+
import type { GameState } from "./state.js";
|
|
19
|
+
export interface SearchFindableIfSpent {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the search's first choice has a candidate in a discard pile as things stand (the deck is hidden, so it never
|
|
22
|
+
* counts). True when there is no such search.
|
|
23
|
+
*/
|
|
24
|
+
readonly found: boolean;
|
|
25
|
+
/** Cards in the player's hand (the played card aside) that the choice would find once spent to pay, in hand order. */
|
|
26
|
+
readonly findableIfSpent: readonly InstanceId[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* For the card `playerId` is playing (`playedCardInstanceId`): whether its search of the discard pile finds anything
|
|
30
|
+
* now, and which other cards in their hand it would find if spent to pay for it.
|
|
31
|
+
*
|
|
32
|
+
* The ability read is `abilityId` when given, else the first ability printed on an event that has such a search (an
|
|
33
|
+
* event's Action, Interrupt or Response: the text playing it resolves). Any other card, or an ability with no such
|
|
34
|
+
* search, answers `{ found: true, findableIfSpent: [] }`.
|
|
35
|
+
*
|
|
36
|
+
* Pure: each "as if spent" state is a throwaway copy with that one card moved to its discard pile the way a payment
|
|
37
|
+
* moves it; `state` is never changed. Candidates come from `selectCards`, the same reader the choice uses as it
|
|
38
|
+
* resolves (`executeChooseCards`) and as initiation judges it (`choiceCandidates`). The played card itself is never a
|
|
39
|
+
* candidate: it is out of play while it resolves (RRG 1.8 "Event", p. 18).
|
|
40
|
+
*/
|
|
41
|
+
export declare function searchFindableIfSpent(state: GameState, deps: EngineDeps, playerId: PlayerId, playedCardInstanceId: InstanceId, abilityId?: AbilityId): SearchFindableIfSpent;
|
|
@@ -155,6 +155,11 @@ export declare const PLAYED_VIA_SLOT = "playedVia";
|
|
|
155
155
|
* in the discard pile, whichever of them the answer is listed under.
|
|
156
156
|
*/
|
|
157
157
|
export declare const TOGETHER_TARGETS_SLOT = "together.targets";
|
|
158
|
+
/**
|
|
159
|
+
* Bound (empty) on a response to a discard initiated once another response had moved the discarded card
|
|
160
|
+
* (`resolve/discarded-card.ts`, #928): its "that card" (`eventTarget`) then names nothing.
|
|
161
|
+
*/
|
|
162
|
+
export declare const DISCARD_MOVED_SLOT = "discard.moved";
|
|
158
163
|
/**
|
|
159
164
|
* The slot a lasting stat modifier's `amount` reads the card whose stat is being read from (`EffectSpec
|
|
160
165
|
* modifyStatUntil`, docs/phase7-wave6.md §3.43: "while Wolverine or Jubilee is making a basic attack …, **they** get
|
|
@@ -1580,10 +1580,10 @@ export type TriggerEventBody = {
|
|
|
1580
1580
|
*
|
|
1581
1581
|
* Response only: the card is already in the discard pile. Recorded only when an ability in the registry listens, and
|
|
1582
1582
|
* announced between frames, so the cards one effect or cost discarded share one response window (RRG 1.8 "Triggering
|
|
1583
|
-
* Condition", p. 45) that resolves before the discarding ability's next effect.
|
|
1584
|
-
*
|
|
1585
|
-
*
|
|
1586
|
-
* 4, answer 1; §4.1 Q32; `settleDeckDiscards`), unless the response that took it says it stays counted
|
|
1583
|
+
* Condition", p. 45) that resolves before the discarding ability's next effect. Once a response has taken the card
|
|
1584
|
+
* away (`deckDiscardStillThere`), a response that needs that card is no longer offered for it, and one that does not
|
|
1585
|
+
* still is (`lostWithDiscardedCard`, issue #928); the discarding ability no longer counts it (ruling, April 30, 2026 -
|
|
1586
|
+
* Ruling 4, answer 1; §4.1 Q32; `settleDeckDiscards`), unless the response that took it says it stays counted
|
|
1587
1587
|
* (`AbilityDefinition.discardsStayCounted`, docs/phase7-wave10-box-heroes.md B3.3).
|
|
1588
1588
|
*
|
|
1589
1589
|
* `at`: where the discard left the card. `"discard"`: the player's discard pile. `"deck"`: the discard emptied the
|
|
@@ -1645,7 +1645,8 @@ export type TriggerEventBody = {
|
|
|
1645
1645
|
* Response only: announced after the card has reached its discard pile, between frames (`announceHandDiscards`), so
|
|
1646
1646
|
* the cards one effect or one cost discarded share one response window (RRG 1.8 "Discard", p. 16: "Responses to the
|
|
1647
1647
|
* discarding of any of those cards are resolved after all discards are made"; "Triggering Condition", p. 45). A
|
|
1648
|
-
* response that takes the card out of the discard pile leaves nothing for another
|
|
1648
|
+
* response that takes the card out of the discard pile leaves nothing for another response that needs that card
|
|
1649
|
+
* (`handDiscardStillThere`, `lostWithDiscardedCard`, issue #928); one that does not need it is still offered.
|
|
1649
1650
|
* Recorded (`recordHandDiscard`) only when an ability in the registry listens.
|
|
1650
1651
|
*/
|
|
1651
1652
|
| {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PackIssue } from "./validate.js";
|
|
2
|
+
/** tsc could not be found or could not run: the pack was not checked (not a defect in the pack). */
|
|
3
|
+
export declare class TypecheckUnavailableError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export interface TypecheckOptions {
|
|
6
|
+
/** The tsc entry script (`typescript/bin/tsc`) to run with Node. Default: found as described above. */
|
|
7
|
+
readonly tsc?: string;
|
|
8
|
+
/** The `.ts` / `.d.ts` file the SDK's import names resolve to. Default: the SDK package's `types`. */
|
|
9
|
+
readonly sdkTypes?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The SDK's type entry: `types` of the package this module is part of (`./src/index.ts` in this repo,
|
|
13
|
+
* `./types/mod-sdk/src/index.d.ts` in the published package, whose bundle runs from `dist/` or `dist/chunks/`).
|
|
14
|
+
*/
|
|
15
|
+
export declare function sdkTypesEntry(): string;
|
|
16
|
+
/** `typescript/bin/tsc`, resolved from the SDK first, then from the pack's folder. */
|
|
17
|
+
export declare function findTsc(packDir: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Type-checks the pack in `packDir` (its `abilities/**\/*.ts`, and what they import) and returns one issue per type
|
|
20
|
+
* error in the pack's own files, at `abilities/<file>:<line>:<col>`. A pack with no `abilities/` folder has nothing to
|
|
21
|
+
* check. Throws `TypecheckUnavailableError` when tsc is missing or fails to run.
|
|
22
|
+
*/
|
|
23
|
+
export declare function typecheckPack(packDir: string, options?: TypecheckOptions): readonly PackIssue[];
|