Payment surfaces by wire¶
A decision surface is the set of questions a wire puts to a seat while a spell is paid for. Pick a wire.
Every gorge wire sits on the same cast flow. The engine announces the choices of CR 601.2b first, then offers the mana window of CR 601.2g, then pays. What differs is how much of that a wire hands to the seat.
The seat sees three ways to pay. It can answer a plain cast, submit a payment plan, or announce the cast and tap in the window.
flowchart LR
A[Priority] --> B[Announce]
B --> C[Plan or window]
C --> D[Tap or Auto-fill]
D --> E[Paid]
C --> F[Cancel cast]
- Plans. With
auto_manaon, the host asks the engine for payment plans and attaches them to the priority decision aspayment_actions. A table without it never sends plans to a human seat (server/host/match.go:624,server/host/table.go:151). The-auto-manaand-bot-auto-manaflags set it (server/gorged/gorged.go:416). - Two intents.
paymentcarries a whole plan.announcenames an action and starts the cast with no plan (engine/decision/decision.go:1316,announce.go:56). An action with no plan cannot be announced. - The mana window. It opens only when the pool cannot pay and an untapped source exists (
cast_paymentplan.go:269). After an announce it carries the cost, what is still owed and the pool, with per-colourmanaoptions,autofill,undo_tapandcancel_cast(announce_pay.go:98,decision/announce.go:26). Without one it offersactivateanddone. - Which casts get a plan. Only the printed-cost cast from hand, command zone, flashback and the plain may-play (
payment_plan.go:602). The planner also declines a cost with X, snow, hybrid or life (pay/classify.go:128) and a convoke, delve, modal or optional-cost shape (payment_plan.go:312). Those casts go through announcements and the window. - One plan per action. The type holds a list (
decision/payment_plan.go:232). The planner builds one (payment_plan.go:667), ranked by the planner. A seat accepts it or pays another way.
Announcements, in order. The cast asks for these before any mana moves:
| Announcement | Ask | Where |
|---|---|---|
| Either-or additional cost | altaddcost choice |
cast_asks.go:27, called at cast_begin.go:1101 |
| Convoke, improvise, harmonize, waterbend taps | one option per contribution | pay/castasks.go:55, cast_begin.go:1202 |
| The value of X | x choice |
cast_subcounter.go:96 |
| Delve | graveyard cards to exile | cast_subcounter.go:581 |
| Each hybrid and Phyrexian pip | pay_<colour>, pay_generic, pay_life |
pay/castasks.go:209, cast_begin.go:1253 |
| Sacrifice, discard, tap-another costs | chosen as the cost is paid | cast_begin.go:1289 |
A kicked, flashback or other alternative-cost cast is a separate cast option, with its mode on the option.
The wire carries the native decision, so the surface is the native one. The agent's hello picks whether it sees plans.
flowchart LR
A[hello] --> B{payment_actions}
B -->|true| C[Plan or announce]
B -->|false| D[Taps and cast]
C --> E[Paid]
D --> E
payment_actions: truemakes the driver attach plans before the decision is handed over, and the agent may answer withintent.paymentorintent.announce(draft/draftlab/extern/player.go:57,:174;engine/seat/seat.go:42).falseleaves the ordinary options, so the agent taps lands and casts.skip_forcednever skips a decision that carries a payment choice (player.go:212).
The wire is specified in gorge-agent/1.
The engine neutral vocabulary has no field for a plan. A gorged table declares engine_autopay, so the agent never taps.
flowchart LR
A[hello_ok] --> B[engine_autopay]
B --> C[cast_spell]
C --> D[Planner pays]
D --> E[Paid]
B -.-> F[asks=native]
- Autopay (the default).
cast_spellpays with the planner's first plan. The host itself answers a mid-resolution mana window, a mana ability's colour ask and a triggered cost's pay-or-decline, and counts those asx_gorge.autopay_fallbacks(env/identity.go:114,session/session.go:119,agent/agent.go:368). - A hybrid pip. The host picks the first offered face. v2 has no kind for it (
mapping/payment.go:18). - X. The agent answers
choose_number(mapping/simple.go:249). - Convoke-family taps. One
select_objectper contribution object (mapping/tail.go:121). - Manual mana.
spellbench-gorge-env -manual-manaoffersactivate_mana_abilitycandidates instead (cmd/spellbench-gorge-env/main.go:26,protocol/kinds.go:31). gorged's own tables do not. - Taps on gorged. A spell with no plan, such as an X spell or an equip, is offered only once mana floats. The client posts the tap on the native routes (spellbench-v2.md).
asks=native. A seat attached this way answers the colour ask, the pay-or-decline, the mana window and each flexible pip itself.
The wire is specified in SpellBench v2.
ManaBrew has a payment prompt of its own, payManaCost. gorge maps the announced window to it.
flowchart LR
A[chooseAction] --> B[pay-id action]
B --> C[payManaCost]
C --> D[act, auto or cancel]
D --> E[Paid]
- A plan-backed cast rides on
chooseActionas apay-<id>cast action. Choosing it sendsintent.announce, never a plan (server/manabrew/prompt_priority.go:48,:240). payManaCostlists oneactivateAbilityaction per source, ability and colour, plusundoManaandautofill.canConfirmFromPoolis true only when adoneoption exists (prompt_payment.go:40,:69).- The answers are
actfor a tap or undo,paywithautofor Auto-fill, andcancelfor the cancel option. A cancel is refused on a window that does not offer one (prompt_payment.go:154). - The cost shown is the resolved amount owed, not the printed pips.
- Convoke-family taps and the hybrid pip ask are plain selections over labels (
prompt_choose.go:97). An either-or additional cost arrives as a generic label selection.
The wire is specified in ManaBrew.
dirac has no manual mana. Mana abilities are never priority options, and a cast is offered when the pool and untapped sources can pay.
flowchart LR
A[Priority] --> B[Cast offered]
B --> C[X and pips]
C --> D[Planner order]
D --> E[Paid]
- Two surfaces. Autopay offers a spell the planner never prices only when the floating pool pays it. Full also offers the plays gorge reaches by lowering a potential play (
dirac/lockstepconfig.go:10,dirac/state.go:71). The lockstep checks both, withkfuzz -surface autopay|full(kfuzz/main.go:93). - Serving.
gorged -engine diracrefuses-auto-mana=falseand-bot-auto-mana=false(server/gorged/engine.go:28,dirac/docs/serving.md:54). It plays on the full surface, and on the autopay one when-sbv2is on (engine.go:70).dplaydefaults to autopay (dirac/cmd/dplay/game.go:39). - X and pips. X spells are offered with X from 0 up to the most affordable, and a hybrid pip's colour is asked after modes and before targets (
dirac/doc.go:196,:334). - Order. The kernel spends sources in gorge's planner order, so both engines tap the same lands (
dirac/doc.go:116). - Deviation on record. The autopay priority vocabulary has no mana-ability options and no concede (
dirac/docs/DEVIATIONS.md:15).
Read more in dirac serving and the dirac guide.