Issue: 474
modified player status to recognize that test suite has been activated. This is to allow deactivation of "phase skip automation" game setting during test suite. TODO: fix "Phase Skip Automation" such that if turned on the test suite does not break. This fix should be considered temporary
This commit is contained in:
@@ -34,6 +34,7 @@ AIPlayer::AIPlayer(MTGPlayerCards * deck, string file, string fileSmall) : Playe
|
|||||||
stats = NULL;
|
stats = NULL;
|
||||||
agressivity = 50;
|
agressivity = 50;
|
||||||
forceBestAbilityUse = false;
|
forceBestAbilityUse = false;
|
||||||
|
playMode = Player::MODE_AI;
|
||||||
}
|
}
|
||||||
|
|
||||||
AIPlayer::~AIPlayer(){
|
AIPlayer::~AIPlayer(){
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ void GameObserver::Update(float dt){
|
|||||||
oldGamePhase = currentGamePhase;
|
oldGamePhase = currentGamePhase;
|
||||||
|
|
||||||
//Auto skip Phases
|
//Auto skip Phases
|
||||||
int skipLevel = options[Options::ASPHASES].number;
|
int skipLevel = (player->playMode == Player::MODE_TEST_SUITE) ? Constants::ASKIP_NONE :
|
||||||
|
options[Options::ASPHASES].number;
|
||||||
int nrCreatures = currentPlayer->game->inPlay->countByType("Creature");
|
int nrCreatures = currentPlayer->game->inPlay->countByType("Creature");
|
||||||
|
|
||||||
if (skipLevel == Constants::ASKIP_SAFE || skipLevel == Constants::ASKIP_FULL) {
|
if (skipLevel == Constants::ASKIP_SAFE || skipLevel == Constants::ASKIP_FULL) {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ Player::Player(MTGPlayerCards * deck, string file, string fileSmall) : Damageabl
|
|||||||
mAvatar = NULL;
|
mAvatar = NULL;
|
||||||
mAvatarTex = NULL;
|
mAvatarTex = NULL;
|
||||||
type_as_damageable = DAMAGEABLE_PLAYER;
|
type_as_damageable = DAMAGEABLE_PLAYER;
|
||||||
|
playMode = MODE_HUMAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Method to call at the end of a game, before all objects involved in the game are destroyed */
|
/*Method to call at the end of a game, before all objects involved in the game are destroyed */
|
||||||
@@ -84,6 +85,7 @@ Player * Player::opponent(){
|
|||||||
|
|
||||||
HumanPlayer::HumanPlayer(MTGPlayerCards * deck, string file, string fileSmall) : Player(deck, file, fileSmall) {
|
HumanPlayer::HumanPlayer(MTGPlayerCards * deck, string file, string fileSmall) : Player(deck, file, fileSmall) {
|
||||||
loadAvatar("avatar.jpg");
|
loadAvatar("avatar.jpg");
|
||||||
|
playMode = MODE_HUMAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,18 +12,10 @@
|
|||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
|
||||||
enum ENUM_PLAY_MODE
|
|
||||||
{
|
|
||||||
MODE_TEST_SUITE,
|
|
||||||
MODE_HUMAN,
|
|
||||||
MODE_AI,
|
|
||||||
};
|
|
||||||
|
|
||||||
TestSuiteAI::TestSuiteAI(TestSuite * _suite, int playerId):AIPlayerBaka(_suite->buildDeck(playerId),"testsuite", "testsuite","baka.jpg"){
|
TestSuiteAI::TestSuiteAI(TestSuite * _suite, int playerId):AIPlayerBaka(_suite->buildDeck(playerId),"testsuite", "testsuite","baka.jpg"){
|
||||||
suite = _suite;
|
suite = _suite;
|
||||||
timer = 0;
|
timer = 0;
|
||||||
playMode = MODE_TEST_SUITE;
|
playMode = MODE_TEST_SUITE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -329,7 +321,7 @@ int TestSuite::assertGame(){
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < 2; i++){
|
for (int i = 0; i < 2; i++){
|
||||||
TestSuiteAI * p = (TestSuiteAI *)(g->players[i]);
|
TestSuiteAI * p = (TestSuiteAI *)(g->players[i]);
|
||||||
if (p->playMode == MODE_AI) wasAI = true;
|
if (p->playMode == Player::MODE_AI) wasAI = true;
|
||||||
|
|
||||||
if (p->life != endState.playerData[i].life){
|
if (p->life != endState.playerData[i].life){
|
||||||
sprintf(result, "<span class=\"error\">==life problem for player %i. Expected %i, got %i==</span><br />",i,endState.playerData[i].life, p->life);
|
sprintf(result, "<span class=\"error\">==life problem for player %i. Expected %i, got %i==</span><br />",i,endState.playerData[i].life, p->life);
|
||||||
|
|||||||
Reference in New Issue
Block a user