From 53b1b5e9ecd19372516fdc1b4e2bf5cdc4335c17 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Wed, 17 Jun 2009 13:11:45 +0000 Subject: [PATCH] Erwan - Magic 2010 - inplay becomes Battlefield. Wagic is still compatible with both, but try to use "battlefield" from now on. For example moveTo(battlefield) instead of moveTo(inPlay) - Magic 2010 - "Removed from game" becomes "Exile". Wagic is still compatible with both, but try to use "exile" from now on. For example moveTo(exile) instead of moveTo(removedFromGame) - Magic 2010 - "End of turn" step becomes "end" step. Wagic is still compatible with both, but try to use "end" from now on. for example: "@next end" rather than "@next endofturn" (not sure this is more clear than before, but at least it's consistent with the rules) --- projects/mtg/include/MTGGameZones.h | 3 +++ projects/mtg/src/AIPlayer.cpp | 1 - projects/mtg/src/MTGDefinitions.cpp | 4 ++-- projects/mtg/src/MTGGameZones.cpp | 17 +++++++++++++++++ projects/mtg/src/TargetChooser.cpp | 2 +- projects/mtg/src/TestSuiteAI.cpp | 2 +- 6 files changed, 24 insertions(+), 5 deletions(-) diff --git a/projects/mtg/include/MTGGameZones.h b/projects/mtg/include/MTGGameZones.h index e57bc494b..7290e4292 100644 --- a/projects/mtg/include/MTGGameZones.h +++ b/projects/mtg/include/MTGGameZones.h @@ -83,8 +83,11 @@ class MTGPlayerCards { MTGGraveyard * graveyard; MTGHand * hand; MTGInPlay * inPlay; + MTGInPlay * battlefield; //alias to inPlay + MTGStack * stack; MTGRemovedFromGame * removedFromGame; + MTGRemovedFromGame * exile; //alias to removedFromZone MTGGameZone * garbage; MTGAllCards * collection; diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index a7c3c4b73..0c736ce5e 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -571,7 +571,6 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, MTGPlayerCa sprintf(debuf,"Deck File: %s", deckFile); OutputDebugString(debuf); #endif - int deck_cards_ids[100]; MTGDeck * tempDeck = NEW MTGDeck(deckFile, NULL, collection); MTGPlayerCards * deck = NEW MTGPlayerCards(collection,tempDeck); delete tempDeck; diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index bd035d825..ca7bbf008 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -63,7 +63,7 @@ const char* Constants::MTGPhaseNames[] = "Combat damage", "Combat ends", "Main phase 2", - "End of turn", + "End", "Cleanup", "---" }; @@ -81,7 +81,7 @@ const char* Constants::MTGPhaseCodeNames[] = "combatdamage", "combatends", "secondmain", - "endofturn", + "end", "cleanup", "beforenextturn" }; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 49eb28e65..539da187c 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -81,8 +81,11 @@ void MTGPlayerCards::init(){ graveyard = NEW MTGGraveyard(); hand = NEW MTGHand(); inPlay = NEW MTGInPlay(); + battlefield=inPlay; + stack = NEW MTGStack(); removedFromGame = NEW MTGRemovedFromGame(); + exile = removedFromGame; garbage = NEW MTGGameZone(); } @@ -412,6 +415,13 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc if(zoneName.compare("ownerinplay") == 0) return target->owner->game->inPlay; if(zoneName.compare("inplay") == 0) return p->game->inPlay; + if(zoneName.compare("mybattlefield") == 0)return p->game->inPlay; + if(zoneName.compare("opponentbattlefield") == 0) return p->opponent()->game->inPlay; + if(zoneName.compare("targetownerbattlefield") == 0) return target->owner->game->inPlay; + if(zoneName.compare("targetcontrollerbattlefield") == 0) return p2->game->inPlay; + if(zoneName.compare("ownerbattlefield") == 0) return target->owner->game->inPlay; + if(zoneName.compare("battlefield") == 0) return p->game->inPlay; + if(zoneName.compare("myhand") == 0)return p->game->hand; if(zoneName.compare("opponenthand") == 0) return p->opponent()->game->hand; if(zoneName.compare("targetcontrollerhand") == 0) return p2->game->hand; @@ -426,6 +436,13 @@ MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * sourc if(zoneName.compare("ownerremovedfromgame") == 0) return target->owner->game->removedFromGame; if(zoneName.compare("removedfromgame") == 0) return target->owner->game->removedFromGame; + if(zoneName.compare("myexile") == 0)return p->game->removedFromGame; + if(zoneName.compare("opponentexile") == 0) return p->opponent()->game->removedFromGame; + if(zoneName.compare("targetcontrollerexile") == 0) return p2->game->removedFromGame; + if(zoneName.compare("targetownerexile") == 0) return target->owner->game->removedFromGame; + if(zoneName.compare("ownerexile") == 0) return target->owner->game->removedFromGame; + if(zoneName.compare("exile") == 0) return target->owner->game->removedFromGame; + if(zoneName.compare("mylibrary") == 0)return p->game->library; if(zoneName.compare("opponentlibrary") == 0) return p->opponent()->game->library; if(zoneName.compare("targetownerlibrary") == 0) return target->owner->game->library; diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index ca5a3e072..4a2da69bb 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -48,7 +48,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta zones[nbzones] = game->players[0]->game->graveyard; nbzones++; zones[nbzones] = game->players[1]->game->graveyard; - }else if(zoneName.compare("inplay") == 0){ + }else if(zoneName.compare("battlefield") == 0 || zoneName.compare("inplay") == 0){ zones[nbzones] = game->players[0]->game->inPlay; nbzones++; zones[nbzones] = game->players[1]->game->inPlay; diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index fe061a1fd..702888893 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -175,7 +175,7 @@ void TestSuiteState::parsePlayerState(int playerId, string s, TestSuite * suite) area = 1; }else if(areaS.compare("hand") == 0){ area = 2; - }else if(areaS.compare("inplay") == 0 ){ + }else if(areaS.compare("inplay") == 0 || areaS.compare("battlefield") == 0 ){ area = 3; }else if(areaS.compare("life") == 0){ playerData[playerId].life = atoi((s.substr(limiter+1)).c_str());