added lifegain and oplifegain variable used the same as lifelost, but stores the value of life gained this turn.
This commit is contained in:
@@ -248,6 +248,8 @@ void GameObserver::nextGamePhase()
|
||||
currentPlayer->prowledTypes.clear();
|
||||
currentPlayer->lifeLostThisTurn = 0;
|
||||
currentPlayer->opponent()->lifeLostThisTurn = 0;
|
||||
currentPlayer->lifeGainedThisTurn = 0;
|
||||
currentPlayer->opponent()->lifeGainedThisTurn = 0;
|
||||
currentPlayer->doesntEmpty->remove(currentPlayer->doesntEmpty);
|
||||
currentPlayer->opponent()->doesntEmpty->remove(currentPlayer->opponent()->doesntEmpty);
|
||||
nextPlayer();
|
||||
|
||||
@@ -166,6 +166,10 @@ int Player::gainOrLoseLife(int value)
|
||||
life+=value;
|
||||
if (value<0)
|
||||
lifeLostThisTurn += abs(value);
|
||||
else if (value > 0)
|
||||
{
|
||||
lifeGainedThisTurn += abs(value);
|
||||
}
|
||||
|
||||
//Send life event to listeners
|
||||
WEvent * lifed = NEW WEventLife(this,value);
|
||||
|
||||
Reference in New Issue
Block a user