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:
@@ -8463,8 +8463,8 @@ AEquip * AEquip::clone() const
|
||||
}
|
||||
|
||||
// casting a card for free, or casting a copy of a card.
|
||||
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent,bool putinplay,bool madness, bool alternative) :
|
||||
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent),putinplay(putinplay), asNormalMadness(madness), alternative(alternative)
|
||||
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent,bool putinplay,bool madness, bool alternative, int kicked) :
|
||||
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent),putinplay(putinplay), asNormalMadness(madness), alternative(alternative), kicked(kicked)
|
||||
{
|
||||
target = _target;
|
||||
andAbility = NULL;
|
||||
@@ -8739,6 +8739,10 @@ int AACastCard::resolveSpell()
|
||||
}
|
||||
if(alternative)
|
||||
copy->alternateCostPaid[ManaCost::MANA_PAID_WITH_ALTERNATIVE] = 1;
|
||||
if(kicked > 0){
|
||||
copy->alternateCostPaid[ManaCost::MANA_PAID_WITH_KICKER] = 1;
|
||||
copy->kicked = kicked;
|
||||
}
|
||||
if (game->targetChooser)
|
||||
{
|
||||
game->targetChooser->Owner = source->controller();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1488,14 +1488,8 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
||||
//Has been kicked
|
||||
else if (attribute.find("kicked") != string::npos)
|
||||
{
|
||||
if (minus)
|
||||
{
|
||||
cd.unsecureSetKicked(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cd.unsecureSetKicked(1);
|
||||
}
|
||||
cd.kicked = comparisonCriterion;
|
||||
cd.kickedComparisonMode = comparisonMode;
|
||||
}
|
||||
//Has kicker cost
|
||||
else if (attribute.find("haskicker") != string::npos)
|
||||
@@ -1648,27 +1642,25 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
||||
//Power restrictions
|
||||
cd.setPower(comparisonCriterion);
|
||||
cd.powerComparisonMode = comparisonMode;
|
||||
//Toughness restrictions
|
||||
}
|
||||
else if (attribute.find("toughness") != string::npos)
|
||||
{
|
||||
//Toughness restrictions
|
||||
cd.setToughness(comparisonCriterion);
|
||||
cd.toughnessComparisonMode = comparisonMode;
|
||||
//zpos restrictions
|
||||
}
|
||||
else if (attribute.find("zpos") != string::npos)
|
||||
{//using > or < don't have effect unless like this: >= or <= or =
|
||||
//zpos restrictions
|
||||
cd.zposition = comparisonCriterion;
|
||||
cd.zposComparisonMode = comparisonMode;
|
||||
//Manacost restrictions
|
||||
}
|
||||
else if (attribute.find("manacost") != string::npos)
|
||||
{
|
||||
//Manacost restrictions
|
||||
cd.convertedManacost = comparisonCriterion;
|
||||
cd.manacostComparisonMode = comparisonMode;
|
||||
//Counter Restrictions
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
int attributefound = 0;
|
||||
|
||||
@@ -3207,7 +3207,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
nameCard = splitCastName[1];
|
||||
}
|
||||
}
|
||||
MTGAbility *a = NEW AACastCard(observer, id, card, target,withRestrictions,asCopy,asNormal,nameCard,newName,sendNoEvent,putinplay, asNormalMadness, alternative);
|
||||
int kicked = 0;
|
||||
if(splitCastCard[1].find("kicked!:") != string::npos)
|
||||
{
|
||||
vector<string> splitCastKicked = parseBetween(splitCastCard[1], "kicked!:", ":!");
|
||||
if(splitCastKicked.size())
|
||||
{
|
||||
kicked = atoi(splitCastKicked[1].c_str());
|
||||
}
|
||||
}
|
||||
MTGAbility *a = NEW AACastCard(observer, id, card, target,withRestrictions,asCopy,asNormal,nameCard,newName,sendNoEvent,putinplay, asNormalMadness, alternative, kicked);
|
||||
a->oneShot = false;
|
||||
if(splitCastCard[1].find("trigger[to]") != string::npos)
|
||||
{
|
||||
|
||||
@@ -485,14 +485,8 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
//Has been kicked
|
||||
else if (attribute.find("kicked") != string::npos)
|
||||
{
|
||||
if (minus)
|
||||
{
|
||||
cd->unsecureSetKicked(-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cd->unsecureSetKicked(1);
|
||||
}
|
||||
cd->kicked = comparisonCriterion;
|
||||
cd->kickedComparisonMode = comparisonMode;
|
||||
}
|
||||
//Has kicker cost
|
||||
else if (attribute.find("haskicker") != string::npos)
|
||||
@@ -718,25 +712,24 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
//Power restrictions
|
||||
cd->setPower(comparisonCriterion);
|
||||
cd->powerComparisonMode = comparisonMode;
|
||||
//Toughness restrictions
|
||||
}
|
||||
else if (attribute.find("toughness") != string::npos)
|
||||
{
|
||||
//Toughness restrictions
|
||||
cd->setToughness(comparisonCriterion);
|
||||
cd->toughnessComparisonMode = comparisonMode;
|
||||
//zpos restrictions
|
||||
}
|
||||
else if (attribute.find("zpos") != string::npos)
|
||||
{
|
||||
//zpos restrictions
|
||||
cd->zposition = comparisonCriterion;
|
||||
cd->zposComparisonMode = comparisonMode;
|
||||
//Manacost restrictions
|
||||
}
|
||||
else if (attribute.find("manacost") != string::npos)
|
||||
{
|
||||
//Manacost restrictions
|
||||
cd->convertedManacost = comparisonCriterion;
|
||||
cd->manacostComparisonMode = comparisonMode;
|
||||
//Counter Restrictions
|
||||
}
|
||||
else if (attribute.find("share!") != string::npos)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user