Exile Corrections

Todo: Update tests to include exile card count...
This commit is contained in:
Anthony Calosa
2015-10-27 01:03:24 +08:00
parent cdf94b281f
commit 4853c8d314
4 changed files with 23 additions and 12 deletions

View File

@@ -15,18 +15,18 @@ GuiAvatars::GuiAvatars(DuelLayers* duelLayers) :
Add(selfGraveyard = NEW GuiGraveyard(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 1, false, mpDuelLayers->getRenderedPlayer(), this));
Add(selfLibrary = NEW GuiLibrary(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 5 + GuiGameZone::Height + 5, false, mpDuelLayers->getRenderedPlayer(), this));
//myexile
Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 + 10, SCREEN_HEIGHT - GuiAvatar::Height, false, mpDuelLayers->getRenderedPlayer(), this));
Add(selfExile = NEW GuiExile(SCREEN_WIDTH - GuiAvatar::Width - GuiGameZone::Width / 2 - 11, SCREEN_HEIGHT - GuiAvatar::Height - 30, false, mpDuelLayers->getRenderedPlayer(), this));
Add(opponent = NEW GuiAvatar(0, 0, false, mpDuelLayers->getRenderedPlayerOpponent(), GuiAvatar::TOP_LEFT, this));
opponent->zoom = 0.9f;
//opponentExile
Add(opponentExile = NEW GuiExile(-30 + GuiAvatar::Width * 1.2 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10,
false, mpDuelLayers->getRenderedPlayerOpponent(), this));
//opponentHand
Add(opponentHand = NEW GuiOpponentHand(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5, false,
mpDuelLayers->getRenderedPlayerOpponent(), this));
//opponentGraveyard
Add(opponentGraveyard = NEW GuiGraveyard(-15 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false,
Add(opponentGraveyard = NEW GuiGraveyard(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5, false,
mpDuelLayers->getRenderedPlayerOpponent(), this));
//opponentHand
Add(opponentHand = NEW GuiOpponentHand(-15 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 35 + GuiGameZone::Height - 10, false,
mpDuelLayers->getRenderedPlayerOpponent(), this));
//opponentLibrary
Add(opponentLibrary = NEW GuiLibrary(5 + GuiAvatar::Width * 1.4 - GuiGameZone::Width / 2, 5 + GuiGameZone::Height + 5, false,
@@ -149,10 +149,12 @@ void GuiAvatars::Render()
float h = 54;
if (opponent == active)
{
r->FillRect(opponent->actX, opponent->actY, 40 * opponent->actZ, h+20 * opponent->actZ, ARGB(200,0,0,0));
r->FillRect(opponent->actX, opponent->actY, w * opponent->actZ, h * opponent->actZ, ARGB(200,0,0,0));
}
else if (self == active)
{
r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h-28 * self->actZ, 24 * self->actZ, h+28 * self->actZ, ARGB(200,0,0,0));
r->FillRect(self->actX - w * self->actZ - 4.5f, self->actY - h * self->actZ, w * self->actZ, h * self->actZ, ARGB(200,0,0,0));
}
GuiLayer::Render();

View File

@@ -166,7 +166,7 @@ void GuiGameZone::Render()
quad->SetColor(ARGB((int)(actA),255,255,255));
if(type == GUI_EXILE)
{
quad->SetColor(ARGB((int)(actA),150,150,150));
quad->SetColor(ARGB((int)(actA),255,240,255));
}
JRenderer::GetInstance()->RenderQuad(quad.get(), actX, actY, 0.0, scale * actZ, scale * actZ);

View File

@@ -1289,6 +1289,10 @@ ostream& operator<<(ostream& out, const MTGPlayerCards& z)
out << "hand=";
out << *(z.hand) << endl;
}
if(z.removedFromGame->cards.size()) {
out << "exile=";
out << *(z.hand) << endl;
}
return out;
}
@@ -1321,6 +1325,11 @@ bool MTGPlayerCards::parseLine(const string& s)
battlefield->parseLine(s.substr(limiter+1));
return true;
}
else if (areaS.compare("removedfromgame") == 0 || areaS.compare("exile") == 0)
{
removedFromGame->parseLine(s.substr(limiter+1));
return true;
}
}
return false;

View File

@@ -46,7 +46,7 @@ MTGCardInstance * TestSuiteAI::getCard(string action)
for (int i = 0; i < 2; i++)
{
Player * p = observer->players[i];
MTGGameZone * zones[] = { p->game->library, p->game->hand, p->game->inPlay, p->game->graveyard, p->game->exile };
MTGGameZone * zones[] = { p->game->library, p->game->hand, p->game->inPlay, p->game->graveyard, p->game->removedFromGame };
for (int j = 0; j < 5; j++)
{
MTGGameZone * zone = zones[j];
@@ -394,12 +394,12 @@ void TestSuiteGame::assertGame()
error++;
}
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->exile };
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->removedFromGame };
MTGGameZone * endstateZones[] = { endState.players[i]->game->graveyard,
endState.players[i]->game->library,
endState.players[i]->game->hand,
endState.players[i]->game->inPlay,
endState.players[i]->game->exile };
endState.players[i]->game->removedFromGame };
for (int j = 0; j < 5; j++)
{
MTGGameZone * zone = playerZones[j];
@@ -854,12 +854,12 @@ void TestSuiteGame::initGame()
stringstream stream;
stream << initState.players[i]->getRandomGenerator()->saveLoadedRandValues(stream);
p->getRandomGenerator()->loadRandValues(stream.str());
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->exile };
MTGGameZone * playerZones[] = { p->game->graveyard, p->game->library, p->game->hand, p->game->inPlay, p->game->removedFromGame };
MTGGameZone * loadedPlayerZones[] = { initState.players[i]->game->graveyard,
initState.players[i]->game->library,
initState.players[i]->game->hand,
initState.players[i]->game->inPlay,
initState.players[i]->game->exile };
initState.players[i]->game->removedFromGame };
for (int j = 0; j < 5; j++)
{
MTGGameZone * zone = playerZones[j];
@@ -912,7 +912,7 @@ MTGPlayerCards * TestSuiteGame::buildDeck(Player* player, int playerId)
MTGGameZone * loadedPlayerZones[] = { initState.players[playerId]->game->graveyard,
initState.players[playerId]->game->library,
initState.players[playerId]->game->hand,
initState.players[playerId]->game->exile,
initState.players[playerId]->game->removedFromGame,
initState.players[playerId]->game->inPlay };
for (int j = 0; j < 5; j++)