Count Total Power of Creatures you control

example usage:  auto={4}{G}:4/4
restriction{compare(powertotalinplay)~morethan~7}
This commit is contained in:
Anthony Calosa
2015-08-10 22:44:27 +08:00
parent fa14219e12
commit 60f3c87de1

View File

@@ -635,6 +635,17 @@ private:
{
intValue = target->controller()->opponent()->game->hand->nb_cards;
}
else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable
{
intValue = 0;
for (int j = card->controller()->game->inPlay->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->inPlay->cards[j]->hasType(Subtypes::TYPE_CREATURE))
{
intValue += card->controller()->game->inPlay->cards[j]->power;
}
}
}
else
{
intValue = atoi(s.c_str());