Improved kicker cards comparison criteria (now it's possible to search for a multi kicked card in stack), added a new castcard mode with multikicker option, added all Zendikar Risings primitives to borderline collection, changed in all primitives the restriction "kicker" with a new sintax "if paid(kicker) then" in order to fit with the new kicker logic comparison criteria and castcard option.

This commit is contained in:
valfieri
2020-10-10 02:44:57 +02:00
parent c4eb931192
commit a99eaac35d
10 changed files with 3348 additions and 294 deletions

View File

@@ -13,6 +13,7 @@ CardDescriptor::CardDescriptor()
counterToughness = 0;
counterNB = 0;
mode = CD_AND;
kickedComparisonMode = COMPARISON_NONE;
powerComparisonMode = COMPARISON_NONE;
toughnessComparisonMode = COMPARISON_NONE;
manacostComparisonMode = COMPARISON_NONE;
@@ -152,6 +153,8 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card)
}
// Quantified restrictions are always AND-ed:
if (kickedComparisonMode && !valueInRange(kickedComparisonMode, card->kicked, kicked))
return NULL;
if (powerComparisonMode && !valueInRange(powerComparisonMode, card->getPower(), power))
return NULL;
if (toughnessComparisonMode && !valueInRange(toughnessComparisonMode, card->getToughness(), toughness))
@@ -195,6 +198,8 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card)
match = NULL;
}
if (kickedComparisonMode && !valueInRange(kickedComparisonMode, card->kicked, kicked))
match = NULL;
if (powerComparisonMode && !valueInRange(powerComparisonMode, card->getPower(), power))
match = NULL;
if (toughnessComparisonMode && !valueInRange(toughnessComparisonMode, card->getToughness(), toughness))
@@ -231,11 +236,6 @@ 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() || card->basicAbilities[Constants::HASOTHERKICKER])) || (hasKickerCost == 1 && (!card->getManaCost()->getKicker() && !card->basicAbilities[Constants::HASOTHERKICKER])))
{
match = NULL;