Bushido & Modular
add Bushido and Modular points
This commit is contained in:
@@ -60,6 +60,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
|
||||
setAICustomCode(source->AICustomCode);
|
||||
setCrewAbility(source->CrewAbility);
|
||||
setPhasedOutAbility(source->PhasedOutAbility);
|
||||
setModularValue(source->ModularValue);
|
||||
power = source->power;
|
||||
toughness = source->toughness;
|
||||
restrictions = source->restrictions ? source->restrictions->clone() : NULL;
|
||||
@@ -381,6 +382,17 @@ const string& CardPrimitive::getPhasedOutAbility() const
|
||||
return PhasedOutAbility;
|
||||
}
|
||||
|
||||
void CardPrimitive::setModularValue(const string& value)
|
||||
{
|
||||
ModularValue = value;
|
||||
std::transform(ModularValue.begin(), ModularValue.end(), ModularValue.begin(), ::tolower);
|
||||
}
|
||||
|
||||
const string& CardPrimitive::getModularValue() const
|
||||
{
|
||||
return ModularValue;
|
||||
}
|
||||
|
||||
void CardPrimitive::setName(const string& value)
|
||||
{
|
||||
name = value;
|
||||
|
||||
@@ -3501,7 +3501,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
vector<string>splitPT = split(splitBushido[1],'/');
|
||||
if(!splitPT.size())
|
||||
return NULL;
|
||||
return NEW ABushidoAbility(observer, id, card,splitBushido[1]);
|
||||
return NEW ABushidoAbility(observer, id, card,splitBushido[1],splitPT[0]);
|
||||
}
|
||||
vector<string> splitPhaseAlter = parseBetween(s, "phasealter(", ")");
|
||||
if (splitPhaseAlter.size())
|
||||
@@ -5327,6 +5327,12 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
|
||||
observer->addObserver(NEW AFlankerAbility(observer, _id, card));
|
||||
}
|
||||
|
||||
if(card->basicAbilities[(int)Constants::MODULAR])
|
||||
{
|
||||
AModularAbility * ability = NEW AModularAbility(observer, _id, card, card, card->getModularValue());
|
||||
observer->addObserver(ability);
|
||||
}
|
||||
|
||||
const int HomeAbilities[] = {(int)Constants::FORESTHOME, (int)Constants::ISLANDHOME, (int)Constants::MOUNTAINHOME, (int)Constants::SWAMPHOME, (int)Constants::PLAINSHOME};
|
||||
const char * HomeLands[] = {"forest", "island", "mountain", "swamp", "plains"};
|
||||
|
||||
|
||||
@@ -154,6 +154,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
doubleFaced = data->doubleFaced;
|
||||
AICustomCode = data->AICustomCode;
|
||||
CrewAbility = data->CrewAbility;
|
||||
ModularValue = data->ModularValue;
|
||||
PhasedOutAbility = data->PhasedOutAbility;
|
||||
origpower = card->origpower;//for flip
|
||||
origtoughness = card->origtoughness;//for flip
|
||||
@@ -279,6 +280,8 @@ void MTGCardInstance::initMTGCI()
|
||||
imprintR = 0;
|
||||
imprintB = 0;
|
||||
imprintW = 0;
|
||||
bushidoPoints = 0;
|
||||
modularPoints = 0;
|
||||
entersBattlefield = 0;
|
||||
currentimprintName = "";
|
||||
imprintedNames.clear();
|
||||
|
||||
@@ -224,9 +224,16 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
case 'm': //mana
|
||||
if (!primitive) primitive = NEW CardPrimitive();
|
||||
{
|
||||
string value = val;
|
||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||
primitive->setManaCost(value);
|
||||
if( key == "modular")//modular
|
||||
{
|
||||
primitive->setModularValue(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
string value = val;
|
||||
std::transform(value.begin(), value.end(), value.begin(), ::tolower);
|
||||
primitive->setManaCost(value);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -187,7 +187,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"showfromtoplibrary",
|
||||
"showopponenttoplibrary",
|
||||
"totemarmor",
|
||||
"discardtoplaybyopponent"
|
||||
"discardtoplaybyopponent",
|
||||
"modular"
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
Reference in New Issue
Block a user