From 1d81c12150ef221b29635425f6d2388abea3d0ef Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 29 May 2016 20:04:51 +0800 Subject: [PATCH] count valid targets any creature --- projects/mtg/include/AllAbilities.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index dffd2dec3..6d61d6b67 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -800,6 +800,24 @@ private: } } } + else if (s == "cantargetcre")// can target any creature + { + intValue = 0; + for (int j = card->controller()->opponent()->game->battlefield->nb_cards - 1; j >= 0; --j) + { + if (card->controller()->opponent()->game->battlefield->cards[j]->hasType("creature") && !card->controller()->opponent()->game->battlefield->cards[j]->protectedAgainst(card)) + { + intValue += 1; + } + } + for (int k = card->controller()->game->battlefield->nb_cards - 1; k >= 0; --k) + { + if (card->controller()->game->battlefield->cards[k]->hasType("creature") && !card->controller()->game->battlefield->cards[k]->protectedAgainst(card)) + { + intValue += 1; + } + } + } else if (s == "controllerturn")//intvalue = 1 if its your turn this(variable{controllerturn}) { intValue = 0;