add nonCombatDamage count

This commit is contained in:
Anthony Calosa
2016-08-04 09:56:53 +08:00
parent 8ba97b8a74
commit 1ab88940f9
6 changed files with 19 additions and 1 deletions

View File

@@ -184,6 +184,8 @@ int Damage::resolve()
if(!_target->inPlay()->hasAbility(Constants::POISONSHROUD))
_target->poisonCount += damage;//this will be changed to poison counters.
_target->damageCount += damage;
if(typeOfDamage == 2)
target->nonCombatDamage += damage;
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
{
vector<string> values = MTGAllCards::getCreatureValuesById();
@@ -202,6 +204,8 @@ int Damage::resolve()
if(!_target->inPlay()->hasAbility(Constants::CANTCHANGELIFE))
a = target->dealDamage(damage);
target->damageCount += damage;
if(typeOfDamage == 2)
target->nonCombatDamage += damage;
if ( typeOfDamage == 1 && target == source->controller()->opponent() )//add vector prowledtypes.
{
vector<string> values = MTGAllCards::getCreatureValuesById();
@@ -237,6 +241,8 @@ int Damage::resolve()
else
a = target->dealDamage(damage);
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount
if(typeOfDamage == 2)
target->nonCombatDamage += damage;
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){
((MTGCardInstance*)target)->wasDealtDamage = true;
((MTGCardInstance*)source)->damageToCreature = true;