mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Fix AI not playing or confirming bad ImmediateTrigger
This commit is contained in:
@@ -31,6 +31,11 @@ public class ImmediateTriggerAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
|
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
|
||||||
|
// always add to stack, targeting happens after payment
|
||||||
|
if (mandatory) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
String logic = sa.getParamOrDefault("AILogic", "");
|
String logic = sa.getParamOrDefault("AILogic", "");
|
||||||
|
|
||||||
SpellAbility trigsa = sa.getAdditionalAbility("Execute");
|
SpellAbility trigsa = sa.getAdditionalAbility("Execute");
|
||||||
@@ -45,11 +50,7 @@ public class ImmediateTriggerAi extends SpellAbilityAi {
|
|||||||
AiController aic = ((PlayerControllerAi)ai.getController()).getAi();
|
AiController aic = ((PlayerControllerAi)ai.getController()).getAi();
|
||||||
trigsa.setActivatingPlayer(ai);
|
trigsa.setActivatingPlayer(ai);
|
||||||
|
|
||||||
if (!sa.hasParam("OptionalDecider")) {
|
return aic.doTrigger(trigsa, !"You".equals(sa.getParamOrDefault("OptionalDecider", "You")));
|
||||||
return aic.doTrigger(trigsa, true);
|
|
||||||
} else {
|
|
||||||
return aic.doTrigger(trigsa, !sa.getParam("OptionalDecider").equals("You"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ ManaCost:1 G
|
|||||||
Types:Creature Elf Soldier
|
Types:Creature Elf Soldier
|
||||||
PT:2/2
|
PT:2/2
|
||||||
K:Trample
|
K:Trample
|
||||||
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | CheckSVar$ X | SVarCompare$ GE1 | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on CARDNAME.
|
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | IsPresent$ Planeswalker.Ajani+YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ At the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on CARDNAME.
|
||||||
SVar:TrigPutCounter:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1
|
SVar:TrigPutCounter:DB$ PutCounter | CounterType$ P1P1 | CounterNum$ 1
|
||||||
SVar:X:Count$Valid Planeswalker.Ajani+YouCtrl
|
|
||||||
Oracle:Trample\nAt the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on Ajani's Comrade.
|
Oracle:Trample\nAt the beginning of combat on your turn, if you control an Ajani planeswalker, put a +1/+1 counter on Ajani's Comrade.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ Name:Cemetery Desecrator
|
|||||||
ManaCost:4 B B
|
ManaCost:4 B B
|
||||||
Types:Creature Zombie
|
Types:Creature Zombie
|
||||||
PT:4/4
|
PT:4/4
|
||||||
|
K:Menace
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield or dies, exile another card from a graveyard.
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield or dies, exile another card from a graveyard.
|
||||||
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigExile | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or dies, exile another card from a graveyard.
|
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigExile | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or dies, exile another card from a graveyard.
|
||||||
SVar:TrigExile:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | Hidden$ True | RememberChanged$ True | ChangeType$ Card.Other | ChangeNum$ 1 | Mandatory$ True | AILogic$ ExilePreference:HighestCMC | SubAbility$ DBImmediateTrigger
|
SVar:TrigExile:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | Hidden$ True | RememberChanged$ True | ChangeType$ Card.Other | ChangeNum$ 1 | Mandatory$ True | AILogic$ ExilePreference:HighestCMC | SubAbility$ DBImmediateTrigger
|
||||||
|
|||||||
Reference in New Issue
Block a user