foul-magics/Mage/src/main/java/mage/abilities/effects/common/PreventCombatDamageBySourceEffect.java
Susucre f75b1c9f0a
Code cleanup: protect all copy constructors (#10750)
* apply regex to change public copy constructors to protected
* cleanup code using now protected constructors
* fix manaBuilder weird casting of Mana into ConditionalMana
2023-08-04 19:34:58 -04:00

33 lines
1 KiB
Java

package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.PreventionEffectImpl;
import mage.constants.Duration;
import mage.game.Game;
import mage.game.events.GameEvent;
/**
* @author jeffwadsworth
*/
public class PreventCombatDamageBySourceEffect extends PreventionEffectImpl {
public PreventCombatDamageBySourceEffect(Duration duration) {
super(duration, Integer.MAX_VALUE, true);
staticText = "Prevent all combat damage that would be dealt by {this}" + duration.toString();
}
protected PreventCombatDamageBySourceEffect(final PreventCombatDamageBySourceEffect effect) {
super(effect);
}
@Override
public PreventCombatDamageBySourceEffect copy() {
return new PreventCombatDamageBySourceEffect(this);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return super.applies(event, source, game)
&& event.getSourceId().equals(source.getSourceId());
}
}