Added Update on CDA

This controls whether to update Power and Toughness if we are setting
base PT or not. If we are setting base PT update the CDA but it will not
be applied since we have an effect that sets PT to a default base. If
there are no effect that sets base PT, apply it on CDA using
current/updated PT. The buffs are not affected. Yeah...
This commit is contained in:
Anthony Calosa
2015-09-16 09:34:32 +08:00
parent 6aab17d0b3
commit db649ddc96
4 changed files with 14 additions and 7 deletions

View File

@@ -2324,7 +2324,7 @@ public:
{
if(!nonstatic)
return;
if(!cda)
if(!cda || (cda && (((MTGCardInstance *) target)->isSettingBase < 1)))
{
((MTGCardInstance *) target)->power -= wppt->power.getValue();
((MTGCardInstance *) target)->addToToughness(-wppt->toughness.getValue());
@@ -2337,8 +2337,8 @@ public:
_target->power += wppt->power.getValue();
_target->addToToughness(wppt->toughness.getValue());
}
else
{//CDA 7a update wppt
if(cda)
{//update but not apply
if(PT.size())
{
SAFE_DELETE(wppt);

View File

@@ -186,6 +186,7 @@ public:
int addToToughness(int value);
int setToughness(int value);
int isSettingBase;
vector<TargetChooser *>protections;
int addProtection(TargetChooser * tc);

View File

@@ -4180,6 +4180,8 @@ for (it = types.begin(); it != types.end(); it++)
}
}
}
if(newpowerfound || newtoughnessfound)
_target->isSettingBase += 1;
if(newpowerfound )
{
WParsedInt * val = NEW WParsedInt(newpower,NULL, source);
@@ -4282,6 +4284,9 @@ int ATransformer::destroy()
_target->setColor(*it);
}
if(newpowerfound || newtoughnessfound)
_target->isSettingBase -= 1;
if(newpowerfound )
{
_target->power -= _target->pbonus;

View File

@@ -53,6 +53,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
thatmuch = 0;
flanked = 0;
castMethod = Constants::NOT_CAST;
isSettingBase = 0;
}
MTGCardInstance * MTGCardInstance::createSnapShot()