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
+6
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;
+2
View File
@@ -211,11 +211,13 @@ void GameObserver::nextGamePhase()
{
cleanupPhase();
currentPlayer->damageCount = 0;
currentPlayer->nonCombatDamage = 0;
currentPlayer->drawCounter = 0;
currentPlayer->raidcount = 0;
currentPlayer->opponent()->raidcount = 0;
currentPlayer->prowledTypes.clear();
currentPlayer->opponent()->damageCount = 0; //added to clear odcount
currentPlayer->opponent()->nonCombatDamage = 0;
currentPlayer->preventable = 0;
mLayers->actionLayer()->cleanGarbage(); //clean abilities history for this turn;
mLayers->stackLayer()->garbageCollect(); //clean stack history for this turn;
+1
View File
@@ -26,6 +26,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
nomaxhandsize = false;
poisonCount = 0;
damageCount = 0;
nonCombatDamage = 0;
preventable = 0;
mAvatarTex = NULL;
type_as_damageable = DAMAGEABLE_PLAYER;