From d3a7ff7e11c50aa68fff93bb72b040e11311d310 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 10 Sep 2015 06:04:43 +0800 Subject: [PATCH] reinitialize counters on destroy --- projects/mtg/include/MTGCardInstance.h | 4 ++-- projects/mtg/src/AllAbilities.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 3b3c5b6d3..c7132e310 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -72,9 +72,9 @@ public: int regenerateTokens; int isToken; int origpower; - int basepower; + int basepower;//to keep origpower intact int origtoughness; - int basetoughness; + int basetoughness;//to keep origtoughness intact int isMultiColored; int isLeveler; bool enchanted; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 058014c45..1d862ad99 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4186,7 +4186,6 @@ for (it = types.begin(); it != types.end(); it++) oldpowerbonus = _target->power - _target->basepower;//keep bonus if any _target->setPower(oldpowerbonus + val->getValue()); _target->basepower = val->getValue(); - //_target->power += reapplyCountersBonus(_target,false,true); delete val; } if(newtoughnessfound ) @@ -4195,7 +4194,6 @@ for (it = types.begin(); it != types.end(); it++) oldtoughnessbonus = _target->toughness - _target->basetoughness;// keep bonus if any _target->setToughness(oldtoughnessbonus + val->getValue()); _target->basetoughness = val->getValue(); - //_target->addToToughness(reapplyCountersBonus(_target,true,false)); _target->life = _target->toughness; delete val; } @@ -4284,10 +4282,12 @@ int ATransformer::destroy() if(newpowerfound ) { _target->setPower(oldpowerbonus + _target->basepower); + _target->power += reapplyCountersBonus(_target,false,true); } if(newtoughnessfound ) { _target->setToughness(oldtoughnessbonus + _target->basetoughness); + _target->addToToughness(reapplyCountersBonus(_target,true,false)); } if(newAbilityFound) {