Merge pull request #893 from kevlahnota/master

revised "colorless" attribute in targetchooser
This commit is contained in:
Anthony Calosa
2016-09-04 14:35:48 +08:00
committed by GitHub
5 changed files with 23 additions and 6 deletions

View File

@@ -96357,7 +96357,7 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Scouting Trek name=Scouting Trek
auto=moveTo(ownerlibrary) notatarget(<anyamount>land[basic]|mylibrary) auto=name(put on top) notatarget(<anyamount>land[basic]|mylibrary) moveTo(ownerexile) and!(moveto(ownerlibrary))!
text=Search your library for any number of basic land cards. Reveal those cards, then shuffle your library and put them on top of it. text=Search your library for any number of basic land cards. Reveal those cards, then shuffle your library and put them on top of it.
mana={1}{G} mana={1}{G}
type=Sorcery type=Sorcery
@@ -130286,7 +130286,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Worldly Tutor name=Worldly Tutor
auto=moveTo(ownerlibrary) notatarget(creature|mylibrary) auto=Reveal:type:*:mylibrary revealzone(mylibrary) revealtype(creature|mylibrary) optionone name(choose card) target(creature|reveal) transforms((,newability[all(other *|reveal) moveto(mylibrary) and!(shuffle)!],newability[moveto(mylibrary)])) optiononeend revealend
text=Search your library for a creature card and reveal that card. Shuffle your library, then put the revealed card back on top of it. text=Search your library for a creature card and reveal that card. Shuffle your library, then put the revealed card back on top of it.
mana={G} mana={G}
type=Instant type=Instant

View File

@@ -74,6 +74,7 @@ class CardDescriptor: public MTGCardInstance
int CDcanProduceR; int CDcanProduceR;
int CDcanProduceB; int CDcanProduceB;
int CDcanProduceW; int CDcanProduceW;
int CDnocolor;
}; };
#endif #endif

View File

@@ -32,6 +32,7 @@ CardDescriptor::CardDescriptor()
CDcanProduceR = 0; CDcanProduceR = 0;
CDcanProduceB = 0; CDcanProduceB = 0;
CDcanProduceW = 0; CDcanProduceW = 0;
CDnocolor = 0;
} }
int CardDescriptor::init() int CardDescriptor::init()
@@ -285,6 +286,17 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{ {
match = NULL; match = NULL;
} }
if ((CDnocolor == -1 && card->getColor() == 0))
{
match = NULL;
}
else if(CDnocolor == 1)
{
if(!card->has(Constants::DEVOID))
if(card->getColor()>0)
match = NULL;
}
if ((isMultiColored == -1 && card->isMultiColored) || (isMultiColored == 1 && !card->isMultiColored)) if ((isMultiColored == -1 && card->isMultiColored) || (isMultiColored == 1 && !card->isMultiColored))
{ {

View File

@@ -641,8 +641,8 @@ void GameObserver::gameStateBasedEffects()
if (players[d]->snowManaW < 0) if (players[d]->snowManaW < 0)
players[d]->snowManaW = 0; players[d]->snowManaW = 0;
MTGGameZone * dzones[] = { players[d]->game->inPlay, players[d]->game->graveyard, players[d]->game->hand, players[d]->game->library, players[d]->game->exile }; MTGGameZone * dzones[] = { players[d]->game->inPlay, players[d]->game->graveyard, players[d]->game->hand, players[d]->game->library, players[d]->game->exile, players[d]->game->stack };
for (int k = 0; k < 5; k++) for (int k = 0; k < 6; k++)
{ {
MTGGameZone * zone = dzones[k]; MTGGameZone * zone = dzones[k];
if (mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0) if (mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)

View File

@@ -790,11 +790,15 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
if (attribute.find("colorless") != string::npos) if (attribute.find("colorless") != string::npos)
{ {
attributefound = 1; attributefound = 1;
for (int cid = 1; cid < Constants::NB_Colors; cid++) /*for (int cid = 1; cid < Constants::NB_Colors; cid++)
{ {
cd->SetExclusionColor(cid); cd->SetExclusionColor(cid);
} }
cd->mode = CardDescriptor::CD_OR; cd->mode = CardDescriptor::CD_OR;*/
if (minus)
cd->CDnocolor = -1;
else
cd->CDnocolor = 1;
} }
if (attribute.find("chosencolor") != string::npos) if (attribute.find("chosencolor") != string::npos)