Improved the Modal Double Faced cards for Zendikar Rising (es. nofizzle when choosing land face, flip for instant and sorcery, new restriction for playing land face during turn).
This commit is contained in:
@@ -5009,7 +5009,8 @@ public:
|
|||||||
string flipStats;
|
string flipStats;
|
||||||
bool isflipcard;
|
bool isflipcard;
|
||||||
bool forcedcopy;
|
bool forcedcopy;
|
||||||
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard = false, bool forcedcopy = false);
|
string forcetype;
|
||||||
|
AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, string flipStats, bool isflipcard = false, bool forcedcopy = false, string forcetype = "");
|
||||||
int resolve();
|
int resolve();
|
||||||
int testDestroy();
|
int testDestroy();
|
||||||
const string getMenuText();
|
const string getMenuText();
|
||||||
|
|||||||
@@ -285,7 +285,8 @@ class Constants
|
|||||||
ADVENTURE = 159,
|
ADVENTURE = 159,
|
||||||
MENTOR = 160,
|
MENTOR = 160,
|
||||||
PROWESS = 161,
|
PROWESS = 161,
|
||||||
NB_BASIC_ABILITIES = 162,
|
NOFIZZLEALTERNATIVE = 162,
|
||||||
|
NB_BASIC_ABILITIES = 163,
|
||||||
|
|
||||||
RARITY_S = 'S', //Special Rarity
|
RARITY_S = 'S', //Special Rarity
|
||||||
RARITY_M = 'M', //Mythics
|
RARITY_M = 'M', //Mythics
|
||||||
|
|||||||
@@ -2999,6 +2999,8 @@ int AAFizzler::resolve()
|
|||||||
sCard = sTarget->source;
|
sCard = sTarget->source;
|
||||||
if (!sCard || !sTarget || sCard->has(Constants::NOFIZZLE))
|
if (!sCard || !sTarget || sCard->has(Constants::NOFIZZLE))
|
||||||
return 0;
|
return 0;
|
||||||
|
if (sCard->has(Constants::NOFIZZLEALTERNATIVE) && sCard->alternateCostPaid[ManaCost::MANA_PAID_WITH_ALTERNATIVE]) // No fizzle if paid with alternative cost (es. Zendikar Rising Modal Double Faced cards).
|
||||||
|
return 0;
|
||||||
if (source->alias == 111057 && sTarget)//Draining Whelk
|
if (source->alias == 111057 && sTarget)//Draining Whelk
|
||||||
{
|
{
|
||||||
for (int j = sTarget->cost->getConvertedCost(); j > 0; j--)
|
for (int j = sTarget->cost->getConvertedCost(); j > 0; j--)
|
||||||
@@ -3683,8 +3685,8 @@ AAMeld * AAMeld::clone() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// flip a card
|
// flip a card
|
||||||
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy) :
|
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy, string forcetype) :
|
||||||
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy)
|
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy),forcetype(forcetype)
|
||||||
{
|
{
|
||||||
target = _target;
|
target = _target;
|
||||||
}
|
}
|
||||||
@@ -3713,6 +3715,13 @@ int AAFlip::resolve()
|
|||||||
while (_target->next)
|
while (_target->next)
|
||||||
_target = _target->next;
|
_target = _target->next;
|
||||||
|
|
||||||
|
if(forcetype != "" && _target) // Added to flip instants and sorceries as permanents (es. Zendikar Rising Modal Double Faced cards).
|
||||||
|
{
|
||||||
|
_target = _target->controller()->game->putInZone(_target,_target->currentZone,_target->controller()->game->battlefield, false);
|
||||||
|
source->addType(forcetype);
|
||||||
|
source->controller()->game->battlefield->cardsSeenThisTurn.push_back(source);
|
||||||
|
}
|
||||||
|
|
||||||
AbilityFactory af(game);
|
AbilityFactory af(game);
|
||||||
_target->isFlipped = true;
|
_target->isFlipped = true;
|
||||||
GameObserver * game = _target->getObserver();
|
GameObserver * game = _target->getObserver();
|
||||||
|
|||||||
@@ -825,6 +825,22 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
|||||||
if(!found)
|
if(!found)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
check = restriction[i].find("can play land");
|
||||||
|
if(check != string::npos)
|
||||||
|
{
|
||||||
|
bool isLand = card->hasType("Land");
|
||||||
|
bool canplay = true;
|
||||||
|
if(!isLand)
|
||||||
|
card->addType("Land");
|
||||||
|
if (observer->currentActionPlayer->game->playRestrictions->canPutIntoZone(card, observer->currentActionPlayer->game->inPlay) == PlayRestriction::CANT_PLAY)
|
||||||
|
canplay = false;
|
||||||
|
if (!card->StackIsEmptyandSorcerySpeed())
|
||||||
|
canplay = false;
|
||||||
|
if(!isLand)
|
||||||
|
card->removeType("Land");
|
||||||
|
if(!canplay)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
check = restriction[i].find("paid(");
|
check = restriction[i].find("paid(");
|
||||||
if(check != string::npos)
|
if(check != string::npos)
|
||||||
{
|
{
|
||||||
@@ -4042,8 +4058,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
/*vector<string>FlipStats = split(splitFlipStat[1],'%');*/
|
/*vector<string>FlipStats = split(splitFlipStat[1],'%');*/
|
||||||
flipStats = splitFlipStat[1];
|
flipStats = splitFlipStat[1];
|
||||||
}
|
}
|
||||||
|
vector<string> splitType = parseBetween(s, "forcetype(", ")", true); // Added to flip instants and sorceries as permanents (es. Zendikar Rising Modal Double Faced cards).
|
||||||
|
string forcetype = "";
|
||||||
|
if(splitType.size() && splitType[1].size())
|
||||||
|
{
|
||||||
|
forcetype = splitType[1];
|
||||||
|
}
|
||||||
bool transmode = card->getdoubleFaced() == "kamiflip"?true:false;
|
bool transmode = card->getdoubleFaced() == "kamiflip"?true:false;
|
||||||
MTGAbility * a = NEW AAFlip(observer, id, card, target,flipStats,transmode);
|
MTGAbility * a = NEW AAFlip(observer, id, card, target, flipStats, transmode, false, forcetype);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
|||||||
"mutate", //it can mutate
|
"mutate", //it can mutate
|
||||||
"adventure", //it can be adventure
|
"adventure", //it can be adventure
|
||||||
"mentor",
|
"mentor",
|
||||||
"prowess"
|
"prowess",
|
||||||
|
"nofizzle alternative" // No fizzle if paid with alternative cost (es. Zendikar Rising Modal Double Faced cards).
|
||||||
};
|
};
|
||||||
|
|
||||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||||
|
|||||||
Reference in New Issue
Block a user