updated variable "type:" to act more like a targetchooser...
draw:type:creature|opponentbattlefield will draw a card for each creature on the opponents battlefield this defualts to "|mybattlefield" however any target zone can be used, hand, library ect.... this will add support to some cards which werent possible with previous version of it, without having to create new word variables to do the same exact thing as can now be done with this.
This commit is contained in:
@@ -84,9 +84,27 @@ public:
|
|||||||
}
|
}
|
||||||
else if (s.find("type:") != string::npos)
|
else if (s.find("type:") != string::npos)
|
||||||
{
|
{
|
||||||
size_t begins = s.find(":");
|
size_t begins = s.find(":");
|
||||||
string theType = s.substr(begins + 1);
|
string theType = s.substr(begins + 1);
|
||||||
intValue = target->controller()->game->inPlay->countByType(theType.c_str());
|
size_t zoned = theType.find("|");
|
||||||
|
if(zoned == string::npos)
|
||||||
|
{
|
||||||
|
theType.append("|mybattlefield");
|
||||||
|
}
|
||||||
|
TargetChooserFactory tf;
|
||||||
|
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
|
||||||
|
GameObserver * game = game->GetInstance();
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * p = game->players[i];
|
||||||
|
MTGGameZone * zones[] = { p->game->inPlay, p->game->graveyard, p->game->hand, p->game->library };
|
||||||
|
for (int k = 0; k < 4; k++)
|
||||||
|
{
|
||||||
|
MTGGameZone * zone = zones[k];
|
||||||
|
intValue += zone->countByCanTarget(tc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SAFE_DELETE(tc);
|
||||||
}
|
}
|
||||||
else if (s == "sunburst")
|
else if (s == "sunburst")
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user