[MID] Implemented Light Up the Night

This commit is contained in:
Daniel Bomar 2021-09-14 18:17:22 -05:00
parent dbd4b32e6b
commit 1b5ad66ae5
No known key found for this signature in database
GPG key ID: C86C8658F4023918
3 changed files with 110 additions and 1 deletions

View file

@ -31,16 +31,25 @@ public class RemoveVariableCountersTargetCost extends VariableCostImpl {
}
public RemoveVariableCountersTargetCost(FilterPermanent filter, CounterType counterTypeToRemove, String xText, int minValue) {
this(filter, counterTypeToRemove, xText, minValue, null);
}
public RemoveVariableCountersTargetCost(FilterPermanent filter, CounterType counterTypeToRemove, String xText, int minValue, String text) {
super(VariableCostType.NORMAL, xText, new StringBuilder(counterTypeToRemove != null ? counterTypeToRemove.getName() + ' ' : "").append("counters to remove").toString());
this.filter = filter;
this.counterTypeToRemove = counterTypeToRemove;
this.text = setText();
if (text != null && !text.isEmpty()) {
this.text = text;
} else {
this.text = setText();
}
this.minValue = minValue;
}
public RemoveVariableCountersTargetCost(final RemoveVariableCountersTargetCost cost) {
super(cost);
this.filter = cost.filter;
this.counterTypeToRemove = cost.counterTypeToRemove;
this.minValue = cost.minValue;
}
@ -63,6 +72,16 @@ public class RemoveVariableCountersTargetCost extends VariableCostImpl {
return new RemoveVariableCountersTargetCost(this);
}
@Override
public boolean canPay(Ability ability, Ability source, UUID controllerId, Game game) {
return getMaxValue(source, game) >= minValue;
}
@Override
public int getMinValue(Ability source, Game game) {
return minValue;
}
@Override
public int getMaxValue(Ability source, Game game) {
int maxValue = 0;