diff --git a/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java b/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java
index 97894c7fea6..146735aa67c 100644
--- a/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java
+++ b/Mage.Sets/src/mage/sets/fatereforged/WildSlash.java
@@ -27,23 +27,20 @@
*/
package mage.sets.fatereforged;
-import java.util.UUID;
-import mage.abilities.Ability;
import mage.abilities.condition.LockedInCondition;
import mage.abilities.condition.common.FerociousCondition;
import mage.abilities.decorator.ConditionalContinuousRuleModifyingEffect;
import mage.abilities.effects.ContinuousRuleModifyingEffect;
-import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Outcome;
import mage.constants.Rarity;
-import mage.game.Game;
-import mage.game.events.GameEvent;
import mage.target.common.TargetCreatureOrPlayer;
+import java.util.UUID;
+
/**
*
* @author jeffwadsworth
@@ -55,7 +52,7 @@ public class WildSlash extends CardImpl {
this.expansionSetCode = "FRF";
// Ferocious If you control a creature with power 4 or greater, damage can't be prevented this turn.
- ContinuousRuleModifyingEffect effect = new DamageCantBePreventedEffect();
+ ContinuousRuleModifyingEffect effect = new DamageCantBePreventedEffect(Duration.EndOfTurn, "damage can't be prevented this turn", false, false);
effect.setText("Ferocious — If you control a creature with power 4 or greater, damage can't be prevented this turn.
");
this.getSpellAbility().addEffect(new ConditionalContinuousRuleModifyingEffect(effect,
new LockedInCondition(FerociousCondition.getInstance())));
@@ -75,30 +72,3 @@ public class WildSlash extends CardImpl {
return new WildSlash(this);
}
}
-
-class DamageCantBePreventedEffect extends ContinuousRuleModifyingEffectImpl {
-
- public DamageCantBePreventedEffect() {
- super(Duration.EndOfTurn, Outcome.Benefit, false, false);
- staticText = "damage can't be prevented this turn";
- }
-
- public DamageCantBePreventedEffect(final DamageCantBePreventedEffect effect) {
- super(effect);
- }
-
- @Override
- public DamageCantBePreventedEffect copy() {
- return new DamageCantBePreventedEffect(this);
- }
-
- @Override
- public boolean checksEventType(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.PREVENT_DAMAGE;
- }
-
- @Override
- public boolean applies(GameEvent event, Ability source, Game game) {
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/Skullcrack.java b/Mage.Sets/src/mage/sets/gatecrash/Skullcrack.java
index 37ecc4d21e8..526ac393cb6 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/Skullcrack.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/Skullcrack.java
@@ -27,21 +27,17 @@
*/
package mage.sets.gatecrash;
-import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.abilities.Ability;
-import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.CantGainLifeAllEffect;
+import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
-import mage.game.Game;
-import mage.game.events.GameEvent;
+import mage.constants.Rarity;
import mage.target.TargetPlayer;
+import java.util.UUID;
+
/**
*
* @author LevelX2
@@ -55,7 +51,7 @@ public class Skullcrack extends CardImpl {
// Players can't gain life this turn. Damage can't be prevented this turn. Skullcrack deals 3 damage to target player.
this.getSpellAbility().addEffect(new CantGainLifeAllEffect(Duration.EndOfTurn));
- this.getSpellAbility().addEffect(new DamageCantBePreventedEffect());
+ this.getSpellAbility().addEffect(new DamageCantBePreventedEffect(Duration.EndOfTurn, "Damage can't be prevented this turn", true, false));
this.getSpellAbility().addEffect(new DamageTargetEffect(3));
this.getSpellAbility().addTarget(new TargetPlayer());
@@ -70,35 +66,3 @@ public class Skullcrack extends CardImpl {
return new Skullcrack(this);
}
}
-
-class DamageCantBePreventedEffect extends ContinuousRuleModifyingEffectImpl {
-
- public DamageCantBePreventedEffect() {
- super(Duration.EndOfTurn, Outcome.Benefit);
- staticText = "Damage can't be prevented this turn";
- }
-
- public DamageCantBePreventedEffect(final DamageCantBePreventedEffect effect) {
- super(effect);
- }
-
- @Override
- public DamageCantBePreventedEffect copy() {
- return new DamageCantBePreventedEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- return true;
- }
-
- @Override
- public boolean checksEventType(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.PREVENT_DAMAGE;
- }
-
- @Override
- public boolean applies(GameEvent event, Ability source, Game game) {
- return true;
- }
-}
diff --git a/Mage.Sets/src/mage/sets/judgment/FlaringPain.java b/Mage.Sets/src/mage/sets/judgment/FlaringPain.java
index 77695d977bf..c3a90465aa3 100644
--- a/Mage.Sets/src/mage/sets/judgment/FlaringPain.java
+++ b/Mage.Sets/src/mage/sets/judgment/FlaringPain.java
@@ -27,19 +27,16 @@
*/
package mage.sets.judgment;
-import java.util.UUID;
-import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
+import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect;
import mage.abilities.keyword.FlashbackAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
-import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TimingRule;
-import mage.game.Game;
-import mage.game.events.GameEvent;
+
+import java.util.UUID;
/**
*
@@ -53,7 +50,7 @@ public class FlaringPain extends CardImpl {
// Damage can't be prevented this turn.
- this.getSpellAbility().addEffect(new DamageCantBePreventedEffect());
+ this.getSpellAbility().addEffect(new DamageCantBePreventedEffect(Duration.EndOfTurn, "Damage can't be prevented this turn", false, false));
// Flashback {R}
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{R}"), TimingRule.INSTANT));
}
@@ -67,33 +64,3 @@ public class FlaringPain extends CardImpl {
return new FlaringPain(this);
}
}
-
-class DamageCantBePreventedEffect extends ContinuousRuleModifyingEffectImpl {
-
- public DamageCantBePreventedEffect() {
- super(Duration.EndOfTurn, Outcome.Benefit, false, false);
- staticText = "Damage can't be prevented this turn";
- }
-
- public DamageCantBePreventedEffect(final DamageCantBePreventedEffect effect) {
- super(effect);
- }
-
- @Override
- public DamageCantBePreventedEffect copy() {
- return new DamageCantBePreventedEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- return true;
- }
-
- @Override
- public boolean applies(GameEvent event, Ability source, Game game) {
- if (event.getType().equals(GameEvent.EventType.PREVENT_DAMAGE)) {
- return true;
- }
- return false;
- }
-}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/EverlastingTorment.java b/Mage.Sets/src/mage/sets/shadowmoor/EverlastingTorment.java
index 90088643d43..382d70e0ff3 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/EverlastingTorment.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/EverlastingTorment.java
@@ -30,9 +30,9 @@ package mage.sets.shadowmoor;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.CantGainLifeAllEffect;
+import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
@@ -60,7 +60,8 @@ public class EverlastingTorment extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantGainLifeAllEffect()));
// Damage can't be prevented.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DamageCantBePreventedEffect(Duration.WhileOnBattlefield)));
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
+ new DamageCantBePreventedEffect(Duration.WhileOnBattlefield, "Damage can't be prevented", true, false)));
// All damage is dealt as though its source had wither.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DamageDealtAsIfSourceHadWitherEffect()));
@@ -77,38 +78,6 @@ public class EverlastingTorment extends CardImpl {
}
}
-class DamageCantBePreventedEffect extends ContinuousRuleModifyingEffectImpl {
-
- public DamageCantBePreventedEffect(Duration duration) {
- super(duration, Outcome.Benefit);
- staticText = "Damage can't be prevented";
- }
-
- public DamageCantBePreventedEffect(final DamageCantBePreventedEffect effect) {
- super(effect);
- }
-
- @Override
- public DamageCantBePreventedEffect copy() {
- return new DamageCantBePreventedEffect(this);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- return true;
- }
-
- @Override
- public boolean checksEventType(GameEvent event, Game game) {
- return event.getType().equals(GameEvent.EventType.PREVENT_DAMAGE);
- }
-
- @Override
- public boolean applies(GameEvent event, Ability source, Game game) {
- return true;
- }
-}
-
class DamageDealtAsIfSourceHadWitherEffect extends ReplacementEffectImpl {
public DamageDealtAsIfSourceHadWitherEffect() {
diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/DamageCantBePreventedEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/DamageCantBePreventedEffect.java
new file mode 100644
index 00000000000..08b432f31be
--- /dev/null
+++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/DamageCantBePreventedEffect.java
@@ -0,0 +1,39 @@
+package mage.abilities.effects.common.continuous;
+
+import mage.abilities.Ability;
+import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+
+public class DamageCantBePreventedEffect extends ContinuousRuleModifyingEffectImpl {
+ public DamageCantBePreventedEffect(Duration duration, String staticText, boolean messageToUser, boolean messageToLog) {
+ super(duration, Outcome.Benefit, messageToUser, messageToLog);
+ this.staticText = staticText;
+ }
+
+ public DamageCantBePreventedEffect(final DamageCantBePreventedEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public DamageCantBePreventedEffect copy() {
+ return new DamageCantBePreventedEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ return true;
+ }
+
+ @Override
+ public boolean checksEventType(GameEvent event, Game game) {
+ return event.getType().equals(GameEvent.EventType.PREVENT_DAMAGE);
+ }
+
+ @Override
+ public boolean applies(GameEvent event, Ability source, Game game) {
+ return true;
+ }
+}