CDA
CDA works by using "cdaactive" keyword on PT changes. Instead of granting bonus, we modify the orig power and toughness since they are dynamic PT. cdaactive are for cards like maro, tarmogoyf, etc. To Follow/To Do: Additional Tests and other bug fix
This commit is contained in:
@@ -2629,7 +2629,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
int MaxOpponent = atoi(rampageParameters[1].c_str());
|
||||
return NEW ARampageAbility(observer, id, card, power, toughness, MaxOpponent);
|
||||
}
|
||||
|
||||
|
||||
//evole
|
||||
if (s.find("evolve") != string::npos)
|
||||
{
|
||||
@@ -2924,7 +2924,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
{
|
||||
return NEW PTInstant(observer, id, card, target, wppt,s,nonstatic);
|
||||
}
|
||||
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,nonstatic);
|
||||
else if(s.find("cdaactive") != string::npos)
|
||||
{
|
||||
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,true);
|
||||
}
|
||||
else
|
||||
return NEW APowerToughnessModifier(observer, id, card, target, wppt,s,nonstatic);
|
||||
}
|
||||
return NEW PTInstant(observer, id, card, target, wppt,s,nonstatic);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
|
||||
|
||||
void MTGCardInstance::applyPTL()
|
||||
{
|
||||
//7a ??how to add cda(Characteristic Defining Ability)??
|
||||
//7a ??(Characteristic Defining Ability)??
|
||||
power = origpower;
|
||||
toughness = origtoughness;
|
||||
//7b
|
||||
@@ -80,17 +80,15 @@ void MTGCardInstance::applyPTL()
|
||||
//7c - 7d shared?
|
||||
power += pbonus;
|
||||
toughness += tbonus;
|
||||
life = toughness;
|
||||
//7e switch is last
|
||||
if (isPTswitch)
|
||||
{
|
||||
oldP = power;
|
||||
oldT = toughness;
|
||||
this->addToToughness(oldP);
|
||||
this->addToToughness(-oldT);
|
||||
this->power = oldT;
|
||||
toughness = oldP;
|
||||
power = oldT;
|
||||
}
|
||||
/* end */
|
||||
life = toughness;
|
||||
doDamageTest = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user