added drawCounter. Returns the number of cards drawn this turn (excludes pre-game draw).

pdrewcount - player draw count
odrewcount - opponent draw count
This commit is contained in:
anthonycalosa@gmail.com
2013-05-18 15:31:12 +00:00
parent ba5debad05
commit cf74c3480e
5 changed files with 19 additions and 0 deletions
+7
View File
@@ -1506,6 +1506,13 @@ AADrawer::AADrawer(GameObserver* observer, int _id, MTGCardInstance * card, Targ
game->mLayers->stackLayer()->resolve();
for(int i = numCards.getValue(); i > 0;i--)
{
player->drawCounter += 1;
if ((game->turn < 1) && game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
&& game->currentPlayer->game->inPlay->nb_cards == 0 && game->currentPlayer->game->graveyard->nb_cards == 0
&& game->currentPlayer->game->exile->nb_cards == 0 && game->currentlyActing() == (Player*)game->currentPlayer) //1st Play Check
{
game->currentPlayer->drawCounter = 0;//Reset drawCounter for pre-game draw
}
WEvent * e = NEW WEventcardDraw(player, 1);
game->receiveEvent(e);
}