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
+22 -2
View File
@@ -549,17 +549,37 @@ unsigned int MTGGameZone::countByCanTarget(TargetChooser * tc)
{
if(!tc)
return 0;
tc->targetter = NULL;//becuase we are counting what can be targeted by this TC, we don't care if cards have protection.
// we don't care if cards have protection.
bool withoutProtections = true;
int result = 0;
for (int i = 0; i < (nb_cards); i++)
{
if (tc->canTarget(cards[i]))
if (tc->canTarget(cards[i]), withoutProtections)
{
result++;
}
}
return result;
}
unsigned int MTGGameZone::countTotalManaSymbols(TargetChooser * tc, int color)
{
if (!tc) {
return 0;
}
// we don't care if cards have protection.
bool withoutProtections = true;
int result = 0;
for (int i = 0; i < nb_cards; i++)
{
if (tc->canTarget(cards[i]), withoutProtections)
{
result += cards[i]->getManaCost()->getManaSymbols(color);
}
}
return result;
}
MTGCardInstance * MTGGameZone::findByName(string name)
{
for (int i = 0; i < (nb_cards); i++)