From 60f3c87de1a1a9a5ff83797ed5257d44fc456d0e Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Mon, 10 Aug 2015 22:44:27 +0800 Subject: [PATCH] Count Total Power of Creatures you control example usage: auto={4}{G}:4/4 restriction{compare(powertotalinplay)~morethan~7} --- projects/mtg/include/AllAbilities.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 69693794f..f39949ba0 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -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());