mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Fixed the AI changing targets of triggers with "OptionalDecider" before resolving.
This commit is contained in:
@@ -10,7 +10,7 @@ SVar:DBSacrifice:DB$ Sacrifice | ConditionCheckSVar$ X | ConditionSVarCompare$ E
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | OptionalDecider$ You | Execute$ TrigDealDamage | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your draw step, you may have CARDNAME deal 3 damage to target creature.
|
||||
SVar:TrigDealDamage:AB$DealDamage | Cost$ 0 | Tgt$ TgtC | NumDmg$ 3
|
||||
SVar:TrigDealDamage:AB$ DealDamage | Cost$ 0 | Tgt$ TgtC | NumDmg$ 3
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/razormane_masticore.jpg
|
||||
|
||||
@@ -124,6 +124,17 @@ public class TargetChoices {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* clear.
|
||||
* </p>
|
||||
*/
|
||||
public final void clear() {
|
||||
this.targetPlayers.clear();
|
||||
this.targetCards.clear();
|
||||
this.targetSAs.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* removeTarget.
|
||||
|
||||
@@ -978,10 +978,21 @@ public class TriggerHandler {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ArrayList<Object> tgts = null;
|
||||
// make sure the targets won't change
|
||||
if (sa[0].getTarget() != null) {
|
||||
tgts = new ArrayList<Object>(sa[0].getTarget().getTargetChoices().getTargets());
|
||||
}
|
||||
// This isn't quite right, but better than canPlayAI
|
||||
if (!sa[0].doTrigger(isMandatory)) {
|
||||
return;
|
||||
}
|
||||
if (sa[0].getTarget() != null) {
|
||||
for (Object tgt : tgts) {
|
||||
sa[0].getTarget().getTargetChoices().clear();
|
||||
sa[0].getTarget().getTargetChoices().addTarget(tgt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user