Play the Top Card of Library

This commit is contained in:
Anthony Calosa
2017-03-03 18:49:36 +08:00
parent 51daf691b3
commit 21b0b4c524
9 changed files with 287 additions and 123 deletions

View File

@@ -368,18 +368,21 @@ void CardGui::Render()
JQuadPtr ssMask = card->getObserver()->getResourceManager()->GetQuad("white");
//choose attacker mask
if(card->isInPlay(game) && card->isCreature()
&& ((!card->canAttack() || (card->attackCost > 0)) && (!card->canAttack(true) || (card->attackPlaneswalkerCost > 0)))
&& !card->isPhased && !card->didattacked )
if(game->currentPlayer->hasPossibleAttackers())
{
if(game->getCurrentGamePhase() > MTG_PHASE_FIRSTMAIN
&& game->getCurrentGamePhase() < MTG_PHASE_SECONDMAIN
&& card->controller() == game->currentPlayer )
if(card->isInPlay(game) && card->isCreature()
&& ((!card->canAttack() || (card->attackCost > 0)) && (!card->canAttack(true) || (card->attackPlaneswalkerCost > 0)))
&& !card->isPhased && !card->didattacked )
{
if(card->controller()->isHuman() && ssMask)
if(game->getCurrentGamePhase() > MTG_PHASE_FIRSTMAIN
&& game->getCurrentGamePhase() < MTG_PHASE_SECONDMAIN
&& card->controller() == game->currentPlayer )
{
ssMask->SetColor(ARGB(170,64,64,64));
renderer->RenderQuad(ssMask.get(), actX, actY, actT, (27 * actZ + 1) / 16, 40 * actZ / 16);
if(card->controller()->isHuman() && ssMask)
{
ssMask->SetColor(ARGB(170,64,64,64));
renderer->RenderQuad(ssMask.get(), actX, actY, actT, (27 * actZ + 1) / 16, 40 * actZ / 16);
}
}
}
}