refactor: additional improves for mana choice in some cards, related to Naked Singularity from 81039d6e72

This commit is contained in:
Oleg Agafonov 2023-09-23 06:39:01 +04:00
parent 81039d6e72
commit 0bf4b63bcf
14 changed files with 75 additions and 31 deletions

View file

@ -8,6 +8,7 @@ import mage.abilities.effects.mana.ManaEffect;
import mage.cards.Card;
import mage.choices.Choice;
import mage.constants.ManaType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterCard;
@ -88,7 +89,7 @@ class AnyColorCardInYourGraveyardManaEffect extends ManaEffect {
choice.setChoice(choice.getChoices().iterator().next());
} else {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.choose(outcome, choice, game)) {
if (player == null || !player.choose(Outcome.PutManaInPool, choice, game)) {
return null;
}
}

View file

@ -6,6 +6,7 @@ import mage.abilities.Ability;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.mana.ManaEffect;
import mage.choices.Choice;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
@ -117,7 +118,7 @@ class AnyColorLandsProduceManaEffect extends ManaEffect {
choice.setChoice(choice.getChoices().iterator().next());
} else {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.choose(outcome, choice, game)) {
if (player == null || !player.choose(Outcome.PutManaInPool, choice, game)) {
return null;
}
}

View file

@ -7,6 +7,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.mana.ManaEffect;
import mage.choices.Choice;
import mage.constants.ManaType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
@ -90,7 +91,7 @@ class AnyColorPermanentTypesManaEffect extends ManaEffect {
choice.setChoice(choice.getChoices().iterator().next());
} else {
Player player = game.getPlayer(source.getControllerId());
if (player == null || !player.choose(outcome, choice, game)) {
if (player == null || !player.choose(Outcome.PutManaInPool, choice, game)) {
return null;
}
}

View file

@ -10,6 +10,7 @@ import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.ColoredManaSymbol;
import mage.constants.CommanderCardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.FilterMana;
import mage.game.Game;
@ -132,7 +133,7 @@ class CommanderIdentityManaEffect extends ManaEffect {
if (choice.getChoices().size() == 1) {
choice.setChoice(choice.getChoices().iterator().next());
} else {
if (!controller.choose(outcome, choice, game)) {
if (!controller.choose(Outcome.PutManaInPool, choice, game)) {
return mana;
}
}