-bug fix (credits cheat with empty deck evil twin mode)
-bug fix ("combat ends" message instead of "Combat Damage(2)" in stack)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-15 13:35:08 +00:00
parent ce39961d78
commit 11ffebf29f
2 changed files with 29 additions and 23 deletions
+22 -18
View File
@@ -40,6 +40,7 @@ void Credits::compute(Player * _p1, Player * _p2, GameApp * _app){
app = _app; app = _app;
showMsg = (rand() % 5); showMsg = (rand() % 5);
GameObserver * g = GameObserver::GetInstance(); GameObserver * g = GameObserver::GetInstance();
if (!g->turn) return;
if (!p1->isAI() && p2->isAI() && p1!= g->gameOver){ if (!p1->isAI() && p2->isAI() && p1!= g->gameOver){
value = 400; value = 400;
if (app->gameType != GAME_TYPE_CLASSIC) value = 200; if (app->gameType != GAME_TYPE_CLASSIC) value = 200;
@@ -144,29 +145,32 @@ void Credits::Render(){
f2->SetScale(1); f2->SetScale(1);
f3->SetScale(1); f3->SetScale(1);
char buffer[512]; char buffer[512];
if (!p1->isAI() && p2->isAI() ){ if (!g->turn){
if (g->gameOver != p1){ sprintf(buffer, _("Please check your deck (not enough cards?)").c_str() );
sprintf (buffer, _("Congratulations! You earn %i credits").c_str(), value); }else{
if (unlockedQuad){ if (!p1->isAI() && p2->isAI() ){
showMsg = 0; if (g->gameOver != p1){
r->RenderQuad(unlockedQuad, 20, 20); sprintf (buffer, _("Congratulations! You earn %i credits").c_str(), value);
} if (unlockedQuad){
if(unlockedString.size()){ showMsg = 0;
f2->DrawString(unlockedString.c_str(),SCREEN_WIDTH/2, 80,JGETEXT_CENTER); r->RenderQuad(unlockedQuad, 20, 20);
}
if(unlockedString.size()){
f2->DrawString(unlockedString.c_str(),SCREEN_WIDTH/2, 80,JGETEXT_CENTER);
}
}else{
sprintf (buffer, _("You have been defeated").c_str());
} }
}else{ }else{
sprintf (buffer, _("You have been defeated").c_str()); int winner = 2;
if (g->gameOver !=p1){
winner = 1;
}
int p0life = p1->life;
sprintf(buffer, _("Player %i wins (%i)").c_str(), winner, p0life );
} }
}else{
int winner = 2;
if (g->gameOver !=p1){
winner = 1;
}
int p0life = p1->life;
sprintf(buffer, _("Player %i wins (%i)").c_str(), winner, p0life );
} }
float y = 130; float y = 130;
if (showMsg == 1) y = 50; if (showMsg == 1) y = 50;
vector<CreditBonus *>:: iterator it; vector<CreditBonus *>:: iterator it;
+7 -5
View File
@@ -24,15 +24,17 @@ PhaseRing::~PhaseRing(){
} }
} }
//This needs to be controlled either by GameObserver or PhaseRing in the future //Tells if next phase will be another Damage phase rather than combat ends
bool PhaseRing::extraDamagePhase(int id){ bool PhaseRing::extraDamagePhase(int id){
GameObserver * g = GameObserver::GetInstance(); GameObserver * g = GameObserver::GetInstance();
if (id != Constants::MTG_PHASE_COMBATEND) return false; if (id != Constants::MTG_PHASE_COMBATEND) return false;
if (g->combatStep != END_FIRST_STRIKE) return false; if (g->combatStep != END_FIRST_STRIKE) return false;
MTGGameZone * z = g->currentPlayer->game->inPlay; for (int j = 0; j < 2; ++j){
for (int i= 0; i < z->nb_cards; ++i){ MTGGameZone * z = g->players[j]->game->inPlay;
MTGCardInstance * card = z->cards[i]; for (int i= 0; i < z->nb_cards; ++i){
if (card->isAttacker() && !(card->has(Constants::FIRSTSTRIKE) || card->has(Constants::DOUBLESTRIKE))) return true; MTGCardInstance * card = z->cards[i];
if ((card->isAttacker() || card->isDefenser()) && !(card->has(Constants::FIRSTSTRIKE) || card->has(Constants::DOUBLESTRIKE))) return true;
}
} }
return false; return false;
} }