diff --git a/projects/mtg/bin/Res/sets/P02/_cards.dat b/projects/mtg/bin/Res/sets/P02/_cards.dat index e2f9f414c..b8c0a7a39 100644 --- a/projects/mtg/bin/Res/sets/P02/_cards.dat +++ b/projects/mtg/bin/Res/sets/P02/_cards.dat @@ -310,7 +310,7 @@ subtype=Serpent power=11 toughness=11 text=When Denizen of the Deep enters the battlefield, return each other creature you control to its owner's hand. -auto=moveTo(ownerHand) all(creature|myBattlefield) +auto=moveTo(ownerHand) all(other creature|myBattlefield) rarity=R [/card] [card] diff --git a/projects/mtg/bin/Res/sets/VIS/_cards.dat b/projects/mtg/bin/Res/sets/VIS/_cards.dat index 356ff23ba..4e5f35fce 100644 --- a/projects/mtg/bin/Res/sets/VIS/_cards.dat +++ b/projects/mtg/bin/Res/sets/VIS/_cards.dat @@ -305,6 +305,16 @@ power=0 toughness=3 [/card] [card] +id=3647 +name=Prosperity +mana={X}{U} +type=Sorcery +text=Each player draws X cards. +auto=Draw:X controller +auto=Draw:X opponent +rarity=U +[/card] +[card] id=3625 name=Python rarity=C diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 05ad1b4e7..2d430a52d 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -238,6 +238,7 @@ paralysis.txt paralysis2.txt persuasion.txt plague_rats.txt +prosperity.txt protomatter_powder.txt prowess_of_the_fair.txt prowess_of_the_fair2.txt diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 25b47ded2..dd327bbd4 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -470,8 +470,8 @@ public: class AADrawer:public ActivatedAbilityTP{ public: - int nbcards; - AADrawer(int _id, MTGCardInstance * card,Targetable * _target,ManaCost * _cost, int _nbcards = 1, int _tap = 0, int who=TargetChooser::UNSET):ActivatedAbilityTP(_id, card,_target,_cost,_tap,who),nbcards(_nbcards){ + WParsedInt *nbcards; + AADrawer(int _id, MTGCardInstance * card,Targetable * _target,ManaCost * _cost, WParsedInt * _nbcards, int _tap = 0, int who=TargetChooser::UNSET):ActivatedAbilityTP(_id, card,_target,_cost,_tap,who),nbcards(_nbcards){ } int resolve(){ @@ -483,7 +483,7 @@ class AADrawer:public ActivatedAbilityTP{ }else{ player = (Player *) _target; } - game->mLayers->stackLayer()->addDraw(player,nbcards); + game->mLayers->stackLayer()->addDraw(player,nbcards->getValue()); game->mLayers->stackLayer()->resolve(); } return 1; @@ -495,10 +495,15 @@ class AADrawer:public ActivatedAbilityTP{ AADrawer * clone() const{ AADrawer * a = NEW AADrawer(*this); + a->nbcards = NEW WParsedInt(*(a->nbcards)); a->isClone = 1; return a; } + ~AADrawer(){ + SAFE_DELETE(nbcards); + } + }; /*Gives life to target controller*/ diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 6de3795e3..6e00fbeff 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -528,13 +528,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG if (found != string::npos){ unsigned int start = s.find(":",found); unsigned int end = s.find(" ",start); - int nbcards; + string nbcardsStr; if (end != string::npos){ - nbcards = atoi(s.substr(start+1,end-start-1).c_str()); + nbcardsStr = s.substr(start+1,end-start-1); }else{ - nbcards = atoi(s.substr(start+1).c_str()); + nbcardsStr = s.substr(start+1); } - + WParsedInt * nbcards = NEW WParsedInt(nbcardsStr,spell,card); Targetable * t = NULL; if (spell) t = spell->getNextTarget(); MTGAbility * a = NEW AADrawer(id,card,t,NULL,nbcards,0,who);