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:
@@ -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);
|
||||
@@ -2385,11 +2385,11 @@ public:
|
||||
int destroy()
|
||||
{
|
||||
if(cda)
|
||||
{
|
||||
;
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
else
|
||||
{
|
||||
((MTGCardInstance *) target)->power -= ((MTGCardInstance *) target)->pbonus;
|
||||
((MTGCardInstance *) target)->addToToughness(-((MTGCardInstance *) target)->tbonus);
|
||||
((MTGCardInstance *) target)->pbonus -= wppt->power.getValue();
|
||||
|
||||
@@ -186,6 +186,7 @@ public:
|
||||
|
||||
int addToToughness(int value);
|
||||
int setToughness(int value);
|
||||
int isSettingBase;
|
||||
|
||||
vector<TargetChooser *>protections;
|
||||
int addProtection(TargetChooser * tc);
|
||||
|
||||
@@ -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);
|
||||
@@ -4281,6 +4283,9 @@ int ATransformer::destroy()
|
||||
{
|
||||
_target->setColor(*it);
|
||||
}
|
||||
|
||||
if(newpowerfound || newtoughnessfound)
|
||||
_target->isSettingBase -= 1;
|
||||
|
||||
if(newpowerfound )
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user