diff --git a/Mage.Sets/src/mage/cards/b/BorosFuryShield.java b/Mage.Sets/src/mage/cards/b/BorosFuryShield.java index 3441abf568a..80bc35cb960 100644 --- a/Mage.Sets/src/mage/cards/b/BorosFuryShield.java +++ b/Mage.Sets/src/mage/cards/b/BorosFuryShield.java @@ -34,7 +34,7 @@ public final class BorosFuryShield extends CardImpl { // If {R} was spent to cast Boros Fury-Shield, it deals damage to that creature's controller equal to the creature's power. this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new BorosFuryShieldDamageEffect(), - ManaWasSpentCondition.RED, "If {R} was spent to cast this spell, it deals damage to that creature's controller equal to the creature's power")); + ManaWasSpentCondition.RED, "If {R} was spent to cast this spell, {this} deals damage to that creature's controller equal to the creature's power")); } private BorosFuryShield(final BorosFuryShield card) { diff --git a/Mage.Sets/src/mage/cards/d/DromokasCommand.java b/Mage.Sets/src/mage/cards/d/DromokasCommand.java index a62f4467789..dc7a823495e 100644 --- a/Mage.Sets/src/mage/cards/d/DromokasCommand.java +++ b/Mage.Sets/src/mage/cards/d/DromokasCommand.java @@ -38,7 +38,8 @@ public final class DromokasCommand extends CardImpl { this.getSpellAbility().getModes().setMaxModes(2); // Prevent all damage target instant or sorcery spell would deal this turn; - this.getSpellAbility().getEffects().add(new PreventDamageByTargetEffect(Duration.EndOfTurn, false)); + this.getSpellAbility().getEffects().add(new PreventDamageByTargetEffect(Duration.EndOfTurn, false) + .withTextOptions(false, true)); this.getSpellAbility().getTargets().add(new TargetSpell(new FilterInstantOrSorcerySpell())); // or Target player sacrifices an enchantment; diff --git a/Mage.Sets/src/mage/cards/r/ResistanceFighter.java b/Mage.Sets/src/mage/cards/r/ResistanceFighter.java index 9ea19fdcb4b..e9723de6e88 100644 --- a/Mage.Sets/src/mage/cards/r/ResistanceFighter.java +++ b/Mage.Sets/src/mage/cards/r/ResistanceFighter.java @@ -30,7 +30,8 @@ public final class ResistanceFighter extends CardImpl { this.toughness = new MageInt(1); // Sacrifice Resistance Fighter: Prevent all combat damage target creature would deal this turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new SacrificeSourceCost()); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, true) + .withTextOptions(false, true), new SacrificeSourceCost()); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/ShieldmageElder.java b/Mage.Sets/src/mage/cards/s/ShieldmageElder.java index c8b655ad2ed..d885fdc1c20 100644 --- a/Mage.Sets/src/mage/cards/s/ShieldmageElder.java +++ b/Mage.Sets/src/mage/cards/s/ShieldmageElder.java @@ -47,12 +47,16 @@ public final class ShieldmageElder extends CardImpl { this.toughness = new MageInt(3); // Tap two untapped Clerics you control: Prevent all damage target creature would deal this turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, false), new TapTargetCost(new TargetControlledPermanent(2, 2, filter1, false))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageByTargetEffect(Duration.EndOfTurn, false).withTextOptions(false, true), + new TapTargetCost(new TargetControlledPermanent(2, 2, filter1, false))); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // Tap two untapped Wizards you control: Prevent all damage target spell would deal this turn. - Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageByTargetEffect(Duration.EndOfTurn, false), new TapTargetCost(new TargetControlledPermanent(2, 2, filter2, false))); + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new PreventDamageByTargetEffect(Duration.EndOfTurn, false).withTextOptions(false, true), + new TapTargetCost(new TargetControlledPermanent(2, 2, filter2, false))); ability2.addTarget(new TargetSpell()); this.addAbility(ability2); } diff --git a/Mage.Sets/src/mage/cards/s/Songstitcher.java b/Mage.Sets/src/mage/cards/s/Songstitcher.java index b1ebe091145..6d5a8e93dd1 100644 --- a/Mage.Sets/src/mage/cards/s/Songstitcher.java +++ b/Mage.Sets/src/mage/cards/s/Songstitcher.java @@ -38,7 +38,8 @@ public final class Songstitcher extends CardImpl { this.toughness = new MageInt(1); // {1}{W}: Prevent all combat damage that would be dealt this turn by target attacking creature with flying. - Ability ability = new SimpleActivatedAbility(new PreventDamageByTargetEffect(Duration.EndOfTurn, true), new ManaCostsImpl<>("{1}{W}")); + Ability ability = new SimpleActivatedAbility(new PreventDamageByTargetEffect(Duration.EndOfTurn, true) + .withTextOptions(true, false), new ManaCostsImpl<>("{1}{W}")); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SoulParry.java b/Mage.Sets/src/mage/cards/s/SoulParry.java index 01fa7b8bda2..2ef358876c1 100644 --- a/Mage.Sets/src/mage/cards/s/SoulParry.java +++ b/Mage.Sets/src/mage/cards/s/SoulParry.java @@ -1,16 +1,14 @@ - - package mage.cards.s; -import java.util.UUID; import mage.abilities.effects.common.PreventDamageByTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; -import mage.target.Target; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** * * @author nantuko @@ -19,13 +17,11 @@ public final class SoulParry extends CardImpl { public SoulParry (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{W}"); - // Prevent all damage one or two target creatures would deal this turn - Target target = new TargetCreaturePermanent(1,2); - target.setTargetName("one or two creatures"); - this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, false)); - this.getSpellAbility().addTarget(target); + this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, false) + .withTextOptions(false, true)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(1, 2)); } private SoulParry(final SoulParry card) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java index 00b9e996303..09cfca78550 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventDamageByTargetEffect.java @@ -15,6 +15,9 @@ import mage.target.TargetSpell; */ public class PreventDamageByTargetEffect extends PreventionEffectImpl { + private boolean passiveVoice = true; + private boolean durationRuleAtEnd = true; + public PreventDamageByTargetEffect(Duration duration, boolean onlyCombat) { this(duration, Integer.MAX_VALUE, onlyCombat); } @@ -25,6 +28,8 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { protected PreventDamageByTargetEffect(final PreventDamageByTargetEffect effect) { super(effect); + this.passiveVoice = effect.passiveVoice; + this.durationRuleAtEnd = effect.durationRuleAtEnd; } @Override @@ -51,33 +56,28 @@ public class PreventDamageByTargetEffect extends PreventionEffectImpl { return false; } + public PreventDamageByTargetEffect withTextOptions(boolean passiveVoice, boolean durationRuleAtEnd) { + this.passiveVoice = passiveVoice; + this.durationRuleAtEnd = durationRuleAtEnd; + return this; + } + @Override public String getText(Mode mode) { if (staticText != null && !staticText.isEmpty()) { return staticText; } - StringBuilder sb = new StringBuilder(); - if (amountToPrevent == Integer.MAX_VALUE) { - sb.append("Prevent all"); - if (onlyCombat) { - sb.append(" combat"); - } - sb.append(" damage target "); + String durationText = duration == Duration.EndOfTurn ? " this turn" : ' ' + duration.toString(); + String targetText = getTargetPointer().describeTargets(mode.getTargets(), "it"); + String preventText = (amountToPrevent == Integer.MAX_VALUE ? "Prevent all" : "Prevent the next" + amountToPrevent) + + (onlyCombat ? " combat damage " : " damage "); + if (passiveVoice) { + preventText += "that would be dealt" + (durationRuleAtEnd ? + " by " + targetText + durationText : + durationText + " by " + targetText); } else { - sb.append("Prevent the next "); - sb.append(amountToPrevent); - if (onlyCombat) { - sb.append(" combat"); - } - sb.append(" damage that "); + preventText += targetText + " would deal" + durationText; } - sb.append(mode.getTargets().get(0).getTargetName()); - sb.append(" would deal "); - if (duration == Duration.EndOfTurn) { - sb.append("this turn"); - } else { - sb.append(duration); - } - return sb.toString(); + return preventText; } }