From c1e9fad271c9792d167dc6ecfff731525659366f Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Thu, 10 Sep 2015 05:26:09 +0800 Subject: [PATCH] added basepower and basetoughness added these two so if we want to access original power and toughness, we can point to origpower and origtoughness respectively. --- projects/mtg/include/MTGCardInstance.h | 2 ++ projects/mtg/src/AllAbilities.cpp | 12 ++++++------ projects/mtg/src/MTGCardInstance.cpp | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 82053bcf1..3b3c5b6d3 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -72,7 +72,9 @@ public: int regenerateTokens; int isToken; int origpower; + int basepower; int origtoughness; + int basetoughness; int isMultiColored; int isLeveler; bool enchanted; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 4bfff0d2a..058014c45 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -4183,18 +4183,18 @@ for (it = types.begin(); it != types.end(); it++) if(newpowerfound ) {//setting p/t only overrides base p/t as of M15 changes WParsedInt * val = NEW WParsedInt(newpower,NULL, source); - oldpowerbonus = _target->power - _target->origpower;//keep bonus if any + oldpowerbonus = _target->power - _target->basepower;//keep bonus if any _target->setPower(oldpowerbonus + val->getValue()); - _target->origpower = val->getValue(); + _target->basepower = val->getValue(); //_target->power += reapplyCountersBonus(_target,false,true); delete val; } if(newtoughnessfound ) {//setting p/t only overrides base p/t as of M15 changes WParsedInt * val = NEW WParsedInt(newtoughness,NULL, source); - oldtoughnessbonus = _target->toughness - _target->origtoughness;// keep bonus if any + oldtoughnessbonus = _target->toughness - _target->basetoughness;// keep bonus if any _target->setToughness(oldtoughnessbonus + val->getValue()); - _target->origtoughness = val->getValue(); + _target->basetoughness = val->getValue(); //_target->addToToughness(reapplyCountersBonus(_target,true,false)); _target->life = _target->toughness; delete val; @@ -4283,11 +4283,11 @@ int ATransformer::destroy() if(newpowerfound ) { - _target->setPower(oldpowerbonus + _target->origpower); + _target->setPower(oldpowerbonus + _target->basepower); } if(newtoughnessfound ) { - _target->setToughness(oldtoughnessbonus + _target->origtoughness); + _target->setToughness(oldtoughnessbonus + _target->basetoughness); } if(newAbilityFound) { diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index b957afa0c..c2daef4a1 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -36,7 +36,9 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to attacker = 0; lifeOrig = life; origpower = power; + basepower = origpower; origtoughness = toughness; + basetoughness = origtoughness; belongs_to = arg_belongs_to; owner = NULL; if (arg_belongs_to)