Little fixes

This commit is contained in:
Oleg Agafonov 2021-08-20 09:38:16 +04:00
parent ca521751cd
commit fb4065ba66
7 changed files with 14 additions and 16 deletions

View file

@ -21,10 +21,10 @@ import mage.util.CardUtil;
*/
public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
private FilterCard filter;
private int amount;
private final FilterCard filter;
private final int amount;
private final boolean upTo;
private boolean onlyControlled;
private final boolean onlyControlled;
private UUID controllerId;
public SpellsCostReductionAllEffect(int amount) {
@ -72,8 +72,8 @@ public class SpellsCostReductionAllEffect extends CostModificationEffectImpl {
}
Mana mana = abilityToModify.getManaCostsToPay().getMana();
int reduceMax = mana.getGeneric();
if (reduceMax > 2) {
reduceMax = 2;
if (reduceMax > this.amount) {
reduceMax = this.amount;
}
if (reduceMax > 0) {
Player controller = game.getPlayer(abilityToModify.getControllerId());

View file

@ -71,8 +71,8 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI
if (upTo) {
Mana mana = abilityToModify.getManaCostsToPay().getMana();
int reduceMax = mana.getGeneric();
if (reduceMax > amount) {
reduceMax = amount;
if (reduceMax > this.amount) {
reduceMax = this.amount;
}
if (reduceMax > 0) {
Player controller = game.getPlayer(abilityToModify.getControllerId());
@ -83,7 +83,7 @@ public class SpellsCostReductionControllerEffect extends CostModificationEffectI
if (!game.inCheckPlayableState()) {
ChoiceImpl choice = new ChoiceImpl(false);
Set<String> set = new LinkedHashSet<>();
for (int i = 0; i <= amount; i++) {
for (int i = 0; i <= reduceMax; i++) {
set.add(String.valueOf(i));
}
choice.setChoices(set);