Altercost

Altercost alter cards to be cast...
Removed Trinisphere temporarily...
This commit is contained in:
Anthony Calosa
2015-10-30 07:11:16 +08:00
parent 40db1180df
commit 8793feb9ba
12 changed files with 297 additions and 149 deletions

View File

@@ -1079,6 +1079,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
MTGGameZone * dest)
{
size_t found;
bool asAlternate = false;
trim(s);
//TODO This block redundant with calling function
if (!card && spell)
@@ -1088,7 +1089,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
MTGCardInstance * target = card->target;
if (!target)
target = card;
//pay and castcard?
if(s.find("pay(") != string::npos || s.find("pay[[") != string::npos && s.find("castcard(restricted") != string::npos)
asAlternate = true;
//MTG Specific rules
//adds the bonus credit system
found = s.find("bonusrule");
@@ -1586,7 +1589,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
vector<string> splitMayPay = parseBetween(s, "pay(", ")", true);
if(splitMayPay.size())
{
GenericPaidAbility * a = NEW GenericPaidAbility(observer, id, card, target,newName,castRestriction,splitMayPay[1],storedPayString);
GenericPaidAbility * a = NEW GenericPaidAbility(observer, id, card, target,newName,castRestriction,splitMayPay[1],storedPayString,asAlternate);
a->oneShot = 1;
a->canBeInterrupted = false;
return a;
@@ -2091,7 +2094,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
vector<string> splitMayPaysub = parseBetween(s, "pay[[","]]", true);
if (splitMayPaysub.size())
{
GenericPaidAbility * a = NEW GenericPaidAbility(observer, id, card, target,newName,castRestriction,splitMayPaysub[1],storedPayString);
GenericPaidAbility * a = NEW GenericPaidAbility(observer, id, card, target,newName,castRestriction,splitMayPaysub[1],storedPayString,asAlternate);
a->oneShot = 1;
a->canBeInterrupted = false;
return a;