This commit is contained in:
jeffwadsworth 2019-02-09 21:57:45 -06:00
parent 3029e16fc1
commit dc693e645a
2 changed files with 12 additions and 6 deletions

View file

@ -96,7 +96,7 @@ class DomriChaosBringerEffect extends OneShotEffect {
} else {
manaEffect = new BasicManaEffect(Mana.GreenMana(1));
}
game.addDelayedTriggeredAbility(new DomriChaosBringerTriggeredAbility(source.getSourceId()), source);
game.addDelayedTriggeredAbility(new DomriChaosBringerTriggeredAbility(source.getSourceId(), game.getTurnNum()), source);
return manaEffect.apply(game, source);
}
}
@ -104,16 +104,19 @@ class DomriChaosBringerEffect extends OneShotEffect {
class DomriChaosBringerTriggeredAbility extends DelayedTriggeredAbility {
private final UUID spellId;
private final int turnNumber;
DomriChaosBringerTriggeredAbility(UUID spellId) {
super(null, Duration.EndOfStep, true);
DomriChaosBringerTriggeredAbility(UUID spellId, int turnNumber) {
super(null, Duration.Custom, true);
this.spellId = spellId;
this.turnNumber = turnNumber;
this.usesStack = false;
}
private DomriChaosBringerTriggeredAbility(final DomriChaosBringerTriggeredAbility ability) {
super(ability);
this.spellId = ability.spellId;
this.turnNumber = ability.turnNumber;
}
@Override
@ -126,6 +129,9 @@ class DomriChaosBringerTriggeredAbility extends DelayedTriggeredAbility {
if (!event.getSourceId().equals(spellId)) {
return false;
}
if (game.getTurnNum() != turnNumber) {
return false;
}
MageObject mo = game.getObject(event.getTargetId());
if (mo == null || !mo.isCreature()) {
return false;

View file

@ -8,7 +8,7 @@ import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.TargetController;
import mage.filter.common.FilterPermanentOrPlayer;
import mage.filter.common.FilterCreaturePlayerOrPlaneswalker;
import mage.filter.predicate.other.PlayerPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -18,10 +18,10 @@ import mage.filter.predicate.permanent.ControllerPredicate;
*/
public final class Endure extends CardImpl {
private static final FilterPermanentOrPlayer filter = new FilterPermanentOrPlayer("you and permanents you control");
private static final FilterCreaturePlayerOrPlaneswalker filter = new FilterCreaturePlayerOrPlaneswalker("you and permanents you control");
static {
filter.getPermanentFilter().add(new ControllerPredicate(TargetController.YOU));
filter.getCreatureFilter().add(new ControllerPredicate(TargetController.YOU));
filter.getPlayerFilter().add(new PlayerPredicate(TargetController.YOU));
}