isaacscript-common 8.5.0 → 8.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,6 @@ import { CollectibleType } from "isaac-typescript-definitions";
3
3
  * Helper function to get all of the collectibles that the player has gotten so far on this run, in
4
4
  * order.
5
5
  *
6
- * Note that this does not include active collectibles that have since been dropped for other
7
- * collectibles.
8
- *
9
6
  * In the case of inventory initialization or the case where the player rerolls their build in the
10
7
  * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
11
8
  * that the items were actually given to the player. In this case, the inventory will be in the
@@ -17,6 +14,17 @@ import { CollectibleType } from "isaac-typescript-definitions";
17
14
  * would not be updated. In vanilla, this situation would never happen, but another mod might do
18
15
  * this for some reason. (With that said, the next time that a collectible is normally added or
19
16
  * removed, it would trigger a re-scan, and the previous changes would be picked up.)
17
+ *
18
+ * @param player The player to get the inventory for.
19
+ * @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
20
+ * is true.
20
21
  */
21
22
  export declare function getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
23
+ /**
24
+ * Helper function to get the last passive collectible that the player picked up. In most cases,
25
+ * this will be the passive that is removed when the player would use Clicker.
26
+ *
27
+ * Returns undefined if the player does not have any passive collectibles.
28
+ */
29
+ export declare function getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
22
30
  //# sourceMappingURL=playerInventory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAyG5E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB"}
1
+ {"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AA6G5E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,YAAY,GACnB,eAAe,GAAG,SAAS,CAK7B"}
@@ -15,6 +15,7 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
15
15
  local ____array = require("functions.array")
16
16
  local arrayRemoveInPlace = ____array.arrayRemoveInPlace
17
17
  local copyArray = ____array.copyArray
18
+ local getLastElement = ____array.getLastElement
18
19
  local ____collectibles = require("functions.collectibles")
19
20
  local isActiveCollectible = ____collectibles.isActiveCollectible
20
21
  local ____collectibleSet = require("functions.collectibleSet")
@@ -84,9 +85,6 @@ end
84
85
  --- Helper function to get all of the collectibles that the player has gotten so far on this run, in
85
86
  -- order.
86
87
  --
87
- -- Note that this does not include active collectibles that have since been dropped for other
88
- -- collectibles.
89
- --
90
88
  -- In the case of inventory initialization or the case where the player rerolls their build in the
91
89
  -- middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
92
90
  -- that the items were actually given to the player. In this case, the inventory will be in the
@@ -98,6 +96,10 @@ end
98
96
  -- would not be updated. In vanilla, this situation would never happen, but another mod might do
99
97
  -- this for some reason. (With that said, the next time that a collectible is normally added or
100
98
  -- removed, it would trigger a re-scan, and the previous changes would be picked up.)
99
+ --
100
+ -- @param player The player to get the inventory for.
101
+ -- @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
102
+ -- is true.
101
103
  function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
102
104
  if includeActiveCollectibles == nil then
103
105
  includeActiveCollectibles = true
@@ -113,4 +115,13 @@ function ____exports.getPlayerInventory(self, player, includeActiveCollectibles)
113
115
  function(____, collectibleType) return not isActiveCollectible(nil, collectibleType) end
114
116
  )
115
117
  end
118
+ --- Helper function to get the last passive collectible that the player picked up. In most cases,
119
+ -- this will be the passive that is removed when the player would use Clicker.
120
+ --
121
+ -- Returns undefined if the player does not have any passive collectibles.
122
+ function ____exports.getPlayerLastPassiveCollectible(self, player)
123
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
124
+ local inventory = ____exports.getPlayerInventory(nil, player, false)
125
+ return getLastElement(nil, inventory)
126
+ end
116
127
  return ____exports
@@ -19,6 +19,9 @@ export declare function getAliveBosses(entityType?: EntityType, variant?: number
19
19
  *
20
20
  * The set contains strings with the entity type and variant, separated by a period.
21
21
  *
22
+ * Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
23
+ * and Gabriel.).
24
+ *
22
25
  * Also see the `getBossSet` and `getCombinedBossSet` functions.
23
26
  *
24
27
  * @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
@@ -1 +1 @@
1
- {"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAyBtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,UAAO,GACxB,WAAW,CAAC,MAAM,CAAC,CAIrB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,GACT,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAOjC;AAED,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAyBX;AAmCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
1
+ {"version":3,"file":"bosses.d.ts","sourceRoot":"","sources":["../../src/functions/bosses.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAyBtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,UAAO,GACxB,WAAW,CAAC,MAAM,CAAC,CAIrB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,UAAU,CAAC,EAAE,UAAU,EACvB,OAAO,CAAC,EAAE,GAAG,EACb,OAAO,CAAC,EAAE,GAAG,EACb,cAAc,UAAQ,GACrB,SAAS,EAAE,CAGb;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,GAAG,GACT,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAOjC;AAED,6FAA6F;AAC7F,wBAAgB,KAAK,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAE7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,EAC7C,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAyBX;AAmCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,EACvC,WAAW,CAAC,EAAE,GAAG,GAChB,SAAS,CAYX"}
@@ -107,6 +107,9 @@ end
107
107
  --
108
108
  -- The set contains strings with the entity type and variant, separated by a period.
109
109
  --
110
+ -- Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
111
+ -- and Gabriel.).
112
+ --
110
113
  -- Also see the `getBossSet` and `getCombinedBossSet` functions.
111
114
  --
112
115
  -- @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
package/dist/index.d.ts CHANGED
@@ -2280,6 +2280,9 @@ export declare function getAliveNPCs(entityType?: EntityType, variant?: number,
2280
2280
  *
2281
2281
  * The set contains strings with the entity type and variant, separated by a period.
2282
2282
  *
2283
+ * Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
2284
+ * and Gabriel.).
2285
+ *
2283
2286
  * Also see the `getBossSet` and `getCombinedBossSet` functions.
2284
2287
  *
2285
2288
  * @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
@@ -4022,9 +4025,6 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
4022
4025
  * Helper function to get all of the collectibles that the player has gotten so far on this run, in
4023
4026
  * order.
4024
4027
  *
4025
- * Note that this does not include active collectibles that have since been dropped for other
4026
- * collectibles.
4027
- *
4028
4028
  * In the case of inventory initialization or the case where the player rerolls their build in the
4029
4029
  * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
4030
4030
  * that the items were actually given to the player. In this case, the inventory will be in the
@@ -4036,6 +4036,10 @@ export declare function getPlayerIndexVanilla(playerToFind: EntityPlayer): int |
4036
4036
  * would not be updated. In vanilla, this situation would never happen, but another mod might do
4037
4037
  * this for some reason. (With that said, the next time that a collectible is normally added or
4038
4038
  * removed, it would trigger a re-scan, and the previous changes would be picked up.)
4039
+ *
4040
+ * @param player The player to get the inventory for.
4041
+ * @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
4042
+ * is true.
4039
4043
  */
4040
4044
  export declare function getPlayerInventory(player: EntityPlayer, includeActiveCollectibles?: boolean): CollectibleType[];
4041
4045
 
@@ -4045,6 +4049,14 @@ export declare function getPlayerInventory(player: EntityPlayer, includeActiveCo
4045
4049
  */
4046
4050
  export declare function getPlayerLastHeart(player: EntityPlayer): HealthType;
4047
4051
 
4052
+ /**
4053
+ * Helper function to get the last passive collectible that the player picked up. In most cases,
4054
+ * this will be the passive that is removed when the player would use Clicker.
4055
+ *
4056
+ * Returns undefined if the player does not have any passive collectibles.
4057
+ */
4058
+ export declare function getPlayerLastPassiveCollectible(player: EntityPlayer): CollectibleType | undefined;
4059
+
4048
4060
  /**
4049
4061
  * Returns the maximum heart containers that the provided player can have. Normally, this is 12, but
4050
4062
  * it can change depending on the character (e.g. Keeper) and other things (e.g. Mother's Kiss).
@@ -1 +1 @@
1
- {"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../src/sets/bossSets.ts"],"names":[],"mappings":";AAibA,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAC3D,GAAG,EACH,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAarC,CAAC;AAEH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CACtD,GAAG,EACH,WAAW,CAAC,MAAM,CAAC,CAanB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAQ7C,CAAC;AAiBH,eAAO,MAAM,qCAAqC,EAAE,WAAW,CAAC,MAAM,CACpC,CAAC"}
1
+ {"version":3,"file":"bossSets.d.ts","sourceRoot":"","sources":["../../src/sets/bossSets.ts"],"names":[],"mappings":";AAibA,eAAO,MAAM,mCAAmC,EAAE,WAAW,CAC3D,GAAG,EACH,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAarC,CAAC;AAEH,eAAO,MAAM,8BAA8B,EAAE,WAAW,CACtD,GAAG,EACH,WAAW,CAAC,MAAM,CAAC,CAanB,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,MAAM,CAQ7C,CAAC;AAEH,eAAO,MAAM,qCAAqC,qBACX,CAAC"}
@@ -7,6 +7,7 @@ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
7
7
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
8
8
  local Map = ____lualib.Map
9
9
  local ____exports = {}
10
+ local getAllBossesExcludingStoryBossesSet
10
11
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
11
12
  local BigHornVariant = ____isaac_2Dtypescript_2Ddefinitions.BigHornVariant
12
13
  local ChubVariant = ____isaac_2Dtypescript_2Ddefinitions.ChubVariant
@@ -43,6 +44,21 @@ local ____set = require("functions.set")
43
44
  local copySet = ____set.copySet
44
45
  local ____storyBossesSet = require("sets.storyBossesSet")
45
46
  local STORY_BOSSES_SET = ____storyBossesSet.STORY_BOSSES_SET
47
+ function getAllBossesExcludingStoryBossesSet(self)
48
+ local allBossesExcludingStoryBossesSet = copySet(nil, ____exports.ALL_BOSSES_SET)
49
+ local allBosses = {__TS__Spread(____exports.ALL_BOSSES_SET:values())}
50
+ for ____, entityTypeVariantString in ipairs(allBosses) do
51
+ local tuple = parseEntityTypeVariantString(nil, entityTypeVariantString)
52
+ if tuple == nil then
53
+ error("Failed to parse a boss tuple when constructing the story boss set.")
54
+ end
55
+ local entityType, _variant = table.unpack(tuple)
56
+ if STORY_BOSSES_SET:has(entityType) then
57
+ allBossesExcludingStoryBossesSet:delete(entityTypeVariantString)
58
+ end
59
+ end
60
+ return allBossesExcludingStoryBossesSet
61
+ end
46
62
  --- Contains just the bosses in Basement (not e.g. Burning Basement).
47
63
  local BASEMENT_BOSSES_SET = __TS__New(
48
64
  Set,
@@ -557,17 +573,5 @@ ____exports.ALL_BOSSES_SET = __TS__New(
557
573
  ____Set_13,
558
574
  {__TS__SparseArraySpread(____array_12)}
559
575
  )
560
- local allBossesExcludingStoryBossesSet = copySet(nil, ____exports.ALL_BOSSES_SET)
561
- local allBosses = {__TS__Spread(____exports.ALL_BOSSES_SET:values())}
562
- for ____, entityTypeVariantString in ipairs(allBosses) do
563
- local tuple = parseEntityTypeVariantString(nil, entityTypeVariantString)
564
- if tuple == nil then
565
- error("Failed to parse a boss tuple when constructing the story boss set.")
566
- end
567
- local entityType, _variant = table.unpack(tuple)
568
- if STORY_BOSSES_SET:has(entityType) then
569
- allBossesExcludingStoryBossesSet:delete(entityTypeVariantString)
570
- end
571
- end
572
- ____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = allBossesExcludingStoryBossesSet
576
+ ____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = getAllBossesExcludingStoryBossesSet(nil)
573
577
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "8.5.0",
3
+ "version": "8.6.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -3,7 +3,11 @@ import { DefaultMap } from "../classes/DefaultMap";
3
3
  import { ModUpgraded } from "../classes/ModUpgraded";
4
4
  import { ModCallbackCustom } from "../enums/ModCallbackCustom";
5
5
  import { errorIfFeaturesNotInitialized } from "../featuresInitialized";
6
- import { arrayRemoveInPlace, copyArray } from "../functions/array";
6
+ import {
7
+ arrayRemoveInPlace,
8
+ copyArray,
9
+ getLastElement,
10
+ } from "../functions/array";
7
11
  import { isActiveCollectible } from "../functions/collectibles";
8
12
  import { getCollectibleArray } from "../functions/collectibleSet";
9
13
  import {
@@ -107,9 +111,6 @@ function postCollectibleRemoved(
107
111
  * Helper function to get all of the collectibles that the player has gotten so far on this run, in
108
112
  * order.
109
113
  *
110
- * Note that this does not include active collectibles that have since been dropped for other
111
- * collectibles.
112
- *
113
114
  * In the case of inventory initialization or the case where the player rerolls their build in the
114
115
  * middle of the run (e.g. with D4), the order of the inventory will not correspond to the order
115
116
  * that the items were actually given to the player. In this case, the inventory will be in the
@@ -121,6 +122,10 @@ function postCollectibleRemoved(
121
122
  * would not be updated. In vanilla, this situation would never happen, but another mod might do
122
123
  * this for some reason. (With that said, the next time that a collectible is normally added or
123
124
  * removed, it would trigger a re-scan, and the previous changes would be picked up.)
125
+ *
126
+ * @param player The player to get the inventory for.
127
+ * @param includeActiveCollectibles Optional. If true, will include all active collectibles. Default
128
+ * is true.
124
129
  */
125
130
  export function getPlayerInventory(
126
131
  player: EntityPlayer,
@@ -139,3 +144,18 @@ export function getPlayerInventory(
139
144
  (collectibleType) => !isActiveCollectible(collectibleType),
140
145
  );
141
146
  }
147
+
148
+ /**
149
+ * Helper function to get the last passive collectible that the player picked up. In most cases,
150
+ * this will be the passive that is removed when the player would use Clicker.
151
+ *
152
+ * Returns undefined if the player does not have any passive collectibles.
153
+ */
154
+ export function getPlayerLastPassiveCollectible(
155
+ player: EntityPlayer,
156
+ ): CollectibleType | undefined {
157
+ errorIfFeaturesNotInitialized(FEATURE_NAME);
158
+
159
+ const inventory = getPlayerInventory(player, false);
160
+ return getLastElement(inventory);
161
+ }
@@ -56,6 +56,9 @@ export function getAliveBosses(
56
56
  *
57
57
  * The set contains strings with the entity type and variant, separated by a period.
58
58
  *
59
+ * Note that this set does not include bosses that do not appear in Boss Rooms (e.g. Krampus, Uriel,
60
+ * and Gabriel.).
61
+ *
59
62
  * Also see the `getBossSet` and `getCombinedBossSet` functions.
60
63
  *
61
64
  * @param includeStoryBosses Optional. Whether to include "story" bosses like Mom and It Lives!
@@ -475,20 +475,29 @@ export const ALL_BOSSES_SET: ReadonlySet<string> = new Set([
475
475
  ...ALL_STAGE_11_BOSSES_SET.values(),
476
476
  ]);
477
477
 
478
- // Since story bosses are stored by entity type, we copy the existing bosses and filter them (to
479
- // avoid having to hard-code story boss variants).
480
- const allBossesExcludingStoryBossesSet = copySet(ALL_BOSSES_SET);
481
- const allBosses = [...ALL_BOSSES_SET.values()];
482
- for (const entityTypeVariantString of allBosses) {
483
- const tuple = parseEntityTypeVariantString(entityTypeVariantString);
484
- if (tuple === undefined) {
485
- error("Failed to parse a boss tuple when constructing the story boss set.");
478
+ export const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET =
479
+ getAllBossesExcludingStoryBossesSet();
480
+
481
+ /**
482
+ * Since story bosses are stored by entity type, we copy the existing bosses and filter them (to
483
+ * avoid having to hard-code story boss variants).
484
+ */
485
+ function getAllBossesExcludingStoryBossesSet(): ReadonlySet<string> {
486
+ const allBossesExcludingStoryBossesSet = copySet(ALL_BOSSES_SET);
487
+ const allBosses = [...ALL_BOSSES_SET.values()];
488
+ for (const entityTypeVariantString of allBosses) {
489
+ const tuple = parseEntityTypeVariantString(entityTypeVariantString);
490
+ if (tuple === undefined) {
491
+ error(
492
+ "Failed to parse a boss tuple when constructing the story boss set.",
493
+ );
494
+ }
495
+
496
+ const [entityType, _variant] = tuple;
497
+ if (STORY_BOSSES_SET.has(entityType)) {
498
+ allBossesExcludingStoryBossesSet.delete(entityTypeVariantString);
499
+ }
486
500
  }
487
501
 
488
- const [entityType, _variant] = tuple;
489
- if (STORY_BOSSES_SET.has(entityType)) {
490
- allBossesExcludingStoryBossesSet.delete(entityTypeVariantString);
491
- }
502
+ return allBossesExcludingStoryBossesSet;
492
503
  }
493
- export const ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET: ReadonlySet<string> =
494
- allBossesExcludingStoryBossesSet;