add PayVariableEnergyCost, fixing [PIP] HELIOS One & [MH3] Chtonian Nightmare

fix #12217
This commit is contained in:
Susucre 2024-05-03 16:44:19 +02:00
parent fc6c7b36e5
commit 534d1be175
6 changed files with 59 additions and 83 deletions

View file

@ -0,0 +1,38 @@
package mage.abilities.costs.common;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.VariableCostImpl;
import mage.abilities.costs.VariableCostType;
import mage.abilities.dynamicvalue.common.SourceControllerCountersCount;
import mage.game.Game;
/**
* @author Susucr
*/
public class PayVariableEnergyCost extends VariableCostImpl {
public PayVariableEnergyCost() {
super(VariableCostType.NORMAL, "{E} to pay");
this.text = "Pay " + xText + " {E}";
}
protected PayVariableEnergyCost(final PayVariableEnergyCost cost) {
super(cost);
}
@Override
public PayVariableEnergyCost copy() {
return new PayVariableEnergyCost(this);
}
@Override
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
return new PayEnergyCost(xValue);
}
@Override
public int getMaxValue(Ability source, Game game) {
return SourceControllerCountersCount.ENERGY.calculate(game, source, null);
}
}