fix for recover cards, preliminary support for madness
This commit is contained in:
@@ -1160,14 +1160,14 @@ int GenericPaidAbility::resolve()
|
||||
baseAbility->target = target;
|
||||
optionalCost = ManaCost::parseManaCost(baseCost, NULL, source);
|
||||
|
||||
// hacky way to produce better MenuText
|
||||
/*// hacky way to produce better MenuText
|
||||
AAFakeAbility* isFake = dynamic_cast< AAFakeAbility* >( baseAbility );
|
||||
size_t findPayN = isFake->named.find(" {value} mana");
|
||||
if (isFake && findPayN != string::npos) {
|
||||
stringstream parseN;
|
||||
parseN << optionalCost->getCost(Constants::MTG_COLOR_ARTIFACT);
|
||||
isFake->named.replace(findPayN + 1, 7, parseN.str());
|
||||
}
|
||||
}//commented out, it crashes cards with recover ability*/
|
||||
|
||||
MTGAbility * set = baseAbility->clone();
|
||||
set->oneShot = true;
|
||||
@@ -5724,7 +5724,7 @@ const string AACastCard::getMenuText()
|
||||
return nameThis.c_str();
|
||||
if(putinplay)
|
||||
return "Put Into Play";
|
||||
return "Cast For Free";
|
||||
return "Cast Card";
|
||||
}
|
||||
|
||||
AACastCard * AACastCard::clone() const
|
||||
|
||||
@@ -411,6 +411,13 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
||||
}
|
||||
}
|
||||
|
||||
check = restriction[i].find("discarded");
|
||||
if(check != string::npos)
|
||||
{
|
||||
if(!card->discarded)
|
||||
return 0;
|
||||
}
|
||||
|
||||
check = restriction[i].find("ownerscontrol");
|
||||
if(check != string::npos)
|
||||
{
|
||||
@@ -3542,6 +3549,9 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
||||
badAbilities[(int)Constants::WEAK] = true;
|
||||
badAbilities[(int)Constants::NOLIFEGAIN] = true;
|
||||
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
|
||||
badAbilities[(int)Constants::CANTLOSE] = false;
|
||||
badAbilities[(int)Constants::CANTLIFELOSE] = false;
|
||||
badAbilities[(int)Constants::CANTMILLLOSE] = false;
|
||||
|
||||
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
|
||||
{
|
||||
|
||||
@@ -58,6 +58,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
|
||||
isSwitchedPT = false;
|
||||
isACopier = false;
|
||||
bypassTC = false;
|
||||
discarded = false;
|
||||
}
|
||||
|
||||
MTGCardInstance * MTGCardInstance::createSnapShot()
|
||||
|
||||
@@ -143,7 +143,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"spellmastery",
|
||||
"nolifegain",
|
||||
"nolifegainopponent",
|
||||
"auraward"
|
||||
"auraward",
|
||||
"madness"
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -325,6 +325,15 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
|
||||
bool ripToken = false;
|
||||
if (g->players[0]->game->battlefield->hasName("Rest in Peace")||g->players[1]->game->battlefield->hasName("Rest in Peace"))
|
||||
ripToken = true;
|
||||
//Madness or Put in Play...
|
||||
for(int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (card->discarded && (to == g->players[i]->game->graveyard) && (from == g->players[i]->game->hand))
|
||||
{
|
||||
if(card->basicAbilities[(int)Constants::MADNESS])
|
||||
to = g->players[i]->game->exile;
|
||||
}
|
||||
}
|
||||
//Darksteel Colossus, Legacy Weapon ... top priority since we replace destination directly automatically...
|
||||
for(int i = 0; i < 2; ++i)
|
||||
{
|
||||
@@ -361,6 +370,13 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
|
||||
{
|
||||
copy->miracle = true;
|
||||
}
|
||||
if (card->discarded)
|
||||
{//set discarded for madness...
|
||||
if(from == g->players[0]->game->hand || from == g->players[1]->game->hand)
|
||||
copy->discarded = true;
|
||||
else//turn off discarded if its previous zone is not in hand...
|
||||
copy->discarded = false;
|
||||
}
|
||||
if (options[Options::SFXVOLUME].number > 0)
|
||||
{
|
||||
if (to == g->players[0]->game->graveyard || to == g->players[1]->game->graveyard)
|
||||
|
||||
@@ -106,6 +106,7 @@ WEventCardSacrifice::WEventCardSacrifice(MTGCardInstance * card, MTGCardInstance
|
||||
WEventCardDiscard::WEventCardDiscard(MTGCardInstance * card) :
|
||||
WEventCardUpdate(card)
|
||||
{
|
||||
card->discarded = true;
|
||||
}
|
||||
|
||||
WEventCardCycle::WEventCardCycle(MTGCardInstance * card) :
|
||||
|
||||
Reference in New Issue
Block a user