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
|
power=11
|
||||||
toughness=11
|
toughness=11
|
||||||
text=When Denizen of the Deep enters the battlefield, return each other creature you control to its owner's hand.
|
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
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
|||||||
@@ -305,6 +305,16 @@ power=0
|
|||||||
toughness=3
|
toughness=3
|
||||||
[/card]
|
[/card]
|
||||||
[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
|
id=3625
|
||||||
name=Python
|
name=Python
|
||||||
rarity=C
|
rarity=C
|
||||||
|
|||||||
@@ -238,6 +238,7 @@ paralysis.txt
|
|||||||
paralysis2.txt
|
paralysis2.txt
|
||||||
persuasion.txt
|
persuasion.txt
|
||||||
plague_rats.txt
|
plague_rats.txt
|
||||||
|
prosperity.txt
|
||||||
protomatter_powder.txt
|
protomatter_powder.txt
|
||||||
prowess_of_the_fair.txt
|
prowess_of_the_fair.txt
|
||||||
prowess_of_the_fair2.txt
|
prowess_of_the_fair2.txt
|
||||||
|
|||||||
@@ -470,8 +470,8 @@ public:
|
|||||||
|
|
||||||
class AADrawer:public ActivatedAbilityTP{
|
class AADrawer:public ActivatedAbilityTP{
|
||||||
public:
|
public:
|
||||||
int nbcards;
|
WParsedInt *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){
|
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(){
|
int resolve(){
|
||||||
@@ -483,7 +483,7 @@ class AADrawer:public ActivatedAbilityTP{
|
|||||||
}else{
|
}else{
|
||||||
player = (Player *) _target;
|
player = (Player *) _target;
|
||||||
}
|
}
|
||||||
game->mLayers->stackLayer()->addDraw(player,nbcards);
|
game->mLayers->stackLayer()->addDraw(player,nbcards->getValue());
|
||||||
game->mLayers->stackLayer()->resolve();
|
game->mLayers->stackLayer()->resolve();
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@@ -495,10 +495,15 @@ class AADrawer:public ActivatedAbilityTP{
|
|||||||
|
|
||||||
AADrawer * clone() const{
|
AADrawer * clone() const{
|
||||||
AADrawer * a = NEW AADrawer(*this);
|
AADrawer * a = NEW AADrawer(*this);
|
||||||
|
a->nbcards = NEW WParsedInt(*(a->nbcards));
|
||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~AADrawer(){
|
||||||
|
SAFE_DELETE(nbcards);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*Gives life to target controller*/
|
/*Gives life to target controller*/
|
||||||
|
|||||||
@@ -528,13 +528,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
if (found != string::npos){
|
if (found != string::npos){
|
||||||
unsigned int start = s.find(":",found);
|
unsigned int start = s.find(":",found);
|
||||||
unsigned int end = s.find(" ",start);
|
unsigned int end = s.find(" ",start);
|
||||||
int nbcards;
|
string nbcardsStr;
|
||||||
if (end != string::npos){
|
if (end != string::npos){
|
||||||
nbcards = atoi(s.substr(start+1,end-start-1).c_str());
|
nbcardsStr = s.substr(start+1,end-start-1);
|
||||||
}else{
|
}else{
|
||||||
nbcards = atoi(s.substr(start+1).c_str());
|
nbcardsStr = s.substr(start+1);
|
||||||
}
|
}
|
||||||
|
WParsedInt * nbcards = NEW WParsedInt(nbcardsStr,spell,card);
|
||||||
Targetable * t = NULL;
|
Targetable * t = NULL;
|
||||||
if (spell) t = spell->getNextTarget();
|
if (spell) t = spell->getNextTarget();
|
||||||
MTGAbility * a = NEW AADrawer(id,card,t,NULL,nbcards,0,who);
|
MTGAbility * a = NEW AADrawer(id,card,t,NULL,nbcards,0,who);
|
||||||
|
|||||||
Reference in New Issue
Block a user