diff --git a/projects/mtg/include/CardSelector.h b/projects/mtg/include/CardSelector.h index b9ca05181..82dfce537 100644 --- a/projects/mtg/include/CardSelector.h +++ b/projects/mtg/include/CardSelector.h @@ -76,6 +76,7 @@ protected: stack memoryStack; PlayGuiObject* fetchMemory(SelectorMemory&); + float timer; public: CardSelector(GameObserver *observer, DuelLayers*); diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 1d3d69332..94bc7383d 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -2448,7 +2448,7 @@ int AIPlayerBaka::Act(float dt) oldGamePhase = currentGamePhase; if (mFastTimerMode) - timer -= 1; + timer -= dt*3; else timer -= dt; if (timer > 0) diff --git a/projects/mtg/src/CardSelector.cpp b/projects/mtg/src/CardSelector.cpp index 8d89efd1f..aec0cb7e0 100644 --- a/projects/mtg/src/CardSelector.cpp +++ b/projects/mtg/src/CardSelector.cpp @@ -176,7 +176,7 @@ bool CardSelector::CheckUserInput(JButton key) return true; } Target* oldactive = active; - + timer = 250; int x,y; JGE* jge = observer->getInput(); if(!jge) return false; @@ -304,6 +304,10 @@ switch_active: if (active) active->Entering(); } + else + { + timer = 250; + } return true; } @@ -319,6 +323,13 @@ void CardSelector::Update(float dt) position = CardGui::BigWidth / 2; bigpos.x = position; bigpos.Update(dt); + //what i really wanted for this was when you remove your finger from the screen or the pointer of your mouse from the screen area + //i wanted it to reduce the show timer to 0, which keeps the big image from displaying. + //couldn't find a method to check if the finger was still touching the screen that wouldn't break mouse support. + //so instead regitering movement resets the timer, which is set to display for about 5 secs; + //if it gets too annoying we can increase or remove this. + if(timer > 0) + timer -= 1; } void CardSelector::Render() @@ -326,9 +337,10 @@ void CardSelector::Render() if (active) { active->Render(); - if (CardView* card = dynamic_cast(active)) + if (CardView* card = dynamic_cast(active) ) { - card->DrawCard(bigpos, mDrawMode); + if(timer > 0) + card->DrawCard(bigpos, mDrawMode); } } } diff --git a/projects/mtg/src/DeckManager.cpp b/projects/mtg/src/DeckManager.cpp index ab939ee03..8eb638ba9 100644 --- a/projects/mtg/src/DeckManager.cpp +++ b/projects/mtg/src/DeckManager.cpp @@ -229,6 +229,14 @@ int DeckManager::getDifficultyRating(Player *statsPlayer, Player *player) if(player->deckFile != "") { DeckMetaData *meta = getDeckMetaDataByFilename(player->deckFile, (player->isAI() == 1) ); + + if (meta) + { + int diff = meta->getVictoryPercentage(); + meta->mPlayerDeck = statsPlayer->GetCurrentDeckStatsFile(); + meta->mStatsFilename = player->deckFileSmall; + meta->LoadStats(); + } return meta->getDifficulty(); } else diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index df3c5a7a3..2f50e009d 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -971,8 +971,19 @@ void GameStateDuel::OnScroll(int inXVelocity, int inYVelocity) // ignore magnitude for now, since no action requires scrolling if (abs(inYVelocity) > 300) { - bool flickUpwards = (inYVelocity < 0); - mEngine->HoldKey_NoRepeat(flickUpwards ? JGE_BTN_PREV : JGE_BTN_SEC); + /*bool flickUpwards = (inYVelocity < 0);*/ + mEngine->HoldKey_NoRepeat(/*flickUpwards ? JGE_BTN_PREV : */JGE_BTN_SEC); + //removing the activation of "left trigger" or "advance phase" because on high end tablets this gesture + //is picked up by simply looking at the cards in your hand if the resolution of tablet exceed 1800 X ANY. + } + if (abs(inXVelocity) > 300) + { + bool flickLeft = (inYVelocity > 0); + if(flickLeft) + { + JButton trigger = (options[Options::REVERSETRIGGERS].number ? JGE_BTN_PREV : JGE_BTN_NEXT); + mEngine->HoldKey_NoRepeat(trigger); + } } } diff --git a/projects/mtg/src/Rules.cpp b/projects/mtg/src/Rules.cpp index 69ac0e56e..65754c54c 100644 --- a/projects/mtg/src/Rules.cpp +++ b/projects/mtg/src/Rules.cpp @@ -156,17 +156,21 @@ void Rules::addExtraRules(GameObserver* g) int difficultyRating = 0; int Optimizedhandcheat = options[Options::OPTIMIZE_HAND].number; MTGAbility * a = af.parseMagicLine(initState.playerData[i].extraRules[j], id++, NULL, &(g->ExtraRules[i])); - if (p->playMode != Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode - != GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode - != GAME_TYPE_STORY && - g->mRules->gamemode != GAME_TYPE_DEMO && (!g->players[0]->playMode == PLAYER_TYPE_CPU && !g->players[1]->playMode == PLAYER_TYPE_CPU) -#ifdef NETWORK_SUPPORT - && !(g->players[1]->playMode == Player::MODE_HUMAN) -#endif //NETWORK_SUPPORT - )//keep this out of momir and other game modes. - { + + if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI)) + difficultyRating = 0; + else if (g->players[1]->playMode == Player::MODE_HUMAN) + difficultyRating = 0; + else if (p->playMode == Player::MODE_TEST_SUITE) + difficultyRating = 0; + else if (g->mRules->gamemode == GAME_TYPE_MOMIR) + difficultyRating = 0; + else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2) + difficultyRating = 0; + else if (g->mRules->gamemode == GAME_TYPE_STORY) + difficultyRating = 0; + else if (a->aType == MTGAbility::STANDARD_DRAW) difficultyRating = g->getDeckManager()->getDifficultyRating(g->players[0], g->players[1]); - } if (a) { @@ -174,13 +178,23 @@ void Rules::addExtraRules(GameObserver* g) a->canBeInterrupted = false; if (a->oneShot) { - if (((p->isAI() && p->playMode - != Player::MODE_AI && p->opponent()->playMode - != Player::MODE_AI)||( !p->isAI() && Optimizedhandcheat)) && a->aType == MTGAbility::STANDARD_DRAW && - difficultyRating != HARD && p->playMode - != Player::MODE_TEST_SUITE && g->mRules->gamemode != GAME_TYPE_MOMIR && g->mRules->gamemode - != GAME_TYPE_RANDOM1 && g->mRules->gamemode != GAME_TYPE_RANDOM2 && g->mRules->gamemode - != GAME_TYPE_STORY)//stupid protections to keep this out of mimor and other game modes. + if (p->isAI() && (p->playMode == Player::MODE_AI && p->opponent()->playMode== Player::MODE_AI)) + a->resolve(); + else if (a->aType == MTGAbility::STANDARD_DRAW && difficultyRating == HARD) + a->resolve(); + else if (a->aType != MTGAbility::STANDARD_DRAW) + a->resolve(); + else if (!p->isAI() && !Optimizedhandcheat) + a->resolve(); + else if (p->playMode == Player::MODE_TEST_SUITE) + a->resolve(); + else if (g->mRules->gamemode == GAME_TYPE_MOMIR) + a->resolve(); + else if(g->mRules->gamemode == GAME_TYPE_RANDOM1 || g->mRules->gamemode == GAME_TYPE_RANDOM2) + a->resolve(); + else if (g->mRules->gamemode == GAME_TYPE_STORY) + a->resolve(); + else//stupid protections to keep this out of mimor and other game modes. { handsize = ((AADrawer *)a)->getNumCards(); if(difficultyRating == EASY) @@ -198,11 +212,7 @@ void Rules::addExtraRules(GameObserver* g) hand->OptimizedHand(p,handsize, 3, 1, 3);//no rating fall out case. } } - else - {//resolve normally if the deck is listed as hard. - a->resolve(); - } - delete (a); + SAFE_DELETE(a); } else { diff --git a/projects/mtg/src/WResourceManager.cpp b/projects/mtg/src/WResourceManager.cpp index c08030975..387e3ffbe 100644 --- a/projects/mtg/src/WResourceManager.cpp +++ b/projects/mtg/src/WResourceManager.cpp @@ -1166,7 +1166,11 @@ cacheItem* WCache::Get(int id, const string& filename, i Cleanup(); // check if we're doing a card lookup - if (submode & TEXTURE_SUB_CARD) + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /* commented out for the following reason: + cardgui updates so quick that the only reason a person would notice a cache miss is because it takes the + engine longer to switch the card quad from kGeneric to the actual image, than it does to just let the update pass. + if (submode & TEXTURE_SUB_CARD) { // processing a cache miss, return a generic card & queue up an async read @@ -1178,8 +1182,9 @@ cacheItem* WCache::Get(int id, const string& filename, i CacheEngine::Instance()->QueueRequest(filename, submode, lookup); return it->second; - } - + } + */ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Space in cache, make new texture return LoadIntoCache(lookup, filename, submode, style); }