* Swords to Plowshares - Fixed a problem that static effects of the exiled target were still applied as the gain life effect resolved (fixes #3290).

This commit is contained in:
LevelX2 2017-05-28 09:46:41 +02:00
parent db9e8e586b
commit d98f73518a
3 changed files with 10 additions and 9 deletions

View file

@ -30,7 +30,7 @@ package mage.cards.a;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.common.RevealLibraryPutIntoHandEffect;
import mage.abilities.effects.common.SwordsToPlowsharesEffect;
import mage.abilities.effects.common.ExileAndGainLifeEqualPowerTargetEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -73,7 +73,7 @@ public class AjaniUnyielding extends CardImpl {
this.addAbility(new LoyaltyAbility(new RevealLibraryPutIntoHandEffect(3, nonlandPermanentFilter, Zone.LIBRARY), 2));
// -2: Exile target creature. Its controller gains life equal to its power.
LoyaltyAbility ajaniAbility2 = new LoyaltyAbility(new SwordsToPlowsharesEffect(), -2);
LoyaltyAbility ajaniAbility2 = new LoyaltyAbility(new ExileAndGainLifeEqualPowerTargetEffect(), -2);
ajaniAbility2.addTarget(new TargetCreaturePermanent());
this.addAbility(ajaniAbility2);

View file

@ -27,7 +27,7 @@
*/
package mage.cards.s;
import mage.abilities.effects.common.SwordsToPlowsharesEffect;
import mage.abilities.effects.common.ExileAndGainLifeEqualPowerTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
@ -46,7 +46,7 @@ public class SwordsToPlowshares extends CardImpl {
// Exile target creature. Its controller gains life equal to its power.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new SwordsToPlowsharesEffect());
this.getSpellAbility().addEffect(new ExileAndGainLifeEqualPowerTargetEffect());
}

View file

@ -37,20 +37,20 @@ import mage.players.Player;
/**
* @author JRHerlehy
*/
public class SwordsToPlowsharesEffect extends OneShotEffect {
public class ExileAndGainLifeEqualPowerTargetEffect extends OneShotEffect {
public SwordsToPlowsharesEffect() {
public ExileAndGainLifeEqualPowerTargetEffect() {
super(Outcome.GainLife);
staticText = "Exile target creature. Its controller gains life equal to its power";
}
public SwordsToPlowsharesEffect(final SwordsToPlowsharesEffect effect) {
public ExileAndGainLifeEqualPowerTargetEffect(final ExileAndGainLifeEqualPowerTargetEffect effect) {
super(effect);
}
@Override
public SwordsToPlowsharesEffect copy() {
return new SwordsToPlowsharesEffect(this);
public ExileAndGainLifeEqualPowerTargetEffect copy() {
return new ExileAndGainLifeEqualPowerTargetEffect(this);
}
@Override
@ -61,6 +61,7 @@ public class SwordsToPlowsharesEffect extends OneShotEffect {
if (player != null) {
int creaturePower = permanent.getPower().getValue();
permanent.moveToExile(null, null, source.getSourceId(), game);
game.applyEffects();
player.gainLife(creaturePower, game);
}
return true;