added an "ifnot|if then" ability, with the option to turn on kicker payment menu choice, it created issue with the cards which were using the "kicker" workaround to show that a card was cast...
the ability checks against any of the current cast restriction checks and is written in the following syntax
example phaige the untouchable is
auto=ifnot casted(this) then wingame opponent
if|ifnot condiation then ability
this can also be used in && abilities such as this card
pulse of the grid
auto=draw:2 && target(*|myhand) reject && if type(*|opponenthand)~morethan~type(*|myhand) then moveto(myhand) all(this)
this adds a few cards in its current state, though the aim for this ability was removing the use of "kicker" workaround for cards like the divinity creatures.
i plan to extend this to support such effects as "if spentmana({b}{u}) then effect....and other conditional checks currently not possible even with workarounds.
I'm committing these now since im working on abilities for kiaos mod and don't want to have a 20 page changelog.
also added missing text to binding grasp, it was thought that it was bugged becuase it simply "ended" its effect....however this is a confusion since the effect was ending due to upcost not being paid, however the card text did not reflect that it had a upcost....
This commit is contained in:
@@ -906,6 +906,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return parseMagicLine(s.substr(kAlternateCostKeywords[i].length()), id, spell, card);
|
||||
}
|
||||
}
|
||||
|
||||
//if/ifnot COND then DO EFFECT.
|
||||
const string ifKeywords[] = {"if ", "ifnot "};
|
||||
int checkIf[] = { 1, 2 };
|
||||
for (size_t i =0; i < sizeof(checkIf)/sizeof(checkIf[0]); ++i)
|
||||
{
|
||||
if (sWithoutTc.find(ifKeywords[i]) == 0)
|
||||
{
|
||||
string cond = sWithoutTc.substr(ifKeywords[i].length(),ifKeywords[i].length() + sWithoutTc.find(" then ")-6);
|
||||
string s1 = s.substr(s.find(" then ")+6);
|
||||
MTGAbility * a = NEW IfThenAbility(id, s1, card,checkIf[i],cond);
|
||||
a->canBeInterrupted = false;
|
||||
a->oneShot = true;
|
||||
if(tc)
|
||||
SAFE_DELETE(tc);
|
||||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
//When...comes into play, you may...
|
||||
//When...comes into play, choose one...
|
||||
|
||||
Reference in New Issue
Block a user