magarena/grammar/mtg.peg

1137 lines
19 KiB
Plaintext
Raw Normal View History

2012-11-03 18:33:50 -07:00
Rule
= (AbilityWord " — ")? Ability
;
Ability
2012-10-28 02:27:04 -07:00
= SpellEffect EOR
/ KeywordAbility EOR
/ ActivatedAbility EOR
2012-10-28 22:36:37 -07:00
/ TriggeredAbility EOR
/ AdditionalCost EOR
;
2012-10-28 00:30:18 -07:00
SpellEffect
2012-11-03 06:31:42 -07:00
= Effect EOS (SPACE Effect EOS)*
;
Effect
= SingleEffect SEP SingleEffect
2012-11-03 06:31:42 -07:00
/ SingleEffect ", then " SingleEffect
/ SingleEffect
;
SingleEffect
2012-12-03 22:36:47 -08:00
= (Duration SEP)? (Optional SPACE)? (SelectPlayer SPACE)? (Optional SPACE)? Action (SPACE Duration)?
2012-10-29 00:33:21 -07:00
;
Optional
= "you may have"
/ "you may"
2012-11-02 19:52:44 -07:00
/ "if you don't,"
2012-11-03 19:49:47 -07:00
/ "if you can't,"
2012-11-02 22:35:21 -07:00
/ "if you do,"
/ "may"
;
2012-11-03 18:33:50 -07:00
AbilityWord
= "metalcraft"
;
2012-10-28 22:36:37 -07:00
KeywordAbility
= Keyword
/ Enchant
;
ActivatedAbility
2012-12-03 22:36:47 -08:00
= ActivationCosts EOC SpellEffect
2012-10-28 22:36:37 -07:00
;
2012-11-03 06:11:57 -07:00
ActivationCosts
2012-12-03 22:36:47 -08:00
= Action (SEP Action)*
2012-11-03 06:11:57 -07:00
;
2012-10-28 22:36:37 -07:00
TriggeredAbility
2012-12-03 22:36:47 -08:00
= Trigger SEP SpellEffect
2012-10-28 22:36:37 -07:00
;
AdditionalCost
= "as an additional cost to cast @, " Effect EOS
;
2012-10-28 22:36:37 -07:00
Trigger
= EntersBattlefieldTrigger
/ LeavesBattlefieldTrigger
2012-10-29 00:59:19 -07:00
/ EntersGraveyardTrigger
2012-10-28 22:43:35 -07:00
/ BeginningUpkeepTrigger
2012-10-29 01:39:28 -07:00
/ BeginningEndStepTrigger
2012-10-28 22:44:37 -07:00
/ DiesTrigger
2012-10-28 23:10:15 -07:00
/ DealsDamageTrigger
2012-10-29 00:26:09 -07:00
/ CastTrigger
2012-10-29 01:37:29 -07:00
/ BecomesTargetTrigger
2012-11-02 20:16:04 -07:00
/ BlocksTrigger
/ AttacksTrigger
/ BlockedTrigger
2012-10-28 22:36:37 -07:00
;
Action
= DestroyNoRegenAction
/ DestroyAction
/ ExileAction
/ CounterAction
2012-10-28 00:30:18 -07:00
/ DamageAction
/ DrawAction
/ DiscardAction
2012-10-28 00:30:18 -07:00
/ TapAction
2012-10-28 03:49:34 -07:00
/ PreventAction
/ RegenerateAction
/ PumpAction
/ GainAction
/ BounceAction
/ AddManaAction
/ ReturnAction
/ SacrificeAction
/ ChangeLifeAction
/ ChangeCounterAction
/ PutTokenAction
2012-10-28 23:14:07 -07:00
/ ControlAction
2012-10-29 01:03:09 -07:00
/ ShuffleAction
2012-10-29 01:30:12 -07:00
/ DoesntUntapAction
2012-11-02 19:52:44 -07:00
/ EntersTapped
/ EntersWithCounter
/ PayManaAction
2012-11-03 06:14:50 -07:00
/ MillAction
2012-11-03 07:00:17 -07:00
/ ReanimateAction
2012-11-03 18:46:59 -07:00
/ PoisonAction
2012-11-03 19:59:41 -07:00
/ SetPTAction
2012-11-03 23:55:16 -07:00
/ ChangeStateAction
/ AnimateAction
2012-11-04 03:52:59 -08:00
/ AnimateActionReminder
2012-11-07 06:48:13 -08:00
/ ChangeLoyaltyAction
2012-11-07 07:02:40 -08:00
/ AbilityRestriction
2012-10-28 00:30:18 -07:00
;
Keyword
2012-10-28 22:36:37 -07:00
= "flash"
/ "flying"
/ "haste"
/ "defender"
/ "vigilance"
/ "reach"
2012-10-29 00:55:19 -07:00
/ "battle cry"
2012-10-28 22:36:37 -07:00
/ "trample"
/ "first strike"
/ "double strike"
/ "infect"
/ "wither"
/ "fear"
/ "shadow"
/ "storm"
/ "swampwalk"
2012-10-29 07:29:53 -07:00
/ "plainswalk"
2012-10-28 22:36:37 -07:00
/ "forestwalk"
/ "islandwalk"
/ "mountainwalk"
/ "changeling"
/ "deathtouch"
/ "lifelink"
/ "exalted"
/ "shroud"
/ "persist"
/ "protection from all colors"
2012-11-04 00:25:21 -07:00
/ "protection from " Color
/ "protection from " Tribal
2012-10-28 22:36:37 -07:00
/ "protection from artifacts"
/ "protection from creatures"
/ "protection from everything"
/ "hexproof"
/ "soulbond"
/ "undying"
/ "flanking"
/ "intimidate"
/ "living weapon"
/ "totem armor"
/ "affinity for artifacts"
2012-10-28 22:36:37 -07:00
/ "bushido" SPACE Number
2012-10-29 07:16:52 -07:00
/ "rampage" SPACE Number
2012-10-28 22:36:37 -07:00
/ "soulshift" SPACE Number
/ "fading" SPACE Number
/ "devour" SPACE Number
/ "modular" SPACE Number
/ "vanishing" SPACE Number
/ "bloodthirst" SPACE Number
/ "buyback" SPACE ManaCost
2012-11-03 19:52:50 -07:00
/ "echo" SPACE ManaCost
2012-10-28 22:36:37 -07:00
/ "kicker" SPACE ManaCost
2012-11-03 06:56:30 -07:00
/ "multikicker" SPACE ManaCost
2012-10-28 22:36:37 -07:00
/ "equip" SPACE ManaCost
/ "cumulative upkeep" SPACE ManaCost
2012-11-02 21:10:01 -07:00
/ "replicate" SPACE ManaCost
2012-11-03 07:18:12 -07:00
/ "miracle" SPACE ManaCost
2012-11-02 21:37:01 -07:00
/ "level up" SPACE ManaCost
2012-10-28 00:30:18 -07:00
;
2012-10-28 02:35:18 -07:00
ColorlessCost
= "{" Number "}"
2012-10-28 22:36:37 -07:00
/ "{x}"
2012-10-28 02:35:18 -07:00
;
2012-10-29 07:15:19 -07:00
SingleColor
2012-10-28 22:36:37 -07:00
= "{b}"
/ "{u}"
/ "{g}"
/ "{r}"
/ "{w}"
2012-10-28 02:35:18 -07:00
;
HybridSingleCost
2012-10-28 22:36:37 -07:00
= "{g/u}"
/ "{g/w}"
/ "{r/g}"
/ "{r/w}"
/ "{u/r}"
/ "{u/b}"
/ "{b/g}"
2012-11-03 19:51:16 -07:00
/ "{b/r}"
2012-10-28 22:36:37 -07:00
/ "{w/b}"
;
2012-10-28 02:35:18 -07:00
ManaCost
2012-11-03 19:42:26 -07:00
= ColorlessCost+ SingleColor*
2012-10-29 07:15:19 -07:00
/ SingleColor+
/ HybridSingleCost+
2012-10-28 00:30:18 -07:00
;
2012-10-29 01:37:29 -07:00
BecomesTargetTrigger
= "when @ becomes the target of a spell or ability"
;
2012-11-02 20:16:04 -07:00
BlocksTrigger
= "whenever @ blocks"
;
BlockedTrigger
= "whenever @ becomes blocked"
;
2012-10-29 00:26:09 -07:00
CastTrigger
2012-11-03 06:31:42 -07:00
= "whenever " SelectPlayer " cast " SelectSpell
/ "when " SelectPlayer " cast " SelectSpell
2012-10-29 00:26:09 -07:00
;
LeavesBattlefieldTrigger
= "when @ leaves the battlefield"
;
2012-10-29 00:59:19 -07:00
EntersGraveyardTrigger
2012-10-29 01:03:09 -07:00
= "when @ is put into a graveyard from the battlefield"
/ "when @ is put into a graveyard from anywhere"
2012-10-29 00:59:19 -07:00
;
2012-10-28 22:36:37 -07:00
EntersBattlefieldTrigger
= "when @ enters the battlefield"
2012-11-02 19:52:44 -07:00
/ "as @ enters the battlefield"
/ "whenever @ or another ally enters the battlefield under your control"
2012-10-28 22:36:37 -07:00
;
2012-10-29 01:39:28 -07:00
BeginningEndStepTrigger
= "at the beginning of the end step"
;
2012-10-28 22:43:35 -07:00
BeginningUpkeepTrigger
= "at the beginning of your upkeep"
/ "at the beginning of each player's upkeep"
2012-10-28 22:43:35 -07:00
;
2012-10-28 22:44:37 -07:00
DiesTrigger
= "when @ dies"
;
2012-10-28 23:10:15 -07:00
DealsDamageTrigger
= "whenever @ deals" " combat"? " damage" (" to a " DamageReceiver)?
;
DamageReceiver
= "itself"
2012-11-02 22:18:37 -07:00
/ SelectPlayer
2012-11-07 06:48:13 -08:00
/ SelectCreature &(" and " SingleEffect)
/ SelectCreature SEP SelectPlayer
2012-11-07 06:48:13 -08:00
/ SelectCreature
;
AttacksTrigger
= "whenever @ attacks"
;
2012-11-07 07:02:40 -08:00
AbilityRestriction
= "activate this ability only any time you could cast a sorcery"
;
AnimateAction
2012-11-04 03:52:59 -08:00
= SelectPermanent " becomes a " CreatureSpec
;
AnimateActionReminder
= "it's still a land"
;
2012-11-07 06:48:13 -08:00
ChangeLoyaltyAction
= SignedNumber
;
2012-11-03 23:55:16 -07:00
ChangeStateAction
= (SelectPermanent SPACE)? PermanentState
;
PermanentState
= "can't attack or block"
/ "can't attack"
/ "can't block"
/ "is indestructible"
/ "is unblockable"
/ "attacks each turn if able"
/ "can't be countered"
2012-11-03 23:55:16 -07:00
;
2012-11-03 19:59:41 -07:00
SetPTAction
2012-11-03 19:59:02 -07:00
= "@'s power and toughness are each equal to the number of " SelectPermanent
2012-11-04 00:29:22 -07:00
/ SelectPermanent " are " Number "/" Number
2012-11-03 19:59:02 -07:00
;
SacrificeAction
= "sacrifice" "s"? SPACE SelectPermanent (SPACE "unless you" SPACE Action)?
;
2012-11-03 18:46:59 -07:00
PoisonAction
2012-12-04 01:19:58 -08:00
= "gets" SPACE Count SPACE "poison counter" "s"?
2012-11-03 18:46:59 -07:00
;
2012-11-03 07:00:17 -07:00
ReanimateAction
= "put " SelectCard " from a graveyard onto the battlefield under your control"
;
2012-11-03 06:14:50 -07:00
MillAction
2012-12-04 01:21:52 -08:00
= "put" "s"? " the top " (Count SPACE)? Card " of his or her library into his or her graveyard"
2012-11-03 06:14:50 -07:00
;
2012-10-29 01:30:12 -07:00
DoesntUntapAction
= SelectPermanent " doesn't untap during its controller's untap step"
/ SelectPermanent " doesn't untap during its controller's next untap step"
/ SelectPermanent " doesn't untap during your untap step"
2012-10-29 01:30:12 -07:00
;
2012-10-29 01:03:09 -07:00
ShuffleAction
= "shuffle it into its owner's library"
/ "shuffle your library"
;
PutTokenAction
2012-12-04 01:32:05 -08:00
= "put " Count SPACE CreatureTokenSpec " onto the battlefield"
2012-11-03 06:57:42 -07:00
/ "put a token that's a copy of " SelectPermanent " onto the battlefield"
;
2012-11-04 03:47:06 -08:00
CreatureTokenSpec
= PowerToughness SPACE ColorSpec (SPACE CreatureType)* " artifact"? " creature token" "s"? (SPACE WithAbilitySpec)?
;
WithAbilitySpec
= "with " Keyword SEP Keyword
/ "with " Keyword
2012-11-04 03:47:06 -08:00
;
CreatureSpec
= PowerToughness (SPACE ColorSpec)? (SPACE CreatureType)* " artifact"? " creature" (SPACE WithAbilitySpec)?
;
2012-10-28 23:14:07 -07:00
ControlAction
= "control" "s"? SPACE SelectPermanent
2012-11-03 04:40:35 -07:00
/ "gain control of " SelectPermanent
2012-10-28 23:14:07 -07:00
;
ChangeCounterAction
= CounterVerb SPACE Count SPACE CounterType SPACE Counter " from " SelectPermanent
/ CounterVerb SPACE Count SPACE CounterType SPACE Counter " on " SelectPermanent
;
CounterVerb
= "remove"
/ "put"
;
Counter
= "counter" "s"?
;
PayManaAction
= "pay" "s"? SPACE ManaCost
2012-11-03 06:11:57 -07:00
/ ManaCost
;
ChangeLifeAction
= ChangeLifeVerb SPACE Number SPACE "life"
;
ChangeLifeVerb
= "lose" "s"?
/ "gain" "s"?
/ "pay" "s"?
2012-10-28 06:41:17 -07:00
;
SelectPlayer
2012-10-28 22:36:37 -07:00
= "target player"
/ "target opponent"
2012-10-28 22:51:17 -07:00
/ "that player"
2012-10-29 01:44:02 -07:00
/ "each player"
2012-11-03 03:51:17 -07:00
/ "each opponent"
2012-11-07 06:52:31 -08:00
/ "your opponents"
2012-11-03 06:23:35 -07:00
/ "an opponent"
2012-10-28 22:36:37 -07:00
/ "you"
2012-11-03 06:23:35 -07:00
/ "he or she"
/ "its controller"
2012-11-03 19:43:48 -07:00
/ "its owner"
2012-11-02 22:23:48 -07:00
/ "player"
2012-10-28 05:50:47 -07:00
;
ReturnAction
2012-10-28 22:36:37 -07:00
= "return " SelectCard " from your graveyard to your hand"
/ "return " SelectCard " from your graveyard to the battlefield"
2012-10-28 23:04:28 -07:00
/ "return " SelectCard " to the battlefield under its owner's control"
;
2012-10-28 02:27:04 -07:00
BounceAction
= BounceVerb SPACE SelectPermanent SPACE BounceLocation
;
BounceLocation
= "to its owner's hand"
/ "on top of its owner's library"
/ "on the bottom of its owner's library"
;
BounceVerb
= "return" "s"?
/ "put" "s"?
2012-10-28 02:27:04 -07:00
;
2012-10-28 03:49:34 -07:00
PreventAction
= "prevent the next " Number SPACE Damage SPACE "that would be dealt" (SPACE DamageRestriction)?
/ "prevent all " Damage SPACE "that would be dealt" (SPACE DamageRestriction)?
2012-11-03 07:37:33 -07:00
/ "if damage would be dealt to " DamageReceiver ", prevent that damage"
2012-11-03 07:24:08 -07:00
;
DamageRestriction
= "to" SPACE DamageReceiver
/ "by" SPACE DamageReceiver
/ "to and dealt by " DamageReceiver
;
2012-11-03 07:24:08 -07:00
Damage
= "damage"
/ "combat damage"
2012-10-28 03:49:34 -07:00
;
2012-10-28 00:30:18 -07:00
TapAction
= TapVerb SPACE SelectPermanent
/ "{t}"
2012-11-03 06:11:57 -07:00
/ "{q}"
;
TapVerb
= "tap or untap"
/ "tap"
/ "untap"
2012-10-28 00:30:18 -07:00
;
RegenerateAction
2012-11-02 21:07:22 -07:00
= "regenerate" SPACE SelectPermanent
2012-10-28 00:30:18 -07:00
;
DamageAction
= SelectPermanent " deals " Number " damage to " DamageReceiver
2012-11-03 03:47:28 -07:00
/ SelectPermanent " deals damage equal to its power to " DamageReceiver
/ SelectPermanent " deals damage equal to the number of " CounterType " counters on it to " DamageReceiver
/ SelectPermanent " deals damage to " DamageReceiver " equal to the number of " SelectPermanent
/ Number " damage to " DamageReceiver
2012-10-28 00:30:18 -07:00
;
EntersTapped
2012-11-02 19:52:44 -07:00
= "@ enters the battlefield tapped"
2012-10-28 00:30:18 -07:00
;
EntersWithCounter
2012-12-04 01:31:22 -08:00
= "@ enters the battlefield with" SPACE Count SPACE CounterType SPACE Counter " on it"
2012-10-28 06:02:31 -07:00
;
CounterType
2012-11-04 02:54:39 -08:00
= "-0/-1"
/ "+0/+1"
/ "-0/-2"
/ "+0/+2"
/ "-1/-0"
/ "+1/+0"
2012-11-04 02:54:39 -08:00
/ "-1/-1"
/ "+1/+1"
/ "+1/+2"
/ "-2/-2"
/ "+2/+2"
2012-11-04 02:38:22 -08:00
/ "age"
/ "aim"
/ "arrow"
/ "arrowhead"
/ "awakening"
/ "blaze"
/ "blood"
/ "bounty"
/ "bribery"
/ "carrion"
2012-10-28 06:02:31 -07:00
/ "charge"
2012-11-04 02:38:22 -08:00
/ "corpse"
/ "credit"
/ "cube"
/ "currency"
/ "death"
/ "delay"
2012-10-28 07:00:15 -07:00
/ "depletion"
2012-11-04 02:38:22 -08:00
/ "despair"
/ "devotion"
/ "divinity"
/ "doom"
/ "dream"
/ "echo"
/ "elixir"
/ "energy"
/ "eon"
/ "fade"
/ "fate"
/ "feather"
/ "filibuster"
/ "flame"
/ "flood"
/ "fungus"
/ "fuse"
/ "glyph"
/ "gold"
/ "growth"
/ "hatchling"
/ "healing"
/ "hoofprint"
/ "hourglass"
/ "hunger"
/ "husk"
/ "ice"
/ "infection"
/ "intervention"
/ "javelin"
2012-10-29 00:26:09 -07:00
/ "ki"
2012-11-04 02:38:22 -08:00
/ "level"
/ "lore"
/ "luck"
/ "magnet"
/ "mannequin"
/ "matrix"
/ "mine"
/ "mining"
/ "mire"
/ "music"
/ "net"
/ "omen"
/ "ore"
/ "page"
/ "pain"
/ "paralyzation"
/ "petal"
/ "petrification"
/ "phylactery"
/ "pin"
/ "plague"
/ "poison"
/ "polyp"
/ "pressure"
/ "pupa"
/ "quest"
2012-11-04 02:38:22 -08:00
/ "rust"
/ "scream"
/ "scroll"
/ "shell"
/ "shield"
/ "shred"
/ "sleep"
/ "sleight"
/ "slime"
/ "soot"
/ "spore"
/ "storage"
/ "strife"
/ "study"
2012-11-03 19:47:53 -07:00
/ "tide"
/ "time"
2012-11-04 02:38:22 -08:00
/ "training"
/ "trap"
/ "treasure"
/ "velocity"
/ "verse"
/ "vitality"
/ "wage"
/ "winch"
/ "wind"
/ "wish"
;
Count
= "an"
/ "a"
2012-12-03 21:36:36 -08:00
/ "one"
/ "two"
/ "three"
2012-10-28 06:20:36 -07:00
/ "four"
/ "five"
/ "six"
/ "seven"
/ "eight"
/ "nine"
/ "ten"
2012-10-28 22:36:37 -07:00
/ "x"
;
2012-10-28 00:30:18 -07:00
Enchant
2012-10-28 22:36:37 -07:00
= "enchant" SPACE RestrictedPermanent
/ "enchant player"
2012-10-28 00:30:18 -07:00
;
2012-11-03 03:44:13 -07:00
Duration
= "until end of turn"
2012-11-03 06:23:35 -07:00
/ "for as long as " SelectPlayer " control @"
2012-11-03 18:33:50 -07:00
/ "as long as you control three or more artifacts"
2012-11-03 07:28:27 -07:00
/ "this turn"
/ "at the beginning of the next turn's upkeep"
2012-11-03 03:44:13 -07:00
;
GainAction
= (SelectPermanent SPACE)? GainVerb SPACE Keyword
2012-12-03 21:51:12 -08:00
;
GainVerb
2012-12-03 21:51:12 -08:00
= "has"
/ "have"
/ "gain" "s"?
/ "lose" "s"?
2012-10-28 03:34:39 -07:00
;
PumpAction
2012-12-03 22:54:59 -08:00
= SelectCreature SPACE "get" "s"? SPACE SignedNumber "/" SignedNumber
2012-10-28 00:30:18 -07:00
;
AddManaAction
2012-10-28 22:36:37 -07:00
= "add " ManaSource " to your mana pool"
;
ManaSource
= "{1}"
2012-12-03 22:36:47 -08:00
/ SingleColor (SEP SingleColor)*
/ "one mana of any color"
2012-10-28 00:30:18 -07:00
;
DrawAction
2012-12-03 21:57:25 -08:00
= Draw SPACE Count SPACE Card
;
Draw
= "draw" "s"?
2012-10-28 05:41:27 -07:00
;
DiscardAction
= Discard SPACE SelectCard " at random"?
/ Discard SPACE Count SPACE RestrictedCard " at random"
;
Discard
= "discard" "s"?
;
DestroyNoRegenAction
2012-12-03 22:00:13 -08:00
= "destroy" SPACE SelectPermanent EOS SPACE NoRegen
;
DestroyAction
2012-12-03 22:00:13 -08:00
= "destroy" SPACE SelectPermanent
;
ExileAction
2012-10-28 22:36:37 -07:00
= "exile " SelectPermanent
;
CounterAction
= "counter " SelectSpell (" unless " SingleEffect)?
;
SelectOp
= "target"
2012-11-02 21:58:23 -07:00
/ "all other"
/ "all"
2012-10-28 06:56:23 -07:00
/ "an"
/ "a"
2012-11-03 18:57:12 -07:00
/ "each other"
2012-10-29 00:46:13 -07:00
/ "each"
/ "enchanted"
/ "equipped"
2012-10-28 23:04:28 -07:00
/ "the"
2012-10-29 02:29:40 -07:00
/ "that"
2012-10-29 00:55:19 -07:00
/ "other"
2012-11-07 06:52:31 -08:00
/ "those"
;
2012-10-28 06:14:02 -07:00
SelectCard
2012-10-29 00:33:21 -07:00
= "@"
/ "it"
/ SelectOp SPACE RestrictedCard
2012-10-28 06:16:51 -07:00
;
2012-10-28 06:52:29 -07:00
SelectCreature
= "@"
2012-10-28 23:05:45 -07:00
/ "it"
2012-10-29 02:16:29 -07:00
/ (SelectOp SPACE)? RestrictedCreature
2012-10-28 06:52:29 -07:00
;
SelectPermanent
2012-10-28 06:16:51 -07:00
= "@"
2012-10-28 23:05:45 -07:00
/ "it"
/ (SelectOp SPACE)? RestrictedPermanentCombination
2012-10-28 06:16:51 -07:00
;
2012-10-28 06:14:02 -07:00
SelectSpell
2012-11-02 20:21:36 -07:00
= "@"
/ "it"
/ SelectOp SPACE RestrictedSpell
2012-10-28 06:16:51 -07:00
;
2012-10-28 06:14:02 -07:00
RestrictedPermanentCombination
= RestrictedPermanent (SEP RestrictedPermanent)*
2012-10-28 06:14:02 -07:00
;
RestrictedPermanent
= (PermanentRestriction SPACE)? Permanent (SPACE PermanentRestriction)?
2012-10-28 06:14:02 -07:00
/ RestrictedCreature
2012-10-28 06:44:01 -07:00
/ RestrictedLand
/ RestrictedArtifact
/ RestrictedEnchantment
/ RestrictedTribal
;
RestrictedArtifact
= Artifact (SPACE PermanentRestriction)?
/ (PermanentRestriction SPACE)? Artifact (SPACE PermanentRestriction)?
;
RestrictedEnchantment
= (PermanentRestriction SPACE)? Enchantment (SPACE PermanentRestriction)?
;
RestrictedLand
2012-10-28 22:53:17 -07:00
= (LandRestriction SPACE)? Land (SPACE LandRestriction)?
;
RestrictedTribal
= (PermanentRestriction SPACE)? Tribal (SPACE PermanentRestriction)?
;
2012-10-28 06:14:02 -07:00
RestrictedSpell
= (SpellRestriction SPACE)? Spell (SPACE SpellRestriction)?
;
ColorSpec
= Color (SEP Color)*
2012-11-04 00:25:21 -07:00
/ "non" Color
2012-11-04 06:26:09 -08:00
/ "colorless"
;
SpellRestriction
= ColorSpec
2012-11-04 00:27:52 -07:00
/ "creature"
2012-10-29 00:26:09 -07:00
/ "multicolored"
2012-10-28 05:34:07 -07:00
/ "noncreature"
2012-10-29 00:26:09 -07:00
/ "enchantment"
/ "spirit or arcane"
/ "treefolk"
/ "vampire creature"
2012-10-29 00:33:21 -07:00
/ "wizard"
2012-11-03 18:56:04 -07:00
/ "artifact"
/ "during an opponent's turn"
/ "instant or sorcery"
/ "instant"
/ "sorcery"
2012-11-03 18:50:23 -07:00
/ "with infect"
2012-11-03 18:53:24 -07:00
/ "with converted mana cost " Number " or less"
/ "with converted mana cost " Number " or greater"
/ "with converted mana cost " Number
2012-10-28 05:34:07 -07:00
;
2012-10-28 06:14:02 -07:00
RestrictedCard
= (CardRestriction SPACE)? Card
;
2012-10-28 05:34:07 -07:00
CardRestriction
= "exiled"
/ SpellRestriction
2012-10-28 05:34:07 -07:00
;
2012-10-28 06:14:02 -07:00
RestrictedCreature
2012-11-04 00:09:29 -07:00
= (CreatureRestriction SPACE)* Creature (SPACE CreatureRestriction)*
2012-10-28 05:34:07 -07:00
;
2012-11-02 22:32:31 -07:00
PermanentRestriction
= ColorSpec
2012-11-02 22:32:31 -07:00
/ "tapped"
/ "untapped"
/ "noncreature"
2012-11-03 06:23:35 -07:00
/ SelectPlayer " control" "s"?
/ SelectPlayer " don't control"
2012-11-02 22:32:31 -07:00
/ "nonartifact, nonblack"
/ "nonartifact"
2012-10-29 00:11:35 -07:00
/ "artifact"
2012-11-03 19:49:47 -07:00
/ "other than @"
2012-11-04 01:20:28 -08:00
/ "legendary"
2012-11-02 22:32:31 -07:00
/ "with converted mana cost " Number " or less"
/ "with converted mana cost " Number " or greater"
/ "with converted mana cost " Number
;
CreatureRestriction
= "with power " Number " or less"
/ "with power " Number " or greater"
/ "with " Keyword
/ "without " Keyword
/ "tapped or blocking"
/ "blocked"
/ "attacking or blocking"
/ "attacking"
2012-11-02 21:42:20 -07:00
/ Tribal
2012-11-02 22:32:31 -07:00
/ PermanentRestriction
;
2012-11-03 06:23:35 -07:00
LandRestriction
= "nonbasic"
/ "basic"
/ PermanentRestriction
;
2012-11-04 00:25:21 -07:00
Color
= "black"
/ "blue"
/ "green"
/ "red"
/ "white"
;
Tribal
2012-11-04 01:09:23 -08:00
= CreatureType "s"?
2012-11-04 01:11:37 -08:00
/ "non-" CreatureType
2012-11-04 01:09:23 -08:00
;
CreatureType
= "advisor"
/ "ally"
/ "angel"
/ "anteater"
/ "antelope"
/ "ape"
/ "archer"
/ "archon"
/ "artificer"
/ "assassin"
/ "assembly-worker"
/ "atog"
/ "aurochs"
/ "avatar"
/ "badger"
/ "barbarian"
/ "basilisk"
/ "bat"
/ "bear"
/ "beast"
/ "beeble"
/ "berserker"
2012-11-02 21:42:20 -07:00
/ "bird"
2012-11-04 01:09:23 -08:00
/ "blinkmoth"
/ "boar"
/ "bringer"
/ "brushwagg"
/ "camarid"
/ "camel"
/ "caribou"
/ "carrier"
/ "cat"
/ "centaur"
/ "cephalid"
/ "chimera"
/ "citizen"
/ "cleric"
/ "cockatrice"
/ "construct"
/ "coward"
/ "crab"
/ "crocodile"
/ "cyclops"
/ "dauthi"
/ "demon"
/ "deserter"
/ "devil"
/ "djinn"
/ "dragon"
/ "drake"
/ "dreadnought"
/ "drone"
/ "druid"
/ "dryad"
/ "dwarf"
/ "efreet"
/ "elder"
/ "eldrazi"
/ "elemental"
/ "elephant"
/ "elf"
/ "elk"
/ "eye"
/ "faerie"
/ "ferret"
/ "fish"
/ "flagbearer"
/ "fox"
/ "frog"
/ "fungus"
/ "gargoyle"
/ "germ"
/ "giant"
/ "gnome"
/ "goat"
2012-11-02 21:09:02 -07:00
/ "goblin"
2012-11-04 01:09:23 -08:00
/ "golem"
/ "gorgon"
/ "graveborn"
/ "gremlin"
/ "griffin"
/ "hag"
/ "harpy"
/ "hellion"
/ "hippo"
/ "hippogriff"
/ "homarid"
/ "homunculus"
/ "horror"
/ "horse"
/ "hound"
/ "human"
/ "hydra"
/ "hyena"
/ "illusion"
/ "imp"
/ "incarnation"
/ "insect"
/ "jellyfish"
/ "juggernaut"
/ "kavu"
/ "kirin"
/ "kithkin"
/ "knight"
/ "kobold"
/ "kor"
/ "kraken"
/ "lammasu"
/ "leech"
/ "leviathan"
/ "lhurgoyf"
/ "licid"
/ "lizard"
/ "manticore"
/ "masticore"
/ "mercenary"
/ "merfolk"
/ "metathran"
/ "minion"
/ "minotaur"
/ "monger"
/ "mongoose"
/ "monk"
/ "moonfolk"
/ "mutant"
/ "myr"
/ "mystic"
/ "nautilus"
/ "nephilim"
/ "nightmare"
/ "nightstalker"
/ "ninja"
/ "noggle"
/ "nomad"
/ "octopus"
/ "ogre"
/ "ooze"
/ "orb"
/ "orc"
/ "orgg"
/ "ouphe"
/ "ox"
/ "oyster"
/ "pegasus"
/ "pentavite"
/ "pest"
/ "phelddagrif"
/ "phoenix"
/ "pincher"
/ "pirate"
/ "plant"
/ "praetor"
/ "prism"
/ "rabbit"
/ "rat"
/ "rebel"
/ "reflection"
/ "rhino"
/ "rigger"
/ "rogue"
/ "salamander"
/ "samurai"
/ "sand"
2012-11-02 21:09:02 -07:00
/ "saproling"
2012-11-04 01:09:23 -08:00
/ "satyr"
/ "scarecrow"
2012-11-04 01:09:23 -08:00
/ "scorpion"
/ "scout"
/ "serf"
/ "serpent"
/ "shade"
/ "shaman"
/ "shapeshifter"
/ "sheep"
/ "siren"
/ "skeleton"
/ "slith"
/ "sliver"
/ "slug"
2012-11-04 00:30:26 -07:00
/ "snake"
/ "soldier"
2012-11-04 01:09:23 -08:00
/ "soltari"
/ "spawn"
/ "specter"
/ "spellshaper"
/ "sphinx"
/ "spider"
/ "spike"
/ "spirit"
/ "splinter"
/ "sponge"
/ "squid"
/ "squirrel"
/ "starfish"
/ "surrakar"
/ "survivor"
/ "tetravite"
/ "thalakos"
/ "thopter"
/ "thrull"
/ "treefolk"
/ "triskelavite"
/ "troll"
/ "turtle"
/ "unicorn"
/ "vampire"
/ "vedalken"
/ "viashino"
/ "volver"
/ "wall"
/ "warrior"
/ "weird"
/ "werewolf"
/ "whale"
/ "wizard"
/ "wolf"
/ "wolverine"
/ "wombat"
/ "worm"
/ "wraith"
/ "wurm"
/ "yeti"
/ "zombie"
/ "zubera"
;
Creature
= "creature" "s"?
;
Artifact
= "artifact" "s"?
2012-10-29 00:13:07 -07:00
/ "equipment" "s"?
;
Land
= "land" "s"?
2012-11-03 20:03:12 -07:00
/ "swamp" "s"?
/ "island" "s"?
/ "forest" "s"?
/ "mountain" "s"?
/ "plains"
;
Enchantment
= "enchantment" "s"?
;
Permanent
= "permanent" "s"?
;
Card
= "card" "s"?
;
Spell
= "spell" "s"?
;
NoRegen
2012-10-28 22:36:37 -07:00
= "it can't be regenerated"
/ "they can't be regenerated"
;
2012-11-04 01:15:05 -08:00
PowerToughness
= Number "/" Number
;
SignedNumber
= Sign Number
;
2012-10-28 00:30:18 -07:00
Number
= [0-9]+
2012-10-28 23:10:15 -07:00
/ "that much"
2012-10-29 02:20:20 -07:00
/ "x"
2012-10-28 00:30:18 -07:00
;
Sign
= "+"
2012-10-28 03:32:08 -07:00
/ "-"
;
2012-12-03 22:36:47 -08:00
SEP
= ", or "
/ ", and "
2012-12-03 22:36:47 -08:00
/ ", "
/ " or "
/ " and "
2012-12-03 22:36:47 -08:00
;
EOC
= ": "
;
SPACE
= " "
;
2012-10-28 02:27:04 -07:00
EOS
= "."
;
2012-10-28 02:27:04 -07:00
EOR
= !_
;