change plandtype & olandtype parsing
This commit is contained in:
@@ -36031,11 +36031,11 @@ type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Exotic Orchard
|
||||
auto=this(variable{olandg}>0) {t}:add{g}
|
||||
auto=this(variable{olandu}>0) {t}:add{u}
|
||||
auto=this(variable{olandr}>0) {t}:add{r}
|
||||
auto=this(variable{olandb}>0) {t}:add{b}
|
||||
auto=this(variable{olandw}>0) {t}:add{w}
|
||||
auto=this(variable{olandg}>0) {t}:out{g}
|
||||
auto=this(variable{olandu}>0) {t}:out{u}
|
||||
auto=this(variable{olandr}>0) {t}:out{r}
|
||||
auto=this(variable{olandb}>0) {t}:out{b}
|
||||
auto=this(variable{olandw}>0) {t}:out{w}
|
||||
text={T}: Add to your mana pool one mana of any color that a land an opponent controls could produce.
|
||||
type=Land
|
||||
[/card]
|
||||
@@ -37789,11 +37789,11 @@ toughness=6
|
||||
[/card]
|
||||
[card]
|
||||
name=Fellwar Stone
|
||||
auto=this(variable{olandg}>0) {t}:add{g}
|
||||
auto=this(variable{olandu}>0) {t}:add{u}
|
||||
auto=this(variable{olandr}>0) {t}:add{r}
|
||||
auto=this(variable{olandb}>0) {t}:add{b}
|
||||
auto=this(variable{olandw}>0) {t}:add{w}
|
||||
auto=this(variable{olandg}>0) {t}:out{g}
|
||||
auto=this(variable{olandu}>0) {t}:out{u}
|
||||
auto=this(variable{olandr}>0) {t}:out{r}
|
||||
auto=this(variable{olandb}>0) {t}:out{b}
|
||||
auto=this(variable{olandw}>0) {t}:out{w}
|
||||
text={T}: Add to your mana pool one mana of any color that a land an opponent controls could produce.
|
||||
mana={2}
|
||||
type=Artifact
|
||||
@@ -50008,11 +50008,11 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Harvester Druid
|
||||
auto=this(variable{plandg}>0) {t}:add{g}
|
||||
auto=this(variable{plandu}>0) {t}:add{u}
|
||||
auto=this(variable{plandr}>0) {t}:add{r}
|
||||
auto=this(variable{plandb}>0) {t}:add{b}
|
||||
auto=this(variable{plandw}>0) {t}:add{w}
|
||||
auto=this(variable{plandg}>0) {t}:out{g}
|
||||
auto=this(variable{plandu}>0) {t}:out{u}
|
||||
auto=this(variable{plandr}>0) {t}:out{r}
|
||||
auto=this(variable{plandb}>0) {t}:out{b}
|
||||
auto=this(variable{plandw}>0) {t}:out{w}
|
||||
text={T}: Add to your mana pool one mana of any color that a land you control could produce.
|
||||
mana={1}{G}
|
||||
type=Creature
|
||||
@@ -85877,11 +85877,11 @@ toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Quirion Explorer
|
||||
auto=this(variable{olandg}>0) {t}:add{g}
|
||||
auto=this(variable{olandu}>0) {t}:add{u}
|
||||
auto=this(variable{olandr}>0) {t}:add{r}
|
||||
auto=this(variable{olandb}>0) {t}:add{b}
|
||||
auto=this(variable{olandw}>0) {t}:add{w}
|
||||
auto=this(variable{olandg}>0) {t}:out{g}
|
||||
auto=this(variable{olandu}>0) {t}:out{u}
|
||||
auto=this(variable{olandr}>0) {t}:out{r}
|
||||
auto=this(variable{olandb}>0) {t}:out{b}
|
||||
auto=this(variable{olandw}>0) {t}:out{w}
|
||||
text={T}: Add to your mana pool one mana of any color that a land an opponent controls could produce.
|
||||
mana={1}{G}
|
||||
type=Creature
|
||||
@@ -88419,12 +88419,12 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Reflecting Pool
|
||||
auto=this(variable{plandg}>0) {t}:add{g}
|
||||
auto=this(variable{plandu}>0) {t}:add{u}
|
||||
auto=this(variable{plandr}>0) {t}:add{r}
|
||||
auto=this(variable{plandb}>0) {t}:add{b}
|
||||
auto=this(variable{plandw}>0) {t}:add{w}
|
||||
auto=this(variable{plandc}>0) {t}:add{1}
|
||||
auto=this(variable{plandg}>0) {t}:out{g}
|
||||
auto=this(variable{plandu}>0) {t}:out{u}
|
||||
auto=this(variable{plandr}>0) {t}:out{r}
|
||||
auto=this(variable{plandb}>0) {t}:out{b}
|
||||
auto=this(variable{plandw}>0) {t}:out{w}
|
||||
auto=this(variable{plandc}>0) {t}:out{1}
|
||||
text={T}: Add to your mana pool one mana of any type that a land you control could produce.
|
||||
type=Land
|
||||
[/card]
|
||||
@@ -110856,11 +110856,11 @@ toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
name=Sylvok Explorer
|
||||
auto=this(variable{olandg}>0) {t}:add{g}
|
||||
auto=this(variable{olandu}>0) {t}:add{u}
|
||||
auto=this(variable{olandr}>0) {t}:add{r}
|
||||
auto=this(variable{olandb}>0) {t}:add{b}
|
||||
auto=this(variable{olandw}>0) {t}:add{w}
|
||||
auto=this(variable{olandg}>0) {t}:out{g}
|
||||
auto=this(variable{olandu}>0) {t}:out{u}
|
||||
auto=this(variable{olandr}>0) {t}:out{r}
|
||||
auto=this(variable{olandb}>0) {t}:out{b}
|
||||
auto=this(variable{olandw}>0) {t}:out{w}
|
||||
text={T}: Add to your mana pool one mana of any color that a land an opponent controls could produce.
|
||||
mana={1}{G}
|
||||
type=Creature
|
||||
|
||||
@@ -748,53 +748,53 @@ private:
|
||||
}
|
||||
else if (s == "olandg")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "olandu")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "olandr")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_RED, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_RED, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "olandb")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "olandw")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "olandc")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target, target->controller()->opponent()) +
|
||||
countManaProducedby(Constants::MTG_COLOR_WASTE, target, target->controller()->opponent());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target->controller()->opponent()) +
|
||||
countManaProducedby(Constants::MTG_COLOR_WASTE, target->controller()->opponent());
|
||||
}
|
||||
else if (s == "plandg")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_GREEN, target->controller());
|
||||
}
|
||||
else if (s == "plandu")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLUE, target->controller());
|
||||
}
|
||||
else if (s == "plandr")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_RED, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_RED, target->controller());
|
||||
}
|
||||
else if (s == "plandb")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_BLACK, target->controller());
|
||||
}
|
||||
else if (s == "plandw")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_WHITE, target->controller());
|
||||
}
|
||||
else if (s == "plandc")
|
||||
{
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target, target->controller()) +
|
||||
countManaProducedby(Constants::MTG_COLOR_WASTE, target, target->controller());
|
||||
intValue = countManaProducedby(Constants::MTG_COLOR_ARTIFACT, target->controller()) +
|
||||
countManaProducedby(Constants::MTG_COLOR_WASTE, target->controller());
|
||||
}
|
||||
else if (s == "cantargetmycre")// can target my creature
|
||||
{
|
||||
@@ -1061,7 +1061,7 @@ public:
|
||||
return count;
|
||||
}
|
||||
|
||||
int countManaProducedby(int color, MTGCardInstance * target, Player * player)
|
||||
/*int countManaProducedby(int color, MTGCardInstance * target, Player * player)
|
||||
{
|
||||
int count = 0;
|
||||
for (size_t i = 0; i < target->getObserver()->mLayers->actionLayer()->manaObjects.size(); i++)
|
||||
@@ -1073,6 +1073,27 @@ public:
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
}*/
|
||||
|
||||
int countManaProducedby(int color, Player * player)
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < player->game->battlefield->nb_cards; i++)
|
||||
{
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceC && (color == Constants::MTG_COLOR_ARTIFACT || color == Constants::MTG_COLOR_WASTE))
|
||||
count += 1;
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceG && color == Constants::MTG_COLOR_GREEN)
|
||||
count += 1;
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceU && color == Constants::MTG_COLOR_BLUE)
|
||||
count += 1;
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceR && color == Constants::MTG_COLOR_RED)
|
||||
count += 1;
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceB && color == Constants::MTG_COLOR_BLACK)
|
||||
count += 1;
|
||||
if(((MTGCardInstance *)player->game->battlefield->cards[i])->canproduceW && color == Constants::MTG_COLOR_WHITE)
|
||||
count += 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
WParsedInt(int value = 0)
|
||||
|
||||
@@ -277,6 +277,12 @@ public:
|
||||
int imprintR;
|
||||
int imprintB;
|
||||
int imprintW;
|
||||
int canproduceG;
|
||||
int canproduceU;
|
||||
int canproduceR;
|
||||
int canproduceB;
|
||||
int canproduceW;
|
||||
int canproduceC;
|
||||
string currentimprintName;
|
||||
vector<string>imprintedNames;
|
||||
|
||||
|
||||
@@ -702,6 +702,25 @@ void GameObserver::gameStateBasedEffects()
|
||||
card->myPair->myPair = NULL;
|
||||
card->myPair = NULL;
|
||||
}
|
||||
///set basic land mana objects canproduce
|
||||
for (size_t gg = 0; gg < mLayers->actionLayer()->manaObjects.size(); gg++)
|
||||
{
|
||||
if (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])) &&
|
||||
(dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->source->isLand() &&
|
||||
(dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->source == card)
|
||||
{
|
||||
if (card->hasType("forest") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_GREEN))
|
||||
card->canproduceG = 1;
|
||||
if (card->hasType("island") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_BLUE))
|
||||
card->canproduceU = 1;
|
||||
if (card->hasType("mountain") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_RED))
|
||||
card->canproduceR = 1;
|
||||
if (card->hasType("swamp") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_BLACK))
|
||||
card->canproduceB = 1;
|
||||
if (card->hasType("plains") && (dynamic_cast<AManaProducer*> (((MTGAbility *) mLayers->actionLayer()->manaObjects[gg])))->output->hasColor(Constants::MTG_COLOR_WHITE))
|
||||
card->canproduceW = 1;
|
||||
}
|
||||
}
|
||||
///clear imprints
|
||||
if(isInPlay(card) && card->imprintedCards.size())
|
||||
{
|
||||
|
||||
@@ -3449,6 +3449,35 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
//Mana Producer
|
||||
found = s.find("add");
|
||||
if (found != string::npos)
|
||||
{
|
||||
bool doesntEmptyTilueot = s.find("doesntempty") != string::npos;
|
||||
ManaCost * output = ManaCost::parseManaCost(s.substr(found),NULL,card);
|
||||
Targetable * t = spell ? spell->getNextTarget() : NULL;
|
||||
if(output->getConvertedCost() > 0)
|
||||
{
|
||||
if(output->hasColor(Constants::MTG_COLOR_ARTIFACT)||output->hasColor(Constants::MTG_COLOR_WASTE))
|
||||
card->canproduceC = 1;
|
||||
if(output->hasColor(Constants::MTG_COLOR_GREEN))
|
||||
card->canproduceG = 1;
|
||||
if(output->hasColor(Constants::MTG_COLOR_BLUE))
|
||||
card->canproduceU = 1;
|
||||
if(output->hasColor(Constants::MTG_COLOR_RED))
|
||||
card->canproduceR = 1;
|
||||
if(output->hasColor(Constants::MTG_COLOR_BLACK))
|
||||
card->canproduceB = 1;
|
||||
if(output->hasColor(Constants::MTG_COLOR_WHITE))
|
||||
card->canproduceW = 1;
|
||||
}
|
||||
MTGAbility * a = NEW AManaProducer(observer, id, card, t, output, NULL, who,s.substr(found),doesntEmptyTilueot);
|
||||
a->oneShot = 1;
|
||||
if(newName.size())
|
||||
((AManaProducer*)a)->menutext = newName;
|
||||
return a;
|
||||
}
|
||||
|
||||
//another mana producer exempted for canproduce
|
||||
found = s.find("out");
|
||||
if (found != string::npos)
|
||||
{
|
||||
bool doesntEmptyTilueot = s.find("doesntempty") != string::npos;
|
||||
ManaCost * output = ManaCost::parseManaCost(s.substr(found),NULL,card);
|
||||
|
||||
@@ -252,6 +252,12 @@ void MTGCardInstance::initMTGCI()
|
||||
imprintR = 0;
|
||||
imprintB = 0;
|
||||
imprintW = 0;
|
||||
canproduceG = 0;
|
||||
canproduceU = 0;
|
||||
canproduceR = 0;
|
||||
canproduceB = 0;
|
||||
canproduceW = 0;
|
||||
canproduceC = 0;
|
||||
currentimprintName = "";
|
||||
imprintedNames.clear();
|
||||
CountedObjects = 0;
|
||||
|
||||
Reference in New Issue
Block a user