diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PartyCount.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PartyCount.java index 5b9c893577..4493d05f58 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/PartyCount.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/PartyCount.java @@ -36,6 +36,16 @@ public enum PartyCount implements DynamicValue { SubType.WIZARD ); + private static Set makeSet(Permanent permanent, Game game) { + Set subTypeSet = new HashSet<>(); + for (SubType subType : partyTypes) { + if (permanent.hasSubtype(subType, game)) { + subTypeSet.add(subType); + } + } + return subTypeSet; + } + private static boolean attemptRearrange(SubType subType, UUID uuid, Set creatureTypes, Map subTypeUUIDMap, Map> creatureTypesMap) { UUID uuid1 = subTypeUUIDMap.get(subType); if (uuid1 == null) { @@ -51,19 +61,18 @@ public enum PartyCount implements DynamicValue { subTypeUUIDMap.put(subType1, uuid1); return true; } - return attemptRearrange(subType1, uuid1, creatureTypes, subTypeUUIDMap, creatureTypesMap); } - return false; - } - - private static Set makeSet(Permanent permanent, Game game) { - Set subTypeSet = new HashSet<>(); - for (SubType subType : partyTypes) { - if (permanent.hasSubtype(subType, game)) { - subTypeSet.add(subType); + for (SubType subType1 : creatureTypes1) { + if (subType == subType1) { + continue; + } + if (attemptRearrange(subType1, uuid1, creatureTypes, subTypeUUIDMap, creatureTypesMap)) { + subTypeUUIDMap.put(subType, uuid); + subTypeUUIDMap.put(subType1, uuid1); + return true; } } - return subTypeSet; + return false; } @Override