diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index be98b40f1..54c679d68 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -402,7 +402,7 @@ toughness=2 [/card] [card] text=As Clone comes into play, you may choose a creature in play. If you do, Clone comes into play as a copy of that creature. -auto=may copy target(creature) +auto=may copy NotATarget(creature) id=129501 name=Clone rarity=R @@ -2141,7 +2141,7 @@ toughness=* [/card] [card] text=As Sculpting Steel comes into play, you may choose an artifact in play. If you do, Sculpting Steel comes into play as a copy of that artifact. -auto=may copy target(artifact) +auto=may copy notatarget(artifact) id=135241 name=Sculpting Steel rarity=R diff --git a/projects/mtg/bin/Res/sets/M10/_cards.dat b/projects/mtg/bin/Res/sets/M10/_cards.dat index bfb87a766..041a04373 100644 --- a/projects/mtg/bin/Res/sets/M10/_cards.dat +++ b/projects/mtg/bin/Res/sets/M10/_cards.dat @@ -320,7 +320,7 @@ subtype=Shapeshifter power=0 toughness=0 text=You may have Clone enter the battlefield as a copy of any creature on the battlefield. -auto=may copy target(creature) +auto=may copy notatarget(creature) rarity=R [/card] [card] diff --git a/projects/mtg/bin/Res/sets/MRD/_cards.dat b/projects/mtg/bin/Res/sets/MRD/_cards.dat index 9d2e70fb3..75d42dcfc 100644 --- a/projects/mtg/bin/Res/sets/MRD/_cards.dat +++ b/projects/mtg/bin/Res/sets/MRD/_cards.dat @@ -1067,7 +1067,7 @@ toughness=4 [/card] [card] text=As Sculpting Steel enters the battlefield, you may choose an artifact on the battlefield. If you do, Sculpting Steel enters the battlefield as a copy of that artifact. -auto=may copy target(artifact) +auto=may copy notatarget(artifact) id=46720 name=Sculpting Steel rarity=R diff --git a/projects/mtg/bin/Res/sets/ONS/_cards.dat b/projects/mtg/bin/Res/sets/ONS/_cards.dat index 5acf107a3..3dd0f16da 100644 --- a/projects/mtg/bin/Res/sets/ONS/_cards.dat +++ b/projects/mtg/bin/Res/sets/ONS/_cards.dat @@ -138,7 +138,7 @@ rarity=U mana={3}{U} type=Creature subtype=Shapeshifter -auto=may copy target(creature) +auto=may copy notatarget(creature) power=0 toughness=0 [/card] diff --git a/projects/mtg/bin/Res/sets/PLC/_cards.dat b/projects/mtg/bin/Res/sets/PLC/_cards.dat index 4e1f8dbba..249ce0fe7 100644 --- a/projects/mtg/bin/Res/sets/PLC/_cards.dat +++ b/projects/mtg/bin/Res/sets/PLC/_cards.dat @@ -24,7 +24,7 @@ abilities=first strike,protection from white [/card] [card] text=You may have Body Double enter the battlefield as a copy of any creature card in a graveyard. -auto=may copy target(creature|graveyard) +auto=may copy notatarget(creature|graveyard) id=124443 name=Body Double rarity=R diff --git a/projects/mtg/bin/Res/sets/RV/_cards.dat b/projects/mtg/bin/Res/sets/RV/_cards.dat index 8bb151ed5..915ddc1a5 100644 --- a/projects/mtg/bin/Res/sets/RV/_cards.dat +++ b/projects/mtg/bin/Res/sets/RV/_cards.dat @@ -363,7 +363,7 @@ toughness=4 [/card] [card] text=You may have Clone enter the battlefield as a copy of any creature on the battlefield. -auto=may copy target(creature) +auto=may copy notAtarget(creature) id=1193 name=Clone rarity=U diff --git a/projects/mtg/bin/Res/sets/TSP/_cards.dat b/projects/mtg/bin/Res/sets/TSP/_cards.dat index 732b0254b..e113399cf 100644 --- a/projects/mtg/bin/Res/sets/TSP/_cards.dat +++ b/projects/mtg/bin/Res/sets/TSP/_cards.dat @@ -389,7 +389,7 @@ rarity=L text={R}, {T}, Discard a card: Destroy target blue permanent. {1}{R}, {T}, Discard a card: Jaya Ballard, Task Mage deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. {5}{R}{R}, {T}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player. id=109752 name=Jaya Ballard, Task Mage -rarity=R +rarity=R mana={1}{R}{R} type=Creature subtype=Human Spellshaper @@ -916,7 +916,7 @@ text=As Vesuva enters the battlefield, you may choose a land on the battlefield. id=113543 name=Vesuva auto=tap -auto=may copy target(land) +auto=may copy notatarget(land) rarity=R type=Land [/card] diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 85c24b334..fcc1d5327 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -128,6 +128,7 @@ circle_of_protection_i211.txt civic_wayfinder.txt clone.txt clone2.txt +clone3.txt cockatrice.txt colossus_of_sardia1.txt colossus_of_sardia2.txt @@ -242,6 +243,7 @@ kraken_eye3.txt kraken_eye4.txt kudzu.txt kudzu2.txt +kudzu_i168.txt leveler.txt lhurgoyf.txt liability.txt diff --git a/projects/mtg/bin/Res/test/clone3.txt b/projects/mtg/bin/Res/test/clone3.txt new file mode 100644 index 000000000..cd73f14fc --- /dev/null +++ b/projects/mtg/bin/Res/test/clone3.txt @@ -0,0 +1,22 @@ +# As Clone comes into play, you may choose a creature in play. If you do, Clone comes into play as a copy of that creature. +#Bug: impossible to copy permanents with shroud +#see: http://code.google.com/p/wagic/issues/detail?id=162 +[INIT] +FIRSTMAIN +[PLAYER1] +hand:clone +manapool:{3}{U} +inplay:Deft Duelist +[PLAYER2] +[DO] +clone +choice 0 +deft duelist +next +[ASSERT] +COMBATBEGIN +[PLAYER1] +inplay:*,* +manapool:{0} +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/bugs/kudzu_i168.txt b/projects/mtg/bin/Res/test/kudzu_i168.txt similarity index 69% rename from projects/mtg/bin/Res/test/bugs/kudzu_i168.txt rename to projects/mtg/bin/Res/test/kudzu_i168.txt index 075a8d92b..6ab1ff683 100644 --- a/projects/mtg/bin/Res/test/bugs/kudzu_i168.txt +++ b/projects/mtg/bin/Res/test/kudzu_i168.txt @@ -2,6 +2,7 @@ #DESC: Bug: Game crashes if a land with #DESC: two Kudzus in it is tapped. #DESC: See: http://code.google.com/p/wagic/issues/detail?id=168 +#TODO Update this code with 2 different kudzus to make the test more reliable [INIT] firstmain [PLAYER1] @@ -17,13 +18,12 @@ Kudzu Swamp Swamp Mountain -Mountain [ASSERT] firstmain [PLAYER1] -inplay: -graveyard:Swamp -manapool: +inplay:* +graveyard:Swamp,* +manapool:{B} [PLAYER2] -inplay:Mountain,Kudzu,Kudzu +inplay:Mountain [END] diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 5d636612e..2d3eb404a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3159,29 +3159,24 @@ class AJandorsRing:public ActivatedAbility{ //What happens when there are no targets ??? class AKudzu: public TargetAbility{ public: - int previouslyTapped; AKudzu(int _id, MTGCardInstance * card, MTGCardInstance * _target):TargetAbility(_id,card, NEW TypeTargetChooser("land",card)){ tc->toggleTarget(_target); target = _target; - previouslyTapped = 0; - if (_target->isTapped()) previouslyTapped = 1; } + int receiveEvent(WEvent * event){ + if (WEventCardTap* wect = dynamic_cast(event)) { + if (wect->before == false && wect->after == true){ + MTGCardInstance * _target = (MTGCardInstance *)target; + if (!_target->isInPlay()) return 0; + target = _target->controller()->game->putInGraveyard(_target); + reactToClick(source); + return 1; + } + } + return 0; - void Update(float dt){ - MTGCardInstance * _target = (MTGCardInstance *)target; - if (_target && !_target->isTapped()){ - previouslyTapped = 0; - }else if (!previouslyTapped){ -#if defined (WIN32) || defined (LINUX) - OutputDebugString("Kudzu Strikes !\n"); -#endif - MTGCardInstance * _target = (MTGCardInstance *)target; - target = _target->controller()->game->putInGraveyard(_target); - reactToClick(source); // ???? - } - TargetAbility::Update(dt); - } + } int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){ MTGCardInstance * _target = (MTGCardInstance *)target; @@ -3198,8 +3193,6 @@ class AKudzu: public TargetAbility{ int resolve(){ target = tc->getNextCardTarget(); source->target = (MTGCardInstance *) target; - previouslyTapped = 0; - if (source->target && source->target->isTapped()) previouslyTapped = 1; return 1; } @@ -3220,12 +3213,6 @@ class AKudzu: public TargetAbility{ return 0; } - virtual ostream& toString(ostream& out) const - { - out << "AKudzu ::: previouslyTapped : " << previouslyTapped - << " ("; - return TargetAbility::toString(out) << ")"; - } AKudzu * clone() const{ AKudzu * a = NEW AKudzu(*this); a->isClone = 1; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index b2e38806d..efb2b378f 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -231,6 +231,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG string starget = s.substr(found + 7,end - found - 7); TargetChooserFactory tcf; tc = tcf.createTargetChooser(starget, card); + if (tc && s.find("notatarget(") != string::npos) tc->targetter = NULL; } AEquip *ae = dynamic_cast(a); @@ -273,6 +274,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG string starget = s.substr(found + 7,end - found - 7); TargetChooserFactory tcf; tc = tcf.createTargetChooser(starget, card); + if (tc && s.find("notatarget(") != string::npos) tc->targetter = NULL; } if (tc) a1 = NEW GenericTargetAbility(id, card, tc, a1); else a1 = NEW GenericActivatedAbility(id, card, a1,NULL);