Refactor - remove duplicate DamageCantBePreventedEffect classes

This commit is contained in:
JOAC69 2016-09-21 23:48:31 -05:00
parent 541c9727ff
commit d4f8224ee9
5 changed files with 56 additions and 147 deletions

View file

@ -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;
}
}