diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 87589eaa8..89426fbb4 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3652,6 +3652,7 @@ public: ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector newAbilitiesList,bool newAbilityFound = false,bool aForever = false); int addToGame(); + int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false); int destroy(); const char * getMenuText(); ATransformer * clone() const; diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index cb088829c..18e078727 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1920,6 +1920,9 @@ int MayAbility::testDestroy() return 0; if (game->mLayers->actionLayer()->getIndexOf(mClone) != -1) return 0; + if(game->currentPlayer == source->controller() && game->isInterrupting == source->controller() && dynamic_cast(AbilityFactory::getCoreAbility(ability))) + //if its my turn, and im interrupting myself(why?) then set interrupting to previous interrupter if the ability was a manaability + //special case since they don't use the stack. game->mLayers->stackLayer()->setIsInterrupting(previousInterrupter); return 1; } @@ -2465,6 +2468,7 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t oldpower = _target->power; _target->power += val->getValue(); _target->power -= oldpower; + _target->power += reapplyCountersBonus(_target,false,true); delete val; } if(newtoughnessfound ) @@ -2473,13 +2477,38 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t oldtoughness = _target->toughness; _target->addToToughness(val->getValue()); _target->addToToughness(-oldtoughness); + _target->addToToughness(reapplyCountersBonus(_target,true,false)); _target->life = _target->toughness; delete val; } } return MTGAbility::addToGame(); } - + + int ATransformer::reapplyCountersBonus(MTGCardInstance * rtarget,bool powerapplied,bool toughnessapplied) + { + if(!rtarget->counters) + return 0; + Counter * c = NULL; + c = rtarget->counters->counters[0]; + int rNewPower = 0; + int rNewToughness = 0; + for (int t = 0; t < rtarget->counters->mCount; t++) + { + if (c) + { + for(int i = 0;i < c->nb;i++) + { + rNewPower += c->power; + rNewToughness += c->toughness; + } + } + c = rtarget->counters->getNext(c); + } + if(toughnessapplied) + return rNewToughness; + return rNewPower; + } int ATransformer::destroy() { if(aForever) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index aaaa6429b..a70a79fad 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -485,6 +485,8 @@ int MTGKickerRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana) if(OptionKicker::KICKER_ALWAYS == options[Options::KICKERPAYMENT].number) return 0; Player * player = game->currentlyActing(); + if(!player->game->hand->hasCard(card)) + return 0; ManaCost * kicker = card->getManaCost()->kicker; if(!kicker) {