- fix Fastbond bug
- Attempt at fixing issues with Escape artist and Amugaba (not tested)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-03-25 14:44:48 +00:00
parent e8d32b2c6d
commit 2031577de4
4 changed files with 34 additions and 8 deletions
+1
View File
@@ -42,6 +42,7 @@ dingus_egg.txt
doomed_necromancer.txt doomed_necromancer.txt
dragon_fodder.txt dragon_fodder.txt
drain_life.txt drain_life.txt
fastbond.txt
flare.txt flare.txt
foratog.txt foratog.txt
force_of_nature.txt force_of_nature.txt
+17
View File
@@ -0,0 +1,17 @@
#Fastbond: infinite loop bug ?
[INIT]
FIRSTMAIN
[PLAYER1]
hand:1375,1373
inplay:1243
[PLAYER2]
[DO]
1373
1375
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:1243,1373,1375
life:19
[PLAYER2]
[END]
+10 -6
View File
@@ -1828,6 +1828,7 @@ class AErgRaiders:public MTGAbility{
class AFastbond:public TriggeredAbility{ class AFastbond:public TriggeredAbility{
public: public:
int alreadyPlayedALand; int alreadyPlayedALand;
int previous;
AFastbond(int _id, MTGCardInstance * card):TriggeredAbility(_id, card){ AFastbond(int _id, MTGCardInstance * card):TriggeredAbility(_id, card){
alreadyPlayedALand = 0; alreadyPlayedALand = 0;
} }
@@ -1840,16 +1841,19 @@ class AFastbond:public TriggeredAbility{
} }
int trigger(){ int trigger(){
if(source->controller()->canPutLandsIntoPlay==0) return 1; if(source->controller()->canPutLandsIntoPlay==0 && previous ==1){
previous = 0;
source->controller()->canPutLandsIntoPlay = 1;
if (alreadyPlayedALand) return 1;
alreadyPlayedALand = 1;
return 0;
}
previous = source->controller()->canPutLandsIntoPlay;
return 0; return 0;
} }
int resolve(){ int resolve(){
source->controller()->canPutLandsIntoPlay = 1; game->mLayers->stackLayer()->addDamage(source, source->controller(), 1);
if (alreadyPlayedALand){
game->mLayers->stackLayer()->addDamage(source, source->controller(), 1);
}
alreadyPlayedALand = 1;
return 1; return 1;
} }
}; };
+5 -1
View File
@@ -363,7 +363,10 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc
GameObserver * g = GameObserver::GetInstance(); GameObserver * g = GameObserver::GetInstance();
if (!source) p = g->currentlyActing(); if (!source) p = g->currentlyActing();
else p = source->controller(); else p = source->controller();
if (!target) p2 = p; if (!target){
p2 = p;
target = source;//hack ?
}
else p2 = target->controller(); else p2 = target->controller();
if(zoneName.compare("mygraveyard") == 0)return p->game->graveyard; if(zoneName.compare("mygraveyard") == 0)return p->game->graveyard;
if(zoneName.compare("opponentgraveyard") == 0) return p->opponent()->game->graveyard; if(zoneName.compare("opponentgraveyard") == 0) return p->opponent()->game->graveyard;
@@ -377,6 +380,7 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc
if(zoneName.compare("targetownerinplay") == 0) return target->owner->game->inPlay; if(zoneName.compare("targetownerinplay") == 0) return target->owner->game->inPlay;
if(zoneName.compare("targetcontrollerinplay") == 0) return p2->game->inPlay; if(zoneName.compare("targetcontrollerinplay") == 0) return p2->game->inPlay;
if(zoneName.compare("ownerinplay") == 0) return target->owner->game->inPlay; if(zoneName.compare("ownerinplay") == 0) return target->owner->game->inPlay;
if(zoneName.compare("inplay") == 0) return p->game->inPlay;
if(zoneName.compare("myhand") == 0)return p->game->hand; if(zoneName.compare("myhand") == 0)return p->game->hand;
if(zoneName.compare("opponenthand") == 0) return p->opponent()->game->hand; if(zoneName.compare("opponenthand") == 0) return p->opponent()->game->hand;