mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Refactor - remove duplicate DamageCantBePreventedEffect classes
This commit is contained in:
parent
541c9727ff
commit
d4f8224ee9
5 changed files with 56 additions and 147 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue