From 8e057379cea1e4f8e3ad6bb1511def1f4ba54e49 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Wed, 16 Sep 2015 10:45:43 +0800 Subject: [PATCH] Finally Fixed... :) The issue last commit was the toughness is refreshed and the damage is not reflected. This commit fixes the bug. Yey... --- projects/mtg/include/AllAbilities.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index f502bffae..7f5435397 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2345,7 +2345,7 @@ public: wppt = NEW WParsedPT(PT,NULL,(MTGCardInstance *) source); } ((MTGCardInstance *) target)->origpower = wppt->power.getValue(); - ((MTGCardInstance *) target)->origtoughness = wppt->toughness.getValue(); + ((MTGCardInstance *) target)->origtoughness = (wppt->toughness.getValue() + ((MTGCardInstance *) target)->life)-((MTGCardInstance *) target)->life;//what? } } int addToGame() @@ -2359,9 +2359,7 @@ public: if(cda) {//Characteristic-defining abilities _target->origpower = wppt->power.getValue();//set orig pt - _target->origtoughness = wppt->toughness.getValue(); - _target->power -= _target->pbonus;//remove current bonuses - _target->addToToughness(-_target->tbonus); + _target->origtoughness = wppt->toughness.getValue(); _target->setPower(_target->origpower);//update PT _target->setToughness(_target->origtoughness); _target->power += _target->pbonus;//add new bonus @@ -2386,16 +2384,16 @@ public: { if(cda) { - ; + /*??Do Nothing??*/; } else { - ((MTGCardInstance *) target)->power -= ((MTGCardInstance *) target)->pbonus; - ((MTGCardInstance *) target)->addToToughness(-((MTGCardInstance *) target)->tbonus); - ((MTGCardInstance *) target)->pbonus -= wppt->power.getValue(); - ((MTGCardInstance *) target)->tbonus -= wppt->toughness.getValue(); - ((MTGCardInstance *) target)->power += ((MTGCardInstance *) target)->pbonus; - ((MTGCardInstance *) target)->addToToughness(((MTGCardInstance *) target)->tbonus); + ((MTGCardInstance *) target)->power -= ((MTGCardInstance *) target)->pbonus; + ((MTGCardInstance *) target)->addToToughness(-((MTGCardInstance *) target)->tbonus); + ((MTGCardInstance *) target)->pbonus -= wppt->power.getValue(); + ((MTGCardInstance *) target)->tbonus -= wppt->toughness.getValue(); + ((MTGCardInstance *) target)->power += ((MTGCardInstance *) target)->pbonus; + ((MTGCardInstance *) target)->addToToughness(((MTGCardInstance *) target)->tbonus); } return 1; }