Added the possibility to specify a name for Kicker cost and Retrace cost with "name()" keyword, implemented Escape cost with Retrace cost, implemented Fuse cost with Kicker cost, fixed several primitives.
This commit is contained in:
@@ -51,6 +51,10 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
|
||||
//increasedCost.copy(source->getIncreasedManaCost());
|
||||
if(source->getManaCost()->getAlternative())
|
||||
manaCost.getAlternative()->alternativeName = source->getManaCost()->getAlternative()->alternativeName;
|
||||
if(source->getManaCost()->getKicker())
|
||||
manaCost.getKicker()->alternativeName = source->getManaCost()->getKicker()->alternativeName;
|
||||
if(source->getManaCost()->getRetrace())
|
||||
manaCost.getRetrace()->alternativeName = source->getManaCost()->getRetrace()->alternativeName;
|
||||
|
||||
text = source->text;
|
||||
formattedText = source->formattedText;
|
||||
|
||||
@@ -218,9 +218,19 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
size_t endK = value.find("{",multikick);
|
||||
value.erase(multikick, endK - multikick);
|
||||
isMultikicker = true;
|
||||
}
|
||||
}
|
||||
cost->setKicker(ManaCost::parseManaCost(value));
|
||||
cost->getKicker()->isMulti = isMultikicker;
|
||||
size_t name = value.find("name(");
|
||||
string theName = "";
|
||||
if(name != string::npos)
|
||||
{
|
||||
size_t endName = value.find(")",name);
|
||||
theName = value.substr(name + 5,endName - name - 5);
|
||||
value.erase(name, endName - name + 1);
|
||||
}
|
||||
if(theName.size())
|
||||
cost->getKicker()->alternativeName.append(theName);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -310,6 +320,16 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
string value = val;
|
||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||
cost->setRetrace(ManaCost::parseManaCost(value));
|
||||
size_t name = value.find("name(");
|
||||
string theName = "";
|
||||
if(name != string::npos)
|
||||
{
|
||||
size_t endName = value.find(")",name);
|
||||
theName = value.substr(name + 5,endName - name - 5);
|
||||
value.erase(name, endName - name + 1);
|
||||
}
|
||||
if(theName.size())
|
||||
cost->getRetrace()->alternativeName.append(theName);
|
||||
}
|
||||
}
|
||||
else if (s.find("rar") != string::npos)
|
||||
|
||||
@@ -636,6 +636,9 @@ int MTGKickerRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
|
||||
if(!card->getManaCost()->getKicker())
|
||||
return 0;
|
||||
|
||||
if(card->model->data->getManaCost()->getKicker() && card->model->data->getManaCost()->getKicker()->alternativeName.size())
|
||||
alternativeName = card->model->data->getManaCost()->getKicker()->alternativeName;
|
||||
|
||||
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::ASFLASH) || (card->StackIsEmptyandSorcerySpeed()))
|
||||
{
|
||||
if(card->controller()->epic)
|
||||
@@ -1264,7 +1267,11 @@ int MTGRetraceRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
for(unsigned int i = 0; i < retraceCost->extraCosts->costs.size();i++)
|
||||
{
|
||||
retraceCost->extraCosts->costs[i]->setSource(card);
|
||||
}
|
||||
}
|
||||
|
||||
if(card->model->data->getManaCost()->getRetrace() && card->model->data->getManaCost()->getRetrace()->alternativeName.size())
|
||||
alternativeName = card->model->data->getManaCost()->getRetrace()->alternativeName;
|
||||
|
||||
return MTGAlternativeCostRule::isReactingToClick( card, mana, retraceCost);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user