changed a previous fix a bit, also, altho this is not the "layers system" and we don't really support it, i thought i could atleast support the reapply of p/t bonuses from counters for atransformer...
and while messing around i found out that i forgot an important check in the new kicker with menu, to check if the card was still in the hand :P
This commit is contained in:
@@ -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<string> newAbilitiesList,bool newAbilityFound = false,bool aForever = false);
|
ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower,bool newpowerfound,string newtoughness,bool newtoughnessfound,vector<string> newAbilitiesList,bool newAbilityFound = false,bool aForever = false);
|
||||||
int addToGame();
|
int addToGame();
|
||||||
|
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL,bool powerapplied=false,bool toughnessapplied=false);
|
||||||
int destroy();
|
int destroy();
|
||||||
const char * getMenuText();
|
const char * getMenuText();
|
||||||
ATransformer * clone() const;
|
ATransformer * clone() const;
|
||||||
|
|||||||
@@ -1920,6 +1920,9 @@ int MayAbility::testDestroy()
|
|||||||
return 0;
|
return 0;
|
||||||
if (game->mLayers->actionLayer()->getIndexOf(mClone) != -1)
|
if (game->mLayers->actionLayer()->getIndexOf(mClone) != -1)
|
||||||
return 0;
|
return 0;
|
||||||
|
if(game->currentPlayer == source->controller() && game->isInterrupting == source->controller() && dynamic_cast<AManaProducer*>(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);
|
game->mLayers->stackLayer()->setIsInterrupting(previousInterrupter);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -2465,6 +2468,7 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
|
|||||||
oldpower = _target->power;
|
oldpower = _target->power;
|
||||||
_target->power += val->getValue();
|
_target->power += val->getValue();
|
||||||
_target->power -= oldpower;
|
_target->power -= oldpower;
|
||||||
|
_target->power += reapplyCountersBonus(_target,false,true);
|
||||||
delete val;
|
delete val;
|
||||||
}
|
}
|
||||||
if(newtoughnessfound )
|
if(newtoughnessfound )
|
||||||
@@ -2473,13 +2477,38 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
|
|||||||
oldtoughness = _target->toughness;
|
oldtoughness = _target->toughness;
|
||||||
_target->addToToughness(val->getValue());
|
_target->addToToughness(val->getValue());
|
||||||
_target->addToToughness(-oldtoughness);
|
_target->addToToughness(-oldtoughness);
|
||||||
|
_target->addToToughness(reapplyCountersBonus(_target,true,false));
|
||||||
_target->life = _target->toughness;
|
_target->life = _target->toughness;
|
||||||
delete val;
|
delete val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return MTGAbility::addToGame();
|
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()
|
int ATransformer::destroy()
|
||||||
{
|
{
|
||||||
if(aForever)
|
if(aForever)
|
||||||
|
|||||||
@@ -485,6 +485,8 @@ int MTGKickerRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
if(OptionKicker::KICKER_ALWAYS == options[Options::KICKERPAYMENT].number)
|
if(OptionKicker::KICKER_ALWAYS == options[Options::KICKERPAYMENT].number)
|
||||||
return 0;
|
return 0;
|
||||||
Player * player = game->currentlyActing();
|
Player * player = game->currentlyActing();
|
||||||
|
if(!player->game->hand->hasCard(card))
|
||||||
|
return 0;
|
||||||
ManaCost * kicker = card->getManaCost()->kicker;
|
ManaCost * kicker = card->getManaCost()->kicker;
|
||||||
if(!kicker)
|
if(!kicker)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user