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

38 lines
843 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 Loki
*/
public class UntapSourceEffect extends OneShotEffect {
public UntapSourceEffect() {
super(Outcome.Untap);
staticText = "untap {this}";
}
protected UntapSourceEffect(final UntapSourceEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
permanent.untap(game);
}
return true;
}
@Override
public UntapSourceEffect copy() {
return new UntapSourceEffect(this);
}
}