Fixed some card primitives, added support for "other" parsing power, toughness and converted cost, added Ingest

Ingest -> topcard of library to exile
Usage ingest:value
ingest:20 will send the top 20 cards of library to exile
This commit is contained in:
Anthony Calosa
2015-09-25 17:39:35 +08:00
parent 201b6d9cfa
commit 2869460a7f
4 changed files with 82 additions and 35 deletions
+10 -3
View File
@@ -261,8 +261,8 @@ AADamager * AADamager::clone() const
//AADepleter
AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost, int who) :
ActivatedAbilityTP(observer, _id, card, _target, _cost, who),nbcardsStr(nbcardsStr)
AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target,string nbcardsStr, ManaCost * _cost, int who, bool toexile) :
ActivatedAbilityTP(observer, _id, card, _target, _cost, who),nbcardsStr(nbcardsStr),toexile(toexile)
{
}
@@ -277,7 +277,12 @@ AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card,
for (int i = 0; i < numCards.getValue(); i++)
{
if (library->nb_cards)
player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->graveyard);
{
if(toexile)
player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->exile);
else
player->game->putInZone(library->cards[library->nb_cards - 1], library, player->game->graveyard);
}
}
}
return 1;
@@ -285,6 +290,8 @@ AADepleter::AADepleter(GameObserver* observer, int _id, MTGCardInstance * card,
const string AADepleter::getMenuText()
{
if(toexile)
return "Ingest";
return "Deplete";
}
+13 -1
View File
@@ -2529,7 +2529,17 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if (splitDeplete.size())
{
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AADepleter(observer, id, card, t , splitDeplete[1], NULL, who);
MTGAbility * a = NEW AADepleter(observer, id, card, t , splitDeplete[1], NULL, who, false);
a->oneShot = 1;
return a;
}
//Ingest
vector<string> splitIngest = parseBetween(s, "ingest:", " ", false);
if (splitIngest.size())
{
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AADepleter(observer, id, card, t , splitIngest[1], NULL, who, true);
a->oneShot = 1;
return a;
}
@@ -3530,6 +3540,8 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
badAbilities[(int)Constants::ONLYMANA] = true;
badAbilities[(int)Constants::EXILEDEATH] = true;
badAbilities[(int)Constants::WEAK] = true;
badAbilities[(int)Constants::NOLIFEGAIN] = true;
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
{