diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index ff2f0ff94..ae0d4985a 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -206,9 +206,9 @@ bool AIPlayer::payTheManaCost(ManaCost * cost, MTGCardInstance * target,vectorinit(); - GameObserver * go = GameObserver::GetInstance(); vectorclicks = vector(); + + paid->init(); for(int k = 0;k < int(gotPayments.size());k++) { AManaProducer * amp = dynamic_cast (gotPayments[k]); @@ -2197,7 +2197,7 @@ int AIPlayerBaka::computeActions() if (targetResult) return 1; } - int currentGamePhase = g->getCurrentGamePhase(); + static bool findingCard = false; //this guard is put in place to prevent Ai from //ever running computeActions() function WHILE its already doing so. diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index eb3ff6771..260341037 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -254,7 +254,7 @@ AAPhaseOut::AAPhaseOut(int _id, MTGCardInstance * _source, MTGCardInstance * _ta } int AAPhaseOut::resolve() -{GameObserver * g = GameObserver::GetInstance(); +{ MTGCardInstance * _target = (MTGCardInstance *) target; if (_target) { @@ -516,7 +516,6 @@ int AAProliferate::resolve() } else if (target->typeAsTarget() == TARGET_CARD && ((MTGCardInstance*)target)->counters) { - Counter * targetCounter = NULL; for(unsigned int i = 0; i < ((MTGCardInstance*)target)->counters->counters.size();i++) { MTGAbility * a = NEW AACounter(game->mLayers->actionLayer()->getMaxId(), source, (MTGCardInstance*)target,"", ((MTGCardInstance*)target)->counters->counters[i]->name.c_str(), ((MTGCardInstance*)target)->counters->counters[i]->power, ((MTGCardInstance*)target)->counters->counters[i]->toughness, 1,0); diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index a6c01222a..cf821965e 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -404,7 +404,7 @@ void GameApp::Render() if (mFont) { mFont->SetColor(ARGB(255,255,255,255)); - mFont->DrawString(buf, 10, SCREEN_HEIGHT-15); + mFont->DrawString(buf, 10, SCREEN_HEIGHT-25); } #endif diff --git a/projects/mtg/src/GameStateAwards.cpp b/projects/mtg/src/GameStateAwards.cpp index a12a6b760..450742513 100644 --- a/projects/mtg/src/GameStateAwards.cpp +++ b/projects/mtg/src/GameStateAwards.cpp @@ -13,7 +13,11 @@ enum ENUM_AWARDS_STATE { - STATE_LISTVIEW, STATE_DETAILS, + STATE_LISTVIEW, + STATE_DETAILS, + EXIT_AWARDS_MENU = -102, + GUI_AWARD_BUTTON = -103, + }; namespace @@ -64,31 +68,31 @@ void GameStateAwards::Start() listview->Add(wgh); aw = NEW WGuiAward(Options::DIFFICULTY_MODE_UNLOCKED, "Difficulty Modes", "Achieved a 66% victory ratio."); - btn = NEW WGuiButton(aw, -103, Options::DIFFICULTY_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::DIFFICULTY_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::MOMIR_MODE_UNLOCKED, "Momir Mode", "Won with exactly 8 lands."); - btn = NEW WGuiButton(aw, -103, Options::MOMIR_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::MOMIR_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::STONEHEWER_MODE_UNLOCKED, "Stone Hewer Mode", "Won with more than 10 equipments."); - btn = NEW WGuiButton(aw, -103, Options::STONEHEWER_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::STONEHEWER_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::HERMIT_MODE_UNLOCKED, "Hermit Druid Mode", "Won with less than 10 lands."); - btn = NEW WGuiButton(aw, -103, Options::HERMIT_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::HERMIT_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::EVILTWIN_MODE_UNLOCKED, "Evil Twin Mode", "Won with same army size."); - btn = NEW WGuiButton(aw, -103, Options::EVILTWIN_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::EVILTWIN_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::RANDOMDECK_MODE_UNLOCKED, "Random Deck Mode", "Won against a higher difficulty."); - btn = NEW WGuiButton(aw, -103, Options::RANDOMDECK_MODE_UNLOCKED, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::RANDOMDECK_MODE_UNLOCKED, this); listview->Add(btn); aw = NEW WGuiAward(Options::AWARD_COLLECTOR, "Valuable Collection", "Collection valued over 10,000c.", "Collection Info"); - btn = NEW WGuiButton(aw, -103, Options::AWARD_COLLECTOR, this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::AWARD_COLLECTOR, this); listview->Add(btn); wgh = NEW WGuiHeader(""); @@ -115,7 +119,7 @@ void GameStateAwards::Start() aw = NEW WGuiAward(Options::optionSet(i), si->getName(), buf, "Card Spoiler"); aw->mFlags = WGuiItem::NO_TRANSLATE; - btn = NEW WGuiButton(aw, -103, Options::optionSet(i), this); + btn = NEW WGuiButton(aw, GUI_AWARD_BUTTON, Options::optionSet(i), this); listview->Add(btn); } if (locked) @@ -176,6 +180,7 @@ void GameStateAwards::Update(float dt) else { JButton key = JGE_BTN_NONE; + while ((key = JGE::GetInstance()->ReadButton())) { switch (key) @@ -183,7 +188,7 @@ void GameStateAwards::Update(float dt) case JGE_BTN_MENU: showMenu = true; SAFE_DELETE(menu); - menu = NEW SimpleMenu(-102, this, Fonts::MENU_FONT, 50, 170); + menu = NEW SimpleMenu(EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170); if (mState == STATE_DETAILS) menu->Add(kBackToTrophiesID, "Back to Trophies"); menu->Add(kBackToMainMenuID, "Back to Main Menu"); @@ -355,7 +360,7 @@ bool GameStateAwards::enterStats(int option) } void GameStateAwards::ButtonPressed(int controllerId, int controlId) { - if (controllerId == -102) + if (controllerId == EXIT_AWARDS_MENU) switch (controlId) { case kBackToMainMenuID: @@ -371,7 +376,7 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId) showMenu = false; break; } - else if (controllerId == -103) + else if (controllerId == GUI_AWARD_BUTTON) { int setid = controlId - Options::SET_UNLOCKS; diff --git a/projects/mtg/src/GameStateShop.cpp b/projects/mtg/src/GameStateShop.cpp index a60c711ae..a67a3885b 100644 --- a/projects/mtg/src/GameStateShop.cpp +++ b/projects/mtg/src/GameStateShop.cpp @@ -831,9 +831,9 @@ void GameStateShop::OnScroll(int inXVelocity, int inYVelocity) { if (abs(inXVelocity) > 200) { - bool flickLeft = (inXVelocity < 0); - if(!flickLeft) - mEngine->HoldKey_NoRepeat(JGE_BTN_PRI); + bool flickRight = (inXVelocity >= 0); + if (flickRight) + mEngine->HoldKey_NoRepeat(JGE_BTN_PRI); } }