Fixed Etchings of the Chosen (issue #1051 by @ranger7271), added primitives with choose card name, added two keywords "chooseaname" and "chooseanameopp" to choose a card name ("chosenname" and "lastchoosenname") between your cards or opponent cards, added a keyword "[attached]" to target equipment attached to a permanent.

This commit is contained in:
Vittorio Alfieri
2021-01-26 20:47:33 +01:00
parent c60f8787d1
commit dd844fc25e
15 changed files with 288 additions and 86 deletions

View File

@@ -607,6 +607,17 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->CDgeared = 1;
}
}
else if (attribute.find("attached") != string::npos)
{
if (minus)
{
cd->CDattached = -1;
}
else
{
cd->CDattached = 1;
}
}
//creature is a level up creature
else if (attribute.find("leveler") != string::npos)
{
@@ -953,6 +964,26 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
}
}
if (attribute.find("chosenname") != string::npos && card->chooseaname != "")
{
attributefound = 1;
cd->compareName = card->chooseaname;
if (minus)
cd->nameComparisonMode = COMPARISON_UNEQUAL;
else
cd->nameComparisonMode = COMPARISON_EQUAL;
}
if (attribute.find("lastnamechosen") != string::npos && card->controller()->lastChosenName != "")
{
attributefound = 1;
cd->compareName = card->controller()->lastChosenName;
if (minus)
cd->nameComparisonMode = COMPARISON_UNEQUAL;
else
cd->nameComparisonMode = COMPARISON_EQUAL;
}
if (attribute.find("evictname") != string::npos && card->imprintedCards.size())
{
attributefound = 1;