diff --git a/Mage.Common/src/main/java/mage/utils/SystemUtil.java b/Mage.Common/src/main/java/mage/utils/SystemUtil.java index 5b63ac57816..44f0e83abee 100644 --- a/Mage.Common/src/main/java/mage/utils/SystemUtil.java +++ b/Mage.Common/src/main/java/mage/utils/SystemUtil.java @@ -440,7 +440,7 @@ public final class SystemUtil { choices.put(ability.getId().toString(), object.getName() + ": " + ability.toString()); }); // TODO: set priority for us? - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(false); choice.setMessage("Choose playable ability to activate by opponent " + opponent.getName()); choice.setKeyChoices(choices); if (feedbackPlayer.choose(Outcome.Detriment, choice, game) && choice.getChoiceKey() != null) { diff --git a/Mage.Sets/src/mage/cards/a/AKillerAmongUs.java b/Mage.Sets/src/mage/cards/a/AKillerAmongUs.java index 37d3c617423..13b19a5f3bf 100644 --- a/Mage.Sets/src/mage/cards/a/AKillerAmongUs.java +++ b/Mage.Sets/src/mage/cards/a/AKillerAmongUs.java @@ -114,7 +114,7 @@ class ChooseHumanMerfolkOrGoblinEffect extends OneShotEffect { return false; } - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(true); Set choices = new LinkedHashSet<>(); choices.add("Human"); choices.add("Merfolk"); diff --git a/Mage.Sets/src/mage/cards/b/BloodOath.java b/Mage.Sets/src/mage/cards/b/BloodOath.java index fc945491840..ce011eac7a2 100644 --- a/Mage.Sets/src/mage/cards/b/BloodOath.java +++ b/Mage.Sets/src/mage/cards/b/BloodOath.java @@ -77,7 +77,7 @@ class BloodOathEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(source.getFirstTarget()); if (player != null && opponent != null && sourceObject != null) { - Choice choiceImpl = new ChoiceImpl(); + Choice choiceImpl = new ChoiceImpl(true); choiceImpl.setChoices(choice); if (player.choose(Outcome.Neutral, choiceImpl, game)) { CardType type = null; diff --git a/Mage.Sets/src/mage/cards/b/ButcherOfTheHorde.java b/Mage.Sets/src/mage/cards/b/ButcherOfTheHorde.java index 7bc2ca25f08..76dd02b5f2d 100644 --- a/Mage.Sets/src/mage/cards/b/ButcherOfTheHorde.java +++ b/Mage.Sets/src/mage/cards/b/ButcherOfTheHorde.java @@ -1,4 +1,3 @@ - package mage.cards.b; import java.util.HashSet; @@ -24,7 +23,6 @@ import mage.constants.*; import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; -import mage.target.common.TargetControlledCreaturePermanent; /** * @@ -72,7 +70,7 @@ class ButcherOfTheHordeEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source); if (sourceObject != null && controller != null) { - Choice abilityChoice = new ChoiceImpl(); + Choice abilityChoice = new ChoiceImpl(true); abilityChoice.setMessage("Choose an ability to add"); Set abilities = new HashSet<>(); diff --git a/Mage.Sets/src/mage/cards/e/ElementalResonance.java b/Mage.Sets/src/mage/cards/e/ElementalResonance.java index 16256b55d36..51017e0df7f 100644 --- a/Mage.Sets/src/mage/cards/e/ElementalResonance.java +++ b/Mage.Sets/src/mage/cards/e/ElementalResonance.java @@ -97,7 +97,7 @@ class ElementalResonanceEffect extends OneShotEffect { String manaToAdd = ""; if (manaOptions.size() > 1) { // TODO: Make the choices look nicer, right now the brace notation is hard to visually parse, especially with Reaper King - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(false); choice.setMessage("Choose a mana combination"); choice.getChoices().addAll(manaOptions); if (!controller.choose(Outcome.PutManaInPool, choice, game)) { diff --git a/Mage.Sets/src/mage/cards/f/FertileImagination.java b/Mage.Sets/src/mage/cards/f/FertileImagination.java index e04a467df5b..f08991728e9 100644 --- a/Mage.Sets/src/mage/cards/f/FertileImagination.java +++ b/Mage.Sets/src/mage/cards/f/FertileImagination.java @@ -80,7 +80,7 @@ class FertileImaginationEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(source.getFirstTarget()); if (player != null && opponent != null && sourceObject != null) { - Choice choiceImpl = new ChoiceImpl(); + Choice choiceImpl = new ChoiceImpl(true); choiceImpl.setChoices(choice); if (player.choose(Outcome.Neutral, choiceImpl, game)) { CardType type = null; diff --git a/Mage.Sets/src/mage/cards/g/GoblinClearcutter.java b/Mage.Sets/src/mage/cards/g/GoblinClearcutter.java index ac4c4a7f3ed..28f10fe6888 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinClearcutter.java +++ b/Mage.Sets/src/mage/cards/g/GoblinClearcutter.java @@ -92,7 +92,7 @@ class GoblinClearCutterManaEffect extends ManaEffect { } Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Choice manaChoice = new ChoiceImpl(); + Choice manaChoice = new ChoiceImpl(false); Set choices = new LinkedHashSet<>(); choices.add("Red"); choices.add("Green"); diff --git a/Mage.Sets/src/mage/cards/g/GolemArtisan.java b/Mage.Sets/src/mage/cards/g/GolemArtisan.java index caf2a80f937..704de90cb19 100644 --- a/Mage.Sets/src/mage/cards/g/GolemArtisan.java +++ b/Mage.Sets/src/mage/cards/g/GolemArtisan.java @@ -80,7 +80,7 @@ class GolemArtisanEffect extends OneShotEffect { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); Player playerControls = game.getPlayer(source.getControllerId()); if (permanent != null && playerControls != null) { - Choice abilityChoice = new ChoiceImpl(); + Choice abilityChoice = new ChoiceImpl(true); abilityChoice.setMessage("Choose an ability to add"); Set abilities = new HashSet<>(); diff --git a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java index aae833a5d49..6153a95fe92 100644 --- a/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java +++ b/Mage.Sets/src/mage/cards/g/GrandWarlordRadha.java @@ -147,7 +147,7 @@ class GrandWarlordRadhaEffect extends OneShotEffect { } } if (attackingCreatures > 0) { - Choice manaChoice = new ChoiceImpl(); + Choice manaChoice = new ChoiceImpl(false); Set choices = new LinkedHashSet<>(); choices.add("Red"); choices.add("Green"); diff --git a/Mage.Sets/src/mage/cards/g/GremlinMine.java b/Mage.Sets/src/mage/cards/g/GremlinMine.java index 7aaa066e805..72583322508 100644 --- a/Mage.Sets/src/mage/cards/g/GremlinMine.java +++ b/Mage.Sets/src/mage/cards/g/GremlinMine.java @@ -84,7 +84,7 @@ class GremlinMineEffect extends OneShotEffect { if (player != null && permanent != null) { int existingCount = permanent.getCounters(game).getCount(CounterType.CHARGE); if (existingCount > 0) { - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(false); choice.setMessage("Select number of charge counters to remove:"); for (Integer i = 0; i <= existingCount; i++) { choice.getChoices().add(i.toString()); diff --git a/Mage.Sets/src/mage/cards/k/KatildaDawnhartPrime.java b/Mage.Sets/src/mage/cards/k/KatildaDawnhartPrime.java index 71dc4f6232a..65015b580d3 100644 --- a/Mage.Sets/src/mage/cards/k/KatildaDawnhartPrime.java +++ b/Mage.Sets/src/mage/cards/k/KatildaDawnhartPrime.java @@ -150,7 +150,7 @@ class KatildaDawnhartPrimeManaEffect extends ManaEffect { if (controller == null || permanent == null) { return new Mana(); } - Choice choice = new ChoiceImpl().setManaColorChoice(true); + Choice choice = new ChoiceImpl(false).setManaColorChoice(true); choice.setMessage("Pick a mana color"); ObjectColor color = permanent.getColor(game); if (color.isWhite()) { diff --git a/Mage.Sets/src/mage/cards/l/LavabrinkFloodgates.java b/Mage.Sets/src/mage/cards/l/LavabrinkFloodgates.java index 3bb83410472..c7ad4de5901 100644 --- a/Mage.Sets/src/mage/cards/l/LavabrinkFloodgates.java +++ b/Mage.Sets/src/mage/cards/l/LavabrinkFloodgates.java @@ -78,8 +78,8 @@ class LavabrinkFloodgatesEffect extends OneShotEffect { if (player == null || permanent == null) { return false; } - Choice choice = new ChoiceImpl(); - choice.setChoices(new HashSet(Arrays.asList( + Choice choice = new ChoiceImpl(false); + choice.setChoices(new HashSet<>(Arrays.asList( "Add a doom counter", "Remove a doom counter", "Do nothing" diff --git a/Mage.Sets/src/mage/cards/l/LeechBonder.java b/Mage.Sets/src/mage/cards/l/LeechBonder.java index d84ba1ba6a9..f13b277fe49 100644 --- a/Mage.Sets/src/mage/cards/l/LeechBonder.java +++ b/Mage.Sets/src/mage/cards/l/LeechBonder.java @@ -102,11 +102,11 @@ class LeechBonderEffect extends OneShotEffect { } Set possibleChoices = new LinkedHashSet<>(fromPermanent.getCounters(game).keySet()); - if (possibleChoices.size() == 0) { + if (possibleChoices.isEmpty()) { return false; } - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(false); choice.setChoices(possibleChoices); if (controller.choose(outcome, choice, game)) { String chosen = choice.getChoice(); diff --git a/Mage.Sets/src/mage/cards/m/Mindblaze.java b/Mage.Sets/src/mage/cards/m/Mindblaze.java index f3b45ffb051..7fb6ce9abe7 100644 --- a/Mage.Sets/src/mage/cards/m/Mindblaze.java +++ b/Mage.Sets/src/mage/cards/m/Mindblaze.java @@ -70,7 +70,7 @@ class MindblazeEffect extends OneShotEffect { if (player == null || playerControls == null || sourceObject == null) { return false; } - Choice numberChoice = new ChoiceImpl(); + Choice numberChoice = new ChoiceImpl(false); numberChoice.setMessage("Choose a number greater than 0"); Set numbers = new HashSet<>(); for (int i = 1; i <= 4; i++) { diff --git a/Mage.Sets/src/mage/cards/n/NestingGrounds.java b/Mage.Sets/src/mage/cards/n/NestingGrounds.java index 8db5d1becda..8fb8fcf5775 100644 --- a/Mage.Sets/src/mage/cards/n/NestingGrounds.java +++ b/Mage.Sets/src/mage/cards/n/NestingGrounds.java @@ -103,7 +103,7 @@ class NestingGroundsEffect extends OneShotEffect { return true; } - Choice choice = new ChoiceImpl(); + Choice choice = new ChoiceImpl(false); Set possibleChoices = new LinkedHashSet<>(fromPermanent.getCounters(game).keySet()); choice.setChoices(possibleChoices); choice.setMessage("Choose a counter"); diff --git a/Mage.Sets/src/mage/cards/o/OrcishLumberjack.java b/Mage.Sets/src/mage/cards/o/OrcishLumberjack.java index a7abb7d486a..791f9a64ec6 100644 --- a/Mage.Sets/src/mage/cards/o/OrcishLumberjack.java +++ b/Mage.Sets/src/mage/cards/o/OrcishLumberjack.java @@ -93,7 +93,7 @@ class OrcishLumberjackManaEffect extends ManaEffect { } Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Choice manaChoice = new ChoiceImpl(); + Choice manaChoice = new ChoiceImpl(false); Set choices = new LinkedHashSet<>(); choices.add("Red"); choices.add("Green"); diff --git a/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java b/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java index dacff01ebf2..dfb72849756 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanUnbroken.java @@ -85,7 +85,7 @@ class SarkhanUnbrokenAbility1 extends OneShotEffect { game.fireUpdatePlayersEvent(); - Choice manaChoice = new ChoiceImpl(); + Choice manaChoice = new ChoiceImpl(false); Set choices = new LinkedHashSet<>(); choices.add("White"); choices.add("Blue"); diff --git a/Mage.Sets/src/mage/cards/s/Shapeshifter.java b/Mage.Sets/src/mage/cards/s/Shapeshifter.java index 6d312867e5e..65c8a4ede3e 100644 --- a/Mage.Sets/src/mage/cards/s/Shapeshifter.java +++ b/Mage.Sets/src/mage/cards/s/Shapeshifter.java @@ -76,7 +76,7 @@ class ShapeshifterEffect extends OneShotEffect { mageObject = game.getPermanent(source.getSourceId()); } if (controller != null) { - Choice numberChoice = new ChoiceImpl(); + Choice numberChoice = new ChoiceImpl(false); numberChoice.setMessage("Choose a number beween 0 and 7"); Set numbers = new HashSet<>(); for (int i = 0; i <= 7; i++) { diff --git a/Mage.Sets/src/mage/cards/s/Snowfall.java b/Mage.Sets/src/mage/cards/s/Snowfall.java index 3f1118eca8d..6b4d939e772 100644 --- a/Mage.Sets/src/mage/cards/s/Snowfall.java +++ b/Mage.Sets/src/mage/cards/s/Snowfall.java @@ -114,7 +114,7 @@ class SnowfallManaEffect extends ManaEffect { } if (land.isSnow(game)) { - Choice choiceImpl = new ChoiceImpl(); + Choice choiceImpl = new ChoiceImpl(false); choiceImpl.setMessage("Add additional blue mana? This mana can only be spent to pay cumulative upkeep costs."); choiceImpl.setChoices(choice); diff --git a/Mage.Sets/src/mage/cards/t/TazriStalwartSurvivor.java b/Mage.Sets/src/mage/cards/t/TazriStalwartSurvivor.java index f02ff663f3b..ee48a88944a 100644 --- a/Mage.Sets/src/mage/cards/t/TazriStalwartSurvivor.java +++ b/Mage.Sets/src/mage/cards/t/TazriStalwartSurvivor.java @@ -80,7 +80,7 @@ class TazriStalwartSurvivorManaAbility extends ActivatedManaAbilityImpl { && permanent .getAbilities(game) .stream() - .filter(ability -> ability.isActivatedAbility()) + .filter(Ability::isActivatedAbility) .map(Ability::getOriginalId) .anyMatch(abilityId -> !source.getOriginalId().equals(abilityId)); } @@ -190,7 +190,7 @@ class TazriStalwartSurvivorManaEffect extends ManaEffect { if (controller == null || permanent == null) { return new Mana(); } - Choice choice = new ChoiceImpl().setManaColorChoice(true); + Choice choice = new ChoiceImpl(false).setManaColorChoice(true); choice.setMessage("Pick a mana color"); ObjectColor color = permanent.getColor(game); if (color.isWhite()) { diff --git a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java index 19abcd3c94e..e3e3ff961bf 100644 --- a/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java +++ b/Mage.Sets/src/mage/cards/u/UrzaAcademyHeadmaster.java @@ -486,7 +486,7 @@ class UrzaAcademyHeadmasterManaEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); if (player != null) { int x = game.getBattlefield().count(new FilterControlledCreaturePermanent(), source.getControllerId(), source, game); - Choice manaChoice = new ChoiceImpl(); + Choice manaChoice = new ChoiceImpl(false); Set choices = new LinkedHashSet<>(); choices.add("White"); choices.add("Blue"); diff --git a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java index 51f21356130..15c2b6fecd6 100644 --- a/Mage.Sets/src/mage/cards/v/VeteranWarleader.java +++ b/Mage.Sets/src/mage/cards/v/VeteranWarleader.java @@ -88,7 +88,7 @@ class VeteranWarleaderEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source); if (sourceObject != null && controller != null) { - Choice abilityChoice = new ChoiceImpl(); + Choice abilityChoice = new ChoiceImpl(true); abilityChoice.setMessage("Choose an ability to add"); Set abilities = new HashSet<>(); diff --git a/Mage.Sets/src/mage/cards/v/VigeanIntuition.java b/Mage.Sets/src/mage/cards/v/VigeanIntuition.java index 819c8594e0d..aa4f1a55300 100644 --- a/Mage.Sets/src/mage/cards/v/VigeanIntuition.java +++ b/Mage.Sets/src/mage/cards/v/VigeanIntuition.java @@ -81,7 +81,7 @@ class VigeanIntuitionEffect extends OneShotEffect { return false; } - Choice choiceImpl = new ChoiceImpl(); + Choice choiceImpl = new ChoiceImpl(true); choiceImpl.setChoices(choice); if (player.choose(Outcome.Neutral, choiceImpl, game)) { String chosenType = choiceImpl.getChoice(); @@ -126,4 +126,4 @@ class VigeanIntuitionEffect extends OneShotEffect { } return false; } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/w/WalkingSponge.java b/Mage.Sets/src/mage/cards/w/WalkingSponge.java index c854330ca8e..f59e76e2c64 100644 --- a/Mage.Sets/src/mage/cards/w/WalkingSponge.java +++ b/Mage.Sets/src/mage/cards/w/WalkingSponge.java @@ -76,8 +76,8 @@ class WalkingSpongeEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { - ChoiceImpl chooseAbility = new ChoiceImpl(); - chooseAbility.setMessage("Choose an ability to remove (default is flying)"); + ChoiceImpl chooseAbility = new ChoiceImpl(true); + chooseAbility.setMessage("Choose an ability to remove"); Set choice = new LinkedHashSet<>(); choice.add("Flying"); choice.add("First strike"); diff --git a/Mage.Sets/src/mage/cards/w/WorldQueller.java b/Mage.Sets/src/mage/cards/w/WorldQueller.java index 889a6de20d2..1d68c25fedf 100644 --- a/Mage.Sets/src/mage/cards/w/WorldQueller.java +++ b/Mage.Sets/src/mage/cards/w/WorldQueller.java @@ -64,7 +64,7 @@ class WorldQuellerEffect extends OneShotEffect { choice.add(CardType.KINDRED.toString()); } - public WorldQuellerEffect() { + WorldQuellerEffect() { super(Outcome.Benefit); staticText = "you may choose a card type. If you do, each player sacrifices a permanent of that type"; } @@ -84,7 +84,7 @@ class WorldQuellerEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); Permanent sourceCreature = game.getPermanent(source.getSourceId()); if (player != null && sourceCreature != null) { - Choice choiceImpl = new ChoiceImpl(); + Choice choiceImpl = new ChoiceImpl(false); choiceImpl.setChoices(choice); if (!player.choose(Outcome.Neutral, choiceImpl, game)) { return false; diff --git a/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java b/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java index fa0b2aa7979..2c4d1532906 100644 --- a/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/CommanderColorIdentityManaAbility.java @@ -106,7 +106,7 @@ class CommanderIdentityManaEffect extends ManaEffect { } Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Choice choice = new ChoiceImpl().setManaColorChoice(true); + Choice choice = new ChoiceImpl(false).setManaColorChoice(true); choice.setMessage("Pick a mana color"); for (UUID commanderId : game.getCommandersIds(controller, CommanderCardType.COMMANDER_OR_OATHBREAKER, false)) { Card commander = game.getCard(commanderId); diff --git a/Mage/src/main/java/mage/choices/ChoiceImpl.java b/Mage/src/main/java/mage/choices/ChoiceImpl.java index 3db38909e9a..da1c6bc95b7 100644 --- a/Mage/src/main/java/mage/choices/ChoiceImpl.java +++ b/Mage/src/main/java/mage/choices/ChoiceImpl.java @@ -36,10 +36,6 @@ public class ChoiceImpl implements Choice { protected boolean manaColorChoice = false; // set true to allow automatic choosing with Outcome.PutManaInPool - public ChoiceImpl() { - this(false); - } - public ChoiceImpl(boolean required) { this(required, ChoiceHintType.TEXT); }