-Fixed a bug with moveTo keyword (cf: Doomed necromancer test)
This commit is contained in:
wagic.the.homebrew
2009-02-05 13:34:40 +00:00
parent ba3b272558
commit 9439d5e6dd
4 changed files with 24 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ counsel_of_the_soratami.txt
counterspell.txt
counterspell2.txt
creature_bond.txt
doomed_necromancer.txt
drain_life.txt
flare.txt
force_of_nature.txt

View File

@@ -0,0 +1,19 @@
#Testing Doomed Necromancer's ability on a brass man in graveyard
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:129880
graveyard:1099
manapool:{B}
[PLAYER2]
[DO]
129880
1099
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:1099
graveyard:129880
manapool:{0}
[PLAYER2]
[END]

View File

@@ -164,7 +164,7 @@ class AZoneMover:public TargetAbility{
public:
string destinationZone;
AZoneMover(int _id, MTGCardInstance * _source, TargetChooser * _tc,string destZone, ManaCost * _cost = NULL):TargetAbility(_id,_source, _tc,_cost){
AZoneMover(int _id, MTGCardInstance * _source, TargetChooser * _tc,string destZone, ManaCost * _cost = NULL, int _tap=0):TargetAbility(_id,_source, _tc,_cost,0,_tap){
destinationZone = destZone;
}

View File

@@ -150,7 +150,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (delimiter!= string::npos){
cost = ManaCost::parseManaCost(line.substr(0,delimiter+1));
}
OutputDebugString("Pqrsing cost\n");
OutputDebugString("Parsing cost\n");
if (cost && cost->isNull()){
OutputDebugString("Cost is null\n");
SAFE_DELETE(cost);
@@ -192,7 +192,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
//Target Abilities
found = s.find("target(");
if (found != string::npos){
int end = s.find(")");
int end = s.find(")", found);
string starget = s.substr(found + 7,end - found - 7);
TargetChooserFactory tcf;
tc = tcf.createTargetChooser(starget, card);
@@ -298,7 +298,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
string szone = s.substr(found + 7,end - found - 7);
if (tc){
if (cost){
game->addObserver(NEW AZoneMover(id,card,tc,szone,cost));
game->addObserver(NEW AZoneMover(id,card,tc,szone,cost,doTap));
}
}else{
MTGGameZone * fromZone = target->getCurrentZone();//this is technically incorrect. The initial zone should be as described in the targetchooser