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:
@@ -374,6 +374,14 @@ private:
|
||||
{
|
||||
intValue = target->controller()->opponent()->life;
|
||||
}
|
||||
else if (s == "pdrewcount")
|
||||
{
|
||||
intValue = target->controller()->drawCounter;
|
||||
}
|
||||
else if (s == "odrewcount")
|
||||
{
|
||||
intValue = target->controller()->opponent()->drawCounter;
|
||||
}
|
||||
else if (s == "p" || s == "power")
|
||||
{
|
||||
intValue = target->getPower();
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
int offerInterruptOnPhase;
|
||||
int skippingTurn;
|
||||
int extraTurn;
|
||||
int drawCounter;
|
||||
vector<MTGCardInstance*>curses;
|
||||
Player(GameObserver *observer, string deckFile, string deckFileSmall, MTGDeck * deck = NULL);
|
||||
virtual ~Player();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -203,6 +203,7 @@ void GameObserver::nextGamePhase()
|
||||
{
|
||||
cleanupPhase();
|
||||
currentPlayer->damageCount = 0;
|
||||
currentPlayer->drawCounter = 0;
|
||||
currentPlayer->opponent()->damageCount = 0; //added to clear odcount
|
||||
currentPlayer->preventable = 0;
|
||||
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
|
||||
@@ -227,6 +228,7 @@ void GameObserver::nextGamePhase()
|
||||
currentPlayer->game->putInGraveyard(currentPlayer->game->hand->cards[0]);
|
||||
}
|
||||
mLayers->actionLayer()->Update(0);
|
||||
currentPlayer->drawCounter = 0;
|
||||
currentPlayer->lifeLostThisTurn = 0;
|
||||
currentPlayer->opponent()->lifeLostThisTurn = 0;
|
||||
currentPlayer->doesntEmpty->remove(currentPlayer->doesntEmpty);
|
||||
|
||||
@@ -32,6 +32,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
|
||||
playMode = MODE_HUMAN;
|
||||
skippingTurn = 0;
|
||||
extraTurn = 0;
|
||||
drawCounter = 0;
|
||||
doesntEmpty = NEW ManaCost();
|
||||
poolDoesntEmpty = NEW ManaCost();
|
||||
if (deck != NULL)
|
||||
|
||||
Reference in New Issue
Block a user