From 8ed4729d821ce4d9b1659e0d1b1bbe63090ff0fd Mon Sep 17 00:00:00 2001 From: Eduardo MG Date: Sun, 18 Aug 2024 17:50:59 -0600 Subject: [PATCH] postcombat to second main, bug fixes in primitives Had to use the treasure defined as primitive since the Fable of the Mirror-Breaker token won't create a treasure otherwise. Changes: Rat Colony Shadow of the Second Sun Sphinx of the Second Sun Viashino is no longer a creature type. The postcombat main phase is now referred to as the second main phase. Updated Rules.cpp to exclude the Viashino type from random kindred decks. Bug Fixes: Fable of the Mirror-Breaker Rat Colony Plumb the Forbidden Oblivion Stone --- .../mtg/bin/Res/sets/primitives/_macros.txt | 2 +- .../bin/Res/sets/primitives/borderline.txt | 49 ++++++++++++------- projects/mtg/bin/Res/sets/primitives/mtg.txt | 4 +- projects/mtg/src/Rules.cpp | 10 ++-- 4 files changed, 38 insertions(+), 27 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/_macros.txt b/projects/mtg/bin/Res/sets/primitives/_macros.txt index cda11a4af..1620cb854 100644 --- a/projects/mtg/bin/Res/sets/primitives/_macros.txt +++ b/projects/mtg/bin/Res/sets/primitives/_macros.txt @@ -236,7 +236,7 @@ #AUTO_DEFINE _HARNESSED_LIGHTNING_($c) this(variable{penergy}>=$c) choice damage:$c && alterenergy:-$c controller -# Enlist. As this creature attacks, you may tap a nonattacking creature you control without summoning sickness. When you do, add its power to this creature’s until end of turn +# Enlist. As this creature attacks, you may tap a nonattacking creature you control without summoning sickness. When you do, add its power to this creature's until end of turn #AUTO_DEFINE _ENLIST_ @combat(attacking) source(this) restriction{type(creature[-fresh]|mybattlefield)~morethan~0}:transforms((,newability[{T(creature[-attacking;-fresh]|mybattlefield)}:storedpower/0 ueot limit:1])) ueot # Angel Token diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 417379674..00d8c5bc5 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -8490,7 +8490,7 @@ subtype=Saga [/card] [card] name=Belbe, Corrupted Observer -text=At the beginning of each player's postcombat main phase, that player adds {C}{C} for each of your opponents who lost life this turn. (Damage causes loss of life.) +text=At the beginning of each player's second main phase, that player adds {C}{C} for each of your opponents who lost life this turn. (Damage causes loss of life.) auto=@each my secondmain restriction{compare(oplifelost)~morethan~0}:add{C}{C} auto=@each opponent secondmain restriction{compare(oplifelost)~morethan~0}:add{C}{C} opponent mana={B}{G} @@ -12791,7 +12791,7 @@ auto=lord(creature[attacking]|mybattlefield) transforms((,newability[@movedTo(th auto=@totalcounteradded(0/0.1.BrazenEffect):name(Brazen deal damage) damage:2 opponent auto=@totalcounteradded(0/0.1.BrazenEffect):name(Effect Ends) removeallcounters(0/0.1.BrazenEffect) auto=@each my secondmain restriction{raid}:name(Exile top card) _IMPULSEUENT_ -text=Whenever an attacking creature you control dies, Brazen Cannonade deals 2 damage to each opponent. -- Raid - At the beginning of your postcombat main phase, if you attacked with a creature this turn, exile the top card of your library. Until end of combat on your next turn, you may play that card. +text=Whenever an attacking creature you control dies, Brazen Cannonade deals 2 damage to each opponent. -- Raid - At the beginning of your second main phase, if you attacked with a creature this turn, exile the top card of your library. Until end of combat on your next turn, you may play that card. mana={3}{R} type=Enchantment [/card] @@ -16460,7 +16460,7 @@ name=Chain to Memory target=creature aicode=activate transforms((,newability[all(*[zpos<=2]|mylibrary) transforms((,newability[may name(Put on bottom of library) moveTo(myreveal) and!( bottomoflibrary )!])) oneshot])) oneshot auto=-4/-0 -auto=_SCRY2_ controller +auto=ability$! _SCRY2_ !$ controller text=Target creature gets -4/-0 until end of turn. Scry 2. mana={U} type=Instant @@ -34743,7 +34743,7 @@ backside=Reflection of Kiki-Jiki restriction=compare(isflipped)~equalto~0 anyzone={0}:doubleside(backside) auto=counter(0/0,1,Lore) -auto=token(Goblin, Goblin Shaman Creature,2/2,red) and!( transforms((,newability[_ATTACKING_name(Create treasure) _TREASURE_])) forever )! +auto=token(Goblin, Goblin Shaman Creature,2/2,red) and!( transforms((,newability[_ATTACKING_name(Create treasure) create(treasure)])) forever )! auto=@each my firstmain:counter(0/0,1,Lore) auto=@counteradded(0/0,1,Lore) from(this):this(counter{0/0.2.Lore}<=2) may name(Discard and draw) reject notatarget(*|myhand) and!( draw:1 controller )! auto=@counteradded(0/0,1,Lore) from(this) turnlimited:this(counter{0/0.3.Lore}) this(counter{0/0.3.Lore}) moveto(exile) and!( flip(backside) forcetype(Enchantment Creature) )! asSorcery @@ -38189,7 +38189,7 @@ name=Florian, Voldaren Scion abilities=first strike aicode=activate target(*[zpos<=oplifelost]|mylibrary) moveto(hand) and!( transforms((,newability[canplayfromexile],newability[all(*[zpos<=oplifelost]|myLibrary) moveto(myreveal) and!( bottomoflibrary )!])) ueot )! auto=@each my secondmain restriction{compare(oplifelost)~morethan~0}:name(Look top card) reveal:oplifelost optionone name(Exile 1 card) target(*|reveal) moveto(myexile) and!( transforms((,newability[canplayfromexile])) ueot )! optiononeend optiontwo name(put on bottom) target(*|reveal) bottomoflibrary and!( all(*|myreveal) bottomoflibrary )! optiontwoend revealend -text=First strike -- At the beginning of your postcombat main phase, look at the top X cards of your library, where X is the total amount of life your opponents lost this turn. Exile one of those cards and put the rest on the bottom of your library in a random order. You may play the exiled card this turn. +text=First strike -- At the beginning of your second main phase, look at the top X cards of your library, where X is the total amount of life your opponents lost this turn. Exile one of those cards and put the rest on the bottom of your library in a random order. You may play the exiled card this turn. type=Legendary Creature subtype=Vampire Noble mana={1}{B}{R} @@ -58780,7 +58780,7 @@ toughness=1 name=Kirri, Talented Sprout auto=lord(other Plant,Treefolk|myBattlefield) 2/0 auto=@each my secondmain:target(*[Plant;Treefolk;land]|myGraveyard) moveTo(myHand) -text=Other Plants and Treefolk you control get +2/+0. -- At the beginning of your postcombat main phase, return target Plant, Treefolk, or land card from your graveyard to your hand. +text=Other Plants and Treefolk you control get +2/+0. -- At the beginning of your second main phase, return target Plant, Treefolk, or land card from your graveyard to your hand. mana={1}{R}{G}{W} type=Legendary Creature subtype=Plant Druid @@ -71599,7 +71599,7 @@ name=Neheb, the Eternal auto=_BLOCKED_life:-3 opponent auto=@each my secondmain:counter(0/0,oplifelost,redmana) && transforms((,newability[thisforeach(counter{0/0.1.redmana}) add{R}])) ueot auto=@each end:removeallcounters(0/0,1,redmana) -text=Afflict 3 (Whenever this creature becomes blocked, defending player loses 3 life.) -- At the beginning of your postcombat main phase, add {R} for each 1 life your opponents have lost this turn. +text=Afflict 3 (Whenever this creature becomes blocked, defending player loses 3 life.) -- At the beginning of your second main phase, add {R} for each 1 life your opponents have lost this turn. mana={3}{R}{R} type=Legendary Creature subtype=Zombie Minotaur Warrior @@ -79431,7 +79431,7 @@ subtype=Arcane [/card] [card] name=Plumb the Forbidden -auto=target(creature|mybattlefield) transforms((,newability[sacrifice],newability[draw:1 controller],newability[life:-1 controller])) oneshot +auto=may target(creature|mybattlefield) transforms((,newability[sacrifice],newability[draw:1 controller],newability[life:-1 controller])) oneshot auto=draw:1 && life:-1 text=As an additional cost to cast this spell, you may sacrifice one or more creatures. When you do, copy this spell for each creature sacrificed this way. -- You draw a card and you lose 1 life. mana={1}{B} @@ -83879,7 +83879,7 @@ toughness=1 [/card] [card] name=Rat Colony -auto=foreach(rat|myBattlefield) 1/0 +auto=foreach(other rat|myBattlefield) 1/0 text=Rat Colony gets +1/+0 for each other Rat you control. -- A deck can have any number of cards named Rat Colony. mana={1}{B} type=Creature @@ -94138,10 +94138,10 @@ type=Instant [card] name=Shadow of the Second Sun target=player -auto=@each targetedplayer combatends:nextphasealter(add,untap,controller,after) -auto=@each targetedplayer combatends:nextphasealter(add,upkeep,controller,after) -auto=@each targetedplayer combatends:nextphasealter(add,draw,controller,after) -text=Enchant player -- At the beginning of enchanted player's postcombat main phase, there is an additional beginning phase after this phase. (The end step happens after the added untap, upkeep, and draw steps.) +auto=@each targetedplayer secondmain:nextphasealter(add,untap,controller,after) +auto=@each targetedplayer secondmain:nextphasealter(add,upkeep,controller,after) +auto=@each targetedplayer secondmain:nextphasealter(add,draw,controller,after) +text=Enchant player -- At the beginning of enchanted player's second main phase, there is an additional beginning phase after this phase. (The end step happens after the added untap, upkeep, and draw steps.) mana={4}{U}{U} type=Enchantment subtype=Aura @@ -99437,7 +99437,7 @@ anyzone={0}:doubleside(backside) abilities=lifelink auto=_EXTORT_ auto=@each secondmain restriction{compare(lifegain)~morethan~2}:moveto(exile) and!( flip(backside) forcetype(Legendary Planeswalker) )! -text=Lifelink -- Extort (Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life.) -- At the beginning of your postcombat main phase, if you gained 3 or more life this turn, exile Sorin of House Markov, then return him to the battlefield transformed under his owner's control. +text=Lifelink -- Extort (Whenever you cast a spell, you may pay {W/B}. If you do, each opponent loses 1 life and you gain that much life.) -- At the beginning of your second main phase, if you gained 3 or more life this turn, exile Sorin of House Markov, then return him to the battlefield transformed under his owner's control. mana={1}{B} type=Legendary Creature subtype=Human Noble @@ -100708,10 +100708,10 @@ toughness=5 [card] name=Sphinx of the Second Sun abilities=flying -auto=@each my combatends:nextphasealter(add,untap,controller,after) -auto=@each my combatends:nextphasealter(add,upkeep,controller,after) -auto=@each my combatends:nextphasealter(add,draw,controller,after) -text=Flying -- At the beginning of your postcombat main phase, there is an additional beginning phase after this phase. (The beginning phase includes the untap, upkeep, and draw steps.) +auto=@each my secondmain:nextphasealter(add,untap,controller,after) +auto=@each my secondmain:nextphasealter(add,upkeep,controller,after) +auto=@each my secondmain:nextphasealter(add,draw,controller,after) +text=Flying -- At the beginning of your second main phase, there is an additional beginning phase after this phase. (The beginning phase includes the untap, upkeep, and draw steps.) mana={6}{U}{U} type=Creature subtype=Sphinx @@ -113691,7 +113691,7 @@ toughness=* name=Tymna the Weaver abilities=lifelink,partner auto=@each my secondmain restriction{compare(odcountminusodnoncountminusend)~morethan~0}:may pay({L:1}) draw:1 controller -text=Lifelink -- At the beginning of your postcombat main phase, you may pay X life, where X is the number of opponents that were dealt combat damage this turn. If you do, draw X cards. -- Partner (You can have two commanders if both have partner.) +text=Lifelink -- At the beginning of your second main phase, you may pay X life, where X is the number of opponents that were dealt combat damage this turn. If you do, draw X cards. -- Partner (You can have two commanders if both have partner.) mana={1}{W}{B} type=Legendary Creature subtype=Human Cleric @@ -123564,3 +123564,14 @@ subtype=Devil power=2 toughness=3 [/card] +[card] +name=Treasure +auto={T}{S}:add{W} +auto={T}{S}:add{U} +auto={T}{S}:add{B} +auto={T}{S}:add{R} +auto={T}{S}:add{G} +text={T}, Sacrifice this artifact: Add one mana of any color. +type=Artifact +subtype=Treasure +[/card] \ No newline at end of file diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index d038cc56d..2654ffd9f 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -81547,8 +81547,8 @@ toughness=8 [/card] [card] name=Oblivion Stone -auto={4}{T}:counter(0/0,1,Fate) target(*) auto={5}{T}{S}:destroy all(*[-land;-counter{0/0.1.Fate}]) && all(*|battlefield) removeallcounters(0/0,1,Fate) +auto={4}{T}:counter(0/0,1,Fate) target(*) text={4}, {T}: Put a fate counter on target permanent. -- {5}, {T}, Sacrifice Oblivion Stone: Destroy each nonland permanent without a fate counter on it, then remove all fate counters from all permanents. mana={3} type=Artifact @@ -135680,7 +135680,7 @@ name=World at War auto=nextphasealter(add,combatphaseswithmain,controller,after) auto=all(creature|mybattlefield) transforms((,newability[@each my combatends turnlimited:phaseaction[combatbegins once sourceinplay] untap])) ueot auto=_REBOUND_ -text=After the first postcombat main phase this turn, there's an additional combat phase followed by an additional main phase. At the beginning of that combat, untap all creatures that attacked this turn. -- Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) +text=After the first second main phase this turn, there's an additional combat phase followed by an additional main phase. At the beginning of that combat, untap all creatures that attacked this turn. -- Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.) mana={3}{R}{R} type=Sorcery [/card] diff --git a/projects/mtg/src/Rules.cpp b/projects/mtg/src/Rules.cpp index c2a82395b..88d9a475d 100644 --- a/projects/mtg/src/Rules.cpp +++ b/projects/mtg/src/Rules.cpp @@ -168,9 +168,9 @@ void Rules::addExtraRules(GameObserver* g) difficultyRating = 0; else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2) difficultyRating = 0; - else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5 || g->mRules->gamemode == GAME_TYPE_RANDOMCOMMANDER) + else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5 || g->mRules->gamemode == GAME_TYPE_RANDOMCOMMANDER) difficultyRating = 0; - else if(g->mRules->gamemode == GAME_TYPE_HORDE || g->mRules->gamemode == GAME_TYPE_SET_LIMITED) + else if(g->mRules->gamemode == GAME_TYPE_HORDE || g->mRules->gamemode == GAME_TYPE_SET_LIMITED) difficultyRating = 0; else if (g->mRules->gamemode == GAME_TYPE_STORY) difficultyRating = 0; @@ -200,7 +200,7 @@ void Rules::addExtraRules(GameObserver* g) a->resolve(); else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2) a->resolve(); - else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5 || g->mRules->gamemode == GAME_TYPE_RANDOMCOMMANDER) + else if(g->mRules->gamemode == GAME_TYPE_RANDOM3 || g->mRules->gamemode == GAME_TYPE_RANDOM5 || g->mRules->gamemode == GAME_TYPE_RANDOMCOMMANDER) a->resolve(); else if (g->mRules->gamemode == GAME_TYPE_STORY) a->resolve(); @@ -419,7 +419,7 @@ Player * Rules::loadPlayerRandomFive(GameObserver* observer, int isAI) Player * Rules::loadPlayerRandomCommander(GameObserver* observer, int isAI) { - MTGDeck * cmdTempDeck = NEW MTGDeck(MTGCollection()); + MTGDeck * cmdTempDeck = NEW MTGDeck(MTGCollection()); MTGDeck * tempDeck = NEW MTGDeck(MTGCollection()); tempDeck->meta_commander = true; @@ -491,7 +491,7 @@ Player * Rules::loadPlayerHorde(GameObserver* observer, int isAI) const char* const whiteTribes[] = { "Angel", "Archer", "Bird", "Cat", "Cleric", "Griffin", "Kithkin", "Knight", "Kor", "Monk", "Rebel", "Samurai", "Scout", "Soldier", "Spirit" }; const char* const blueTribes[] = { "Artificer", "Bird", "Drake", "Faerie", "Illusion", "Merfolk", "Mutant", "Nightmare", "Pirate", "Shapeshifter", "Sphinx", "Spirit", "Vedalken", "Wizard" }; const char* const blackTribes[] = { "Assassin", "Cleric", "Demon", "Faerie", "Horror", "Insect", "Knight", "Nightmare", "Orc", "Phyrexian", "Pirate", "Rat", "Rogue", "Shade", "Skeleton", "Spirit", "Vampire", "Wizard", "Zombie" }; - const char* const redTribes[] = { "Artificer", "Beast", "Berserker", "Devil", "Dinosaur", "Dragon", "Dwarf", "Goblin", "Kavu", "Lizard", "Minotaur", "Ogre", "Orc", "Shaman", "Viashino", "Warrior", "Werewolf" }; + const char* const redTribes[] = { "Artificer", "Beast", "Berserker", "Devil", "Dinosaur", "Dragon", "Dwarf", "Goblin", "Kavu", "Lizard", "Minotaur", "Ogre", "Orc", "Shaman", "Warrior", "Werewolf" }; const char* const greenTribes[] = { "Archer", "Beast", "Cat", "Centaur", "Dinosaur", "Druid", "Dryad", "Elf", "Fungus", "Insect", "Kavu", "Lizard", "Mutant", "Plant", "Ranger", "Scout", "Shaman", "Snake", "Spider", "Treefolk", "Warrior", "Werewolf", "Wurm" }; int multicolorTribesSize = sizeof(multicolorTribes)/sizeof(multicolorTribes[0]);