reinitialize counters on destroy

This commit is contained in:
Anthony Calosa
2015-09-10 06:04:43 +08:00
parent c1e9fad271
commit d3a7ff7e11
2 changed files with 4 additions and 4 deletions

View File

@@ -72,9 +72,9 @@ public:
int regenerateTokens; int regenerateTokens;
int isToken; int isToken;
int origpower; int origpower;
int basepower; int basepower;//to keep origpower intact
int origtoughness; int origtoughness;
int basetoughness; int basetoughness;//to keep origtoughness intact
int isMultiColored; int isMultiColored;
int isLeveler; int isLeveler;
bool enchanted; bool enchanted;

View File

@@ -4186,7 +4186,6 @@ for (it = types.begin(); it != types.end(); it++)
oldpowerbonus = _target->power - _target->basepower;//keep bonus if any oldpowerbonus = _target->power - _target->basepower;//keep bonus if any
_target->setPower(oldpowerbonus + val->getValue()); _target->setPower(oldpowerbonus + val->getValue());
_target->basepower = val->getValue(); _target->basepower = val->getValue();
//_target->power += reapplyCountersBonus(_target,false,true);
delete val; delete val;
} }
if(newtoughnessfound ) if(newtoughnessfound )
@@ -4195,7 +4194,6 @@ for (it = types.begin(); it != types.end(); it++)
oldtoughnessbonus = _target->toughness - _target->basetoughness;// keep bonus if any oldtoughnessbonus = _target->toughness - _target->basetoughness;// keep bonus if any
_target->setToughness(oldtoughnessbonus + val->getValue()); _target->setToughness(oldtoughnessbonus + val->getValue());
_target->basetoughness = val->getValue(); _target->basetoughness = val->getValue();
//_target->addToToughness(reapplyCountersBonus(_target,true,false));
_target->life = _target->toughness; _target->life = _target->toughness;
delete val; delete val;
} }
@@ -4284,10 +4282,12 @@ int ATransformer::destroy()
if(newpowerfound ) if(newpowerfound )
{ {
_target->setPower(oldpowerbonus + _target->basepower); _target->setPower(oldpowerbonus + _target->basepower);
_target->power += reapplyCountersBonus(_target,false,true);
} }
if(newtoughnessfound ) if(newtoughnessfound )
{ {
_target->setToughness(oldtoughnessbonus + _target->basetoughness); _target->setToughness(oldtoughnessbonus + _target->basetoughness);
_target->addToToughness(reapplyCountersBonus(_target,true,false));
} }
if(newAbilityFound) if(newAbilityFound)
{ {