Fixed some primitives, added new primitives from MAT set, improved filter for multicolored cards, added new keywords for handling multicolored cards.

This commit is contained in:
Vittorio Alfieri
2023-05-24 15:15:52 +02:00
parent 675705a6e5
commit 09f4c408cd
6 changed files with 292 additions and 32 deletions

View File

@@ -4,6 +4,7 @@
#include "Subtypes.h"
#include "Counters.h"
#include "ExtraCost.h"
#include "WParsedInt.h"
CardDescriptor::CardDescriptor()
: MTGCardInstance(), mColorExclusions(0)
@@ -21,6 +22,8 @@ CardDescriptor::CardDescriptor()
manacostComparisonMode = COMPARISON_NONE;
counterComparisonMode = COMPARISON_NONE;
convertedManacost = -1;
numofColorsComparisonMode = COMPARISON_NONE;
numofColors = -1;
zposComparisonMode = COMPARISON_NONE;
zposition = -1;
hasKickerCost = 0;
@@ -199,6 +202,16 @@ MTGCardInstance * CardDescriptor::match_or(MTGCardInstance * card)
} else if(!valueInRange(toughnessComparisonMode, card->getToughness(), toughness))
return NULL;
}
if (numofColorsComparisonMode){
int totalcolor = 0;
WParsedInt* value = NEW WParsedInt("mycolnum", NULL, card);
if(value){
totalcolor = value->getValue();
SAFE_DELETE(value);
}
if(!valueInRange(numofColorsComparisonMode, totalcolor, numofColors))
return NULL;
}
if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost))
return NULL;
if (zposComparisonMode && !valueInRange(zposComparisonMode, card->zpos, zposition))
@@ -256,6 +269,16 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card)
} else if(!valueInRange(toughnessComparisonMode, card->getToughness(), toughness))
return NULL;
}
if (numofColorsComparisonMode){
int totalcolor = 0;
WParsedInt* value = NEW WParsedInt("mycolnum", NULL, card);
if(value){
totalcolor = value->getValue();
SAFE_DELETE(value);
}
if(!valueInRange(numofColorsComparisonMode, totalcolor, numofColors))
return NULL;
}
if (manacostComparisonMode && !valueInRange(manacostComparisonMode, card->myconvertedcost, convertedManacost))
match = NULL;
if (zposComparisonMode && !valueInRange(zposComparisonMode, card->zpos, zposition))