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

43 lines
1.2 KiB
Java

package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.target.targetpointer.FixedTarget;
/**
* The controlling player of the source ability has to sacrifice [count] permanents
* that match the [filter].
*
* @author LevelX
*/
public class SacrificeControllerEffect extends SacrificeEffect {
public SacrificeControllerEffect(FilterPermanent filter, DynamicValue count, String preText) {
super(filter, count, preText);
}
public SacrificeControllerEffect(FilterPermanent filter, int count, String preText) {
this(filter, StaticValue.get(count), preText);
}
protected SacrificeControllerEffect(final SacrificeControllerEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
this.targetPointer = new FixedTarget(source.getControllerId());
return super.apply(game, source);
}
@Override
public SacrificeControllerEffect copy() {
return new SacrificeControllerEffect(this);
}
}