Erwan
-added WParsedInt (X, p, t, manacost) for "Draw" effects. See prosperity - Fixed denizen of the deep (P02), it had broken the test suite, sorry for that!
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user