Small rework for autochoosing color of mana to add (#11495)

fix #11494
This commit is contained in:
xenohedron 2023-12-01 00:49:42 -05:00 committed by GitHub
parent b4a58a339d
commit 35f4a898f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 24 additions and 7 deletions

View file

@ -24,7 +24,6 @@ import mage.cards.repository.CardCriteria;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.FilterCard;
@ -1956,7 +1955,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
}
// choose the correct color to pay a spell
if (outcome == Outcome.PutManaInPool && choice instanceof ChoiceColor && currentUnpaidMana != null) {
if (outcome == Outcome.PutManaInPool && choice.isManaColorChoice() && currentUnpaidMana != null) {
if (currentUnpaidMana.containsColor(ColoredManaSymbol.W) && choice.getChoices().contains("White")) {
choice.setChoice("White");
return true;

View file

@ -16,7 +16,6 @@ import mage.abilities.mana.ManaAbility;
import mage.cards.*;
import mage.cards.decks.Deck;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.choices.ChoiceImpl;
import mage.constants.*;
import mage.filter.StaticFilters;
@ -583,7 +582,7 @@ public class HumanPlayer extends PlayerImpl {
}
// Try to autopay for mana
if (Outcome.PutManaInPool == outcome && choice instanceof ChoiceColor && currentlyUnpaidMana != null) {
if (Outcome.PutManaInPool == outcome && choice.isManaColorChoice() && currentlyUnpaidMana != null) {
// Check check if the spell being paid for cares about the color of mana being paid
// See: https://github.com/magefree/mage/issues/9070
boolean caresAboutManaColor = false;