forked from External/mage
Fix OrTriggeredAbility interaction with AtStepTriggeredAbility, remove unneeded RazorPendulum withTargetPointerSet
This commit is contained in:
parent
2ec9b8efa9
commit
924585cb86
2 changed files with 4 additions and 2 deletions
|
|
@ -27,7 +27,7 @@ public final class RazorPendulum extends CardImpl {
|
||||||
TargetController.EACH_PLAYER,
|
TargetController.EACH_PLAYER,
|
||||||
new DamageTargetEffect(2, true, "that player"),
|
new DamageTargetEffect(2, true, "that player"),
|
||||||
false, condition
|
false, condition
|
||||||
).withTargetPointerSet(true));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private RazorPendulum(final RazorPendulum card) {
|
private RazorPendulum(final RazorPendulum card) {
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,14 @@ public class OrTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
boolean toRet = false;
|
boolean toRet = false;
|
||||||
for (TriggeredAbility ability : triggeredAbilities) {
|
for (TriggeredAbility ability : triggeredAbilities) {
|
||||||
for (Effect e : getEffects()) { //Add effects to the sub-abilities so that they can set target pointers
|
for (Effect e : getEffects()) { // Add effects to the sub-abilities so that they can set target pointers
|
||||||
ability.addEffect(e);
|
ability.addEffect(e);
|
||||||
}
|
}
|
||||||
|
ability.getTargets().addAll(this.getTargets()); // AtStepTriggeredAbility automatically sets target pointer if it can't find any targets
|
||||||
if (ability.checkEventType(event, game) && ability.checkTrigger(event, game) && ability.checkTriggerCondition(game)) {
|
if (ability.checkEventType(event, game) && ability.checkTrigger(event, game) && ability.checkTriggerCondition(game)) {
|
||||||
toRet = true;
|
toRet = true;
|
||||||
}
|
}
|
||||||
|
ability.getTargets().clear();
|
||||||
ability.getEffects().clear(); //Remove afterwards, ensures that they remain synced even with copying
|
ability.getEffects().clear(); //Remove afterwards, ensures that they remain synced even with copying
|
||||||
}
|
}
|
||||||
return toRet;
|
return toRet;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue