Devotion mechanics (thanks to excessum for patch)

+ some refactoring:
extrManaCost --> ExtraManaCost
unattachCost --> UnattachCost
This commit is contained in:
pankdm
2013-10-18 06:37:09 +00:00
parent d5b089f86b
commit f7eded7417
16 changed files with 203 additions and 66 deletions
+17 -3
View File
@@ -183,7 +183,12 @@ private:
}
else
{
replace(theType.begin(), theType.end(), ':', '|');
replace(theType.begin(), theType.end(), ':', '|');
}
int color = 0;
if (theType.find("mana") != string::npos) {
color = ManaCost::parseManaSymbol(theType[4]);
theType.replace(0, 5, "*");
}
TargetChooserFactory tf(card->getObserver());
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
@@ -194,8 +199,17 @@ private:
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = zones[k];
if(tc->targetsZone(zone,target))
intValue += zone->countByCanTarget(tc);
if (tc->targetsZone(zone, target))
{
if (color)
{
intValue += zone->countTotalManaSymbols(tc, color);
}
else
{
intValue += zone->countByCanTarget(tc);
}
}
}
}
SAFE_DELETE(tc);