From d247c53136c42e24e950b0e843111c8420306178 Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Sat, 9 Jul 2016 17:55:08 -0400 Subject: [PATCH 1/2] edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor. --- projects/mtg/bin/Res/player/premade/deck1.txt | 18 +++--------------- projects/mtg/bin/Res/sets/primitives/mtg.txt | 15 +++++---------- projects/mtg/bin/Res/test/_tests.txt | 1 + projects/mtg/src/MTGGameZones.cpp | 6 +++++- 4 files changed, 14 insertions(+), 26 deletions(-) diff --git a/projects/mtg/bin/Res/player/premade/deck1.txt b/projects/mtg/bin/Res/player/premade/deck1.txt index ef32db48a..9d374e7ad 100644 --- a/projects/mtg/bin/Res/player/premade/deck1.txt +++ b/projects/mtg/bin/Res/player/premade/deck1.txt @@ -1,19 +1,7 @@ #NAME:Premade G/R #DESC:A Red/Green deck with simple mechanics to get you started. We recommend you create your own decks to get the full Wagic experience! -Forest (10E) *11 -Mountain (10E) *12 - -Aggressive Urge (10E) *4 -Wall of Wood (10E) *4 -Llanowar Elves (10E) *4 -Mirri, Cat Warrior (10E) -Scion of the Wild (10E) *4 -Primal Rage (10E) *2 - -Lightning Elemental (10E) *4 -Shock (10E) *4 -Firebreathing (10E) *2 -Raging Goblin (10E) *4 -Anaba Bodyguard (10E) *4 +arbor elf *25 +Arbiter of Knollridge *13 +Arbor Colossus *13 diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 508697533..ab02f2be9 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -4288,20 +4288,15 @@ toughness=5 [/card] [card] name=Arbor Colossus -abilities=reach -auto=this(cantargetcard(*[-monstrous]) {3}{G}{G}{G}:becomes(monstrous) forever && counter(1/1,3) && transforms((,newAbility[destroy target(creature[flying]|opponentbattlefield)])) forever -text=Reach -- {3}{G}{G}{G}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.) -- When Arbor Colossus becomes monstrous, destroy target creature with flying an opponent controls -mana={2}{G}{G}{G} -type=Creature -subtype=Giant -power=6 -toughness=6 +auto=draw:2 +type=instant [/card] [card] name=Arbor Elf -auto={t}:untap target(forest) +autohand={0}:name(Control Magic) activate castcard(normal named!:Control Magic:!) text={T}: Untap target Forest. -mana={G} +mana={g} +dredge=dredge(2) type=Creature subtype=Elf Druid power=1 diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index dc83fac83..b8cfe6b9c 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -1,3 +1,4 @@ +savor the moment.txt ######################## #Internal tests ######################## diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 8e995dd69..5e664c3f8 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -980,7 +980,11 @@ void MTGInPlay::untapAll() MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2) { - + if (p2 != p && p2 && (p != p2->opponent())) + { + p = p2->opponent(); + //these cases are generally handled this is a edge case fix. + } switch (zoneId) { case MY_GRAVEYARD: From 78e4407c717fca08a8d4da2cb0027ef821dd4240 Mon Sep 17 00:00:00 2001 From: zethfox Date: Sat, 9 Jul 2016 18:21:52 -0400 Subject: [PATCH 2/2] Revert "edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor." This reverts commit d247c53136c42e24e950b0e843111c8420306178. --- projects/mtg/bin/Res/player/premade/deck1.txt | 18 +++++++++++++++--- projects/mtg/bin/Res/sets/primitives/mtg.txt | 15 ++++++++++----- projects/mtg/bin/Res/test/_tests.txt | 1 - projects/mtg/src/MTGGameZones.cpp | 6 +----- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/projects/mtg/bin/Res/player/premade/deck1.txt b/projects/mtg/bin/Res/player/premade/deck1.txt index 9d374e7ad..ef32db48a 100644 --- a/projects/mtg/bin/Res/player/premade/deck1.txt +++ b/projects/mtg/bin/Res/player/premade/deck1.txt @@ -1,7 +1,19 @@ #NAME:Premade G/R #DESC:A Red/Green deck with simple mechanics to get you started. We recommend you create your own decks to get the full Wagic experience! -arbor elf *25 +Forest (10E) *11 +Mountain (10E) *12 + +Aggressive Urge (10E) *4 +Wall of Wood (10E) *4 +Llanowar Elves (10E) *4 +Mirri, Cat Warrior (10E) +Scion of the Wild (10E) *4 +Primal Rage (10E) *2 + +Lightning Elemental (10E) *4 +Shock (10E) *4 +Firebreathing (10E) *2 +Raging Goblin (10E) *4 +Anaba Bodyguard (10E) *4 -Arbiter of Knollridge *13 -Arbor Colossus *13 diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index ab02f2be9..508697533 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -4288,15 +4288,20 @@ toughness=5 [/card] [card] name=Arbor Colossus -auto=draw:2 -type=instant +abilities=reach +auto=this(cantargetcard(*[-monstrous]) {3}{G}{G}{G}:becomes(monstrous) forever && counter(1/1,3) && transforms((,newAbility[destroy target(creature[flying]|opponentbattlefield)])) forever +text=Reach -- {3}{G}{G}{G}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.) -- When Arbor Colossus becomes monstrous, destroy target creature with flying an opponent controls +mana={2}{G}{G}{G} +type=Creature +subtype=Giant +power=6 +toughness=6 [/card] [card] name=Arbor Elf -autohand={0}:name(Control Magic) activate castcard(normal named!:Control Magic:!) +auto={t}:untap target(forest) text={T}: Untap target Forest. -mana={g} -dredge=dredge(2) +mana={G} type=Creature subtype=Elf Druid power=1 diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index b8cfe6b9c..dc83fac83 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -1,4 +1,3 @@ -savor the moment.txt ######################## #Internal tests ######################## diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 5e664c3f8..8e995dd69 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -980,11 +980,7 @@ void MTGInPlay::untapAll() MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2) { - if (p2 != p && p2 && (p != p2->opponent())) - { - p = p2->opponent(); - //these cases are generally handled this is a edge case fix. - } + switch (zoneId) { case MY_GRAVEYARD: