support "other" in type:* parsing
if a card with a cleric subtype has an autoline like this: othertype:cleric:battlefield, means that the targetchooser excludes that card, only the other "cleric" are counted.
This commit is contained in:
@@ -68,6 +68,7 @@ private:
|
|||||||
bool plusone = false;
|
bool plusone = false;
|
||||||
bool plustwo = false;
|
bool plustwo = false;
|
||||||
bool plusthree = false;
|
bool plusthree = false;
|
||||||
|
bool other = false;//othertype:[subtype]
|
||||||
if (!target) target = card;
|
if (!target) target = card;
|
||||||
int multiplier = 1;
|
int multiplier = 1;
|
||||||
if (s[0] == '-')
|
if (s[0] == '-')
|
||||||
@@ -134,6 +135,12 @@ private:
|
|||||||
size_t pThree = s.find("plusthree");
|
size_t pThree = s.find("plusthree");
|
||||||
s.erase(pThree,pThree + 9);
|
s.erase(pThree,pThree + 9);
|
||||||
}
|
}
|
||||||
|
if(s.find("othertype") != string::npos)
|
||||||
|
{
|
||||||
|
other = true;
|
||||||
|
size_t oth = s.find("othertype");
|
||||||
|
s.erase(oth,oth + 5);
|
||||||
|
}
|
||||||
if(s == "prex")
|
if(s == "prex")
|
||||||
{
|
{
|
||||||
ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost());
|
ManaCost * cX = card->controller()->getManaPool()->Diff(card->getManaCost());
|
||||||
@@ -395,6 +402,7 @@ private:
|
|||||||
}
|
}
|
||||||
TargetChooserFactory tf(card->getObserver());
|
TargetChooserFactory tf(card->getObserver());
|
||||||
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
|
TargetChooser * tc = tf.createTargetChooser(theType.c_str(),NULL);
|
||||||
|
tc->other = other;
|
||||||
for (int i = 0; i < 2; i++)
|
for (int i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
Player * p = card->getObserver()->players[i];
|
Player * p = card->getObserver()->players[i];
|
||||||
@@ -642,6 +650,21 @@ private:
|
|||||||
{
|
{
|
||||||
intValue = target->controller()->opponent()->game->hand->nb_cards;
|
intValue = target->controller()->opponent()->game->hand->nb_cards;
|
||||||
}
|
}
|
||||||
|
else if (s == "myname")//Plague Rats and others
|
||||||
|
{
|
||||||
|
intValue = 0;
|
||||||
|
for (int i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
Player * p = card->getObserver()->players[i];
|
||||||
|
for (int j = p->game->battlefield->nb_cards - 1; j >= 0; --j)
|
||||||
|
{
|
||||||
|
if (p->game->battlefield->cards[j]->name == card->name)
|
||||||
|
{
|
||||||
|
intValue += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (s == "pgbzombie")//Soulless One
|
else if (s == "pgbzombie")//Soulless One
|
||||||
{
|
{
|
||||||
intValue = 0;
|
intValue = 0;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ Author: Michael Nguyen
|
|||||||
|
|
||||||
/* Wagic versions */
|
/* Wagic versions */
|
||||||
#define WAGIC_VERSION_MAJOR 0
|
#define WAGIC_VERSION_MAJOR 0
|
||||||
#define WAGIC_VERSION_MEDIUM 19
|
#define WAGIC_VERSION_MEDIUM 20
|
||||||
#define WAGIC_VERSION_MINOR 2
|
#define WAGIC_VERSION_MINOR 1
|
||||||
|
|
||||||
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
|
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
|
||||||
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
|
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
|
||||||
|
|||||||
Reference in New Issue
Block a user