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:
omegablast2002@yahoo.com
2011-07-23 10:36:03 +00:00
parent bd1c31b6f9
commit 444d13b457
3 changed files with 73 additions and 0 deletions
+42
View File
@@ -2065,6 +2065,48 @@ AAWinGame * AAWinGame::clone() const
//Generic Abilities
//IfThenEffect
IfThenAbility::IfThenAbility(int _id, string delayAbility, MTGCardInstance * _source, int type,string Cond) :
MTGAbility(_id, _source),delayAbility(delayAbility), type(type),Cond(Cond)
{
}
int IfThenAbility::resolve()
{
MTGCardInstance * card = (MTGCardInstance*)source;
AbilityFactory af;
int checkCond = af.parseCastRestrictions(card,card->controller(),Cond);
if((checkCond && type == 1)||(!checkCond && type == 2))
{
MTGAbility * a1 = af.parseMagicLine(delayAbility, this->GetId(), NULL, card);
if (!a1)
return 0;
if(a1->oneShot)
{
a1->resolve();
SAFE_DELETE(a1);
}
else
a1->addToGame();
return 1;
}
return 0;
}
const char * IfThenAbility::getMenuText()
{
return "";
}
IfThenAbility * IfThenAbility::clone() const
{
IfThenAbility * a = NEW IfThenAbility(*this);
a->isClone = 1;
return a;
}
//
//May Abilities
MayAbility::MayAbility(int _id, MTGAbility * _ability, MTGCardInstance * _source, bool must) :
MTGAbility(_id, _source), NestedAbility(_ability), must(must)