Merge pull request #779 from zethfoxster/master

pushing to master
This commit is contained in:
zethfoxster
2016-07-21 22:31:17 -04:00
committed by GitHub
4 changed files with 16 additions and 1 deletions

View File

@@ -658,6 +658,14 @@ private:
{
intValue = target->controller()->lifeLostThisTurn;
}
else if (s == "oplifegain")
{
intValue = target->controller()->opponent()->lifeGainedThisTurn;
}
else if (s == "lifegain")
{
intValue = target->controller()->lifeGainedThisTurn;
}
else if (s == "pdcount")
{
intValue = target->controller()->damageCount;

View File

@@ -27,11 +27,12 @@ public:
int preventable;
int thatmuch;
int lifeLostThisTurn;
int lifeGainedThisTurn;
DamageableType type_as_damageable;
Damageable(GameObserver* observer, int _life)
: Targetable(observer), life(_life), handsize(0),
poisonCount(0), damageCount(0), preventable(0), thatmuch(0),
lifeLostThisTurn(0), type_as_damageable(DAMAGEABLE_MTGCARDINSTANCE)
lifeLostThisTurn(0), lifeGainedThisTurn(0), type_as_damageable(DAMAGEABLE_MTGCARDINSTANCE)
{}
int getLife(){return life;}
virtual int dealDamage(int damage){life-=damage;return life;}

View File

@@ -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();

View File

@@ -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);