megapatch contents
added
"whenever a creature enters the battlefield you may pay {1}, if you do gain one life"
conditional may pay({cost}) effect
this version is a super type ability, and can only be used in certain combos.
to nest you will need to use it in its subtype pay[[{cost}]] effect
pay keyword can have sideeffects coded as follows
pay[[{1}]] life:1?life:-1
pay one mana and gain 1 life, if you dont then you lose one life. notice no space between the abilities and the question mark.
added castcard()
a method to cast a targeted card, this contains the following subkeywords which can be used in combinations
(normal)
(restricted)
(copied)
(noevent)
castcard(restricted copied noevent) for example will cast a card that is a copy or the spell without sending a cast event only when the spell is castable.
"normal" subkeyword cast the actual spell, not a copy.
extended the use of exiledeath to everyzone, any card going from any zone to graveyard is placed in exile if it has exiledeath.
limited swipe left to open hand only when hand is closed view.
"moveto(" can now be named.
This commit is contained in:
@@ -1354,7 +1354,24 @@ int AIPlayerBaka::selectHintAbility()
|
||||
|
||||
int AIPlayerBaka::selectAbility()
|
||||
{
|
||||
observer->mExtraPayment = NULL;
|
||||
if(observer->mExtraPayment && observer->mExtraPayment->source->controller() == this)
|
||||
{
|
||||
extraManaCost * check = NULL;
|
||||
check = dynamic_cast<extraManaCost*>(observer->mExtraPayment->costs[0]);
|
||||
if(check)
|
||||
{
|
||||
vector<MTGAbility*> CostToPay = canPayMana(observer->mExtraPayment->source,check->costToPay);
|
||||
if(CostToPay.size())
|
||||
{
|
||||
payTheManaCost(check->costToPay,check->source,CostToPay);
|
||||
}
|
||||
else
|
||||
{
|
||||
observer->mExtraPayment->action->CheckUserInput(JGE_BTN_SEC);
|
||||
observer->mExtraPayment = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Try Deck hints first
|
||||
if (selectHintAbility())
|
||||
return 1;
|
||||
@@ -1479,7 +1496,11 @@ int AIPlayerBaka::effectBadOrGood(MTGCardInstance * card, int mode, TargetChoose
|
||||
|
||||
int AIPlayerBaka::chooseTarget(TargetChooser * _tc, Player * forceTarget,MTGCardInstance * chosenCard,bool checkOnly)
|
||||
{
|
||||
if(observer->mExtraPayment)
|
||||
{
|
||||
observer->mExtraPayment->action->CheckUserInput(JGE_BTN_SEC);
|
||||
observer->mExtraPayment = NULL;
|
||||
}
|
||||
//there should never be a case where a extra cost target selection is happening at the same time as this..
|
||||
//extracost uses "chooseCard()" to determine its targets.
|
||||
vector<Targetable *> potentialTargets;
|
||||
@@ -2132,8 +2153,11 @@ int AIPlayerBaka::computeActions()
|
||||
else
|
||||
{
|
||||
if(observer->mExtraPayment)
|
||||
{
|
||||
//no extra payment should be waiting before selecting an ability.
|
||||
observer->mExtraPayment->action->CheckUserInput(JGE_BTN_SEC);
|
||||
observer->mExtraPayment = NULL;
|
||||
}
|
||||
//this is a fix for a rare bug that somehow ai trips over an extra payment without paying
|
||||
//then locks in a loop of trying to choose something different to do and trying to pay the extra payment.
|
||||
selectAbility();
|
||||
@@ -2538,6 +2562,25 @@ int AIPlayerBaka::Act(float dt)
|
||||
{
|
||||
if (observer->isInterrupting == this)
|
||||
{
|
||||
if(observer->mExtraPayment && observer->mExtraPayment->source->controller() == this)
|
||||
{
|
||||
extraManaCost * check = NULL;
|
||||
check = dynamic_cast<extraManaCost*>(observer->mExtraPayment->costs[0]);
|
||||
if(check)
|
||||
{
|
||||
vector<MTGAbility*> CostToPay = canPayMana(observer->mExtraPayment->source,check->costToPay);
|
||||
if(CostToPay.size())
|
||||
{
|
||||
payTheManaCost(check->costToPay,check->source,CostToPay);
|
||||
}
|
||||
else
|
||||
{
|
||||
observer->mExtraPayment->action->CheckUserInput(JGE_BTN_SEC);
|
||||
observer->mExtraPayment = NULL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
observer->mLayers->stackLayer()->cancelInterruptOffer(); //endOfInterruption();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user