-fixed bug with Rampant growth. Other cards that do the same kind of thing can now be coded
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-07-20 13:56:30 +00:00
parent 82204fd8b3
commit 5a1b75b8d9
6 changed files with 32 additions and 7 deletions
+1 -1
View File
@@ -561,7 +561,7 @@ mana={WB}{WB}{WB}
[/card] [/card]
[card] [card]
text={T}: Target red or green creature gets -2/-0 until end of turn. text={T}: Target red or green creature gets -2/-0 until end of turn.
auto={T}:-2/0 target(creature[red]) auto={T}:-2/0 target(creature[red;green])
id=153476 id=153476
name=Wilderness Hypnotist name=Wilderness Hypnotist
rarity=C rarity=C
+1 -1
View File
@@ -1131,7 +1131,7 @@ mana={1}{G}
type=Sorcery type=Sorcery
text=Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library. text=Search your library for a basic land card and put that card onto the battlefield tapped. Then shuffle your library.
target=basic|myLibrary target=basic|myLibrary
auto=moveTo(myBattlefield) auto=moveTo(myBattlefield) && tap
rarity=C rarity=C
[/card] [/card]
[card] [card]
+1
View File
@@ -125,6 +125,7 @@ plague_rats.txt
protomatter_powder.txt protomatter_powder.txt
pygmy_troll.txt pygmy_troll.txt
pyroclasm.txt pyroclasm.txt
rampant_growth.txt
recover.txt recover.txt
resurrection.txt resurrection.txt
righteous_cause.txt righteous_cause.txt
@@ -0,0 +1,20 @@
#Bug:rampant growth does not tap target
[INIT]
FIRSTMAIN
[PLAYER1]
library:island
hand:rampant growth
manapool:{1}{G}
[PLAYER2]
[DO]
rampant growth
island
island
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:island
manapool:{0}
graveyard:rampant growth
[PLAYER2]
[END]
+7 -4
View File
@@ -162,7 +162,8 @@ public:
vector<MTGAbility *> abilities; vector<MTGAbility *> abilities;
MultiAbility(int _id, MTGCardInstance * card,ManaCost * _cost, int _tap):ActivatedAbility(_id, card,_cost,0,_tap){ MultiAbility(int _id, MTGCardInstance * card,Targetable * _target, ManaCost * _cost, int _tap):ActivatedAbility(_id, card,_cost,0,_tap){
if (_target) target = _target;
} }
@@ -1648,13 +1649,14 @@ class AATapper:public ActivatedAbility{
int resolve(){ int resolve(){
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target){ if (_target){
while (_target->next) _target=_target->next; //This is for cards such as rampant growth
_target->tap(); _target->tap();
} }
return 1; return 1;
} }
const char * getMenuText(){ const char * getMenuText(){
return "Tap target"; return "Tap";
} }
AATapper * clone() const{ AATapper * clone() const{
@@ -1675,13 +1677,14 @@ class AAUntapper:public ActivatedAbility{
int resolve(){ int resolve(){
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target){ if (_target){
_target->tap(); while (_target->next) _target=_target->next; //This is for cards such as rampant growth
_target->untap();
} }
return 1; return 1;
} }
const char * getMenuText(){ const char * getMenuText(){
return "untap target"; return "Untap";
} }
AAUntapper * clone() const{ AAUntapper * clone() const{
+2 -1
View File
@@ -210,11 +210,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if (found != string::npos){ if (found != string::npos){
string s1 = s.substr(0,found); string s1 = s.substr(0,found);
string s2 = s.substr(found+2); string s2 = s.substr(found+2);
MultiAbility * multi = NEW MultiAbility(id, card,NULL,NULL); MultiAbility * multi = NEW MultiAbility(id, card,target,NULL,NULL);
MTGAbility * a1 = parseMagicLine(s1,id,spell, card); MTGAbility * a1 = parseMagicLine(s1,id,spell, card);
MTGAbility * a2 = parseMagicLine(s2,id,spell, card); MTGAbility * a2 = parseMagicLine(s2,id,spell, card);
multi->Add(a1); multi->Add(a1);
multi->Add(a2); multi->Add(a2);
multi->oneShot=1;
return multi; return multi;
} }