From dd7c307c7a2ecacb8439a66166f41f5692da207d Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sun, 25 Oct 2009 14:01:25 +0000 Subject: [PATCH] Erwan -Fix issue 107 as well as another issue with doesnotuntap mentioned by leungcl -Changed wording for Paralyzing Graps (to match oracle), please verify --- projects/mtg/bin/Res/sets/ZEN/_cards.dat | 4 +- projects/mtg/bin/Res/test/_tests.txt | 2 + .../mtg/bin/Res/test/generic/doesnotuntap.txt | 39 +++++++++++++++++++ .../bin/Res/test/generic/doesnotuntap2.txt | 37 ++++++++++++++++++ projects/mtg/src/ConstraintResolver.cpp | 1 + projects/mtg/src/GameStateMenu.cpp | 2 +- projects/mtg/src/MTGAbility.cpp | 17 ++++---- 7 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 projects/mtg/bin/Res/test/generic/doesnotuntap.txt create mode 100644 projects/mtg/bin/Res/test/generic/doesnotuntap2.txt diff --git a/projects/mtg/bin/Res/sets/ZEN/_cards.dat b/projects/mtg/bin/Res/sets/ZEN/_cards.dat index fc424372a..e83fa5dad 100644 --- a/projects/mtg/bin/Res/sets/ZEN/_cards.dat +++ b/projects/mtg/bin/Res/sets/ZEN/_cards.dat @@ -940,8 +940,8 @@ power=1 toughness=1 [/card] [card] -text=Enchant tapped creature Enchanted creature doesn't untap during its controller's untap step. -target=creature[tapped] +text=Enchant creature Enchanted creature doesn't untap during its controller's untap step. +target=creature auto=doesnotuntap id=178109 name=Paralyzing Grasp diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index ffca65ab1..cd47bf1eb 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -3,6 +3,8 @@ ######################## generic/attacks_each_turn.txt generic/deathtouch.txt +generic/doesnotuntap.txt +generic/doesnotuntap2.txt generic/fear.txt generic/first_strike.txt generic/first_strike2.txt diff --git a/projects/mtg/bin/Res/test/generic/doesnotuntap.txt b/projects/mtg/bin/Res/test/generic/doesnotuntap.txt new file mode 100644 index 000000000..32830b65c --- /dev/null +++ b/projects/mtg/bin/Res/test/generic/doesnotuntap.txt @@ -0,0 +1,39 @@ +#Bug doesnotuntap +#issue http://code.google.com/p/wagic/issues/detail?id=107 +[INIT] +SECONDMAIN +[PLAYER1] +inplay:icy manipulator +hand:paralyzing grasp +manapool:{3}{U} +[PLAYER2] +inplay:grizzly bears +[DO] +icy manipulator +grizzly bears +paralyzing grasp +grizzly bears +eot +next +#upkeep +next +#draw +next +#main +grizzly bears +next +#begins +next +#attackers +grizzly bears +next +#end of combat +next +#main phase 2 +[ASSERT] +SECONDMAIN +[PLAYER1] +inplay:paralyzing grasp,icy manipulator +[PLAYER2] +inplay:grizzly bears +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/generic/doesnotuntap2.txt b/projects/mtg/bin/Res/test/generic/doesnotuntap2.txt new file mode 100644 index 000000000..71ea51605 --- /dev/null +++ b/projects/mtg/bin/Res/test/generic/doesnotuntap2.txt @@ -0,0 +1,37 @@ +#Bug doesnotuntap +[INIT] +SECONDMAIN +[PLAYER1] +inplay:icy manipulator +hand:paralyzing grasp +manapool:{3}{U} +[PLAYER2] +inplay:grizzly bears +[DO] +icy manipulator +grizzly bears +paralyzing grasp +grizzly bears +eot +next +#upkeep +next +#draw +next +#main +next +#begins +next +#attackers +grizzly bears +next +#end of combat +next +#main phase 2 +[ASSERT] +SECONDMAIN +[PLAYER1] +inplay:paralyzing grasp,icy manipulator +[PLAYER2] +inplay:grizzly bears +[END] \ No newline at end of file diff --git a/projects/mtg/src/ConstraintResolver.cpp b/projects/mtg/src/ConstraintResolver.cpp index 7305cf107..c01345182 100644 --- a/projects/mtg/src/ConstraintResolver.cpp +++ b/projects/mtg/src/ConstraintResolver.cpp @@ -6,6 +6,7 @@ int ConstraintResolver::untap(GameObserver * game, MTGCardInstance * card){ if (!card->isUntapping()){ return 0; } + if (card->has(Constants::DOESNOTUNTAP)) return 0; int ok = 1; ManaCost * untapManaCost = NEW ManaCost(); UntapBlockers * blockers = card->getUntapBlockers(); diff --git a/projects/mtg/src/GameStateMenu.cpp b/projects/mtg/src/GameStateMenu.cpp index 9a4b12402..ec1b9e448 100644 --- a/projects/mtg/src/GameStateMenu.cpp +++ b/projects/mtg/src/GameStateMenu.cpp @@ -11,7 +11,7 @@ #include "../include/utils.h" #include "../include/DeckDataWrapper.h" -static const char* GAME_VERSION = "WTH?! 0.9.0 - by wololo"; +static const char* GAME_VERSION = "WTH?! 0.9.1 - by wololo"; #define DEFAULT_ANGLE_MULTIPLIER 0.4 #define MAX_ANGLE_MULTIPLIER (3*M_PI) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index edbc715fb..c50f90390 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -363,15 +363,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } - //Untapper (Ley Druid...) - found = s.find("untap"); - if (found != string::npos){ - MTGAbility * a = NEW AAUntapper(id,card,target); - a->oneShot = 1; - return a; - } - - //Regeneration found = s.find("regenerate"); if (found != string::npos){ @@ -679,6 +670,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG } } + //Untapper (Ley Druid...) + found = s.find("untap"); + if (found != string::npos){ + MTGAbility * a = NEW AAUntapper(id,card,target); + a->oneShot = 1; + return a; + } + //Tapper (icy manipulator) found = s.find("tap"); if (found != string::npos){