A Magic: The Gathering collectible card game played entirely through Discord, in the spirit of Pokémon TCG Pocket. Built on DiscordPHP-MTG, with card data from MTGJSON and card images from Scryfall.
Planned features:
- Foundation (done): the project, the card pool import, and JSON storage for players, inventories, decks and side decks.
- Packs and collection (done): one free pack a day. A pack is one set plus one color, and every pack holds at least one rare or mythic rare. Commands to view your collection and build decks.
- Rules engine and matches (implemented with partial card and rules support): played through Discord buttons and menus: opening hands, turns, priority and the stack, mana, casting, combat, state-based actions, and triggered, activated and loyalty abilities with tokens and Equipment. Unrecognized abilities are reported to players; recognized text does not by itself establish complete gameplay support. See the architecture review and continuation priorities.
- Matchmaking and game modes (done): ranked queues and a ratings ladder for each mode, friendly challenges, deck rules and a card library for each mode (Commander included), rental decks, and points from ranked games and daily and weekly quests.
Also in: trading and the points shop. Players trade cards and points with each other, sell cards they don't need for points, and spend points on single cards or on packs of one color of one set.
Everything can be done with buttons, menus and forms: /menu opens your home panel, and every slash command below opens the same panels, so you never have to type a command's options.
| Panel | What you do there |
|---|---|
| 🏠 Menu | Your points, whether your free pack is ready, the deck you play with, your game, draft, trade offers and quests at a glance, and a button for each section. |
| 🎁 Packs | Pick a set and a color from menus (or leave them on 🎲 for a surprise), then Open free pack or Buy a pack. |
| 📚 Collection | Your cards a page at a time; Filter asks for a set, color, rarity and part of a name. |
| 🃏 Decks | Open a deck from a menu or make one with New deck. On a deck: Add cards lists the cards you own with copies to spare (by color, a page at a time) to add from a menu; Add by name and Take out ask for a card and a count; a menu takes one copy out; Basic lands sets every basic land count at once; the format, Rename, Commander, Play with it and Delete are there too. Rental decks lists the official decks to play with. |
| ⚔️ Play | Find a ranked game in a mode from a menu, or pick a player to challenge; show your board, leave the queue, concede, see a ladder, or get your last game's record. Practice vs bot plays your active deck (rentals too) against the bot in the mode you pick; Starter decks vs bot starts the How to play practice game. |
| 🎴 Draft | Join an open pod or make one for a set from menus; start, leave, take your picks, and build your draft deck from menus (Basic lands, Auto-build, Ready), then play your round. |
| 🛒 Shop | Buy a card, Sell a card, Sell extras and Check a price each ask in a short form; Buy a pack goes to the packs panel. |
| 🤝 Trades | Pick a player to open the offer form (cards you give and want, one per line like 2 Shock, and points each way); add to or call off an offer you made from a menu. |
| 🎯 Quests | Your daily and weekly quests. |
| 📖 How to play | A quick start for someone who has never played Magic: seven short pages on cards, mana and lands, turns, combat and winning, then a practice game against a bot. |
A practice game needs no cards or deck: you play a red-green starter deck against the bot's white-black one, in Casual. Only you see it, it is not ranked and pays nothing, and your action panel adds a 💡 tip for each decision.
Your own panels change in place. Anyone else who clicks a panel you posted gets their own copy, only for them. Challenges, trade offers, draft pods and boards are posted in the channel for everyone.
| Command | What it does |
|---|---|
/menu |
Your home panel, only for you. |
/tutorial |
How to play, only for you: the basics of Magic in a few pages, then a practice game. |
/pack open [set] [color] |
Opens your free pack for today and adds it to your collection. Leave the set or color empty for a surprise. |
/pack list |
The sets and colors you can open, and when your next free pack is ready. |
/collection [set] [color] [rarity] [name] [player] |
The cards you (or another player) own, in pages. Pick a card to see it in full. |
/decks create <name> [format] |
Starts an empty deck. Your first deck becomes your active one. |
/decks add <deck> <card> [count] [side] |
Puts cards you own, or basic lands, in the main deck or the side deck. |
/decks remove <deck> <card> [count] [side] |
Takes cards out. |
/decks show [deck] · /decks list |
A deck with its cards grouped by type and an Export for… picker; or all your decks. |
/export deck [deck] [format] |
A deck as a file for MTG Arena (also Moxfield and Archidekt), Tabletop Simulator (a saved object with Scryfall card images) or Frogtown (also Cockatrice and Forge). Defaults to your active deck and Arena. |
/export collection [format] [set] [color] [rarity] [player] |
The cards you (or another player) own as a file in the same formats. |
/decks rename · /decks format · /decks delete · /decks use |
Rename a deck, change its format, delete it, or make it the one you play with. |
/decks commander <deck> [card] |
Makes a legendary creature you own the commander of a Commander deck, or takes it out. |
/decks rentals · /decks rent <rental> |
The official decks you can play without owning the cards; or plays with one until you pick your own deck with /decks use. |
/match queue [mode] [deck] |
Waits for a ranked game in a mode (default: your deck's format) against a player of about your rating. |
/match challenge <opponent> [deck] [mode] |
Challenges another player to a friendly game. They get Accept and Decline buttons. |
/match bot [mode] [deck] |
Practice against the bot with one of your decks or a rental (default: your active deck) in a mode (default: Casual, any deck of 40+ cards). The bot plays a random rental deck. Unranked, pays nothing, uses up none of your rental games, and only you see it. Also under Play in /menu. |
/match modes · /match ladder [mode] |
The game modes with their deck rules and who is waiting; or a mode's ratings. |
/match board |
The board of the game you are in. |
/match leave |
Leaves the queue, calls off your challenge, or concedes your game. |
/match log [match] |
The full record of your current or last game (or any game by id), as a text file. Finished boards also have a Game record button. |
/draft create <set> [players] · /draft join [draft] |
Makes a booster draft pod for a set, or joins an open one; either way you pay the entry fee in points. |
/draft start · /draft leave · /draft status [draft] |
Starts your pod before it is full (its host only); leaves your draft; or shows a pod's players, pairings and standings. |
/draft pack |
The pack in front of you, with a menu to take a card. |
/draft pool · /draft add <card> [count] · /draft remove <card> [count] · /draft lands · /draft auto · /draft ready |
Your picks and draft deck; move cards between deck and side deck, set basic lands, let the bot build it, and send it in. |
/draft play |
Starts your game this round if it waited on someone busy, or shows it. |
/quests |
Your daily and weekly quests and how far along you are. |
/shop balance |
Your points, what cards cost by rarity and set age, and what each set's packs cost. |
/shop price <card> |
What a card costs to buy and pays to sell. |
/shop sell <card> [count] |
Sells cards you own for points. Copies your decks use are kept. |
/shop sell-extras [keep] [rarity] [set] |
Sells every copy beyond keep (default 4) of each card and beyond what your decks use. It lists what would sell and waits for Sell first. |
/shop buy-card <card> [count] |
Buys any card from the game's sets with points. |
/shop buy-pack [set] [color] |
Buys a pack with points. It is built exactly like a free pack and does not use up your free one. |
/trade offer <player> [give] [give_count] [want] [want_count] [give_points] [want_points] |
Offers another player a trade. They get Accept and Decline buttons; you get Cancel offer. |
/trade add <side> [card] [count] [points] [offer] |
Adds a card or points to an offer you made (your newest, unless you pick one). |
/trade list · /trade cancel [offer] |
Your open offers, made and received; or calls one off. |
Packs. Everyone gets one free pack a day; the day turns over at midnight UTC. A pack is 15 cards of one color (white, blue, black, red, green, multicolor or colorless) of one set: 10 commons, 3 uncommons, a wildcard slot that is usually a common or uncommon but sometimes rarer, and a rare slot that is always a rare or mythic rare. A mythic shows up as often as on a real print sheet (each rare printed twice, each mythic once). A pack never repeats a card unless its color is too small to fill it; a color with no rare or mythic rare has no packs.
Matches. A match is one game between two players, each playing the main deck of their active deck (or the deck they name). The board is public: life, cards in hand, library and graveyard, everything on the battlefield, the stack and what just happened. Your hand & actions opens your own panel, which only you see: your hand and the choice in front of you (keep or mulligan, play a land or cast a spell, use an ability, choose X and targets, attack, block, discard). Each action posts a fresh board that mentions whoever the game waits on.
What the rules engine does today:
- Game flow: a coin flip for who plays first (they skip their first draw), seven-card hands with the London mulligan, every step of the turn, the maximum hand size, and losing at 0 life, 10 poison counters or when drawing from an empty library. Conceding is
/match leave. - Priority and the stack: spells are cast at instant or sorcery speed (flash counts), resolve last in, first out, and do nothing if all their targets are gone. Like MTG Arena, a player who has nothing they could do passes automatically, except in their own first main phase; Auto-pass in your panel turns that off. An ability you could activate stops auto-pass only when something is on the stack or it is your own main phase.
- Mana: costs are paid for you from floating mana and your untapped lands and mana creatures, saving dual lands for the colors only they make. Hybrid, Phyrexian (2 life when you have no mana for it), colorless and X costs work, and lands that say they enter tapped do so.
- Combat: attacking (summoning sickness, haste, defender, vigilance), blocking (flying and reach, menace), first strike and double strike, trample, deathtouch and lifelink. An attacker assigns lethal damage to its blockers in the order they were declared and the rest to the last one, or with trample to the player.
- Abilities: triggered abilities go on the stack the next time a player would get priority, the active player's first, so the other player's resolve first. Their controller picks targets in their panel (or they are picked for them when there is only one choice), and one with no legal target is removed. Activated abilities, loyalty abilities (one per planeswalker per turn, at sorcery speed) and Equip are used from the panel's Use an ability menu; their costs (mana,
{T}, sacrificing it, life, loyalty) are paid for you. - Tokens enter like any permanent and stop existing when they leave the battlefield, though they still "die" on the way.
- State-based actions: lethal damage and deathtouch, 0 toughness, planeswalkers with no loyalty, the legend rule (the newest stays), Auras attached to nothing, Equipment attached to something that is not a creature, and +1/+1 against -1/-1 counters.
- Card text it reads: keyword lines (flying, reach, first strike, double strike, deathtouch, lifelink, trample, vigilance, haste, defender, menace, indestructible, hexproof, shroud, flash, prowess, fear, intimidate, shadow, skulk, infect, wither, devoid, changeling, landwalk, exalted, persist, undying, soulshift, convoke, affinity for artifacts, rebound, unearth, bestow, saddle, bushido, toxic, bloodthirst, ward, crew, cycling, basic landcycling and the like, flashback, kicker, morph, megamorph, disguise, level up and Job select),
{T}: Add …mana abilities (several on one land, and painlands andPay 1 lifelands that hurt for their colors), Auras and Equipment that give +N/+N and keywords, Auras that stop a creature attacking, blocking, untapping or using abilities (Pacifism, Arrest, Claustrophobia),This creature can't block,can't be blocked,can't be blocked by creatures with power 2 or greater,can block only creatures with flying,attacks each combat if able,This spell can't be counteredand the like,Equip {N}(named ones too),enters with N (or X) +1/+1 countersand-1/-1 counters, lands that enter tapped unless you control something or pay life,Creatures you control get +1/+1andOther creatures you control …,As an additional cost to cast this spell, sacrifice a creatureordiscard a card, level up bands, and the most common effects (damage, draw, gain and lose life, destroy, exile, return to hand, counter a spell, counter unless its controller pays {N}, tap and untap, +N/+N until end of turn for one creature or all of yours,can't block this turn, +1/+1 counters, creature tokens, scry, surveil, regenerate, discard and loot, fight, search for a basic land, Empower Jace,Exile this spell, mill, Food, Clue and Treasure tokens, investigate, gain control until end of turn,Target player reveals their hand. You choose …, return a creature card from your graveyard to your hand or the battlefield, look at or reveal the top N cards and put one or two (or a creature, land, Dwarf and so on) into your hand, energy (you get {E}{E}andPay {E}{E}:costs)). Modal spells (Choose one —,Choose two —,Choose one or both —,Choose one or more —) andIf this spell was kicked, …are read too, and so are modal triggered abilities (When this creature enters, choose one —). Those effects are also read as triggered abilities (When … enters,… dies,Whenever … attacks,… deals combat damage to a player,When … is turned face up, Landfall (Whenever a land you control enters),When this Equipment enters, attach it to target creature you control,Whenever you cast a noncreature spell,At the beginning of your upkeeporend step), as activated abilities with mana,{T}, sacrifice and life costs (andActivate only as a sorceryoronce each turn), and as planeswalker loyalty abilities. An ability is read whole or not at all. Text it cannot read yet is listed under the card in your panel, and the card still works without it.composer card-coverageshows how much of the imported cards it reads, set by set for the newest ones, and the most common lines it does not read in sets of the last two years;composer card-coverage -- 100 modernmeasures only the cards legal in Modern. - Ways to play a card are offered one by one in the play menu: each mode of a modal spell, with or without kicker, flashback from the graveyard, face down for {3}, and cycling. Crewing taps the creatures that could not attack this turn first, then the weakest. Ward is paid along with the spell or ability that targets the permanent; a triggered ability whose controller cannot pay it is countered. A modal triggered ability asks its controller for its mode before targets, offering only modes with something to target. Looking at the top cards, scry, surveil and discard stop the spell while its player picks which cards go to their hand, the bottom, the graveyard or away from their hand; with no more cards than they must discard, they discard them all without being asked. A counterspell that can be paid off is paid for its target's controller when they can. A land that enters tapped unless you pay life is paid for on your own turn while you have more than 10 life. Searching for a basic land takes the color your hand needs most that your lands make least. An additional cost sacrifices your weakest creature (tokens first) or discards your cheapest card. Convoke taps creatures once lands are used up.
As this enters, choose a creature type(ora color) is chosen for the player: the creature type most of their creature cards have, or the color most common in their mana costs;Creatures you control of the chosen type get +1/+1andAdd one mana of the chosen coloruse it. Curses (Enchant player) go on a player: theirAt the beginning of enchanted player's upkeepabilities andCreatures enchanted player controls get -1/-1work. A Class gains each level's abilities when its{2}{G}: Level 2ability resolves, one level at a time. Station taps your strongest other creature that could not attack anyway, and a Spacecraft gains eachN+ |ability with that many charge counters, becoming a creature at the last one. Bestow is offered as its own way to cast the card: it enters attached to a creature and becomes a creature again when that creature leaves. Saddle taps creatures like crew, as a sorcery, and turns onWhenever this creature attacks while saddledabilities. Unearth is offered in the play menu from your graveyard; the creature is exiled at the end step or whenever it would leave the battlefield. A spell with rebound cast from your hand is exiled as it resolves and offered again, free, in your next upkeep.Start your engines!gives its controller speed 1, which goes up once on each of their turns when an opponent loses life, to 4;Max speed —abilities work only at 4, and the player line shows 🏁 speed.Up to one targetandTap up to two target creaturesadd No target to the target menu;don't untap during their controller's next untap stepand stun counters keep the creatures tapped. Fabricate always takes the +1/+1 counters, not the Servos. Riot always takes the +1/+1 counter, not haste. Unleash always takes the counter, and devour eats only your creature tokens. Firebending's {R} goes into the mana pool, which empties at the end of the step.Exile target … until this leaves the battlefieldreturns the card when it leaves.You control enchanted creaturemoves the creature to the Aura's controller until the Aura leaves it. Leylines start the game on the battlefield. Delve exiles as many cards from your graveyard as can pay for generic mana, oldest first. Split second, umbra armor (and totem armor),Destroy all creatures(and other wraths),Instant and sorcery spells you cast cost {1} less to castand similar reducers,If that creature would die this turn, exile it insteadandWhen this is put into a graveyard from the battlefieldwork as written. Graft,Prevent all combat damage that would be dealt this turnand entering with oil (or charge, time, lore …) counters work as written. Exploit sacrifices your weakest other creature only when it is a token or has total power and toughness 2 or less. Explore leaves a nonland card on top. Adapt, monstrosity (withWhen this creature becomes monstrous), vanishing, mentor,At the beginning of the end step, sacrifice this creatureand sacrificing an artifact or creature as an additional cost work as written. Extort is paid whenever its controller has the mana. Improvise taps artifacts for generic mana once lands run out. Modular, renown, evolve, living weapon,Whenever you gain life,You have no maximum hand size,You may play an additional land on each of your turnsandDuring your turn, this creature has first strikework as written. Dash, evoke and warp are offered as their own ways to cast the card: a dashed creature has haste and returns to its owner's hand at the end step, an evoked one is sacrificed as it enters, and a warped one is exiled at the end step and offered again from exile on a later turn. Plot is offered from your hand as a sorcery; the plotted card is offered free from exile on a later turn. Mobilize's Warrior tokens attack and are sacrificed at the end step.Whenever another creature you control enters,Whenever you draw your second card each turn,can't be blocked by more than one creatureandA deck can have any number of cards named …work as written. Ninjutsu is offered once blockers are declared and returns your weakest unblocked attacker. A discarded card with madness is exiled and offered at its madness cost while its trigger waits; otherwise it goes to the graveyard. Spree and entwine show each choice of modes with its added cost. Suspend is offered from your hand; the card loses a time counter each upkeep and is offered free in the upkeep the last one comes off, a creature with haste. Offspring is offered like kicker. Backup gives another creature only its keywords; a backup card whose other abilities would be granted is not read yet.Return this card from your graveyard to your handis offered from the graveyard. Afterlife, annihilator (the defending player sacrifices their weakest permanents),It can't be regeneratedandIf that spell is countered this way, exile it insteadwork as written. Bounce lands make both of their colors and return a tapped land you control (basic first, else themselves) as they enter.{1}, {T}: Add one mana of any coloris used when a color is missing, paying {1} more.Target opponent reveals their hand. You choose … Exile that card.,Put one of those cards into your hand and the other on the bottomandYou have hexproofwork as written. Modal triggered abilities with any trigger (Landfall — …, choose one —) offer only the modes that have targets. Sunburst counts the colors of mana spent.Exile the top two cards of your library. Until the end of your next turn, you may play those cards.(and… this turn) offers them from exile, lands as the land drop. Ascend gives the city's blessing at ten permanents, andYou may look at the top card of your library any timeshows it in your hand panel. Echo is paid in your next upkeep when you have the mana; otherwise the permanent is sacrificed. Flanking gives each blocker without flanking -1/-1. Escape, jump-start and retrace are offered from your graveyard: escape exiles your oldest other graveyard cards, jump-start discards your cheapest card, retrace your first land card. Bargain is offered as its own way to cast the card and sacrifices a token first, else your weakest artifact or enchantment.When this becomes the target of a spell or ability, sacrifice itworks as written. Storm copies the spell, with the same targets, once for each spell cast before it this turn. Cascade exiles cards from the top of your library until a nonland card with lesser mana value, which is offered free while the cascade trigger waits; the rest, and that card if not cast, go on the bottom. Foretell is offered on your own turn for {2}; the foretold card is offered from exile for its foretell cost on a later turn. Cumulative upkeep is paid in each upkeep while you have the mana; otherwise the permanent is sacrificed.Put a spore counter on …(and charge, age, time … counters),Remove three spore counters from …:costs andIts controller loses 2 lifework as written.Copy target instant or sorcery spellcopies it with the same targets. Casualty is offered as its own way to cast the card: it sacrifices your weakest creature with enough power and copies the spell. For Mirrodin!,Ward—Discard a card(the cheapest other card), power and toughness equal to the number of lands (creatures, artifacts …) you control,Return this to its owner's handandyou may search your library for a basic land card(always searched) work as written. Overload is offered as its own way to cast the card and affects each matching permanent instead of a target. Eternalize and embalm are offered from your graveyard as a sorcery. Enlist taps your weakest creature that could have attacked but didn't. Signets ({1}, {T}: Add {W}{U}.) are used when their two colors help, paid with other mana.This land enters tapped unless a player has 13 or less lifeworks as written. Protection from a color stops damage, blocking and targeting by sources of that color. Battle cry and prototype (a smaller creature for its prototype cost) work as written. Proliferate adds a counter of each kind to your permanents (except -1/-1, stun and age counters), -1/-1 and stun counters to your opponents' permanents, poison to opponents who have some and energy to you if you have some. An opponent never pays tribute, soif tribute wasn't paidalways happens.Prevent the next 1 damage that would be dealt to any target this turn(andPrevent all damage …) andShuffle this into its owner's librarywork as written. Reconfigure attaches the Equipment creature to another creature you control, when it stops being a creature, or unattaches it.Look at the top four cardsandReveal the top N cardsalso readYou may put a land card from among them onto the battlefield tapped,Put all land cards revealed this way into your hand,a creature card and/or a land card,up to two of themand any sentences after them.Then shuffle,Then that player shufflesandExile it (or Sacrifice it) at the beginning of the next end stepafter a token or a creature returned to the battlefield work as written. A look can follow other sentences (… deals 5 damage to up to one target creature. Look at the top two cards …),the top X cards, where X is the number of lands you controlcounts your lands, andIts controller may search their library for a basic land card, put that card onto the battlefield tapped, then shufflesearches for the owner of the exiled or destroyed card.Search target opponent's library for a creature card and put that card onto the battlefield under your controltakes their most expensive matching card. Surgical Extraction and Crumble to Dust styleSearch its owner's graveyard, hand, and library for any number of cards with the same name as that card and exile themexile every copy. Double-faced cards keep their back face (runcomposer import-cardsagain to add it to existing pools); a back face's unread lines count against the card.Transform CARDNAME, the werewolves'At the beginning of each upkeep, if no spells were cast last turn, transform CARDNAMEand daybound/nightbound work: it becomes day when a daybound permanent enters, night after a turn with no spells, and day again after a turn with two or more (counting every player's spells). Disturb is offered from your graveyard and casts the back face, which is exiled whenever it would go to a graveyard.At the beginning of your first main phase, you may pay {N}. If you do, transform thisis paid when it can be. Sagas get a lore counter as they enter and after your draw step, trigger that chapter, and are sacrificed once the last chapter has resolved;Exile this Saga, then return it to the battlefield transformedworks. Read ahead always starts on chapter I.Must be blocked if ablegets a blocker from the defending player when they leave it unblocked and one can block it.Creatures with power less than this creature's power can't block it, power and toughness equal to the number of cards in your hand (or graveyard, or creature cards in your graveyard),Search your library for up to two basic land cards, put them onto the battlefield tappedand Cultivate work as written. Training,This creature gets +1/+1 for each artifact you control,Each creature you control with a +1/+1 counter on it has trample,This spell costs {1} less to cast for each creature in your party(or artifact, creature or land you control) andSacrifice this: It deals 2 damage to target creaturework as written. Afflict, incubate (the Incubator transforms for {2} into a Phyrexian with its counters),Whenever you cast a Spirit or Arcane spellandyou draw a card and you lose 1 lifework as written. Dredge is always taken while the library keeps at least seven cards more than the dredge number, the biggest dredge first. Blitz is offered as its own way to cast the card: it has haste, draws a card when it dies, and is sacrificed at the end step. Buyback is offered like kicker and returns the spell to your hand as it resolves. Ingest andWhenever this or another Ally you control enters, you may put a +1/+1 counter on thiswork as written. Conspire is offered as its own way to cast the spell: it taps your two weakest untapped creatures that share a color with it and copies the spell. Awaken is offered as its own way to cast the spell; the game picks the land (one already awakened, else a tapped one), which becomes a 0/0 Elemental creature with haste and its counters. A creature that connives draws a card, then you choose a card to discard; a nonland discard gives it a +1/+1 counter.costs {2} less to cast if it targets a tapped creaturechecks the targets you choose, andYou may play lands from your graveyard.lets you play your land for the turn from there. Targets such astarget creature with power 4 or greater(or2 or less) work too. A tutor such asSearch your library for a creature card, reveal it, put it into your hand, then shuffle.lets you pick from one card of each name that fits (or none, when it names a kind of card).return target instant or sorcery card from your graveyard to your handworks, and so do artifact, land and enchantment cards.You may discard a card. If you do, draw a card.adds a "Don't discard" button.Take an extra turn after this one.gives its caster the next turn, andAs an additional cost to cast this spell, exile a creature card from your graveyard.exiles your cheapest one as you cast it. Scavenge is offered from your graveyard as a sorcery and puts its counters on your strongest creature. Filter lands such as{W/U}, {T}: Add {W}{W}, {W}{U}, or {U}{U}.work, their cost paid with either color. Freerunning is offered as its own way to cast the spell once an Assassin or your commander has dealt combat damage to a player this turn. Auras can also enchant a tapped or untapped creature, a creature with or without flying, an artifact creature, a nonbasic land, a nonland permanent an opponent controls, or a permanent of one subtype such asEnchant Forest, andEnchanted land has hexproof.works like the creature version. Auras can enchant combined kinds such as "creature or land", "red or green creature" and "artifact or creature you control". Hand-reveal discards read mana value and "nonX, nonY" limits, "{N}: Untap this creature" works, and burn that says "It can't be regenerated" ignores regeneration shields. Shield counters stop damage or destruction once, "can't attack unless defending player controls an Island" and Lure-style "All creatures able to block it do so" work, and charge-counter mana rocks run dry. Amass grows one Army token (making it first if needed), "Return target permanent card from your graveyard" works, and "You may choose not to untap" is read. Auras that stop a permanent untapping work on any permanent, "can't be blocked except by N or more creatures" is enforced, and top-or-bottom tucks put the creature on top. "Put a +1/+1 counter on each (other) creature you control", "Up to N target creatures each get +N/+N" and rituals such as "Add {R}{R}{R}" work. Outlast, "Creatures your opponents control get -N/-N" and "Untap those creatures. They gain haste" after taking several creatures work. Kill spells read "with mana value N or less", "nongreen", "non-Zombie" and "that isn't enchanted" targets, "Counter target spell unless its controller pays {X}" uses the X paid, and "Until end of turn, you may play those cards" impulse spells work. Transmute discards a card as a sorcery to find one with the same mana value, and "gains protection from the color of your choice" picks the color the opponent plays most. A creature that "can block an additional creature each combat" blocks two attackers and splits its damage between them. Learn discards a card to draw a card (there are no Lessons outside the game), and "Exile target player's graveyard" and its each-opponent and all-graveyards forms are read. Compleated planeswalkers enter with two fewer loyalty counters for each Phyrexian symbol paid with life, and Eldrazi titans shuffle back into the library when put into a graveyard from anywhere. "{T}, Tap an untapped creature you control: Add one mana of any color" taps the weakest creature without a mana ability, edicts ("Target player sacrifices a creature", "Each opponent sacrifices a creature or planeswalker") take the weakest that fits, and "sacrifice an artifact" is read as an additional cost. Teamwork spells tap creatures with enough total power to choose both modes, impulse draws read "until your next end step" and "during your next turn" (playable only then), and Ancient Stirrings finds a colorless card. Multikicker can be paid up to three times, with a +1/+1 counter for each kick. Clash spells and abilities reveal both top cards and do their "If you win" part only on a win. Gift spells and creatures can be cast with the gift promised (a card, Food, Treasure, Clue or tapped Fish for the opponent), which turns on their "If the gift was promised" part. "Play with the top card of your library revealed" shows that card on the board, Courser of Kruphix and Future Sight let you play from the top of your library, and Cipher spells are encoded on your strongest creature and copied each time it deals combat damage to a player. Collected Company-style digs put up to two cheap cards onto the battlefield, and "Discard a card" works as an ability cost (the cheapest card in hand is discarded). "Choose a card name" spells such as Infinite Obliteration name the opponent's most-seen matching card and exile its copies, and Goryo's Vengeance-style legendary reanimation works. Creature-type lords ("Other Elves you control get +1/+1"), "Whenever you cast a creature (or artifact, or enchantment) spell" and "Whenever you draw a card" triggers work. Protection from artifacts (and other card types) works, Bolster puts its counters on your weakest creature, and "Its controller loses N life" follows any destroyed permanent or countered spell. Spells that cost less for each instant and sorcery (or creature) card in your graveyard are cheaper, "If a creature an opponent controls would die, exile it instead" works, Converge creatures enter with a counter for each color spent, "tap target creature and put a stun counter on it" triggers work, and "Damage can't be prevented this turn" beats Fogs, prevention shields, protection and shield counters. Replicate makes a copy for each time its cost is paid. "The Ring tempts you" levels up the Ring, shown as 💍 on the board, and makes your strongest creature the Ring-bearer: it can't be blocked by creatures with greater power, loots when it attacks, makes its blockers be sacrificed at end of combat, and drains each opponent for 3 when it deals combat damage to a player. Raid creatures enter with their counter if you attacked this turn, "When CARDNAME dies, put its counters on target creature you control" moves its +1/+1 counters, "Untap all creatures you control" and "Tap all creatures your opponents control" work, and "target artifact, enchantment, or creature with flying" is a target. "Whenever CARDNAME deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step" freezes the creature it hit. Increment creatures get a +1/+1 counter when you cast a spell whose mana value (with X) is greater than their power or toughness. Fiend Hunter-style pairs ("exile another target creature" when it enters, "return the exiled card" when it leaves) hold the creature until the hunter leaves, and "create a Blood token" makes Blood tokens. Preparation cards (FRA, SOS) enter prepared: while one is, its controller may pay its spell's cost to cast a copy of the spell from the card's buttons, which unprepares it (this copy doesn't count as casting a spell for other triggers yet). The card pool importer keeps each preparation card's spell, so pools need re-importing to pick it up. Preparation cards also become prepared again from their triggers, with intervening "if" clauses for lands, creatures that died, life gained and cards in hand. Mana abilities that filter for any color without tapping (Three Tree Mascot, Energy Refractor) and Vivid lands with their charge counters work too. Split cards can cast either half, and both with Fuse. Heroic, Escalate, "Untap those creatures" after a team pump, and "Spells your opponents cast that target this cost {N} more" work as well. Damage to each creature without flying too. Harmonize, Support, "Sacrifice a creature" costs, "can't attack or block alone", and "up to N target creatures" bounces are read too. Splice onto Arcane adds a spliced card's effects to an Arcane spell for its splice cost, Gilded Lotus makes three mana of one color, and life-gain replacements such as Angel of Vitality and Sunspine Lynx apply. Color lords such as the Lieges, attacking-creature anthems, land auras that add mana such as Wild Growth, and "Target player gains N life" work too. Metalcraft and Threshold pumps, Court Hussar's "sacrifice it unless {W} was spent", and color-filtered destroy spells such as Execute are read as well. Miracle cards can be cast for their miracle cost right after they are drawn as the first card of the turn, and "Exile target card from a graveyard" works. Zendikons animate the enchanted land and return it to hand when it dies, and Dragons of Tarkir spells reveal a Dragon from your hand when they can. Triggers that say "you may pay {cost}. If you do, …" pay from untapped lands and then apply the rest. "Target creature has base power and toughness N/N until end of turn" sets a new base for the turn, with counters and pumps still on top. Sneak casts a spell during the declare blockers step by returning your weakest unblocked attacker, and a creature cast that way enters tapped and attacking. "You gain life equal to the damage prevented this way" pays out as a prevention shield absorbs damage, and shields on a targeted creature now actually stop damage. "You may pay {E}{E}. If you do, …" triggers spend energy. Soulbond pairs a creature as it or another creature enters, and "as long as CARDNAME is paired" bonuses apply to both. Emerge sacrifices your highest mana value creature to cut the cost, and the Pacts are paid at your next upkeep or you lose the game. Hideaway exiles the best of the top N cards, and its payoff casts that card free (or plays a land) when its condition holds. Also read: impulse draws inside enters triggers, "has K as long as it's untapped", Threshold worded "there are seven or more cards in your graveyard", graveyard tucks, "deals damage to itself equal to its power", flicker, and "Exile all creatures". "You may put a card from your hand on the bottom of your library. If you do, draw a card." trades a spare land, and land searches can put the land on top after shuffling. Damage "divided as you choose" among up to three targets is split evenly, "create a token that's a copy of" works, "you may draw" and "you may put a land card from your hand onto the battlefield" are read, and "Whenever CARDNAME blocks a creature with flying" triggers. Token copies can have haste and be exiled at the next end step, and "shuffles up to N target cards from their graveyard into their library" returns the best cards. Tribal enters triggers ("When a Dragon you control enters"), "When CARDNAME enters or dies", "Whenever another creature (you control) dies", "During your turn" and "as long as it's attacking" bonuses, Delirium, "Other creatures you control with flying", auras that grant a keyword as they enter, "Its controller mills", "each player loses", damage to each creature your opponents control, "Creatures without flying can't block this turn" and "that player discards" on combat damage are read. The Battlebond lands check for two basic lands, the Devotees filter {1} into their colors once a turn, "Return CARDNAME from your graveyard to the battlefield tapped" works, and endure and Exhaust are read. "Costs {1} less to cast if you control a Wizard", Heroic triggers printed without the ability word, and damage "equal to the number of lands you control" are read. "Whenever CARDNAME becomes tapped" triggers wherever it was tapped, and Discover N casts the card free or puts it into your hand. Color and creature-type families are read too: Medallions and "Goblin spells cost less", Harbingers that put a card on top, "If you control a Goblin", Kird Ape style conditions, Slivers that pump every player's Slivers, "can't be blocked by black creatures", "can't attack alone", affinity for Equipment, and "sacrifice it unless you pay". Manlands and animated artifacts ("becomes a 4/4 Elemental creature until end of turn"), -X/-X spells, "sacrifice a creature or pay {3}" and "reveal an Elf card or pay {3}", Beast Within, Swords to Plowshares and "Regenerate enchanted creature" work as well. Surge (with "if its surge cost was paid") and bloodrush from your hand are read too. Loyalty abilities printed as "[+1]:", the Theros gods' devotion clause, the Swords of X and Y's two protections, and spectacle are read too. Cleave, "Equip Wizard {1}", "gets +2/+0 for each Mountain you control" or "for each Aura attached to it", "whenever you cast a red (or multicolored) spell" and Haru-Onna's return to hand work as well. Channel and reinforce abilities can be activated from your hand by discarding the card, and Power-up works once as a sorcery. Mayhem casts a card from your graveyard the turn you discarded it, and recover returns its card when a creature dies (paid whenever you can). Lands that enter tapped unless you reveal a creature type, "Attacking creatures get +2/+0", X tokens, kicked "-5/-5 instead" and "Target creature can't block CARDNAME this turn" are read as well. Mastery spells can be cast for their cheaper alternative cost, artifact lords pump other artifact creatures, abilities can sacrifice an artifact, and a creature told to block one does if able. Strive spells take more targets for more mana, Craft exiles an artifact to transform, and Web-slinging casts a creature cheaply by returning a tapped creature to hand. Inquisition of Kozilek's wording reads, Equipment like Dwarven Shortsword arrives on its own token, and "Kicker {M} and/or {M}" is read as one kicker paying both. Stampeding Wildebeests-style upkeep returns, creatures that tap for mana equal to their power, "Skip your draw step" and Tiered spells are read too. Paradigm spells are copied for free each first main phase, and Haunt cards haunt a creature and trigger again when it dies. Mutate merges a creature spell over or under a non-Human creature you own, keeping every card's abilities. Collect evidence is offered as an optional cost, and Chalice of the Void enters with X charge counters and counters spells of that mana value. Tail Swipe style spells pump then fight, creatures can be unblockable by or protected from a creature type, dying creatures can deal damage equal to their power, spells can grant an extra land play this turn, and Reinforce works on instants. Spells can choose the same mode more than once, creature-only mana pays only for creature spells, a kicker paid by sacrificing an artifact or creature works like bargain, and "Then shuffle your graveyard into your library" is read. Impending permanents enter with time counters and aren't creatures until the last is removed, and "Whenever a creature dealt damage by this creature this turn dies" triggers. Spells castable for life or for free while you control a given type (Snuff Out, Dragon spells) offer that alternative cost. "If you cast this spell during your main phase" and "If you control an artifact" conditions are checked as the spell resolves, and cast triggers can copy the spell that triggered them, including on your second spell each turn. Spells that say "Choose a creature type" pick the type most of your creatures share, and team pumps can be limited to the chosen type or a named one ("Elves you control get +1/+1 until end of turn"). "Your opponents can't cast spells during your turn" is enforced, cards exiled until a permanent leaves can return to their owner's hand when the text says so, and token copies can gain haste. Chromatic Lantern lets your lands tap for any color, creature spells can be cast from the top of your library when a permanent allows it, and "End the turn" exiles the stack and skips to the cleanup step. Earthbend turns one of your lands into a 0/0 creature with haste and +1/+1 counters, and returns it to the battlefield tapped when it dies or is exiled. Lander, Map and Junk tokens are created with their abilities, and "Target creature you control explores" works. Pitch spells can be cast by exiling a card of their color from your hand or sacrificing a nontoken creature of their color, including the "If it's not your turn" kind. Harnessed Lightning pays all your energy as damage, and "you may pay any amount of {E}. Put that many +1/+1 counters on it" pays it all as counters. "Gets +X/+X until end of turn, where X is the number of creatures (or lands, artifacts, enchantments) you control" counts X as it resolves. Activated abilities with {X} in their cost (firebreathing, X damage, X counters) are read, paying the largest X the mana allows. "Whenever another creature you control enters, … it" now affects the creature that entered rather than the source, and Equipment can attach itself to each creature that enters. "Whenever a creature you control attacks" and "deals combat damage to a player", and "Whenever you attack", trigger for each of your creatures, and bots no longer pick targets with protection from the source. "Whenever a creature you control dies", "At the beginning of combat on your turn", "Whenever an opponent casts a spell", and artifacts, enchantments, lands or permanents "an opponent controls" as targets are read. Trigger conditions "if you gained life this turn", "if a creature died this turn", "if you attacked this turn", "if an opponent lost life this turn", "if you have N or more life" and "if you control an artifact" are read. "Whenever you cast your first spell each turn" triggers, and "you may sacrifice another creature. If you do, …" sacrifices a token or small creature when one is available. Tokens "that are tapped and attacking", "you may return target … card" and "another target creature you control" are read. Sweepers by power, mana value, flying or tapped ("Destroy all creatures with power 3 or less"), drains that gain the life lost, and "target noncreature permanent" are read. Blocks, leaves-the-battlefield, opponent-creature-dies, discard and cycling triggers are read, and cycling counts as discarding. Statics "as long as you control another Elf (or creature)", "as long as it's not your turn" and "as long as you have N or fewer cards in hand" are read. Spell taxes ("Noncreature spells cost {1} more to cast", "Spells your opponents cast cost {1} more") and "Creatures your opponents control enter tapped" are read. Triggers on each opponent's upkeep, an opponent drawing a card and a land entering under an opponent's control are read, with "that player" meaning that opponent. "Draw a card for each creature you control", "Create X tokens, where X is the number of lands you control" and other "for each" counts are counted as the spell resolves. Edicts that take "the creature with the greatest power" (or least mana value) and "Return a creature card from your graveyard to your hand" (chosen as it resolves, so cards milled just before count) are read. "Target creature gets -X/-X until end of turn, where X is the number of Swamps you control" and other counted X pumps, and "for each other attacking creature" pumps, are read. Intervening "if" clauses also read creature, artifact and enchantment counts, cards in your graveyard, a small or empty hand, and "it's not your turn." "You may draw a card. If you do, discard a card." loots like "draw a card, then discard a card." Enters triggers limited to creatures with power N or greater, such as "Whenever a creature you control with power 4 or greater enters," are read. "Whenever you sacrifice a permanent" triggers, including "another creature", tokens, card types and subtypes such as Food, are read; every sacrifice the game makes now passes through one path that fires them. "Whenever a player sacrifices" and "Whenever an opponent sacrifices" triggers (Mayhem Devil) are read too. "Whenever a nontoken creature you control dies" and "another nontoken creature" dies triggers skip tokens. "Whenever an artifact you control is put into a graveyard from the battlefield" triggers, including "another" and "nontoken" ones, are read. "Whenever an opponent casts a noncreature (creature, artifact, instant or sorcery …) spell" triggers, "damage to that player" on opponent casts, and "defending player loses …" on attack triggers are read. "Whenever you discard one or more cards" triggers once per discard, however many cards. "When CARDNAME dies, return it to the battlefield (tapped)" and "put it on the bottom of its owner's library" are read, and dies triggers that return the card now find it in the graveyard ("return it to its owner's hand" used to do nothing). "Whenever CARDNAME (a creature you control) becomes the target of a spell or ability an opponent controls" triggers are read. "Whenever CARDNAME attacks or blocks" triggers on either event, and "deals combat damage to a player or planeswalker" reads as player damage, since creatures attack only players here. "Whenever another creature enters" watches every player's creatures, and "a creature an opponent controls enters" only the opponent's. "Whenever CARDNAME attacks alone" and "Whenever a creature you control attacks alone" trigger when exactly one creature attacks. "Whenever you (or an opponent) cast a spell with mana value N or greater (or less)" and "… cast a Dragon spell" (any subtype) watch the spell cast. "Whenever CARDNAME deals damage to a player (an opponent)" triggers on any damage, combat or not, and "that player" is the player dealt damage. "At the beginning of each upkeep" and "each player's upkeep" trigger every turn, with "that player" as the active player. "Whenever a creature dies" watches every player's creatures and, on a creature, itself. "Whenever a player casts a spell" (or a kind of spell) watches every player's spells. "Whenever an opponent loses life" triggers on every life loss, from damage, drains, extort or paid life, and "that player" is the player who lost it. "Whenever an artifact (enchantment, land, token, nontoken permanent or subtype) you control (an opponent controls) enters" and "Whenever a land enters" watch that kind of permanent, itself included unless "another". "Whenever you lose life (during your turn)" and "Whenever an opponent gains life" use the same life-loss and life-gain paths. "Whenever you scry", "Whenever you surveil" and "Whenever a player draws a card" (with "that player") trigger too. "Whenever you create a (creature, artifact or subtype) token" triggers per token, and "one or more tokens" once per batch. "At the beginning of each opponent's end step", "each combat" and "your draw step" trigger at those steps. "Whenever a creature attacks you", "Whenever a creature you control blocks" and "Whenever one or more creatures you control deal combat damage to a player" (once) trigger in combat. "Whenever a creature (or other kind) you control leaves the battlefield", "Whenever you play a land" and "Whenever you cycle or discard a card" trigger too. "Whenever you commit a crime" triggers once for each spell or ability you control that targets an opponent or their spell, permanent or graveyard card. Expend ("Whenever you expend 4") counts the mana each player spends per turn. "Whenever you activate an ability that isn't a mana ability" and "… an exhaust ability" trigger on activation. "Whenever a creature you control becomes tapped" sees every tap, attacking included. "Whenever a creature you control explores" and "Whenever a permanent (creature) you control is turned face up" trigger too. "Mill N cards. You may put a land (creature, permanent …) card from among them into your hand." picks only from the cards just milled. Activated costs can forage, exile N cards from your graveyard, or sacrifice a Food, land, token or other named kind. Costs can also tap other untapped creatures (or artifacts), sacrifice two or more, discard two or more, mill, pay bare {E}, or exile a creature (or other kind of) card from your graveyard. Costs that return a land you control or the card itself to hand, or remove a +1/+1 counter from a creature you control, are paid too. "Whenever a creature token you control dies" triggers only for tokens. "Whenever a creature deals combat damage to you" triggers once for each creature that hit you. "Becomes the target of a spell or ability" triggers also read for any creature you control and for spells and abilities you control. "Whenever CARDNAME blocks (becomes blocked by) a creature, that creature …" and "Whenever a land (an enchantment, a Treasure) you control is put into a graveyard" read too. "Whenever you (an opponent) cast a creature spell with power 4 or greater" reads too. "Whenever one or more +1/+1 counters are put on CARDNAME (a creature you control)" triggers once for each creature that got more counters. Attack, block and death triggers also read for a subtype ("Whenever a Human you control attacks", "Whenever another Elf you control dies") or a keyword ("a creature you control with flying"). "Whenever an opponent (cycles or) discards a card" and "Whenever you discard a creature card" read too. "Whenever you cast a historic spell" and "a creature spell that has flying" read too. "Whenever a creature you control becomes blocked" reads too, with "it" as that creature. Trigger conditions also read "if you control no creatures". ETB and spell bounces of "(another) target (nonland) permanent you control" are read. "for each attacking creature" multipliers are counted as they resolve. Other "Whenever CARDNAME deals combat damage to a creature" effects apply to that creature. "it gets +N/+N until end of turn for each creature blocking it" pumps are read. Targets "defending player controls" read as the opponent's. "if CARDNAME attacked this turn" conditions track each creature's last attack. Combat-damage triggers that target "… that player controls" read as the opponent's. "Whenever CARDNAME is dealt damage" triggers (Boros Reckoner) use the amount dealt. So do "Whenever CARDNAME deals damage to a creature" triggers, combat or not. "life, cards or damage equal to the number of …" read like "where X is the number of …". Land, artifact, enchantment and permanent cards return from your graveyard to the battlefield, tapped when the card says so. Life and draws "equal to its power/toughness" use the permanent's own. "Creature tokens you control" and "Nontoken creatures you control" anthems are read. "CARDNAME gets +N/+N for each card in your hand" (or graveyard, by kind) is read. "Each other creature you control that's a Wizard gets +1/+1" reads as a lord. "Look at the top card of your library. You may put that card into your graveyard." reads as surveil 1. "If that creature would die this turn, exile it instead" also follows targeted -N/-N effects. "target creature an opponent controls with mana value N or less" is read. "Whenever equipped (enchanted) creature attacks, blocks, deals combat damage to a player or dies" triggers are read (the Swords). "Equipped (Enchanted) creature gets +N/+N for each … you control" is read. Static bonuses also read more "as long as" conditions: three or more creatures, four or more cards in hand, no cards in hand, an opponent at 10 or less life, life gained, attacking, a creature dying or an opponent losing life this turn, a +1/+1 counter on it, and no other creatures. "Up to one other target …" works as the optional form of "another target …", such as returning up to one other creature you control to its owner's hand. "Whenever CARDNAME blocks (or becomes blocked by) a creature, that creature doesn't untap during its controller's next untap step" keeps that creature from untapping once. Creatures that enter with a +1/+1 counter for each creature (or other permanent, card in hand or graveyard, or opponent) you have, or for each creature that died this turn, count as they enter. "Whenever one or more other creatures you control enter" triggers once for creature tokens created together. The older "counter that spell or ability unless its controller pays …" wording (Frost Titan) reads as ward. "Whenever CARDNAME blocks or becomes blocked by a (non-Wall) creature, destroy that creature at end of combat" marks that creature, and the mark survives a save. "CARDNAME can't be blocked as long as defending player controls an artifact" (or an enchantment, a colored permanent, or a basic land type, which is landwalk) is read. Trigger conditions also read "if an opponent controls more lands (or creatures) than you" and "if an opponent has more life than you". An ability word such as "Flurry —", "Eerie —" or "Landfall —" before an ability that is otherwise read no longer stops it being read. "Whenever this creature or another creature (or Human, or nontoken creature) you control dies, enters or attacks" is read as triggering for itself and for the others. Trigger conditions also read "if it's your turn" and "if you've cast a noncreature spell this turn". "Create a tapped Treasure token" and other tapped tokens (artifact or creature) are read. Trigger conditions also read "if this creature is tapped" (Survival) and "if this creature is untapped". Void's "if a nonland permanent left the battlefield this turn or a spell was warped this turn" is read. "Whenever one or more creatures you control with power 4 or greater attack" triggers once per attack. Triggered "you may collect evidence N. If you do, …" is read; like the additional cost, the highest mana values are exiled first. "Whenever a source an opponent controls deals damage to you" is read. Dies triggers filtered by power ("another creature you control with power 3 or greater dies", "if it had power 3 or greater") use the power it last had on the battlefield. "Other attacking creatures you control get +1/+0 until end of turn" and "other creatures you control gain haste until end of turn" leave out the source. "Look at target player's hand" shows that hand in the match log, like a reveal, since only the two players are in the game. "Create a 1/1 white Spirit creature token with flying for each opponent" counts opponents as it resolves. Targets capped by power or mana value can also name an opponent ("target creature with power 2 or less an opponent controls"), and "counter target spell with mana value 2 or less" checks the spell. Goad ("goad target creature an opponent controls") makes that creature attack each combat if able until your next turn, and it is kept in saved games. "When this creature enters, it fights (up to one) target creature you don't control" and "you may have it fight …" use the creature itself, and choosing no target declines the optional fight. "Double the number of +1/+1 counters on target creature" (also after ", then") adds as many as it already has. "Each player mills two cards", "exile all cards from target player's graveyard", "If it was a creature card, …" after exiling a card from a graveyard (checked against the card exiled), and Descend-style "four or more permanent cards in your graveyard" conditions read too. "You may return another target creature card from your graveyard to your hand" leaves out the dying creature itself, and "target card from defending player's (an opponent's) graveyard" only offers that player's graveyard. Combined permanent targets such as "target artifact, enchantment, or planeswalker" (with "an opponent controls", "you don't control" or "you control"), "target player draws two cards, then discards a card" (that player chooses), and "Those creatures gain trample until end of turn" after putting counters on each creature you control also read. Generic "Spells you cast cost {1} less", "Creatures you control have ward {1}" and "You may cast spells as though they had flash" now work. Blind Obedience-style "Artifacts and creatures your opponents control enter tapped", "Each opponent can't gain life" and "they lose 1 life" draw triggers now work. "if you control another Elf" intervening conditions and reflexive "When you do, draw two cards" now work. "Put a +1/+1 counter on each other Elf you control" and "-1/-1 counter on target creature" now work, and the practice bot aims shrinking effects at the opponent. Elvish Archdruid-style "Add {G} for each Elf you control", "if you control two or more other Elves" and "return target Elf card from your graveyard" now work. "Target Elf you control" targets and targeted "Whenever a Goblin you control dies" triggers now work. "Other Elves you control get +1/+1 until end of turn" and "Elves you control gain hexproof until end of turn" now work. "Destroy target Dragon"-style typed targets and "a token for each other Elf you control" now work. Typed "becomes tapped" triggers (an Elf you control) and "if an opponent controls a creature with flying / an artifact / a Type" conditions now work. Exert ("You may exert this creature as it attacks. When you do, …") now works: the creature is always exerted while it can be, skips its next untap step, and any target is chosen with the attack trigger. Pumps "until end of turn for each Elf (artifact, Swamp …) you control" and "Untap all other creatures you control" (Ahn-Crop Champion) now work. Mass bounce ("Return all creatures (attacking creatures, nonland permanents …) to their owners' hands", Evacuation) now works. Team pumps that count ("Creatures you control get +1/+1 until end of turn for each Elf you control", "+X/+X … where X is the number of …") and "Create a number of … tokens equal to the number of …" now work. Valiant and other "for the first time each turn" triggers (kept in saved games) and "Whenever this creature attacks, mobilize N" now work. Renew and other abilities activated by exiling the card from your graveyard now work. Behold ("you may behold a Dragon", "behold a Dragon or pay {2}", "If a Dragon was beheld, …" and "you may behold a Dragon. If you do, …") and "+1/+1 counter on each creature you control with flying" now work. "Whenever one or more other creatures you control die" (once for creatures dying together) and "it also gains flying until end of turn" after a kicked or beheld spell now work. Spell cost reductions can scale with a count ("Creature spells you cast cost {1} less to cast for each creature card in your graveyard"), and "Then you may put a land card from your hand onto the battlefield tapped" reads after another effect. Optional payments and sacrifices ("you may pay {2}. If you do, destroy target artifact", "you may sacrifice another creature. When you do, … any target") can carry one target, chosen with the trigger. Triggers can offer "you may forage. If you do, …" and "you may tap an untapped creature you control. If you do, …". Trigger costs also cover "you may discard a card. When you do, …" (its controller chooses), "you may pay N life", "you may mill N cards", "you may sacrifice a Food (Treasure, Clue, …)" and "you may sacrifice it". "You may . If you do, …" triggers read as both effects on the chosen target, and trigger costs cover exiling cards from your graveyard and returning a tapped land to hand. Enter triggers read "if it's a Human" and "if it has power 3 or greater" as filters, attack triggers read "while you control a Dragon" as a condition, and "When this creature dies, you may exile it. If you do, …" works. Triggers read "Whenever you attack with two or more creatures", "if you attacked with three or more creatures this combat" and "Whenever an opponent casts a spell during your turn". "Can't attack (block) unless you control another creature (a Dragon)" restrictions and "each other attacking creature gets +1/+0" work. Combat damage triggers can use "that many"/"that much" (the damage dealt), and "Whenever a creature an opponent controls becomes tapped" triggers. Your creatures dealing combat damage can now gain you "that much" life, and attackers can get +X/+0 where X is the number of attacking creatures. "Each player draws" and "each player gains life" now resolve for every player in turn order. "Each opponent (or each other player) draws/gains" and "each creature (you control) gets/gains" now read too. "Prevent all damage target creature would deal this turn", "Its controller gains N life" after removal, and freezing several tapped creatures now read too. "It must be blocked this turn if able" now reads as a one-turn lure. Damage to "each opponent and each creature your opponents control" and to "each creature and each player" now reads too. Airbend (TLA) now exiles a permanent its owner may recast for {2}, and "Put one into your hand and the other …" reads too. Waterbend (TLA) activation costs can now be paid by tapping untapped artifacts and creatures. "For each creature you control with a +1/+1 counter on it" now counts in pumps, draws and static bonuses, and counters can go on each creature that already has one. Attack triggers can put +1/+1 counters on each other attacking creature and target a land you control. Endure can target a creature you control, and "It endures N" after a targeted effect applies to that creature rather than making a Spirit. "When you cast this spell, …" triggers go on the stack above the spell and resolve even if it is countered. Team anthems can carry a condition ("Creatures you control get +1/+0 as long as it's your turn", "During your turn, creatures you control have first strike"). Mill can count ("mills cards equal to the number of creatures you control"), and a blocked creature can deal damage to each creature blocking it. Equipment and Aura bonuses can count cards in your hand or graveyard. Aura enters triggers can tap and freeze the enchanted creature or put +1/+1 counters on it. Decayed creatures can't block and are sacrificed at end of combat after they attack; "Then that creature gains …" follows a targeted effect. Coven triggers check for three creatures with different powers, and a target creature you control can connive. Triggers can check "if you control a creature with power N or greater" (ferocious), and "For each creature you control, put a +1/+1 counter on it" reads as counters on each. Targets that "your opponents control" (tap up to two target creatures your opponents control),Up to two target creatures … getwithout "each", andCARDNAME can't block creatures with flying.are read too.another target (nonland) permanent(not the source) andcreatures defending player controlsorcreatures you don't controlas a group are read too.As long as CARDNAME has a +1/+1 counter on it, it has flying.andCARDNAME enters with two +1/+1 counters on it if you control another Elf.(and other game conditions) are read too.Whenever a creature you control with a +1/+1 counter on it dies, …andWhenever a creature you control with power 4 or greater attacks, …are read too. Enters triggers foranother creature you control with flying,a creature token,an artifact creatureanda nontoken artifactyou control are read too.Whenever you cast a spell that targets a creature you control, …is read too.If it's a Knight, it also gains first strike until end of turn.after a targeted pump is read too. Game-condition riders such asIf you control a Knight, it also gains first strike until end of turn.andIf it's your turn, …are read too. Spell clauses likeIf it's your turn, scry 1.andIf you control a Goblin, it deals 3 damage instead.are read too. Larger amounts instead under a condition, such asIf you control three or more artifacts, draw two cards instead.or… put two +1/+1 counters on it instead., are read too. Larger pumps instead, such asIf you control a Zombie, that creature gets -3/-3 until end of turn instead., are read too.Whenever an opponent loses life during your turn, …triggers only on its controller's turn. Enrage triggers with any effect, such asWhenever this creature is dealt damage, create a Treasure token., are read too.Whenever this creature deals combat damage to a creature, destroy that creature at end of combat.is read too. Typed cast triggers with a mana value, such asWhenever you cast a creature spell with mana value 5 or greater, …, are read too. Random discards, such asTarget player discards a card at random., use the game seed.This ability triggers only once each turn.after a trigger is read too. Hand wheels, such asEach player discards their hand, then draws seven cards.andDiscard your hand., are read too. Excess damage, such asIf excess damage was dealt this way, draw a card.andExcess damage is dealt to that creature's controller instead., is read too.Investigate twice.andTap it.after a targeted effect are read too.Whenever you cast a spell that targets a creature an opponent controls, …is read too. Amounts equal to the cards in a targeted player's hand, such as Sudden Impact, are read too. Day and night conditions, such asif it's nightandas long as it's night, are read too. Round 294 readsWhen CARDNAME enters, if you cast it (from your hand), …from how the permanent entered, andEach creature you control with a counter on it has …with any kind of counter. Round 295 readsWhenever you cast an instant or sorcery (or noncreature or creature) spell that targets a creature you control (or an opponent controls), …, checking the spell. Round 296 reads tutors fora creature card with mana value 3 or lessand… with power 2 or less, as printed. Round 297 readsWhenever you cast your first spell during each opponent's turn, …. Round 298 readsWhenever CARDNAME attacks (or blocks), sacrifice it at end of combat., sharing decayed's end-of-combat sacrifice. Round 299 readsWhen CARDNAME becomes the target of a spell, …(spells only, not abilities). Round 300 readsWhenever a token (or creature token or nontoken permanent) you control leaves the battlefield, …. Round 301 readsWhenever CARDNAME attacks, it deals 1 damage to defending player.andif there are three or more cards in your graveyard. Round 302 readsWhenever CARDNAME deals combat damage to a creature, you gain that much life.. Round 303 readsWhenever you (an opponent) cast(s) a spell that has an X in its mana cost, …. Round 304 reads "target attacking creature with(out) flying". Round 305 reads "can't block creatures with power N or less". Round 306 reads "Enchanted creature gets +1/+1 for each Aura attached to it". Round 307 reads "Whenever you cast an Aura, Equipment, or Vehicle spell".
Game modes. Each mode has deck rules and a card library, set in config/modes.php: Standard (60+ cards, a side deck of up to 15, up to 4 copies of a card, sets released in the last 3 years), Casual (40+ cards, anything you own), Limited (40+ cards, no copy limit) and Commander (exactly 100 cards counting the commander, one copy of each, every card within the commander's colors, 40 life). Basic lands are never limited. /decks show says whether a deck meets its format's rules, and what to fix if not.
Match records. Every game is recorded move by move and saved with the match, like a chess game score. The record opens with tags (players, decks, mode, result, why the game ended), then a score sheet with one numbered line per turn (+Forest plays a land, Shock > Bob casts a spell at a target, Card* activates an ability, atk and blk are attacks and blocks, †Card goes to the graveyard, life totals at the end of each turn), then the full log step by step with each player's position at the end of every turn. Nothing hidden is in it: drawn cards are not named, and the shuffle seed is only shown once the game is over. Each player's last 25 games are kept for /match log.
Matchmaking. /match queue pairs you at once with a player waiting in the same mode whose rating is within 200 of yours, a range that widens by 50 for every minute they have waited; the closest rating goes first. A spot in the queue lasts 30 minutes. Queued games are ranked: each mode has its own Elo ladder (everyone starts at 1000). Challenges are friendly: they never move the ladder or pay points.
Booster drafts. A player makes a pod for one set with /draft create, and others join; everyone pays the entry fee in points (1,200 by default), refunded if they leave before the draft starts or the pod never fills. The draft starts when the pod is full (8 players), when its host starts it (2 or more), or after 24 hours with at least 2. Everyone opens a pack of one color of the set, takes a card and passes the rest, left, then right, then left, for 3 packs; there is no waiting for the whole table, and the bot picks for anyone who takes longer than 3 minutes. Then each player builds a deck of 40 or more from their picks and free basic lands, and the games start when everyone is ready or after an hour (anyone without a deck plays one the bot builds). The rounds are Swiss, one game each, enough rounds to leave one unbeaten player; a game not finished in 24 hours is a draw. Every player keeps all the cards they drafted: they go to their collection when the event ends, when they leave it after the draft, or when the event times out 7 days after the draft starts. The entry fees make a prize pool: when the rounds are over, 1st, 2nd, 3rd and 4th place get 40%, 25%, 15% and 10% of it in points (players who left before the end get none). Every match win, a bye included, also opens a pack of the drafted set (a random color) straight into the winner's collection. The pod's channel gets each stage, pairing and result as it happens. The numbers are in config/drafts.php.
Commander. Pick a legendary creature you own to lead a deck with /decks commander. It starts the game in the command zone, listed with your hand, and can be cast from there; each time after the first it costs {2} more. When it would go to the graveyard or exile, it returns to the command zone instead (its "dies" abilities still trigger). A player who takes 21 combat damage from one commander loses, whatever their life. The board shows each command zone, the current tax, and commander damage taken. Pools imported before this release lack color identity data; it is then worked out from each card's colors, cost and text, and composer import-cards fills it in.
Rental decks. Official preconstructed decks of the sets in the Standard library (Commander decks aside), imported with the card pools. Anyone can play one with /decks rent, up to 3 games a day, so new players can play before they own enough cards. A precon shorter than 60 cards (a 40-card theme deck) gets basic lands added to reach 60, split like the basics it already has (or by its mana symbols), so every rental can play Standard. Rentals can't be edited or exported.
Points from games and quests. A ranked game that reaches turn 3 pays 50 points to the winner and 10 to the loser, for up to 10 games a day. Every day you get 3 quests and every week 2, such as "Win a ranked game" or "Open 7 packs", which pay their points the moment they are done; different players get different quests. Quests count ranked games (from turn 3) and opened packs. The amounts are in config/economy.php (matches) and the quests in config/quests.php.
Points and the shop. Selling a card earns points; points buy single cards or packs. Prices are set in config/economy.php: a card costs 20, 60, 300 or 900 points by rarity (common to mythic), times 2 for a set from the last year, 1.5 for the last three years, 1 for the last ten and 0.75 for older ones. A pack costs 500 points with the same multiplier. Selling pays 20% of the buy price (at least 1 point), so selling a card and buying it back always loses points. Cards your decks use are never sold: a deck that needs 2 copies keeps 2.
Trades. An offer can hold cards and points on both sides, up to 20 different cards each. Sending it is your agreement and Accept is theirs. Nothing is set aside while the offer is open: when it is accepted, both sides are checked again and the whole trade happens at once or not at all. Adding to an offer with /trade add posts the new version, and Accept on an older copy shows the new one instead of agreeing to it. Offers stay open for 7 days, and a player can have 10 open at a time. Cards a deck uses can't be traded away.
Decks. A deck may use each card you own as many times as you own it, main and side deck together, and the same cards can go in any number of decks. Basic lands are free and unlimited. Deck edits answer only you. A deck's format (Standard, Commander, Limited, Casual) decides which rules it is checked against and its default game mode.
Card data comes from DiscordPHP-MTG's local copy of MTGJSON's AllPrintings SQLite build. The game copies what it needs out of it into its own JSON files under var/data/ (or MTGPOCKET_DATA):
| File | What it holds |
|---|---|
pools/{SET}.json |
The cards packs of a set are drawn from, sorted by color (W U B R G, M multicolor, C colorless) and rarity (common to mythic). Each card keeps its MTGJSON uuid and its scryfallId for images. |
players/{userId}.json |
A player's profile, when they last opened their daily pack, their shop points, their rental deck, today's rental and rewarded games, and their quest progress. |
inventories/{userId}.json |
The cards a player owns: printing uuid → copies. |
decks/{userId}.json |
A player's decks, each with a format, a main deck and a side deck: printing uuid → copies, with basic lands as basic:Plains and so on. |
matches/{id}.json |
A challenge, or a game with everything in it, saved after every action so games survive a restart. |
live/{userId}.json |
The match a player is in. |
queues/{mode}.json |
Who is waiting for a ranked game in a mode, with their deck and rating. |
ladders/{mode}.json |
A mode's ratings, wins, losses and draws. |
rentals/{id}.json |
An official preconstructed deck players can rent, with its cards' data. |
trades/{id}.json |
An open trade offer. The file is deleted once the offer is accepted, declined, cancelled or expired. |
drafts/{id}.json |
A booster draft: its players, what each has paid and picked, their decks, the packs going round, and every round's pairings and results. |
drafters/{userId}.json |
The draft a player last joined. |
Writes are atomic (a temporary file renamed into place) and every read-modify-write holds a lock on its file, so nothing is lost when two changes land at once.
A set's pool is the cards its real boosters contain: front faces only, no promos or basic lands, and one printing per card name. Sets of type core, expansion, draft innovation and masters that are already released are imported by default.
- PHP 8.3 or higher, with the
pdo_sqliteandzlibextensions - Composer
- About 1.4 GB of free disk space for the MTGJSON build
git clone https://github.com/Valgorithms/DiscordPHP-MTGPocket.git
cd DiscordPHP-MTGPocket
composer install
cp env.example .env # then set TOKEN
composer import-cards # downloads the MTGJSON build on first run, then writes var/data/pools/
php bot.phpcomposer import-cards -- KTK DMU imports just those sets, and their official decks as rentals. Re-run the import after MTGJSON adds a set.
The bot reads its settings from config/: shop prices and match points from economy.php, game modes from modes.php, quests from quests.php and booster drafts from drafts.php. Set MTGPOCKET_ECONOMY, MTGPOCKET_MODES, MTGPOCKET_QUESTS or MTGPOCKET_DRAFTS to use copies kept elsewhere.
Pools imported before matches existed lack the rules data (mana costs, power and toughness, rules text). Run composer import-cards again before playing; a deck with such cards cannot start a match until then.
composer unit # PHPUnit
composer coverage # HTML coverage report in coverage/ (needs Xdebug)
composer pint # Laravel Pint, the style CI checks
composer cs # php-cs-fixer with .php-cs-fixer.dist.php
composer phpacker # standalone bot binaries for every platform in bin/build/composer cs-unsupported runs php-cs-fixer on a PHP version it does not support yet.
The class reference is built with phpDocumentor through discord-php/phpdoc-tool, the same way as the other DiscordPHP libraries. The Build Docs workflow publishes it to the gh-pages branch on a release, a manual run, or a push whose commit message contains build docs. To build it locally:
composer create-project discord-php/phpdoc-tool:^1.0 phpdoc-tool --repository='{"type":"vcs","url":"https://github.com/discord-php/phpdoc-tool"}'
composer docsPacked binaries and the generated docs are git-ignored and left out of dist archives. A packed binary can be decompiled, so never commit one.
MIT. See LICENSE.md. Magic: The Gathering is © Wizards of the Coast; this project is not affiliated with or endorsed by Wizards of the Coast.