Improved Kicker cards, now it's possible to target a specific card with kicker cost and handle any event connected to a kicker casting cost.

This commit is contained in:
valfieri
2020-10-03 16:54:17 +02:00
parent 1b320d5325
commit bf6439db00
9 changed files with 109 additions and 19 deletions

View File

@@ -20,6 +20,7 @@ CardDescriptor::CardDescriptor()
convertedManacost = -1;
zposComparisonMode = COMPARISON_NONE;
zposition = -1;
hasKickerCost = 0;
compareName ="";
nameComparisonMode = COMPARISON_NONE;
colorComparisonMode = COMPARISON_NONE;
@@ -50,6 +51,16 @@ int CardDescriptor::init()
return result;
}
void CardDescriptor::unsecureSetKicked(int k)
{
kicked = k;
}
void CardDescriptor::unsecureSetHasKickerCost(int k)
{
hasKickerCost = k;
}
void CardDescriptor::unsecureSetTapped(int i)
{
tapped = i;
@@ -220,6 +231,15 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
if (excludedSet.any())
return NULL;
if ((kicked == -1 && card->kicked) || (kicked == 1 && !card->kicked))
{
match = NULL;
}
if ((hasKickerCost == -1 && card->getManaCost()->getKicker()) || (hasKickerCost == 1 && !card->getManaCost()->getKicker()))
{
match = NULL;
}
if ((tapped == -1 && card->isTapped()) || (tapped == 1 && !card->isTapped()))
{