isaacscript-common 81.0.5 → 82.0.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.
@@ -2,13 +2,15 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__New = ____lualib.__TS__New
3
3
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
4
4
  local __TS__Spread = ____lualib.__TS__Spread
5
+ local Set = ____lualib.Set
6
+ local __TS__Iterator = ____lualib.__TS__Iterator
5
7
  local ____exports = {}
6
8
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
9
  local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
8
10
  local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
9
- local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
11
+ local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
10
12
  local ____cachedEnumValues = require("arrays.cachedEnumValues")
11
- local BOSS_IDS = ____cachedEnumValues.BOSS_IDS
13
+ local BOSS_ID_VALUES = ____cachedEnumValues.BOSS_ID_VALUES
12
14
  local ____set = require("functions.set")
13
15
  local combineSets = ____set.combineSets
14
16
  local ____storyBosses = require("functions.storyBosses")
@@ -17,7 +19,7 @@ local ____ReadonlyMap = require("types.ReadonlyMap")
17
19
  local ReadonlyMap = ____ReadonlyMap.ReadonlyMap
18
20
  local ____ReadonlySet = require("types.ReadonlySet")
19
21
  local ReadonlySet = ____ReadonlySet.ReadonlySet
20
- --- Contains just the bosses in Basement (not e.g. Burning Basement).
22
+ --- For `StageID.BASEMENT` (1).
21
23
  local BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
22
24
  BossID.MONSTRO,
23
25
  BossID.LARRY_JR,
@@ -34,7 +36,7 @@ local BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
34
36
  BossID.TURDLING,
35
37
  BossID.BABY_PLUM
36
38
  })
37
- --- Contains just the bosses in Cellar (not e.g. Burning Basement).
39
+ --- For `StageID.CELLAR` (2).
38
40
  local CELLAR_BOSSES_SET = __TS__New(ReadonlySet, {
39
41
  BossID.FAMINE,
40
42
  BossID.DUKE_OF_FLIES,
@@ -48,7 +50,7 @@ local CELLAR_BOSSES_SET = __TS__New(ReadonlySet, {
48
50
  BossID.RAG_MAN,
49
51
  BossID.BABY_PLUM
50
52
  })
51
- --- Contains just the bosses in Burning Basement (not e.g. Cellar).
53
+ --- For `StageID.BURNING_BASEMENT` (3).
52
54
  local BURNING_BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
53
55
  BossID.MONSTRO,
54
56
  BossID.LARRY_JR,
@@ -66,9 +68,9 @@ local BURNING_BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
66
68
  BossID.TURDLING,
67
69
  BossID.BABY_PLUM
68
70
  })
69
- --- Contains just the bosses in Downpour (not e.g. Burning Basement).
71
+ --- For `StageID.DOWNPOUR` (27).
70
72
  local DOWNPOUR_BOSSES_SET = __TS__New(ReadonlySet, {BossID.LIL_BLUB, BossID.WORMWOOD, BossID.RAINMAKER, BossID.MIN_MIN})
71
- --- Contains just the bosses in Dross (not e.g. Burning Basement).
73
+ --- For `StageID.DROSS` (28).
72
74
  local DROSS_BOSSES_SET = __TS__New(ReadonlySet, {
73
75
  BossID.LIL_BLUB,
74
76
  BossID.WORMWOOD,
@@ -76,7 +78,7 @@ local DROSS_BOSSES_SET = __TS__New(ReadonlySet, {
76
78
  BossID.COLOSTOMIA,
77
79
  BossID.TURDLET
78
80
  })
79
- --- The set of unique bosses for Basement, Cellar, and so on.
81
+ --- The set of unique bosses for Basement, Cellar, Burning Basement, Downpour, and Dross.
80
82
  local ALL_BASEMENT_BOSSES_SET = combineSets(
81
83
  nil,
82
84
  BASEMENT_BOSSES_SET,
@@ -85,14 +87,7 @@ local ALL_BASEMENT_BOSSES_SET = combineSets(
85
87
  DOWNPOUR_BOSSES_SET,
86
88
  DROSS_BOSSES_SET
87
89
  )
88
- local BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
89
- {StageType.ORIGINAL, BASEMENT_BOSSES_SET},
90
- {StageType.WRATH_OF_THE_LAMB, CELLAR_BOSSES_SET},
91
- {StageType.AFTERBIRTH, BURNING_BASEMENT_BOSSES_SET},
92
- {StageType.REPENTANCE, DOWNPOUR_BOSSES_SET},
93
- {StageType.REPENTANCE_B, DROSS_BOSSES_SET}
94
- })
95
- --- Contains just the bosses in Caves (not e.g. Flooded Caves).
90
+ --- For `StageID.CAVES` (4).
96
91
  local CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
97
92
  BossID.CHUB,
98
93
  BossID.GURDY,
@@ -110,7 +105,7 @@ local CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
110
105
  BossID.BIG_HORN,
111
106
  BossID.BUMBINO
112
107
  })
113
- --- Contains just the bosses in Catacombs (not e.g. Flooded Caves).
108
+ --- For `StageID.CATACOMBS` (5).
114
109
  local CATACOMBS_BOSSES_SET = __TS__New(ReadonlySet, {
115
110
  BossID.PESTILENCE,
116
111
  BossID.PEEP,
@@ -129,7 +124,7 @@ local CATACOMBS_BOSSES_SET = __TS__New(ReadonlySet, {
129
124
  BossID.BIG_HORN,
130
125
  BossID.BUMBINO
131
126
  })
132
- --- Contains just the bosses in Flooded Caves (not e.g. Catacombs).
127
+ --- For `StageID.FLOODED_CAVES` (6).
133
128
  local FLOODED_CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
134
129
  BossID.CHUB,
135
130
  BossID.GURDY,
@@ -149,9 +144,9 @@ local FLOODED_CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
149
144
  BossID.BIG_HORN,
150
145
  BossID.BUMBINO
151
146
  })
152
- --- Contains just the bosses in Mines (not e.g. Flooded Caves).
147
+ --- For `StageID.MINES` (29).
153
148
  local MINES_BOSSES_SET = __TS__New(ReadonlySet, {BossID.REAP_CREEP, BossID.TUFF_TWINS, BossID.HORNFEL, BossID.GREAT_GIDEON})
154
- --- Contains just the bosses in Ashpit (not e.g. Flooded Caves).
149
+ --- For `StageID.ASHPIT` (30).
155
150
  local ASHPIT_BOSSES_SET = __TS__New(ReadonlySet, {
156
151
  BossID.PILE,
157
152
  BossID.GREAT_GIDEON,
@@ -159,7 +154,7 @@ local ASHPIT_BOSSES_SET = __TS__New(ReadonlySet, {
159
154
  BossID.SHELL,
160
155
  BossID.CLUTCH
161
156
  })
162
- --- The set of unique bosses for Caves, Catacombs, and so on.
157
+ --- The set of unique bosses for Caves, Catacombs, Flooded Caves, Mines, and Ashpit.
163
158
  local ALL_CAVES_BOSSES_SET = combineSets(
164
159
  nil,
165
160
  CAVES_BOSSES_SET,
@@ -168,14 +163,7 @@ local ALL_CAVES_BOSSES_SET = combineSets(
168
163
  MINES_BOSSES_SET,
169
164
  ASHPIT_BOSSES_SET
170
165
  )
171
- local CAVES_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
172
- {StageType.ORIGINAL, CAVES_BOSSES_SET},
173
- {StageType.WRATH_OF_THE_LAMB, CATACOMBS_BOSSES_SET},
174
- {StageType.AFTERBIRTH, FLOODED_CAVES_BOSSES_SET},
175
- {StageType.REPENTANCE, MINES_BOSSES_SET},
176
- {StageType.REPENTANCE_B, ASHPIT_BOSSES_SET}
177
- })
178
- --- Contains just the bosses in Depths (not e.g. Dank Depths).
166
+ --- For `StageID.DEPTHS` (7).
179
167
  --
180
168
  -- Note that this set includes Mom, even though they are not technically in the boss pool.
181
169
  local DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
@@ -192,7 +180,7 @@ local DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
192
180
  BossID.SISTERS_VIS,
193
181
  BossID.REAP_CREEP
194
182
  })
195
- --- Contains just the bosses in Necropolis (not e.g. Dank Depths).
183
+ --- For `StageID.NECROPOLIS` (8).
196
184
  --
197
185
  -- Note that this set includes Mom, even though they are not technically in the boss pool.
198
186
  local NECROPOLIS_BOSSES_SET = __TS__New(ReadonlySet, {
@@ -208,7 +196,7 @@ local NECROPOLIS_BOSSES_SET = __TS__New(ReadonlySet, {
208
196
  BossID.SISTERS_VIS,
209
197
  BossID.PILE
210
198
  })
211
- --- Contains just the bosses in Dank Depths (not e.g. Necropolis).
199
+ --- For `StageID.DANK_DEPTHS` (9).
212
200
  --
213
201
  -- Note that this set includes Mom, even though they are not technically in the boss pool.
214
202
  local DANK_DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
@@ -225,15 +213,15 @@ local DANK_DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
225
213
  BossID.SISTERS_VIS,
226
214
  BossID.REAP_CREEP
227
215
  })
228
- --- Contains just the bosses in Mausoleum (not e.g. Dank Depths).
216
+ --- For `StageID.MAUSOLEUM` (31).
229
217
  --
230
218
  -- Note that this set includes Mausoleum Mom, even though they are not technically in the boss pool.
231
219
  local MAUSOLEUM_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SIREN, BossID.HERETIC, BossID.MAUSOLEUM_MOM})
232
- --- Contains just the bosses in Gehenna (not e.g. Dank Depths).
220
+ --- For `StageID.GEHENNA` (32).
233
221
  --
234
222
  -- Note that this set includes Mausoleum Mom, even though they are not technically in the boss pool.
235
223
  local GEHENNA_BOSSES_SET = __TS__New(ReadonlySet, {BossID.VISAGE, BossID.MAUSOLEUM_MOM, BossID.HORNY_BOYS})
236
- --- The set of unique bosses for Depths, Necropolis, and so on.
224
+ --- The set of unique bosses for Depths, Necropolis, Dank Depths, Mausoleum, and Gehenna.
237
225
  local ALL_DEPTHS_BOSSES_SET = combineSets(
238
226
  nil,
239
227
  DEPTHS_BOSSES_SET,
@@ -242,14 +230,7 @@ local ALL_DEPTHS_BOSSES_SET = combineSets(
242
230
  MAUSOLEUM_BOSSES_SET,
243
231
  GEHENNA_BOSSES_SET
244
232
  )
245
- local DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
246
- {StageType.ORIGINAL, DEPTHS_BOSSES_SET},
247
- {StageType.WRATH_OF_THE_LAMB, NECROPOLIS_BOSSES_SET},
248
- {StageType.AFTERBIRTH, DANK_DEPTHS_BOSSES_SET},
249
- {StageType.REPENTANCE, MAUSOLEUM_BOSSES_SET},
250
- {StageType.REPENTANCE_B, GEHENNA_BOSSES_SET}
251
- })
252
- --- Contains just the bosses in Womb (not e.g. Scarred Womb).
233
+ --- For `StageID.WOMB` (10).
253
234
  --
254
235
  -- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
255
236
  -- boss pool.
@@ -267,7 +248,7 @@ local WOMB_BOSSES_SET = __TS__New(ReadonlySet, {
267
248
  BossID.MR_FRED,
268
249
  BossID.MATRIARCH
269
250
  })
270
- --- Contains just the bosses in Utero (not e.g. Scarred Womb).
251
+ --- For `StageID.UTERO` (11).
271
252
  --
272
253
  -- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
273
254
  -- boss pool.
@@ -284,7 +265,7 @@ local UTERO_BOSSES_SET = __TS__New(ReadonlySet, {
284
265
  BossID.DADDY_LONG_LEGS,
285
266
  BossID.TRIACHNID
286
267
  })
287
- --- Contains just the bosses in Scarred Womb (not e.g. Utero).
268
+ --- For `StageID.SCARRED_WOMB` (12).
288
269
  --
289
270
  -- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
290
271
  -- boss pool.
@@ -303,11 +284,11 @@ local SCARRED_WOMB_BOSSES_SET = __TS__New(ReadonlySet, {
303
284
  BossID.MR_FRED,
304
285
  BossID.MATRIARCH
305
286
  })
306
- --- Contains just the bosses in Corpse (not e.g. Scarred Womb).
287
+ --- For `StageID.CORPSE` (33).
307
288
  --
308
- -- Note that this set includes Mother, even though they are not technically in the boss pool.
289
+ -- Note that this set includes Mother, even though she is not technically in the boss pool.
309
290
  local CORPSE_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SCOURGE, BossID.CHIMERA, BossID.ROTGUT, BossID.MOTHER})
310
- --- The set of unique bosses for Womb, Utero, and so on.
291
+ --- The set of unique bosses for Womb, Utero, Scarred Womb, and Corpse.
311
292
  local ALL_WOMB_BOSSES_SET = combineSets(
312
293
  nil,
313
294
  WOMB_BOSSES_SET,
@@ -315,38 +296,46 @@ local ALL_WOMB_BOSSES_SET = combineSets(
315
296
  SCARRED_WOMB_BOSSES_SET,
316
297
  CORPSE_BOSSES_SET
317
298
  )
318
- local WOMB_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, WOMB_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, UTERO_BOSSES_SET}, {StageType.AFTERBIRTH, SCARRED_WOMB_BOSSES_SET}, {StageType.REPENTANCE, CORPSE_BOSSES_SET}})
319
299
  local BLUE_WOMB_BOSSES_SET = __TS__New(ReadonlySet, {BossID.HUSH})
320
- local BLUE_WOMB_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, BLUE_WOMB_BOSSES_SET}})
321
300
  local SHEOL_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SATAN})
322
301
  local CATHEDRAL_BOSSES_SET = __TS__New(ReadonlySet, {BossID.ISAAC})
323
302
  local ALL_STAGE_10_BOSSES_SET = combineSets(nil, SHEOL_BOSSES_SET, CATHEDRAL_BOSSES_SET)
324
- local STAGE_10_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, SHEOL_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, CATHEDRAL_BOSSES_SET}})
325
303
  --- Note that this set includes Mega Satan, even though they are not technically in the boss pool.
326
304
  local DARK_ROOM_BOSSES_SET = __TS__New(ReadonlySet, {BossID.LAMB, BossID.MEGA_SATAN})
327
305
  --- Note that this set includes Mega Satan, even though they are not technically in the boss pool.
328
306
  local CHEST_BOSSES_SET = __TS__New(ReadonlySet, {BossID.BLUE_BABY, BossID.MEGA_SATAN})
329
307
  local ALL_STAGE_11_BOSSES_SET = combineSets(nil, DARK_ROOM_BOSSES_SET, CHEST_BOSSES_SET)
330
- local STAGE_11_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, DARK_ROOM_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, CHEST_BOSSES_SET}})
331
308
  local VOID_BOSSES_SET = __TS__New(ReadonlySet, {BossID.DELIRIUM})
332
- local VOID_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, VOID_BOSSES_SET}})
333
- --- Note that this does not include Ultra Famine, Ultra Pestilence, Ultra War, and Ultra Death.
309
+ --- Includes Dogma and The Beast. Does not include Ultra Famine, Ultra Pestilence, Ultra War, and
310
+ -- Ultra Death (since they do not have boss IDs).
334
311
  local HOME_BOSSES_SET = __TS__New(ReadonlySet, {BossID.DOGMA, BossID.BEAST})
335
- local HOME_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, HOME_BOSSES_SET}})
336
- ____exports.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
337
- {LevelStage.BASEMENT_1, BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP},
338
- {LevelStage.BASEMENT_2, BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP},
339
- {LevelStage.CAVES_1, CAVES_STAGE_TYPE_TO_BOSS_SET_MAP},
340
- {LevelStage.CAVES_2, CAVES_STAGE_TYPE_TO_BOSS_SET_MAP},
341
- {LevelStage.DEPTHS_1, DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP},
342
- {LevelStage.DEPTHS_2, DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP},
343
- {LevelStage.WOMB_1, WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
344
- {LevelStage.WOMB_2, WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
345
- {LevelStage.BLUE_WOMB, BLUE_WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
346
- {LevelStage.SHEOL_CATHEDRAL, STAGE_10_STAGE_TYPE_TO_BOSS_SET_MAP},
347
- {LevelStage.DARK_ROOM_CHEST, STAGE_11_STAGE_TYPE_TO_BOSS_SET_MAP},
348
- {LevelStage.VOID, VOID_STAGE_TYPE_TO_BOSS_SET_MAP},
349
- {LevelStage.HOME, HOME_STAGE_TYPE_TO_BOSS_SET_MAP}
312
+ ____exports.STAGE_ID_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
313
+ {StageID.BASEMENT, BASEMENT_BOSSES_SET},
314
+ {StageID.CELLAR, CELLAR_BOSSES_SET},
315
+ {StageID.BURNING_BASEMENT, BURNING_BASEMENT_BOSSES_SET},
316
+ {StageID.DOWNPOUR, DOWNPOUR_BOSSES_SET},
317
+ {StageID.DROSS, DROSS_BOSSES_SET},
318
+ {StageID.CAVES, CAVES_BOSSES_SET},
319
+ {StageID.CATACOMBS, CATACOMBS_BOSSES_SET},
320
+ {StageID.FLOODED_CAVES, FLOODED_CAVES_BOSSES_SET},
321
+ {StageID.MINES, MINES_BOSSES_SET},
322
+ {StageID.ASHPIT, ASHPIT_BOSSES_SET},
323
+ {StageID.DEPTHS, DEPTHS_BOSSES_SET},
324
+ {StageID.NECROPOLIS, NECROPOLIS_BOSSES_SET},
325
+ {StageID.DANK_DEPTHS, DANK_DEPTHS_BOSSES_SET},
326
+ {StageID.MAUSOLEUM, MAUSOLEUM_BOSSES_SET},
327
+ {StageID.GEHENNA, GEHENNA_BOSSES_SET},
328
+ {StageID.WOMB, WOMB_BOSSES_SET},
329
+ {StageID.UTERO, UTERO_BOSSES_SET},
330
+ {StageID.SCARRED_WOMB, SCARRED_WOMB_BOSSES_SET},
331
+ {StageID.CORPSE, CORPSE_BOSSES_SET},
332
+ {StageID.BLUE_WOMB, BLUE_WOMB_BOSSES_SET},
333
+ {StageID.SHEOL, SHEOL_BOSSES_SET},
334
+ {StageID.CATHEDRAL, CATHEDRAL_BOSSES_SET},
335
+ {StageID.DARK_ROOM, DARK_ROOM_BOSSES_SET},
336
+ {StageID.CHEST, CHEST_BOSSES_SET},
337
+ {StageID.VOID, VOID_BOSSES_SET},
338
+ {StageID.HOME, HOME_BOSSES_SET}
350
339
  })
351
340
  ____exports.STAGE_TO_COMBINED_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
352
341
  {LevelStage.BASEMENT_1, ALL_BASEMENT_BOSSES_SET},
@@ -366,7 +355,7 @@ ____exports.STAGE_TO_COMBINED_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
366
355
  ____exports.ALL_BOSSES_SET = __TS__New(
367
356
  ReadonlySet,
368
357
  __TS__ArrayFilter(
369
- BOSS_IDS,
358
+ BOSS_ID_VALUES,
370
359
  function(____, bossID) return bossID ~= BossID.RAGLICH end
371
360
  )
372
361
  )
@@ -377,4 +366,19 @@ ____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = __TS__New(
377
366
  function(____, bossID) return not isStoryBossID(nil, bossID) end
378
367
  )
379
368
  )
369
+ ____exports.BOSS_ID_TO_STAGE_IDS = (function()
370
+ local bossIDsToStageIDs = {}
371
+ for ____, bossID in ipairs(BOSS_ID_VALUES) do
372
+ local stageIDs = __TS__New(Set)
373
+ for ____, ____value in __TS__Iterator(____exports.STAGE_ID_TO_BOSS_SET_MAP) do
374
+ local stageID = ____value[1]
375
+ local bossSet = ____value[2]
376
+ if bossSet:has(bossID) then
377
+ stageIDs:add(stageID)
378
+ end
379
+ end
380
+ bossIDsToStageIDs[bossID] = stageIDs
381
+ end
382
+ return bossIDsToStageIDs
383
+ end)(nil)
380
384
  return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "81.0.5",
3
+ "version": "82.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -37,6 +37,6 @@
37
37
  "lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
38
38
  },
39
39
  "dependencies": {
40
- "isaac-typescript-definitions": "^39.0.5"
40
+ "isaac-typescript-definitions": "^39.0.6"
41
41
  }
42
42
  }
@@ -27,64 +27,48 @@ import { PlayerStat } from "../enums/PlayerStat";
27
27
  import { SerializationBrand } from "../enums/private/SerializationBrand";
28
28
  import { getEnumValues } from "../functions/enums";
29
29
 
30
- export const ACTIVE_SLOT_VALUES: readonly ActiveSlot[] =
31
- getEnumValues(ActiveSlot);
30
+ export const ACTIVE_SLOT_VALUES = getEnumValues(ActiveSlot);
32
31
 
33
- export const BOSS_IDS: readonly BossID[] = getEnumValues(BossID);
32
+ export const BOSS_ID_VALUES = getEnumValues(BossID);
34
33
 
35
- export const CACHE_FLAG_VALUES: readonly CacheFlag[] = getEnumValues(CacheFlag);
34
+ export const CACHE_FLAG_VALUES = getEnumValues(CacheFlag);
36
35
 
37
- export const CONTROLLER_INDEX_VALUES: readonly ControllerIndex[] =
38
- getEnumValues(ControllerIndex);
36
+ export const CONTROLLER_INDEX_VALUES = getEnumValues(ControllerIndex);
39
37
 
40
- export const DOOR_SLOT_FLAG_VALUES: readonly DoorSlotFlag[] =
41
- getEnumValues(DoorSlotFlag);
38
+ export const DOOR_SLOT_FLAG_VALUES = getEnumValues(DoorSlotFlag);
42
39
 
43
- export const DOOR_SLOT_VALUES: readonly DoorSlot[] = getEnumValues(DoorSlot);
40
+ export const DOOR_SLOT_VALUES = getEnumValues(DoorSlot);
44
41
 
45
- export const GRID_ENTITY_TYPE_VALUES: readonly GridEntityType[] =
46
- getEnumValues(GridEntityType);
42
+ export const GRID_ENTITY_TYPE_VALUES = getEnumValues(GridEntityType);
47
43
 
48
- export const GRID_ENTITY_XML_TYPE_VALUES: readonly GridEntityXMLType[] =
49
- getEnumValues(GridEntityXMLType);
44
+ export const GRID_ENTITY_XML_TYPE_VALUES = getEnumValues(GridEntityXMLType);
50
45
 
51
- export const MOD_CALLBACK_CUSTOM_VALUES: readonly ModCallbackCustom[] =
52
- getEnumValues(ModCallbackCustom);
46
+ export const MOD_CALLBACK_CUSTOM_VALUES = getEnumValues(ModCallbackCustom);
53
47
 
54
- export const ITEM_CONFIG_TAG_VALUES: readonly ItemConfigTag[] =
55
- getEnumValues(ItemConfigTag);
48
+ export const ITEM_CONFIG_TAG_VALUES = getEnumValues(ItemConfigTag);
56
49
 
57
- export const ITEM_CONFIG_CARD_TYPE_VALUES: readonly ItemConfigCardType[] =
58
- getEnumValues(ItemConfigCardType);
50
+ export const ITEM_CONFIG_CARD_TYPE_VALUES = getEnumValues(ItemConfigCardType);
59
51
 
60
- export const ITEM_POOL_TYPE_VALUES: readonly ItemPoolType[] =
61
- getEnumValues(ItemPoolType);
52
+ export const ITEM_POOL_TYPE_VALUES = getEnumValues(ItemPoolType);
62
53
 
63
- export const KEYBOARD_VALUES: readonly Keyboard[] = getEnumValues(Keyboard);
54
+ export const KEYBOARD_VALUES = getEnumValues(Keyboard);
64
55
 
65
- export const HEALTH_TYPE_VALUES: readonly HealthType[] =
66
- getEnumValues(HealthType);
56
+ export const HEALTH_TYPE_VALUES = getEnumValues(HealthType);
67
57
 
68
- export const PILL_COLOR_VALUES: readonly PillColor[] = getEnumValues(PillColor);
58
+ export const PILL_COLOR_VALUES = getEnumValues(PillColor);
69
59
 
70
- export const PLAYER_FORM_VALUES: readonly PlayerForm[] =
71
- getEnumValues(PlayerForm);
60
+ export const PLAYER_FORM_VALUES = getEnumValues(PlayerForm);
72
61
 
73
- export const POCKET_ITEM_SLOT_VALUES: readonly PocketItemSlot[] =
74
- getEnumValues(PocketItemSlot);
62
+ export const POCKET_ITEM_SLOT_VALUES = getEnumValues(PocketItemSlot);
75
63
 
76
- export const ROOM_SHAPE_VALUES: readonly RoomShape[] = getEnumValues(RoomShape);
64
+ export const ROOM_SHAPE_VALUES = getEnumValues(RoomShape);
77
65
 
78
- export const SEED_EFFECTS: readonly SeedEffect[] = getEnumValues(SeedEffect);
66
+ export const SEED_EFFECTS = getEnumValues(SeedEffect);
79
67
 
80
- export const SERIALIZATION_BRAND_VALUES: readonly SerializationBrand[] =
81
- getEnumValues(SerializationBrand);
68
+ export const SERIALIZATION_BRAND_VALUES = getEnumValues(SerializationBrand);
82
69
 
83
- export const SOUND_EFFECT_VALUES: readonly SoundEffect[] =
84
- getEnumValues(SoundEffect);
70
+ export const SOUND_EFFECT_VALUES = getEnumValues(SoundEffect);
85
71
 
86
- export const PLAYER_STAT_VALUES: readonly PlayerStat[] =
87
- getEnumValues(PlayerStat);
72
+ export const PLAYER_STAT_VALUES = getEnumValues(PlayerStat);
88
73
 
89
- export const TRINKET_SLOT_VALUES: readonly TrinketSlot[] =
90
- getEnumValues(TrinketSlot);
74
+ export const TRINKET_SLOT_VALUES = getEnumValues(TrinketSlot);
@@ -244,7 +244,7 @@ export class CustomStages extends Feature {
244
244
  }
245
245
 
246
246
  if (!this.usingRedKey) {
247
- return;
247
+ return undefined;
248
248
  }
249
249
  this.usingRedKey = false;
250
250
 
@@ -277,7 +277,7 @@ export class CustomStages extends Feature {
277
277
  ): Record<string, unknown> | undefined => {
278
278
  const customStage = v.run.currentCustomStage;
279
279
  if (customStage === null) {
280
- return;
280
+ return undefined;
281
281
  }
282
282
 
283
283
  streakTextGetShaderParams(customStage, shaderName);
@@ -108,11 +108,11 @@ export class Pause extends Feature {
108
108
  buttonAction: ButtonAction,
109
109
  ): boolean | float | undefined => {
110
110
  if (buttonAction !== ButtonAction.SHOOT_RIGHT) {
111
- return;
111
+ return undefined;
112
112
  }
113
113
 
114
114
  if (!v.run.shouldUnpause) {
115
- return;
115
+ return undefined;
116
116
  }
117
117
  v.run.shouldUnpause = false;
118
118
 
@@ -76,7 +76,7 @@ export class PreventGridEntityRespawn extends Feature {
76
76
 
77
77
  const roomListIndex = getRoomListIndex();
78
78
  if (!v.level.roomListIndexToDecorationGridIndexes.has(roomListIndex)) {
79
- return;
79
+ return undefined;
80
80
  }
81
81
 
82
82
  // Since the room was filled with decorations to prevent any grid entities from respawning, if
@@ -1,4 +1,4 @@
1
- import type { LevelStage, StageType } from "isaac-typescript-definitions";
1
+ import type { LevelStage, StageID } from "isaac-typescript-definitions";
2
2
  import {
3
3
  BossID,
4
4
  EntityType,
@@ -13,8 +13,9 @@ import { BOSS_NAMES, DEFAULT_BOSS_NAME } from "../objects/bossNames";
13
13
  import {
14
14
  ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET,
15
15
  ALL_BOSSES_SET,
16
+ BOSS_ID_TO_STAGE_IDS,
17
+ STAGE_ID_TO_BOSS_SET_MAP,
16
18
  STAGE_TO_COMBINED_BOSS_SET_MAP,
17
- STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP,
18
19
  } from "../sets/bossSets";
19
20
  import { REPENTANCE_ONLY_BOSS_IDS_SET } from "../sets/repentanceBossIDsSet";
20
21
  import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
@@ -147,16 +148,13 @@ export function getBossName(bossID: BossID): string {
147
148
  *
148
149
  * Also see the `getAllBossesSet` and `getCombinedBossSet` functions.
149
150
  */
150
- export function getBossSet(
151
- stage: LevelStage,
152
- stageType: StageType,
153
- ): ReadonlySet<BossID> | undefined {
154
- const stageTypeMap = STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP.get(stage);
155
- if (stageTypeMap === undefined) {
156
- return undefined;
157
- }
151
+ export function getBossSet(stageID: StageID): ReadonlySet<BossID> | undefined {
152
+ return STAGE_ID_TO_BOSS_SET_MAP.get(stageID);
153
+ }
158
154
 
159
- return stageTypeMap.get(stageType);
155
+ /** Helper function to get the set of stage IDs that a particular boss naturally appears in. */
156
+ export function getBossStageIDs(bossID: BossID): ReadonlySet<StageID> {
157
+ return BOSS_ID_TO_STAGE_IDS[bossID];
160
158
  }
161
159
 
162
160
  /**
@@ -1226,7 +1226,7 @@ export function spawnGridEntityWithVariant(
1226
1226
  if (removeExistingGridEntity) {
1227
1227
  removeGridEntity(existingGridEntity, true);
1228
1228
  } else {
1229
- return;
1229
+ return undefined;
1230
1230
  }
1231
1231
  }
1232
1232