mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Avoid being unnecessarily prompted when tapping multi-color creature for convoke
This commit is contained in:
@@ -580,4 +580,12 @@ public class ManaCostBeingPaid {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public final byte getUnpaidColors() {
|
||||
byte result = 0;
|
||||
for (ManaCostShard s : unpaidShards.keySet()) {
|
||||
result |= s.getColorMask();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,17 @@ public final class InputSelectCardsForConvoke extends InputSelectManyBase<Card>
|
||||
}
|
||||
else {
|
||||
byte chosenColor;
|
||||
final ColorSet colors = CardUtil.getColors(card);
|
||||
if (colors.isMonoColor()) {
|
||||
ColorSet colors = CardUtil.getColors(card);
|
||||
if (colors.isMulticolor()) {
|
||||
//if card is multicolor, strip out any colors which can't be paid towards remaining cost
|
||||
colors = ColorSet.fromMask(colors.getColor() & remainingCost.getUnpaidColors());
|
||||
}
|
||||
if (!colors.isMulticolor()) {
|
||||
// Since the convoke mana logic can use colored mana as colorless if needed,
|
||||
// there is no need to prompt the user when convoking with a mono-color creature.
|
||||
chosenColor = colors.getColor();
|
||||
} else {
|
||||
}
|
||||
else { //prompt user if more than one option for which color to pay towards convoke
|
||||
chosenColor = player.getController().chooseColorAllowColorless("Convoke " + card.toString() + " for which color?", card, colors);
|
||||
}
|
||||
final ManaCostShard shard = remainingCost.payManaViaConvoke(chosenColor);
|
||||
|
||||
Reference in New Issue
Block a user