count valid targets

count creature/s that are valid target/s
This commit is contained in:
Anthony Calosa
2016-05-29 19:38:00 +08:00
parent c472a0215d
commit 0fed1ba1ab
2 changed files with 25 additions and 3 deletions

View File

@@ -778,6 +778,28 @@ private:
intValue = 1;
}//end
}
else if (s == "cantargetmycre")// can target my creature
{
intValue = 0;
for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->battlefield->cards[j]->hasType("creature") && !card->controller()->game->battlefield->cards[j]->protectedAgainst(card))
{
intValue += 1;
}
}
}
else if (s == "cantargetoppocre")// can target opponent 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;
}
}
}
else if (s == "controllerturn")//intvalue = 1 if its your turn this(variable{controllerturn})
{
intValue = 0;