From b5794ad328e09db79ffead38173549d6300a96c3 Mon Sep 17 00:00:00 2001 From: pankdm Date: Fri, 18 Oct 2013 06:38:15 +0000 Subject: [PATCH] Small fixes (misstype, formatting, target p2) --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 8 ++++---- projects/mtg/bin/Res/test/spoils_of_evil.txt | 1 + projects/mtg/include/AllAbilities.h | 2 +- projects/mtg/src/MTGAbility.cpp | 4 ++-- projects/mtg/src/MTGGameZones.cpp | 6 +++--- projects/mtg/src/TargetChooser.cpp | 5 +++-- 6 files changed, 14 insertions(+), 12 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index e6303bc4d..79547c7d7 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -41358,7 +41358,7 @@ type=Legendary Enchantment ###The 2 cards above should stay together (Flip Card)### [card] name=Honden of Cleansing Fire -auto=@each my upkeep:life:type:shrine && life:type:shrine +auto=@each my upkeep:life:twicetype:shrine text=At the beginning of your upkeep, you gain 2 life for each Shrine you control. mana={3}{W} type=Legendary Enchantment @@ -50519,7 +50519,7 @@ toughness=4 [/card] [card] name=Lightmine Field -auto=@each blockers:damage:type:creature[attacking]:battlefield all(creature[attacking]|Battlefield) +auto=@each blockers:foreach(creature[attacking]|Battlefield) damage:1 all(creature[attacking]|Battlefield) text=Whenever one or more creatures attack, Lightmine Field deals damage to each of those creatures equal to the number of attacking creatures. mana={2}{W}{W} type=Enchantment @@ -70900,8 +70900,8 @@ toughness=2 [card] name=Rending Vines target=artifact,enchantment -auto=teach(artifact[manacost<=type:*:opponenthand]) destroy -auto=teach(enchantment[manacost<=type:*:opponenthand]) destroy +auto=teach(artifact[manacost<=type:*:myhand]) destroy +auto=teach(enchantment[manacost<=type:*:myhand]) destroy auto=draw:1 controller text=Destroy target artifact or enchantment if its converted mana cost is less than or equal to the number of cards in your hand. -- Draw a card. mana={1}{G}{G} diff --git a/projects/mtg/bin/Res/test/spoils_of_evil.txt b/projects/mtg/bin/Res/test/spoils_of_evil.txt index 41d532f30..40ec4dc50 100644 --- a/projects/mtg/bin/Res/test/spoils_of_evil.txt +++ b/projects/mtg/bin/Res/test/spoils_of_evil.txt @@ -9,6 +9,7 @@ manapool:{2}{B} graveyard:swamp,grizzly bears,dragon engine [DO] Spoils Of Evil +p2 [ASSERT] FIRSTMAIN [PLAYER1] diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index a7cddacee..c824187db 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -199,7 +199,7 @@ private: for (int k = 0; k < 4; k++) { MTGGameZone * zone = zones[k]; - if (tc->targetsZone(zone, target)) + if (tc->targetsZone(zone, card)) { if (color) { diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index eff66a93a..08827ccab 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1777,7 +1777,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG found = s.find("compare"); if (found != string::npos) { - compareZone = true; + compareZone = true; } switch (i) @@ -1810,7 +1810,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG { result->oneShot = oneShot; a->forcedAlive = forcedalive; - if(neverRemove) + if (neverRemove) { result->oneShot = false; result->forceDestroy = -1; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index ea8da1258..56f7efe12 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -554,7 +554,7 @@ unsigned int MTGGameZone::countByCanTarget(TargetChooser * tc) int result = 0; for (int i = 0; i < (nb_cards); i++) { - if (tc->canTarget(cards[i]), withoutProtections) + if (tc->canTarget(cards[i], withoutProtections)) { result++; } @@ -572,7 +572,7 @@ unsigned int MTGGameZone::countTotalManaSymbols(TargetChooser * tc, int color) int result = 0; for (int i = 0; i < nb_cards; i++) { - if (tc->canTarget(cards[i]), withoutProtections) + if (tc->canTarget(cards[i], withoutProtections)) { result += cards[i]->getManaCost()->getManaSymbols(color); } @@ -947,7 +947,7 @@ MTGGameZone * MTGGameZone::intToZone(GameObserver *g, int zoneId, MTGCardInstanc { //bug or bug case default to p2 = source->controller(); - target = source; + target = source; } } else diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index b51946f74..4db161dc0 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -1258,10 +1258,11 @@ bool TargetZoneChooser::targetsZone(MTGGameZone * z) if (MTGGameZone::intToZone(Owner->getObserver(), zones[i], source) == z) return true; return false; } + bool TargetZoneChooser::targetsZone(MTGGameZone * z,MTGCardInstance * mSource) { -if(mSource) -source = mSource; + if (mSource) + source = mSource; for (int i = 0; i < nbzones; i++) if (MTGGameZone::intToZone(source->owner->getObserver(), zones[i], source) == z) return true; return false;