diff --git a/projects/mtg/bin/Res/graphics/iconsideboard.png b/projects/mtg/bin/Res/graphics/iconsideboard.png new file mode 100644 index 000000000..a333e044e Binary files /dev/null and b/projects/mtg/bin/Res/graphics/iconsideboard.png differ diff --git a/projects/mtg/bin/Res/lang/es.txt b/projects/mtg/bin/Res/lang/es.txt index e186a45b2..de66465f6 100644 --- a/projects/mtg/bin/Res/lang/es.txt +++ b/projects/mtg/bin/Res/lang/es.txt @@ -100,6 +100,7 @@ Random 3 Colors=Aleatorio de 3 colores Random 5 Colors=Aleatorio de 5 colores Set Limited=Edicion Limitada Blitzkrieg Mode Unlocked=Modo Asalto relampago desbloqueado +Commander Format=Modo Comandante #Juegos por partida: How many games per match?=Cuantos juegos por partida? diff --git a/projects/mtg/bin/Res/lang/it.txt b/projects/mtg/bin/Res/lang/it.txt index 5e9051cf6..62df76d43 100644 --- a/projects/mtg/bin/Res/lang/it.txt +++ b/projects/mtg/bin/Res/lang/it.txt @@ -86,6 +86,7 @@ Random 3 Colors=Tre colori casuali Random 5 Colors=Cinque colori casuali Set Limited=Edizione limitata Blitzkrieg Mode Unlocked=Modalita Assalto fulmineo sbloccata +Commander Format=Modalita' Commander #Games per match: How many games per match?=Quante mani per partita? diff --git a/projects/mtg/bin/Res/rules/Commander.txt b/projects/mtg/bin/Res/rules/Commander.txt index 8a14e6098..521b10cb4 100644 --- a/projects/mtg/bin/Res/rules/Commander.txt +++ b/projects/mtg/bin/Res/rules/Commander.txt @@ -1,7 +1,7 @@ name=Commander Format unlock=prx_commander [INIT] -mode=mtg +mode=commander #MTG Game specific rules auto=bonusrule @@ -37,6 +37,7 @@ auto=bestowrule [PLAYERS] life:40 offerinterruptonphase=draw +auto=ability$!all(*[iscommander]|myzones) moveto(mycommandzone)!$ controller auto=shuffle auto=draw:7 @@ -67,6 +68,9 @@ auto=@each secondmain:removeMana(*) auto=@each end:removeMana(*) auto=@each cleanup:removeMana(*) +#Monarch rule +auto=@each my endofturn restriction{compare(pmonarch)~morethan~0}:draw:1 + #reset Creature damage at the cleanup phase auto=@each cleanup:all(*|myBattlefield) resetDamage diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 05244c940..1e0ae5123 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -32456,6 +32456,18 @@ power=3 toughness=4 [/card] [card] +name=Path of Ancestry +auto=tap(noevent) +auto=if type(*[red]|myzones)~morethan~0 then transforms((,newability[{T}:add{R} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever +auto=if type(*[white]|myzones)~morethan~0 then transforms((,newability[{T}:add{W} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend}])) forever +auto=if type(*[green]|myzones)~morethan~0 then transforms((,newability[{T}:add{G} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever +auto=if type(*[blue]|myzones)~morethan~0 then transforms((,newability[{T}:add{U} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever +auto=if type(*[black]|myzones)~morethan~0 then transforms((,newability[{T}:add{B} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever +auto=if type(*[-black;-red;-white;-blue;-green]|myzones)~morethan~0 then transforms((,newability[{T}:add{C} && scry:1 scrycore delayed dontshow donothing scrycoreend scryend])) forever +text=Path of Ancestry enters the battlefield tapped. -- {T}: Add one mana of any color in your commander's color identity. When that mana is spent to cast a creature spell that shares a creature type with your commander, scry 1. +type=Land +[/card] +[card] name=Pathmaker Initiate auto={T}:target(creature[power<=2]) unblockable ueot text={T}: Target creature with power 2 or less can't be blocked this turn. @@ -32510,6 +32522,13 @@ mana={2}{G} type=Instant [/card] [card] +name=Pay No Heed +auto=name(prevent all damage) notatarget(*|battlefield,stack,hand,graveyard) transforms((,newability[preventalldamage from(this)])) ueot +text=Prevent all damage a source of your choice would deal this turn. +mana={W} +type=Instant +[/card] +[card] name=Peer into the Abyss auto=choice name(Target opponent) draw:halfuptype:*:opponentlibrary opponent && life:-halfupopponentlifetotal opponent auto=choice name(Target controller) draw:halfuptype:*:mylibrary controller && life:-halfuplifetotal controller @@ -52627,6 +52646,7 @@ toughness=0 [card] name=Yuriko, the Tiger's Shadow autohand={U}{B}{N}:ninjutsu +autocommandzone={U}{B}{N}:ninjutsu auto=@combatdamagefoeof(player) from(ninja|myBattlefield):moveto(myhand) and!( transforms((,newability[damage:manacost opponent])) ueot )! all(*[zpos=1]|mylibrary) auto=@combatdamageof(player) from(ninja|myBattlefield):moveto(myhand) and!( transforms((,newability[damage:manacost controller])) ueot )! all(*[zpos=1]|mylibrary) text=Commander ninjutsu {U}{B} ({U}{B}, Return an unblocked attacker you control to hand: Put this card onto the battlefield from your hand or the command zone tapped and attacking.) -- Whenever a Ninja you control deals combat damage to a player, reveal the top card of your library and put that card into your hand. Each opponent loses life equal to that card's converted mana cost. diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index 7afdd8fbc..bec3cd7f8 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -9958,12 +9958,6 @@ mana={3}{B}{B} type=Sorcery [/card] [card] -name=Pay No Heed -text=Prevent all damage a source of your choice would deal this turn. -mana={W} -type=Instant -[/card] -[card] name=Peace Talks text=This turn and next turn, creatures can't attack, and players and permanents can't be the targets of spells or activated abilities. mana={1}{W} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 8804cc004..6e73806a2 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -429,7 +429,7 @@ private: for (int i = 0; i < 2; i++) { Player * p = card->getObserver()->players[i]; - MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->sideboard, p->game->commandzone };//wish cards use sideboard + MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->commandzone, p->game->sideboard };//wish cards use sideboard for (int k = 0; k < 7; k++) { MTGGameZone * zone = zones[k]; diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 6e2bc01e6..d2a477516 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -133,6 +133,7 @@ class GameObserver{ int isInPlay(MTGCardInstance * card); int isInGrave(MTGCardInstance * card); int isInExile(MTGCardInstance * card); + int isInCommandZone(MTGCardInstance * card); int isInHand(MTGCardInstance * card); int isInLibrary(MTGCardInstance * card); virtual void Update(float dt); diff --git a/projects/mtg/include/GuiAvatars.h b/projects/mtg/include/GuiAvatars.h index 501e530d6..cb59a4cce 100644 --- a/projects/mtg/include/GuiAvatars.h +++ b/projects/mtg/include/GuiAvatars.h @@ -9,6 +9,7 @@ class GuiLibrary; class GuiOpponentHand; class GuiExile; class GuiCommandZone; +class GuiSideboard; class GuiAvatars: public GuiLayer { protected: @@ -18,6 +19,7 @@ protected: GuiOpponentHand *opponentHand; GuiExile* selfExile, *opponentExile; GuiCommandZone* selfCommandZone, *opponentCommandZone; + GuiSideboard* selfSideboard; GuiAvatar* active; public: diff --git a/projects/mtg/include/GuiStatic.h b/projects/mtg/include/GuiStatic.h index 1d28aa268..a783274aa 100644 --- a/projects/mtg/include/GuiStatic.h +++ b/projects/mtg/include/GuiStatic.h @@ -108,4 +108,14 @@ public: virtual ostream& toString(ostream& out) const; }; +class GuiSideboard: public GuiGameZone +{ +public: + Player * player; + GuiSideboard(float _x, float _y, bool hasFocus, Player * player, GuiAvatars* parent); + int receiveEventPlus(WEvent*); + int receiveEventMinus(WEvent*); + virtual ostream& toString(ostream& out) const; +}; + #endif // _GUISTATIC_H_ diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index d73612d69..f04d83bf2 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -104,6 +104,7 @@ public: bool handEffects; bool graveEffects; bool exileEffects; + bool commandZoneEffects; bool suspended; bool miracle; bool hasCopiedToken; diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index 75308de82..265629125 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -23,6 +23,7 @@ typedef enum GAME_TYPE_DEMO, GAME_TYPE_STONEHEWER, GAME_TYPE_HERMIT, + GAME_TYPE_COMMANDER, #ifdef NETWORK_SUPPORT GAME_TYPE_SLAVE, diff --git a/projects/mtg/include/MTGGameZones.h b/projects/mtg/include/MTGGameZones.h index d9135cf47..16eb07007 100644 --- a/projects/mtg/include/MTGGameZones.h +++ b/projects/mtg/include/MTGGameZones.h @@ -230,7 +230,7 @@ public: MTGPlayerCards(MTGDeck * deck); ~MTGPlayerCards(); void initGame(int shuffle = 1, int draw = 1); - void OptimizedHand(Player * who,int amount = 7,int lands = 3,int creatures = 0,int othercards = 4); + void OptimizedHand(Player * who,int amount = 7,int lands = 3,int creatures = 0,int othercards = 4); void setOwner(Player * player); void discardRandom(MTGGameZone * from,MTGCardInstance * source); void drawFromLibrary(); diff --git a/projects/mtg/include/PlayGuiObject.h b/projects/mtg/include/PlayGuiObject.h index b7ec15ac1..e79e20c60 100644 --- a/projects/mtg/include/PlayGuiObject.h +++ b/projects/mtg/include/PlayGuiObject.h @@ -12,6 +12,7 @@ #define GUI_OPPONENTHAND 5 #define GUI_EXILE 6 #define GUI_COMMANDZONE 7 +#define GUI_SIDEBOARD 8 #include #include "WEvent.h" diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index f437342a3..0a22749e7 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -1908,7 +1908,7 @@ int AIPlayerBaka::createAbilityTargets(MTGAbility * a, MTGCardInstance * c, Rank for (int i = 0; i < 2; i++) { Player * p = observer->players[i]; - MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay,p->game->stack,p->game->exile, p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay,p->game->stack,p->game->exile, p->game->commandzone, p->game->sideboard, p->game->reveal }; if(a->getActionTc()->canTarget((Targetable*)p)) { if(a->getActionTc()->maxtargets == 1) @@ -2395,7 +2395,7 @@ int AIPlayerBaka::chooseTarget(TargetChooser * _tc, Player * forceTarget,MTGCard } } MTGPlayerCards * playerZones = target->game; - MTGGameZone * zones[] = { playerZones->hand, playerZones->library, playerZones->inPlay, playerZones->graveyard,playerZones->stack,playerZones->exile,playerZones->reveal, playerZones->sideboard, playerZones->commandzone }; + MTGGameZone * zones[] = { playerZones->hand, playerZones->library, playerZones->inPlay, playerZones->graveyard,playerZones->stack,playerZones->exile,playerZones->commandzone, playerZones->sideboard, playerZones->reveal }; for (int j = 0; j < 9; j++) { MTGGameZone * zone = zones[j]; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 68ecc5918..feed6209e 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -908,6 +908,7 @@ void GameObserver::gameStateBasedEffects() { card->graveEffects = false; card->exileEffects = false; + card->commandZoneEffects = false; if(card->isCreature()) { @@ -1348,6 +1349,8 @@ void GameObserver::ButtonPressed(PlayGuiObject * target) exile->toggleDisplay(); else if (GuiCommandZone* commandzone = dynamic_cast(target)) commandzone->toggleDisplay(); + else if (GuiSideboard* sideboard = dynamic_cast(target)) + sideboard->toggleDisplay(); //opponenthand else if (GuiOpponentHand* opponentHand = dynamic_cast(target)) if (opponentHand->showCards) @@ -1683,6 +1686,17 @@ int GameObserver::isInExile(MTGCardInstance * card) } return 0; } +int GameObserver::isInCommandZone(MTGCardInstance * card) +{ + + for (int i = 0; i < 2; i++) + { + MTGGameZone * commandzone = players[i]->game->commandzone; + if (players[i]->game->isInZone(card,commandzone)) + return 1; + } + return 0; +} int GameObserver::isInHand(MTGCardInstance * card) { diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index cc080255c..2acb98b5e 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -211,7 +211,7 @@ void GameStateDuel::Start() // match mode is available in classic and demo mode. // in both modes player 1 is from type PLAYER_TYPE_CPU - if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) + if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) { //initialize match // only reset "Played Games" and "Victories" info if we didn't come here from within a match @@ -385,7 +385,7 @@ void GameStateDuel::ConstructOpponentMenu() GameStateDuel::selectedAIDeckId, true); int nbUnlockedDecks = options[Options::CHEATMODEAIDECK].number ? 1000 : options[Options::AIDECKS_UNLOCKED].number; - if ((mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&&mParent->players[1] == PLAYER_TYPE_CPU) + if ((mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO) && mParent->players[1] == PLAYER_TYPE_CPU) { if (!tournamentSelection) { @@ -618,7 +618,7 @@ void GameStateDuel::Update(float dt) } else { - if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) + if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_DEMO)) { if (deckmenu && (!popupScreen || popupScreen->isClosed())) deckmenu->Update(dt); } @@ -675,7 +675,7 @@ void GameStateDuel::Update(float dt) } else { - if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) + if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_DEMO)) { ConstructOpponentMenu(); opponentMenu->Update(dt); @@ -766,7 +766,7 @@ void GameStateDuel::Update(float dt) sprintf(temp, "ai_baka_music%i.mp3", OpponentsDeckid); musictrack.assign(temp); } - else if (mParent->gameType == GAME_TYPE_CLASSIC) + else if (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_COMMANDER) musictrack = "ai_baka_music.mp3"; else if (mParent->gameType == GAME_TYPE_MOMIR) musictrack = "ai_baka_music_momir.mp3"; @@ -781,7 +781,7 @@ void GameStateDuel::Update(float dt) GameApp::playMusic(musictrack); // init Score table - if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU) + if ( (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO) && mParent->players[1] == PLAYER_TYPE_CPU) { tournament->updateScoreTable(game->players[0], game->players[1], mParent->gameType); tournament->setScoreDisplayed(false); @@ -799,7 +799,7 @@ void GameStateDuel::Update(float dt) if (game->didWin()) { //the following section will be called only in a classic or demo gamemode and if a tournament or match with more than one game is activ - if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 )) + if ( (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO) && mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 )) { setGamePhase(DUEL_STATE_SHOW_SCORE); /* Determine the winner of this game. @@ -950,7 +950,7 @@ void GameStateDuel::Update(float dt) menu->Add(MENUITEM_LOAD, "Load"); #endif - if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) + if (mParent->players[1] == PLAYER_TYPE_CPU && (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)) { menu->Add(MENUITEM_SHOW_SCORE, "Show current score"); if (mParent->players[0] == PLAYER_TYPE_CPU) @@ -1180,6 +1180,7 @@ void GameStateDuel::Render() && mParent->gameType != GAME_TYPE_SLAVE #endif //NETWORK_SUPPORT && mParent->gameType != GAME_TYPE_STONEHEWER + && mParent->gameType != GAME_TYPE_COMMANDER && mParent->gameType != GAME_TYPE_HERMIT) mFont->DrawString(_("LOADING DECKS").c_str(), 0, SCREEN_HEIGHT / 2); else @@ -2693,7 +2694,7 @@ void Tournament::renderScoreTable() // For some reason, there's currently no player avatar prepared in-game: if (p1IsAI) { - if (mgameType == GAME_TYPE_CLASSIC || mgameType == GAME_TYPE_DEMO) + if (mgameType == GAME_TYPE_COMMANDER || mgameType == GAME_TYPE_CLASSIC || mgameType == GAME_TYPE_DEMO) r->RenderQuad(p1Quad.get(), x_score, 70, 0,1,1); } else @@ -2703,7 +2704,7 @@ void Tournament::renderScoreTable() } if (p0IsAI) { - if (mgameType == GAME_TYPE_CLASSIC || mgameType == GAME_TYPE_DEMO) + if (mgameType == GAME_TYPE_COMMANDER || mgameType == GAME_TYPE_CLASSIC || mgameType == GAME_TYPE_DEMO) r->RenderQuad(p0Quad.get(), x_score+190, 215, 0,1,1); } else diff --git a/projects/mtg/src/GuiAvatars.cpp b/projects/mtg/src/GuiAvatars.cpp index 5c215f924..53796963b 100644 --- a/projects/mtg/src/GuiAvatars.cpp +++ b/projects/mtg/src/GuiAvatars.cpp @@ -18,6 +18,8 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) : Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this)); //mycommandZone Add(selfCommandZone = NEW GuiCommandZone(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 + 9, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this)); + //mySideboard + Add(selfSideboard = NEW GuiSideboard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 + 29, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this)); Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this)); opponent->zoom = 0.9f; @@ -42,13 +44,14 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) : observer->getCardSelector()->Add(selfExile); observer->getCardSelector()->Add(selfCommandZone); observer->getCardSelector()->Add(selfLibrary); + observer->getCardSelector()->Add(selfSideboard); observer->getCardSelector()->Add(opponent); observer->getCardSelector()->Add(opponentGraveyard); observer->getCardSelector()->Add(opponentExile); observer->getCardSelector()->Add(opponentCommandZone); observer->getCardSelector()->Add(opponentLibrary); observer->getCardSelector()->Add(opponentHand); - selfGraveyard->alpha = selfExile->alpha = selfCommandZone->alpha = opponentCommandZone->alpha = opponentExile->alpha = selfLibrary->alpha = opponentGraveyard->alpha = opponentLibrary->alpha = opponentHand->alpha = 0; + selfGraveyard->alpha = selfExile->alpha = selfCommandZone->alpha = selfSideboard->alpha = opponentCommandZone->alpha = opponentExile->alpha = selfLibrary->alpha = opponentGraveyard->alpha = opponentLibrary->alpha = opponentHand->alpha = 0; } float GuiAvatars::LeftBoundarySelf() @@ -71,9 +74,9 @@ void GuiAvatars::Activate(PlayGuiObject* c) active = opponent; opponent->zoom = 1.2f; } - else if ((selfGraveyard == c) || (selfExile == c) || (selfCommandZone == c) || (selfLibrary == c) || (self == c)) + else if ((selfGraveyard == c) || (selfExile == c) || (selfCommandZone == c) || (selfSideboard == c) || (selfLibrary == c) || (self == c)) { - selfGraveyard->alpha = selfExile->alpha = selfCommandZone->alpha = selfLibrary->alpha = 128.0f; + selfGraveyard->alpha = selfExile->alpha = selfSideboard->alpha = selfCommandZone->alpha = selfLibrary->alpha = 128.0f; self->zoom = 1.0f; active = self; } @@ -90,9 +93,9 @@ void GuiAvatars::Deactivate(PlayGuiObject* c) opponent->zoom = 0.9f; active = NULL; } - else if ((selfGraveyard == c) || (selfExile == c) || (selfCommandZone == c) || (selfLibrary == c) || (self == c)) + else if ((selfGraveyard == c) || (selfExile == c) || (selfCommandZone == c) || (selfSideboard == c) || (selfLibrary == c) || (self == c)) { - selfGraveyard->alpha = selfExile->alpha = selfCommandZone->alpha = selfLibrary->alpha = 0; + selfGraveyard->alpha = selfExile->alpha = selfSideboard->alpha = selfCommandZone->alpha = selfLibrary->alpha = 0; self->zoom = 0.5f; active = NULL; } @@ -100,7 +103,7 @@ void GuiAvatars::Deactivate(PlayGuiObject* c) int GuiAvatars::receiveEventPlus(WEvent* e) { - return selfGraveyard->receiveEventPlus(e) | selfExile->receiveEventPlus(e) | selfCommandZone->receiveEventPlus(e) | opponentExile->receiveEventPlus(e) | opponentCommandZone->receiveEventPlus(e) | opponentGraveyard->receiveEventPlus(e) | opponentHand->receiveEventPlus(e); + return selfGraveyard->receiveEventPlus(e) | selfExile->receiveEventPlus(e) | selfSideboard->receiveEventPlus(e) | selfCommandZone->receiveEventPlus(e) | opponentExile->receiveEventPlus(e) | opponentCommandZone->receiveEventPlus(e) | opponentGraveyard->receiveEventPlus(e) | opponentHand->receiveEventPlus(e); } int GuiAvatars::receiveEventMinus(WEvent* e) @@ -108,6 +111,7 @@ int GuiAvatars::receiveEventMinus(WEvent* e) selfGraveyard->receiveEventMinus(e); selfExile->receiveEventMinus(e); selfCommandZone->receiveEventMinus(e); + selfSideboard->receiveEventMinus(e); opponentGraveyard->receiveEventMinus(e); opponentExile->receiveEventMinus(e); opponentCommandZone->receiveEventMinus(e); @@ -127,6 +131,8 @@ bool GuiAvatars::CheckUserInput(JButton key) return true; if (selfCommandZone->CheckUserInput(key)) return true; + if (selfSideboard->CheckUserInput(key)) + return true; if (opponentGraveyard->CheckUserInput(key)) return true; if (opponentExile->CheckUserInput(key)) @@ -149,6 +155,7 @@ void GuiAvatars::Update(float dt) selfGraveyard->Update(dt); selfExile->Update(dt); selfCommandZone->Update(dt); + selfSideboard->Update(dt); opponentHand->Update(dt); opponentGraveyard->Update(dt); opponentExile->Update(dt); @@ -169,8 +176,8 @@ void GuiAvatars::Render() } else if (self == active) { - r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h-28 * self->actZ, 24 * self->actZ + 19, h+28 * self->actZ, ARGB(200,0,0,0)); - //r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h * self->actZ, w * self->actZ, h * self->actZ, ARGB(200,0,0,0)); + r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h-28 * self->actZ, 24 * self->actZ + 35, h+28 * self->actZ, ARGB(200,0,0,0)); + r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h * self->actZ, w * self->actZ, h * self->actZ, ARGB(200,0,0,0)); } GuiLayer::Render(); diff --git a/projects/mtg/src/GuiStatic.cpp b/projects/mtg/src/GuiStatic.cpp index 43b4c7f31..718e990ae 100644 --- a/projects/mtg/src/GuiStatic.cpp +++ b/projects/mtg/src/GuiStatic.cpp @@ -207,7 +207,7 @@ void GuiGameZone::Render() bool showopponenttop = (zone && zone->owner->opponent()->game->battlefield->nb_cards && zone->owner->opponent()->game->battlefield->hasAbility(Constants::SHOWOPPONENTTOPLIBRARY))?true:false; quad->SetColor(ARGB((int)(actA),255,255,255)); - if(type == GUI_EXILE || type == GUI_COMMANDZONE) + if(type == GUI_EXILE || type == GUI_COMMANDZONE || type == GUI_SIDEBOARD) { quad->SetColor(ARGB((int)(actA),255,240,255)); } @@ -218,6 +218,7 @@ void GuiGameZone::Render() JQuadPtr iconlibrary = WResourceManager::Instance()->RetrieveTempQuad("iconlibrary.png"); JQuadPtr iconexile = WResourceManager::Instance()->RetrieveTempQuad("iconexile.png"); JQuadPtr iconcommandzone = WResourceManager::Instance()->RetrieveTempQuad("iconcommandzone.png"); + JQuadPtr iconsideboard = WResourceManager::Instance()->RetrieveTempQuad("iconsideboard.png"); if(iconlibrary && type == GUI_LIBRARY) { @@ -259,6 +260,14 @@ void GuiGameZone::Render() iconcommandzone->SetColor(ARGB((int)(actA),255,255,255)); quad = iconcommandzone; } + if(iconsideboard && type == GUI_SIDEBOARD) + { + scale2 = defaultHeight / iconsideboard->mHeight; + modx = -0.f; + mody = -2.f; + iconsideboard->SetColor(ARGB((int)(actA),255,255,255)); + quad = iconsideboard; + } // if(type == GUI_LIBRARY && zone->nb_cards && !showCards) @@ -575,6 +584,52 @@ ostream& GuiCommandZone::toString(ostream& out) const return out << "GuiCommandZone :::"; } +GuiSideboard::GuiSideboard(float x, float y, bool hasFocus, Player * player, GuiAvatars* parent) : + GuiGameZone(x, y, hasFocus, player->game->sideboard, parent), player(player) +{ + type = GUI_SIDEBOARD; +} + +int GuiSideboard::receiveEventPlus(WEvent* e) +{ + if (WEventZoneChange* event = dynamic_cast(e)) + if (event->to == zone) + { + CardView* t; + if (event->card->view) + t = NEW CardView(CardView::nullZone, event->card, *(event->card->view)); + else + t = NEW CardView(CardView::nullZone, event->card, x, y); + t->x = x + Width / 2; + t->y = y + Height / 2; + t->zoom = 0.6f; + t->alpha = 0; + cards.push_back(t); + return 1; + } + return 0; +} + +int GuiSideboard::receiveEventMinus(WEvent* e) +{ + if (WEventZoneChange* event = dynamic_cast(e)) + if (event->from == zone) + for (vector::iterator it = cards.begin(); it != cards.end(); ++it) + if (event->card->previous == (*it)->card) + { + CardView* cv = *it; + cards.erase(it); + zone->owner->getObserver()->mTrash->trash(cv); + return 1; + } + return 0; +} + +ostream& GuiSideboard::toString(ostream& out) const +{ + return out << "GuiSideboard :::"; +} + //opponenthand begins GuiOpponentHand::GuiOpponentHand(float x, float y, bool hasFocus, Player * player, GuiAvatars* parent) : GuiGameZone(x, y, hasFocus, player->game->hand, parent), player(player) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 5e0e1985c..8f268658d 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -4918,6 +4918,7 @@ int AbilityFactory::getAbilities(vector * v, Spell * spell, MTGCar { card->graveEffects = false; card->exileEffects = false; + card->commandZoneEffects = false; card->handEffects = false; for (int i = 0; i < 2; ++i) { @@ -4945,7 +4946,13 @@ int AbilityFactory::getAbilities(vector * v, Spell * spell, MTGCar card->exileEffects = true; break; } - if (dest == zones->library) + if (dest == zones->commandzone) + { + magicText = card->magicTexts["commandzone"]; + card->commandZoneEffects = true; + break; + } + if (dest == zones->library) { magicText = card->magicTexts["library"]; break; @@ -5847,6 +5854,8 @@ int MTGAbility::testDestroy() return 0; if(source->exileEffects && game->isInExile(source)) return 0; + if(source->commandZoneEffects && game->isInCommandZone(source)) + return 0; if(this->forcedAlive == 1) return 0; if (!game->isInPlay(source)) @@ -6506,7 +6515,7 @@ void ListMaintainerAbility::updateTargets() for (int i = 0; i < 2; i++) { Player * p = game->players[i]; - MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->stack, p->game->exile ,p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->stack, p->game->exile, p->game->commandzone, p->game->sideboard, p->game->reveal }; for (int k = 0; k < 9; k++) { MTGGameZone * zone = zones[k]; @@ -6578,7 +6587,7 @@ void ListMaintainerAbility::checkTargets() for (int i = 0; i < 2; i++) { Player * p = game->players[i]; - MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->stack, p->game->exile, p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->stack, p->game->exile, p->game->commandzone, p->game->sideboard, p->game->reveal }; for (int k = 0; k < 9; k++) { MTGGameZone * zone = zones[k]; diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index cbb6d50d2..25babaed2 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -320,6 +320,7 @@ void MTGCardInstance::initMTGCI() blocked = false; graveEffects = false; exileEffects = false; + commandZoneEffects = false; currentZone = NULL; cardsAbilities = vector(); //cardsAbilitiesFilter = vector(); diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index f181005a6..c4fd02893 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -60,9 +60,9 @@ void MTGPlayerCards::initDeck(MTGDeck * deck) if(card) { MTGCardInstance * newCard = NEW MTGCardInstance(card, this); - //commander zone + //the card is marked as commander ad added to library. newCard->basicAbilities[Constants::ISCOMMANDER] = 1; - commandzone->addCard(newCard); + library->addCard(newCard); } } } @@ -75,43 +75,47 @@ void MTGPlayerCards::initDeck(MTGDeck * deck) for (int j = 0; j < it->second; j++) { MTGCardInstance * newCard = NEW MTGCardInstance(card, this); - if(!commandzone->cards.size()){ //If no commander in Deck there are no limitations for cards. + if(!deck->CommandZone.size()){ //If no commander format there are no limitations for cards. library->addCard(newCard); } else { if(newCard->hasType("Land") && newCard->hasType("Basic")){ //There are no limitations for basic lands cards. library->addCard(newCard); } else{ bool colorFound = false; // All the cards have to share at least one color with commander identity color (any symbol in manacost or magic text). - bool colorless = false; // Colorless card can be always added to deck. - for(unsigned int i = 0; i < commandzone->cards.size() && !colorFound; i++){ - if((newCard->hasColor(Constants::MTG_COLOR_WHITE) && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_WHITE)) || - (newCard->hasColor(Constants::MTG_COLOR_BLACK) && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_BLACK)) || - (newCard->hasColor(Constants::MTG_COLOR_RED) && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_RED)) || - (newCard->hasColor(Constants::MTG_COLOR_BLUE) && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_BLUE)) || - (newCard->hasColor(Constants::MTG_COLOR_GREEN) && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_GREEN)) || - (newCard->hasColor(Constants::MTG_COLOR_WHITE) && commandzone->cards[i]->magicText.find("{w}") != std::string::npos) || - (newCard->hasColor(Constants::MTG_COLOR_BLACK) && commandzone->cards[i]->magicText.find("{b}") != std::string::npos)|| - (newCard->hasColor(Constants::MTG_COLOR_RED) && commandzone->cards[i]->magicText.find("{r}") != std::string::npos) || - (newCard->hasColor(Constants::MTG_COLOR_BLUE) && commandzone->cards[i]->magicText.find("{u}") != std::string::npos) || - (newCard->hasColor(Constants::MTG_COLOR_GREEN) && commandzone->cards[i]->magicText.find("{g}") != std::string::npos) || - (newCard->magicText.find("{w}") != std::string::npos && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_WHITE)) || - (newCard->magicText.find("{b}") != std::string::npos && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_BLACK)) || - (newCard->magicText.find("{r}") != std::string::npos && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_RED)) || - (newCard->magicText.find("{u}") != std::string::npos && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_BLUE)) || - (newCard->magicText.find("{g}") != std::string::npos && commandzone->cards[i]->hasColor(Constants::MTG_COLOR_GREEN)) || - (newCard->magicText.find("{w}") != std::string::npos && commandzone->cards[i]->magicText.find("{w}") != std::string::npos) || - (newCard->magicText.find("{b}") != std::string::npos && commandzone->cards[i]->magicText.find("{b}") != std::string::npos)|| - (newCard->magicText.find("{r}") != std::string::npos && commandzone->cards[i]->magicText.find("{r}") != std::string::npos) || - (newCard->magicText.find("{u}") != std::string::npos && commandzone->cards[i]->magicText.find("{u}") != std::string::npos) || - (newCard->magicText.find("{g}") != std::string::npos && commandzone->cards[i]->magicText.find("{g}") != std::string::npos)){ - colorFound = true; + bool colorless = false; // Colorless card can be always added to deck. + for(unsigned int i = 0; i < deck->CommandZone.size() && !colorFound; i++){ + MTGCard * cmdcard = MTGCollection()->getCardById(atoi(deck->CommandZone[i].c_str())); + if(cmdcard){ + MTGCardInstance * commander = NEW MTGCardInstance(cmdcard, this); + if((newCard->hasColor(Constants::MTG_COLOR_WHITE) && commander->hasColor(Constants::MTG_COLOR_WHITE)) || + (newCard->hasColor(Constants::MTG_COLOR_BLACK) && commander->hasColor(Constants::MTG_COLOR_BLACK)) || + (newCard->hasColor(Constants::MTG_COLOR_RED) && commander->hasColor(Constants::MTG_COLOR_RED)) || + (newCard->hasColor(Constants::MTG_COLOR_BLUE) && commander->hasColor(Constants::MTG_COLOR_BLUE)) || + (newCard->hasColor(Constants::MTG_COLOR_GREEN) && commander->hasColor(Constants::MTG_COLOR_GREEN)) || + (newCard->hasColor(Constants::MTG_COLOR_WHITE) && commander->magicText.find("{w}") != std::string::npos) || + (newCard->hasColor(Constants::MTG_COLOR_BLACK) && commander->magicText.find("{b}") != std::string::npos)|| + (newCard->hasColor(Constants::MTG_COLOR_RED) && commander->magicText.find("{r}") != std::string::npos) || + (newCard->hasColor(Constants::MTG_COLOR_BLUE) && commander->magicText.find("{u}") != std::string::npos) || + (newCard->hasColor(Constants::MTG_COLOR_GREEN) && commander->magicText.find("{g}") != std::string::npos) || + (newCard->magicText.find("{w}") != std::string::npos && commander->hasColor(Constants::MTG_COLOR_WHITE)) || + (newCard->magicText.find("{b}") != std::string::npos && commander->hasColor(Constants::MTG_COLOR_BLACK)) || + (newCard->magicText.find("{r}") != std::string::npos && commander->hasColor(Constants::MTG_COLOR_RED)) || + (newCard->magicText.find("{u}") != std::string::npos && commander->hasColor(Constants::MTG_COLOR_BLUE)) || + (newCard->magicText.find("{g}") != std::string::npos && commander->hasColor(Constants::MTG_COLOR_GREEN)) || + (newCard->magicText.find("{w}") != std::string::npos && commander->magicText.find("{w}") != std::string::npos) || + (newCard->magicText.find("{b}") != std::string::npos && commander->magicText.find("{b}") != std::string::npos)|| + (newCard->magicText.find("{r}") != std::string::npos && commander->magicText.find("{r}") != std::string::npos) || + (newCard->magicText.find("{u}") != std::string::npos && commander->magicText.find("{u}") != std::string::npos) || + (newCard->magicText.find("{g}") != std::string::npos && commander->magicText.find("{g}") != std::string::npos)){ + colorFound = true; + } } } - if(!colorFound) + if(!colorFound) colorless = (newCard->magicText.find("{g}") == std::string::npos && newCard->magicText.find("{w}") == std::string::npos && newCard->magicText.find("{b}") == std::string::npos && - newCard->magicText.find("{r}") == std::string::npos && newCard->magicText.find("{u}") == std::string::npos && !newCard->hasColor(Constants::MTG_COLOR_BLUE) && - !newCard->hasColor(Constants::MTG_COLOR_RED) && !newCard->hasColor(Constants::MTG_COLOR_WHITE) && !newCard->hasColor(Constants::MTG_COLOR_GREEN) && - !newCard->hasColor(Constants::MTG_COLOR_BLACK)); + newCard->magicText.find("{r}") == std::string::npos && newCard->magicText.find("{u}") == std::string::npos && !newCard->hasColor(Constants::MTG_COLOR_BLUE) && + !newCard->hasColor(Constants::MTG_COLOR_RED) && !newCard->hasColor(Constants::MTG_COLOR_WHITE) && !newCard->hasColor(Constants::MTG_COLOR_GREEN) && + !newCard->hasColor(Constants::MTG_COLOR_BLACK)); if(colorFound || colorless){ bool onlyInstance = true; // In commander format only single cards are allowed if they are not basic lands. for(unsigned int k = 0; k < library->cards.size() && onlyInstance; k++){ @@ -460,7 +464,7 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone } //close the currently open MAIN display. - if (from == g->players[i]->game->library || from == g->players[i]->game->graveyard || from == g->players[i]->game->exile || from == g->players[i]->game->commandzone) + if (from == g->players[i]->game->library || from == g->players[i]->game->graveyard || from == g->players[i]->game->exile || from == g->players[i]->game->commandzone || from == g->players[i]->game->sideboard) { if (g->guiOpenDisplay) { diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index 4c0a76976..ca23ec6d3 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -439,7 +439,7 @@ bool Player::parseLine(const string& s) void HumanPlayer::End() { - if(!premade && opponent() && (observer->gameType() == GAME_TYPE_CLASSIC)) + if(!premade && opponent() && (observer->gameType() == GAME_TYPE_CLASSIC || observer->gameType() == GAME_TYPE_COMMANDER)) DeckStats::GetInstance()->saveStats(this, opponent(), observer); } diff --git a/projects/mtg/src/Rules.cpp b/projects/mtg/src/Rules.cpp index 6c0522519..e1681c80e 100644 --- a/projects/mtg/src/Rules.cpp +++ b/projects/mtg/src/Rules.cpp @@ -497,6 +497,8 @@ Player * Rules::initPlayer(GameObserver *g, int playerId) return loadPlayerMomir(g, isAI); case GAME_TYPE_CLASSIC: return NULL; //Error for the time being + case GAME_TYPE_COMMANDER: + return NULL; //Error for the time being case GAME_TYPE_RANDOM1: return loadPlayerRandom(g, isAI, GAME_TYPE_RANDOM1); case GAME_TYPE_RANDOM2: @@ -528,9 +530,12 @@ MTGDeck * Rules::buildDeck(int playerId) initState.playerData[playerId].player->game->library, initState.playerData[playerId].player->game->hand, initState.playerData[playerId].player->game->inPlay, - initState.playerData[playerId].player->game->exile }; + initState.playerData[playerId].player->game->exile, + initState.playerData[playerId].player->game->commandzone, + initState.playerData[playerId].player->game->sideboard, + initState.playerData[playerId].player->game->reveal }; - for (int j = 0; j < 5; j++) + for (int j = 0; j < 7; j++) { for (size_t k = 0; k < loadedPlayerZones[j]->cards.size(); k++) { @@ -605,16 +610,16 @@ void Rules::initGame(GameObserver *g, bool currentPlayerSet) { p->mAvatarName = initState.playerData[i].player->mAvatarName; } - MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->exile , p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->exile , p->game->commandzone, p->game->sideboard, p->game->reveal }; MTGGameZone * loadedPlayerZones[] = { initState.playerData[i].player->game->graveyard, initState.playerData[i].player->game->library, initState.playerData[i].player->game->hand, initState.playerData[i].player->game->inPlay, initState.playerData[i].player->game->exile, - initState.playerData[i].player->game->reveal, + initState.playerData[i].player->game->commandzone, initState.playerData[i].player->game->sideboard, - initState.playerData[i].player->game->commandzone }; - for (int j = 0; j < 5; j++) + initState.playerData[i].player->game->reveal }; + for (int j = 0; j < 7; j++) { MTGGameZone * zone = playerZones[j]; for (size_t k = 0; k < loadedPlayerZones[j]->cards.size(); k++) @@ -699,7 +704,7 @@ Rules::Rules(string _bg) bool Rules::canChooseDeck() { - return (gamemode == GAME_TYPE_CLASSIC || gamemode == GAME_TYPE_STONEHEWER || gamemode == GAME_TYPE_HERMIT); + return (gamemode == GAME_TYPE_CLASSIC || gamemode == GAME_TYPE_STONEHEWER || gamemode == GAME_TYPE_HERMIT || gamemode == GAME_TYPE_COMMANDER); } int Rules::load(string _filename) @@ -826,5 +831,6 @@ GameType Rules::strToGameMode(string s) if (s.compare("story") == 0) return GAME_TYPE_STORY; if (s.compare("stonehewer") == 0) return GAME_TYPE_STONEHEWER; if (s.compare("hermit") == 0) return GAME_TYPE_HERMIT; + if (s.compare("commander") == 0) return GAME_TYPE_COMMANDER; return GAME_TYPE_CLASSIC; } diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 6406fc2e7..9ca3a227b 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -1170,7 +1170,7 @@ bool TargetChooser::validTargetsExist(int maxTargets) int maxAmount = 0; Player *p = observer->players[i]; if (canTarget(p)) return true; - MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->stack, p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->stack, p->game->commandzone, p->game->sideboard, p->game->reveal }; for (int k = 0; k < 9; k++) { MTGGameZone * z = zones[k]; @@ -1204,7 +1204,7 @@ int TargetChooser::countValidTargets(bool withoutProtections) Player *p = observer->players[i]; if(canTarget(p)) result++; - MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->stack, p->game->reveal, p->game->sideboard, p->game->commandzone }; + MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library, p->game->exile, p->game->stack, p->game->commandzone, p->game->sideboard, p->game->reveal }; for (int k = 0; k < 9; k++) { MTGGameZone * z = zones[k];