From 1430cfd6b462a6851ceac748c163183017d73431 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 28 Feb 2017 17:32:01 +0800 Subject: [PATCH] momir indicator (non PSP) green + can play a land, red + means you already played a land/ or cant play a land anymore. also some minor fix --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 2 +- projects/mtg/src/CardGui.cpp | 27 ++++++++++++++++++-- projects/mtg/src/GameObserver.cpp | 2 ++ projects/mtg/src/GuiPlay.cpp | 5 +++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index dc409e6ce..1509175c9 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -132620,7 +132620,7 @@ type=Instant [card] name=Welkin Guide abilities=flying -auto=target(creature) 2/2 ueot && flying ueot +auto=choice target(creature) 2/2 ueot && flying ueot text=Flying -- When Welkin Guide enters the battlefield, target creature gets +2/+2 and gains flying until end of turn. mana={4}{W} type=Creature diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index d4f84d6c7..a31981179 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -491,7 +491,7 @@ void CardGui::Render() renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); } } - if(!alternate && buff != "" && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... + if(!alternate && buff != "" && game && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... { mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; @@ -501,7 +501,30 @@ void CardGui::Render() mFont->DrawString(buffer, actX - 10 * actZ, actY - (18.3f * actZ)); mFont->SetScale(1); } - +#if !defined (PSP) + if(game && game->gameType() == GAME_TYPE_MOMIR) + { + if(game->isInHand(card) && !card->controller()->isAI()) + { + if ((game->currentPlayer != card->controller()) || (card->controller()->game->playRestrictions->canPutIntoZone(card, card->controller()->game->inPlay) == PlayRestriction::CANT_PLAY)) + { + mFont->SetScale(0.4f); + mFont->SetColor(ARGB(static_cast(actA),255,0,0)); + mFont->SetScale(actZ); + mFont->DrawString("+", actX - 12 * actZ, actY - (18.8f * actZ)); + mFont->SetScale(1); + } + else + { + mFont->SetScale(0.4f); + mFont->SetColor(ARGB(static_cast(actA),0,255,0)); + mFont->SetScale(actZ); + mFont->DrawString("+", actX - 12 * actZ, actY - (18.8f * actZ)); + mFont->SetScale(1); + } + } + } +#endif if (card->counters->mCount > 0) { unsigned c = -1; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 7ba565a51..1d28642b5 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -712,6 +712,8 @@ void GameObserver::gameStateBasedEffects() for (int j = zone->nb_cards - 1; j >= 0; j--) { MTGCardInstance * card = zone->cards[j]; + //lastcontroller zone update + card->lastController = players[i]; card->entersBattlefield = 0; card->LKIpower = card->power; card->LKItoughness = card->toughness; diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index acc5cbb56..39015f586 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -338,7 +338,10 @@ void GuiPlay::Update(float dt) { battleField.Update(dt); for (iterator it = cards.begin(); it != cards.end(); ++it) - (*it)->Update(dt); + { + if((*it)) + (*it)->Update(dt); + } } int GuiPlay::receiveEventPlus(WEvent * e)