kjdskjdsk
This commit is contained in:
@@ -165,6 +165,8 @@ The types live in `src/effects/types.ts`. A card contains one or more abilities:
|
||||
| `activated` | Cost `:` effect, including loyalty | `{T}: Add {G}.` |
|
||||
| `static` | Continuous effect or restriction | `Creatures you control get +1/+1.` |
|
||||
| `spell` | Effect line of an instant or sorcery | `Draw two cards.` |
|
||||
| `alternative_cost` | Alternative cast with a condition, possibly free | `If you control a commander, you may cast this without paying its mana cost.` |
|
||||
| `overload` | Overload alternate cost; the engine widens the spell's targets | `Overload {6}{U}` |
|
||||
| `unsupported` | Preserved text plus a reason | `Choose one —` |
|
||||
|
||||
### Effects
|
||||
@@ -182,7 +184,7 @@ The types live in `src/effects/types.ts`. A card contains one or more abilities:
|
||||
| `sacrifice` | `player`, `target`, optional `unless` cost |
|
||||
| `counter` | `what`, `target`, optional `unless` cost |
|
||||
| `return_to_hand`, `return_to_battlefield`, `put_on_top` | `target` |
|
||||
| `search`, `shuffle` | player, selector, destination |
|
||||
| `search`, `shuffle` | player, selector, destination, optional `split` destination |
|
||||
| `add_mana` | `player`, `mana` (`symbols` or `any_color`) |
|
||||
| `scry`, `surveil` | `player`, `amount` |
|
||||
| `fight` | two targets |
|
||||
@@ -191,6 +193,9 @@ The types live in `src/effects/types.ts`. A card contains one or more abilities:
|
||||
| `restriction` | target, rule, duration |
|
||||
| `keyword_action` | `action`, optional `amount`, `detail`, `target` |
|
||||
| `proliferate` | no payload |
|
||||
| `hideaway` | `amount`; exiles the top card and links it to the source |
|
||||
| `play_exiled` | `player`, optional `free`; plays a card linked with `hideaway` |
|
||||
| `exile_graveyards` | no payload; exiles all cards from every graveyard |
|
||||
|
||||
### Targets, values, costs
|
||||
|
||||
@@ -202,8 +207,12 @@ The types live in `src/effects/types.ts`. A card contains one or more abilities:
|
||||
`source_toughness`, `cards_in_hand`, or `event_amount`.
|
||||
- **Costs** are mana symbols, tap/untap, tapping another permanent, energy,
|
||||
loyalty, life, discard, sacrifice, self-exile, mill, and removing counters.
|
||||
- **Conditions** cover controlling permanents, turn ownership, tapped source,
|
||||
life totals, and graveyard size.
|
||||
- **Conditions** cover controlling permanents, commander control, turn ownership,
|
||||
tapped source, life totals, graveyard/hand/library size, total power, distinct
|
||||
permanent names, and this-turn attacks and damage.
|
||||
- **Static effects** include pumps, keyword grants, restrictions, enters
|
||||
tapped/with counters, control, choices, replacements, cost reduction/increase,
|
||||
search restriction, and exiling cards instead of putting them into graveyards.
|
||||
- **Durations** cover permanent, end of turn, your next turn, the end of your
|
||||
next turn, end of combat, controller's next untap step, and while the source
|
||||
remains.
|
||||
|
||||
@@ -58,7 +58,7 @@ const bolt: CardDefinition = {
|
||||
| ------ | ------- |
|
||||
| `start()` | Shuffles libraries, draws opening hands, begins turn 1. |
|
||||
| `playLand(playerId, cardId)` | Plays a land from hand; once per turn, main phase, empty stack. |
|
||||
| `castSpell(playerId, cardId, { targets, x, mode })` | Puts a spell on the stack and pays its mana cost. Accepts a commander in the command zone and adds commander tax. |
|
||||
| `castSpell(playerId, cardId, { targets, x, mode, overload })` | Puts a spell on the stack and pays its mana cost. Accepts a commander in the command zone, adds commander tax, and can pay the overload cost instead. |
|
||||
| `activateAbility(playerId, sourceId, abilityIndex, { targets, x, mode })` | Activates an ability on a permanent. Mana abilities resolve immediately. |
|
||||
| `movePermanent(playerId, cardId, x, y)` | Cosmetic board layout for a permanent you control; coordinates are 0..1 within the battlefield. |
|
||||
| `declareAttackers(playerId, [{ attackerId, defenderId }])` | Starts combat from the precombat main if needed. |
|
||||
@@ -66,6 +66,7 @@ const bolt: CardDefinition = {
|
||||
| `resolveCombatDamage()` | Deals combat damage manually; passing priority also does this. |
|
||||
| `pass(playerId?)` | Passes priority; when everyone passes, resolves the top of the stack or advances the phase. |
|
||||
| `chooseSearchCard(playerId, cardId)` | Finishes one pick of a paused library search. |
|
||||
| `chooseCreatureType(playerId, type)` | Answers an "as this enters, choose a creature type" prompt. |
|
||||
| `resolveStack()` | Convenience for tests/scripts: passes priority until the stack is empty. Does not advance phases. |
|
||||
| `endTurn(playerId)` | Ends the active player's turn, skipping remaining phases. Requires an empty stack. |
|
||||
| `canPlayCard(playerId, cardId)` | Whether a hand or command-zone card can legally be played now, including timing, mana, and targets. |
|
||||
@@ -78,7 +79,13 @@ non-flash spells can only be cast in the active player's main phase with an empt
|
||||
stack. Targets may be supplied explicitly; if omitted, the first legal target is
|
||||
chosen automatically, which keeps scripted games short. A search effect that matches
|
||||
several cards pauses instead: other actions are refused until its controller calls
|
||||
`chooseSearchCard` (the match API uses the `choose_search` action).
|
||||
`chooseSearchCard` (the match API uses the `choose_search` action). The match API also
|
||||
sends the chooser the full searched pool (`searchPool`) so the UI can show and filter
|
||||
the library; only `searchCandidates` are legal picks. A permanent with "as this enters,
|
||||
choose a creature type" also pauses play: `pendingChoice` records the controller and
|
||||
the permanent, and the match API refuses other priority actions until `chooseCreatureType`
|
||||
(the `choose_type` action) receives one of the creature types in `CREATURE_TYPES`.
|
||||
The chosen type is stored on the object and cleared when it leaves the battlefield.
|
||||
|
||||
## Turn structure
|
||||
|
||||
@@ -100,20 +107,27 @@ shown to players who can actually do something.
|
||||
- Zones: library, hand, battlefield, graveyard, exile, stack, and command zone. Tokens
|
||||
cease to exist when they leave the battlefield.
|
||||
- Commander: command-zone casting, `{2}` tax per previous cast from the command
|
||||
zone, return to the command zone instead of graveyard/exile/hand/library, and a
|
||||
loss at 21 combat damage from one commander. Deck construction is validated by
|
||||
`validateCommanderDeck`.
|
||||
zone, free alternative costs while you control a commander, return to the command
|
||||
zone instead of graveyard/exile/hand/library, and a loss at 21 combat damage from
|
||||
one commander. Deck construction is validated by `validateCommanderDeck`.
|
||||
- Mana: colored, generic, hybrid, Phyrexian, `{X}`, and `{S}` costs; manual mana
|
||||
abilities plus automatic tapping of untapped mana sources when paying.
|
||||
- Costs: tap, untap, tap another permanent, pay life, discard, sacrifice, exile,
|
||||
putting/removing counters, mill, energy, and choice costs.
|
||||
- Abilities: spell effects, activated abilities, triggered abilities (enters,
|
||||
leaves, dies, attacks, blocks, cast, draw, life, upkeep, end step, combat), static
|
||||
effects, and basic replacement effects for entering tapped/with counters.
|
||||
putting/removing counters, mill, energy, and choice costs. Static cost reductions
|
||||
and increases apply while their source is on the battlefield.
|
||||
- Abilities: spell effects, overload, activated abilities, triggered abilities
|
||||
(enters, leaves, dies, attacks, blocks, cast, draw, life, upkeep, end step,
|
||||
combat), static effects, and basic replacement effects for entering tapped/with
|
||||
counters and exiling cards instead of putting them into graveyards.
|
||||
- Effects: damage, draw, discard, mill, life, pump/set P/T, grant keyword,
|
||||
counters, proliferate, tokens, destroy, exile, sacrifice, counter spell/ability,
|
||||
zone returns, tap/untap, search/shuffle, add mana, fight, regenerate, energy,
|
||||
attach, restrictions, conditional and modal effects, dig, and divided damage.
|
||||
counters, proliferate, tokens, destroy, exile, exile all graveyards, sacrifice,
|
||||
counter spell/ability, zone returns, tap/untap, search/shuffle, add mana, fight,
|
||||
regenerate, energy, attach, restrictions, conditional and modal effects, dig,
|
||||
divided damage, hideaway, and playing a card exiled with hideaway.
|
||||
- Restrictions and conditions: activated abilities can be disabled, opponents can
|
||||
be limited to the top N cards when searching, cards can begin the game on the
|
||||
battlefield from the opening hand, and conditions can count commander control or
|
||||
distinct permanent names.
|
||||
- Combat keywords: flying, reach, first strike, double strike, trample, deathtouch,
|
||||
lifelink, vigilance, haste, indestructible. Regeneration shields replace
|
||||
destruction.
|
||||
@@ -136,6 +150,16 @@ shown to players who can actually do something.
|
||||
- Modal spells choose a mode by index (`options.mode`); optional "you may" choices
|
||||
are not modelled. An optional `pay` is simply not paid when unaffordable. Search
|
||||
effects with several matching cards do pause for the player's pick.
|
||||
- "As this enters, choose a creature type" pauses for a pick and stores the type on
|
||||
the permanent, but no effect reads the chosen type yet. The other `choose` kinds
|
||||
(color, card name, player, opponent, number) are accepted and ignored. Cavern of
|
||||
Souls' mana is not restricted to the chosen type and does not make the spell
|
||||
uncounterable.
|
||||
- Hideaway automatically exiles the top card and does not track cards as face down.
|
||||
`play_exiled` only supports the free "without paying its mana cost" case.
|
||||
- Overload widens only top-level effect targets; a nested modal or conditional target
|
||||
keeps its printed target. Free alternative costs are modelled only for controlling
|
||||
a commander, and search restrictions cap the searching player's own library.
|
||||
- Opening hands are kept automatically; there is no mulligan flow.
|
||||
- Replacement/prevention effects, layers, and dependency ordering are simplified.
|
||||
Continuous effects apply in creation order rather than in full rules order.
|
||||
|
||||
Reference in New Issue
Block a user