add restriction for checking what alternative cost was paid. combined with if/ifnot ability becomes a very powerful tool.

paid(blah)
auto=if paid(alternative) then damage:3 target(creature)
auto=if paid(alternative) then life:10 target(player)
auto=ifnot paid(alternative) then damage:3 controller
auto=ifnot paid(alternative) then life:4 opponent

it can be used any place a restriction can be used. 
rearranged the constants for the payment type keywords to match the order we int the alternatePayment array on a card, added keywords for the remaining payment types, 

    "notpaid",
    "paidmana",
the 2 above pretain to paying the real manacost of a card
it checks the mana={1} cost line and is not joined to the other types.

    "kicker", 
    "alternative", 
    "buyback", 
    "flashback", 
    "retrace", 
    "facedown",
    "suspended"

note: all test pass in this revision.
This commit is contained in:
omegablast2002@yahoo.com
2013-01-15 02:11:05 +00:00
parent 9201860744
commit a26f872ff3
5 changed files with 56 additions and 6 deletions

View File

@@ -260,6 +260,12 @@ bool Spell::FullfilledAlternateCost(const int &costType)
switch (costType)
{
case ManaCost::MANA_UNPAID:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_UNPAID);
break;
case ManaCost::MANA_PAID:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID);
break;
case ManaCost::MANA_PAID_WITH_KICKER:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_KICKER);
break;
@@ -275,6 +281,9 @@ bool Spell::FullfilledAlternateCost(const int &costType)
case ManaCost::MANA_PAID_WITH_RETRACE:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_RETRACE);
break;
case ManaCost::MANA_PAID_WITH_SUSPEND:
hasFullfilledAlternateCost = (payResult == ManaCost::MANA_PAID_WITH_RETRACE);
break;
}
return hasFullfilledAlternateCost;