* Victimize - Fixed that continuous effects of sacrificed permanent did not end before returning targets from graveyard (fixes #4315).

This commit is contained in:
LevelX2 2018-01-02 15:01:58 +01:00
parent 8d0079bd3d
commit 70c08a2d81
2 changed files with 5 additions and 5 deletions

View file

@ -51,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
public class Victimize extends CardImpl {
public Victimize(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}");
// Choose two target creature cards in your graveyard. Sacrifice a creature. If you do, return the chosen cards to the battlefield tapped.
this.getSpellAbility().addEffect(new VictimizeEffect());
@ -90,6 +90,7 @@ class VictimizeEffect extends OneShotEffect {
if (controller != null) {
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")));
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) {
game.applyEffects(); // To end effects of the sacrificed creature
controller.moveCards(new CardsImpl(getTargetPointer().getTargets(game, source)).getCards(game),
Zone.BATTLEFIELD, source, game, true, false, false, null);
}

View file

@ -77,6 +77,7 @@ public class DoIfCostPaid extends OneShotEffect {
&& (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) {
cost.clearPaid();
if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
game.applyEffects(); // To end effects e.g. of sacrificed permanents
for (Effect effect : executingEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -86,8 +87,7 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
player.resetStoredBookmark(game); // otherwise you can e.g. undo card drawn with Mentor of the Meek
}
else if (!otherwiseEffects.isEmpty()) {
} else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {
@ -97,8 +97,7 @@ public class DoIfCostPaid extends OneShotEffect {
}
}
}
}
else if (!otherwiseEffects.isEmpty()) {
} else if (!otherwiseEffects.isEmpty()) {
for (Effect effect : otherwiseEffects) {
effect.setTargetPointer(this.targetPointer);
if (effect instanceof OneShotEffect) {