adding life loss event sending to damage from creature sources in combat.

This commit is contained in:
omegablast2002@yahoo.com
2011-01-29 22:32:34 +00:00
parent 4103a8964f
commit 50aa62675e

View File

@@ -171,7 +171,13 @@ int Damage::resolve()
//return the left over amount after effects have been applied to them.
a = target->dealDamage(damage);
target->damageCount += 1;
target->lifeLostThisTurn += damage;
if (target->type_as_damageable == DAMAGEABLE_PLAYER)
{
target->lifeLostThisTurn += damage;
WEvent * lifed = NEW WEventLife((Player*)target,-damage);
GameObserver * game = GameObserver::GetInstance();
game->receiveEvent(lifed);
}
}
//Send (Damage/Replaced effect) event to listeners