diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index e02df1394..5794f1bc5 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -42,6 +42,7 @@ dingus_egg.txt doomed_necromancer.txt dragon_fodder.txt drain_life.txt +fastbond.txt flare.txt foratog.txt force_of_nature.txt @@ -86,4 +87,4 @@ tranquil_domain.txt volcanic_island.txt white_knight1.txt wrath_of_god.txt -zombie_master.txt \ No newline at end of file +zombie_master.txt diff --git a/projects/mtg/bin/Res/test/fastbond.txt b/projects/mtg/bin/Res/test/fastbond.txt new file mode 100644 index 000000000..0b9a4f26c --- /dev/null +++ b/projects/mtg/bin/Res/test/fastbond.txt @@ -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] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 89c3da6fc..a3e38ce30 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1828,6 +1828,7 @@ class AErgRaiders:public MTGAbility{ class AFastbond:public TriggeredAbility{ public: int alreadyPlayedALand; + int previous; AFastbond(int _id, MTGCardInstance * card):TriggeredAbility(_id, card){ alreadyPlayedALand = 0; } @@ -1840,16 +1841,19 @@ class AFastbond:public TriggeredAbility{ } 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; } int resolve(){ - source->controller()->canPutLandsIntoPlay = 1; - if (alreadyPlayedALand){ - game->mLayers->stackLayer()->addDamage(source, source->controller(), 1); - } - alreadyPlayedALand = 1; + game->mLayers->stackLayer()->addDamage(source, source->controller(), 1); return 1; } }; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index a0f9eaf9d..d9d1b17be 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -363,7 +363,10 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc GameObserver * g = GameObserver::GetInstance(); if (!source) p = g->currentlyActing(); else p = source->controller(); - if (!target) p2 = p; + if (!target){ + p2 = p; + target = source;//hack ? + } else p2 = target->controller(); if(zoneName.compare("mygraveyard") == 0)return p->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("targetcontrollerinplay") == 0) return p2->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("opponenthand") == 0) return p->opponent()->game->hand;