- Fix issue #16 (testsuite segfaults if file does not exist)
- Fix issue #37 (Normal Combat Damage is not dealt to creatures when the AI attacks)
- TestSuite now has an "AI" mode (see test/manual/p2_attacks.txt)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-22 06:15:32 +00:00
parent d7657e8bdf
commit 71d4818646
16 changed files with 172 additions and 22 deletions

View File

@@ -26,7 +26,8 @@ enum ENUM_DUEL_STATE
DUEL_STATE_CANCEL,
DUEL_STATE_PLAY,
DUEL_STATE_BACK_TO_MAIN_MENU,
DUEL_STATE_MENU
DUEL_STATE_MENU,
DUEL_STATE_ERROR
};
enum ENUM_DUEL_MENUS
@@ -275,7 +276,11 @@ void GameStateDuel::Update(float dt)
sprintf(buf, "nb cards in player2's graveyard : %i\n",mPlayers[1]->game->graveyard->nb_cards);
LOG(buf);
}else{
mGamePhase = DUEL_STATE_END;
if (!game){
mGamePhase = DUEL_STATE_ERROR;
}else{
mGamePhase = DUEL_STATE_END;
}
}
}
#endif
@@ -402,6 +407,13 @@ void GameStateDuel::Render()
credits->Render();
break;
}
case DUEL_STATE_ERROR:
{
JRenderer * r = JRenderer::GetInstance();
r->ClearScreen(ARGB(200,0,0,0));
mFont->DrawString(_("AN ERROR OCCURED, CHECK FILE NAMES").c_str(),0,SCREEN_HEIGHT/2);
break;
}
case DUEL_STATE_CHOOSE_DECK1:
case DUEL_STATE_CHOOSE_DECK1_TO_2:
case DUEL_STATE_CHOOSE_DECK2: