From 449e82a796b3556e47c3a1842bf399053faf99c2 Mon Sep 17 00:00:00 2001 From: igoudt Date: Wed, 2 Aug 2017 08:04:26 +0200 Subject: [PATCH] fixing choosing creature types --- Mage.Sets/src/mage/cards/b/BloodlineShaman.java | 10 ++++------ Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java | 11 ++++------- Mage.Sets/src/mage/cards/c/CoordinatedBarrage.java | 10 ++++------ Mage.Sets/src/mage/cards/d/DistantMelody.java | 10 ++++------ Mage.Sets/src/mage/cards/l/LuminescentRain.java | 10 ++++------ Mage.Sets/src/mage/cards/o/Outbreak.java | 10 ++++------ Mage.Sets/src/mage/cards/p/PatriarchsBidding.java | 10 ++++------ Mage.Sets/src/mage/cards/p/PeerPressure.java | 10 ++++------ Mage.Sets/src/mage/cards/r/RiptideChronologist.java | 10 ++++------ Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java | 11 ++++------- Mage.Sets/src/mage/cards/t/TribalUnity.java | 10 ++++------ .../effects/common/ChooseCreatureTypeEffect.java | 3 ++- .../BecomesChosenCreatureTypeTargetEffect.java | 11 +++-------- .../main/java/mage/choices/ChoiceCreatureType.java | 3 ++- Mage/src/main/java/mage/constants/SubType.java | 7 ++++--- 15 files changed, 55 insertions(+), 81 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BloodlineShaman.java b/Mage.Sets/src/mage/cards/b/BloodlineShaman.java index 659c88f193..c8e5591919 100644 --- a/Mage.Sets/src/mage/cards/b/BloodlineShaman.java +++ b/Mage.Sets/src/mage/cards/b/BloodlineShaman.java @@ -27,8 +27,6 @@ */ package mage.cards.b; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -37,7 +35,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; import mage.cards.*; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -47,6 +45,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author fireshoes @@ -98,9 +98,7 @@ class BloodlineShamanEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null) { // Choose a creature type. - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!controller.choose(outcome, typeChoice, game)) { if (!controller.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java index 457f9a61c5..f28f168e6a 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java @@ -27,8 +27,6 @@ */ package mage.cards.c; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; @@ -41,17 +39,18 @@ import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; -import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.ChosenSubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author jeffwadsworth @@ -133,9 +132,7 @@ class ChooseCreatureTypeEffect extends OneShotEffect { // code by LevelX2, but t Player controller = game.getPlayer(source.getControllerId()); MageObject mageObject = game.getObject(source.getSourceId()); if (controller != null && mageObject != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!controller.choose(outcome, typeChoice, game)) { if (!controller.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/c/CoordinatedBarrage.java b/Mage.Sets/src/mage/cards/c/CoordinatedBarrage.java index a9758f04a7..d9c068c192 100644 --- a/Mage.Sets/src/mage/cards/c/CoordinatedBarrage.java +++ b/Mage.Sets/src/mage/cards/c/CoordinatedBarrage.java @@ -27,14 +27,12 @@ */ package mage.cards.c; -import java.util.UUID; -import java.util.stream.Collectors; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -45,6 +43,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetAttackingOrBlockingCreature; +import java.util.UUID; + /** * * @author emerald000 @@ -89,9 +89,7 @@ class CoordinatedBarrageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Choice choice = new ChoiceImpl(true); - choice.setMessage("Choose a creature type"); - choice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice choice = new ChoiceCreatureType(); if (controller.choose(Outcome.Damage, choice, game)) { String chosenType = choice.getChoice(); FilterControlledPermanent filter = new FilterControlledPermanent(); diff --git a/Mage.Sets/src/mage/cards/d/DistantMelody.java b/Mage.Sets/src/mage/cards/d/DistantMelody.java index cd5b4b4db9..e773eeeedf 100644 --- a/Mage.Sets/src/mage/cards/d/DistantMelody.java +++ b/Mage.Sets/src/mage/cards/d/DistantMelody.java @@ -27,8 +27,6 @@ */ package mage.cards.d; -import java.util.UUID; -import java.util.stream.Collectors; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; @@ -36,7 +34,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -45,6 +43,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author emerald000 @@ -89,9 +89,7 @@ class DistantMelodyEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/l/LuminescentRain.java b/Mage.Sets/src/mage/cards/l/LuminescentRain.java index a2aa647727..5437d5eec3 100644 --- a/Mage.Sets/src/mage/cards/l/LuminescentRain.java +++ b/Mage.Sets/src/mage/cards/l/LuminescentRain.java @@ -27,8 +27,6 @@ */ package mage.cards.l; -import java.util.UUID; -import java.util.stream.Collectors; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.OneShotEffect; @@ -36,7 +34,7 @@ import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -45,6 +43,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author michael.napoleon@gmail.com @@ -88,9 +88,7 @@ class LuminescentRainEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(p->p.toString()).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/o/Outbreak.java b/Mage.Sets/src/mage/cards/o/Outbreak.java index 15f9691509..1b6e48355a 100644 --- a/Mage.Sets/src/mage/cards/o/Outbreak.java +++ b/Mage.Sets/src/mage/cards/o/Outbreak.java @@ -27,8 +27,6 @@ */ package mage.cards.o; -import java.util.UUID; -import java.util.stream.Collectors; import mage.abilities.Ability; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.common.DiscardTargetCost; @@ -38,7 +36,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -50,6 +48,8 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInHand; +import java.util.UUID; + /** * @author fireshoes */ @@ -96,9 +96,7 @@ class OutbreakEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(p -> p.toString()).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(outcome, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/p/PatriarchsBidding.java b/Mage.Sets/src/mage/cards/p/PatriarchsBidding.java index 614acd4fea..a964d7f791 100644 --- a/Mage.Sets/src/mage/cards/p/PatriarchsBidding.java +++ b/Mage.Sets/src/mage/cards/p/PatriarchsBidding.java @@ -27,15 +27,13 @@ */ package mage.cards.p; -import java.util.*; -import java.util.stream.Collectors; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -47,6 +45,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.*; + /** * @author duncant */ @@ -93,9 +93,7 @@ class PatriarchsBiddingEffect extends OneShotEffect { Set chosenTypes = new HashSet<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(Outcome.PutCreatureInPlay, typeChoice, game)) { if (!player.canRespond()) { break; diff --git a/Mage.Sets/src/mage/cards/p/PeerPressure.java b/Mage.Sets/src/mage/cards/p/PeerPressure.java index 5bfcb821a7..8101dc06be 100644 --- a/Mage.Sets/src/mage/cards/p/PeerPressure.java +++ b/Mage.Sets/src/mage/cards/p/PeerPressure.java @@ -27,8 +27,6 @@ */ package mage.cards.p; -import java.util.UUID; -import java.util.stream.Collectors; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.effects.ContinuousEffect; @@ -37,7 +35,7 @@ import mage.abilities.effects.common.continuous.GainControlTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -50,6 +48,8 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** * * @author emerald000 @@ -93,9 +93,7 @@ class PeerPressureEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - Choice choice = new ChoiceImpl(true); - choice.setMessage("Choose creature type"); - choice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::getDescription).collect(Collectors.toSet())); + Choice choice = new ChoiceCreatureType(); while (!controller.choose(Outcome.GainControl, choice, game)) { if (!controller.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/r/RiptideChronologist.java b/Mage.Sets/src/mage/cards/r/RiptideChronologist.java index e83bd913b0..336c13232a 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideChronologist.java +++ b/Mage.Sets/src/mage/cards/r/RiptideChronologist.java @@ -27,8 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -39,7 +37,7 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; import mage.constants.SubType; @@ -50,6 +48,8 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** * @author fireshoes */ @@ -94,9 +94,7 @@ class RiptideChronologistEffect extends OneShotEffect { Player player = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (player != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(outcome, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java index 0b94461321..3d9a844301 100644 --- a/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java +++ b/Mage.Sets/src/mage/cards/r/RiptideShapeshifter.java @@ -27,8 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; @@ -38,14 +36,15 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; import mage.cards.*; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Outcome; -import mage.constants.SubType; import mage.constants.Zone; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author emerald000 @@ -96,9 +95,7 @@ class RiptideShapeshifterEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null) { - Choice choice = new ChoiceImpl(true); - choice.setMessage("Choose a creature type:"); - choice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice choice = new ChoiceCreatureType(); while (!controller.choose(Outcome.BoostCreature, choice, game)) { if (!controller.canRespond()) { return false; diff --git a/Mage.Sets/src/mage/cards/t/TribalUnity.java b/Mage.Sets/src/mage/cards/t/TribalUnity.java index 8b852f4c61..e3ac24efd3 100644 --- a/Mage.Sets/src/mage/cards/t/TribalUnity.java +++ b/Mage.Sets/src/mage/cards/t/TribalUnity.java @@ -27,8 +27,6 @@ */ package mage.cards.t; -import java.util.UUID; -import java.util.stream.Collectors; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; @@ -38,7 +36,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; @@ -48,6 +46,8 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * @author anonymous */ @@ -91,9 +91,7 @@ class TribalUnityEffect extends OneShotEffect { MageObject sourceObject = game.getObject(source.getSourceId()); int boost = amount.calculate(game, source, this); if (player != null) { - Choice typeChoice = new ChoiceImpl(true); - typeChoice.setMessage("Choose a creature type:"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + Choice typeChoice = new ChoiceCreatureType(); while (!player.choose(outcome, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java index 442205ca31..67b8960a00 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseCreatureTypeEffect.java @@ -39,6 +39,7 @@ import mage.game.permanent.Permanent; import mage.players.Player; import mage.util.CardUtil; +import java.util.LinkedHashSet; import java.util.stream.Collectors; /** @@ -65,7 +66,7 @@ public class ChooseCreatureTypeEffect extends OneShotEffect { if (controller != null && mageObject != null) { Choice typeChoice = new ChoiceImpl(true); typeChoice.setMessage("Choose creature type"); - typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + typeChoice.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toCollection(LinkedHashSet::new))); while (!controller.choose(outcome, typeChoice, game)) { if (!controller.canRespond()) { return false; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java index bc2d2f1df8..6a21fcf093 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesChosenCreatureTypeTargetEffect.java @@ -6,16 +6,13 @@ import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.choices.Choice; -import mage.choices.ChoiceImpl; +import mage.choices.ChoiceCreatureType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SubType; import mage.game.Game; import mage.players.Player; import mage.target.targetpointer.FixedTarget; -import mage.util.SubTypeList; - -import java.util.stream.Collectors; public class BecomesChosenCreatureTypeTargetEffect extends OneShotEffect { @@ -48,17 +45,15 @@ public class BecomesChosenCreatureTypeTargetEffect extends OneShotEffect { Card card = game.getCard(source.getSourceId()); String chosenType = ""; if (player != null && card != null) { - Choice typeChoice = new ChoiceImpl(true); + Choice typeChoice = new ChoiceCreatureType(); String msg = "Choose a creature type"; if(nonWall) { msg += " other than Wall"; } typeChoice.setMessage(msg); - SubTypeList types = SubType.getCreatureTypes(false); if(nonWall) { - types.remove(SubType.WALL); + typeChoice.getChoices().remove(SubType.WALL.getDescription()); } - typeChoice.setChoices(types.stream().map(SubType::toString).collect(Collectors.toSet())); while (!player.choose(Outcome.BoostCreature, typeChoice, game)) { if (!player.canRespond()) { return false; diff --git a/Mage/src/main/java/mage/choices/ChoiceCreatureType.java b/Mage/src/main/java/mage/choices/ChoiceCreatureType.java index 0947edf1b1..558a6ecb5c 100644 --- a/Mage/src/main/java/mage/choices/ChoiceCreatureType.java +++ b/Mage/src/main/java/mage/choices/ChoiceCreatureType.java @@ -2,13 +2,14 @@ package mage.choices; import mage.constants.SubType; +import java.util.LinkedHashSet; import java.util.stream.Collectors; public class ChoiceCreatureType extends ChoiceImpl { public ChoiceCreatureType() { super(true); - this.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toSet())); + this.setChoices(SubType.getCreatureTypes(false).stream().map(SubType::toString).collect(Collectors.toCollection(LinkedHashSet::new))); this.message = "Choose a creature type:"; } diff --git a/Mage/src/main/java/mage/constants/SubType.java b/Mage/src/main/java/mage/constants/SubType.java index bb7a8e8f9b..d636f37c13 100644 --- a/Mage/src/main/java/mage/constants/SubType.java +++ b/Mage/src/main/java/mage/constants/SubType.java @@ -3,6 +3,7 @@ package mage.constants; import mage.util.SubTypeList; import java.util.Arrays; +import java.util.EnumSet; import java.util.Set; import java.util.stream.Collectors; @@ -418,10 +419,10 @@ public enum SubType { return subTypeSet; } - public static SubTypeList getCreatureTypes(boolean customSet) { - SubTypeList subTypes = new SubTypeList(); + public static Set getCreatureTypes(boolean customSet) { + Set subTypes = EnumSet.noneOf(SubType.class); for (SubType s : values()) { - if (!s.customSet) { + if (s.customSet == customSet && s.getSubTypeSet() == SubTypeSet.CreatureType) { subTypes.add(s); } }