foul-magics/Mage/src/main/java/mage/abilities/effects/common/PhaseOutSourceEffect.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

36 lines
896 B
Java

package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author fireshoes
*/
public class PhaseOutSourceEffect extends OneShotEffect {
public PhaseOutSourceEffect() {
super(Outcome.Detriment);
this.staticText = "{this} phases out";
}
protected PhaseOutSourceEffect(final PhaseOutSourceEffect effect) {
super(effect);
}
@Override
public PhaseOutSourceEffect copy() {
return new PhaseOutSourceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
if (permanent != null) {
return permanent.phaseOut(game);
}
return false;
}
}