isaacscript-common 4.2.8 → 4.3.2

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.
Files changed (51) hide show
  1. package/enums/StageTravelEntityState.d.ts +4 -0
  2. package/enums/StageTravelEntityState.lua +7 -0
  3. package/enums/StageTravelState.d.ts +6 -0
  4. package/enums/StageTravelState.lua +11 -0
  5. package/features/{getCollectibleItemPoolType.d.ts → collectibleItemPoolType.d.ts} +0 -0
  6. package/features/{getCollectibleItemPoolType.lua → collectibleItemPoolType.lua} +2 -2
  7. package/features/customTrapdoor/constants.d.ts +5 -0
  8. package/features/customTrapdoor/constants.lua +7 -0
  9. package/features/customTrapdoor/exports.d.ts +37 -0
  10. package/features/customTrapdoor/exports.lua +120 -0
  11. package/features/customTrapdoor/init.d.ts +1 -0
  12. package/features/customTrapdoor/init.lua +11 -0
  13. package/features/{stageTravel → customTrapdoor}/stageTravel.d.ts +0 -0
  14. package/features/{stageTravel → customTrapdoor}/stageTravel.lua +0 -0
  15. package/features/{stageTravel → customTrapdoor}/trapdoor.d.ts +0 -0
  16. package/features/{stageTravel → customTrapdoor}/trapdoor.lua +0 -0
  17. package/features/customTrapdoor/v.d.ts +14 -0
  18. package/features/customTrapdoor/v.lua +16 -0
  19. package/features/extraConsoleCommands/commandsSubroutines.d.ts +1 -1
  20. package/features/extraConsoleCommands/commandsSubroutines.lua +1 -1
  21. package/features/extraConsoleCommands/init.lua +1 -1
  22. package/features/extraConsoleCommands/listCommands.d.ts +3 -3
  23. package/features/extraConsoleCommands/listCommands.lua +6 -6
  24. package/features/ponyDetection.d.ts +6 -1
  25. package/features/ponyDetection.lua +14 -1
  26. package/features/roomClearFrame.d.ts +11 -0
  27. package/features/roomClearFrame.lua +38 -0
  28. package/features/stageHistory.d.ts +15 -0
  29. package/features/stageHistory.lua +62 -0
  30. package/functions/gridEntity.d.ts +5 -0
  31. package/functions/gridEntity.lua +9 -0
  32. package/functions/gridEntitySpecific.d.ts +11 -6
  33. package/functions/gridEntitySpecific.lua +18 -0
  34. package/functions/log.lua +7 -1
  35. package/functions/nextStage.d.ts +18 -0
  36. package/functions/nextStage.lua +245 -0
  37. package/functions/rooms.d.ts +2 -2
  38. package/functions/rooms.lua +2 -2
  39. package/functions/stage.d.ts +10 -0
  40. package/functions/stage.lua +28 -0
  41. package/index.d.ts +9 -5
  42. package/index.lua +58 -20
  43. package/initFeatures.lua +12 -3
  44. package/interfaces/StageTravelEntityDescription.d.ts +5 -0
  45. package/interfaces/StageTravelEntityDescription.lua +2 -0
  46. package/objects/roomTypeNames.lua +1 -1
  47. package/package.json +2 -2
  48. package/enums/StageTravelEntityType.d.ts +0 -5
  49. package/enums/StageTravelEntityType.lua +0 -9
  50. package/features/stageTravel/exports.d.ts +0 -23
  51. package/features/stageTravel/exports.lua +0 -44
@@ -2,11 +2,21 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
3
3
  local ____exports = {}
4
4
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
5
6
  local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
6
7
  local ____cachedClasses = require("cachedClasses")
7
8
  local game = ____cachedClasses.game
8
9
  local ____gridEntity = require("functions.gridEntity")
9
10
  local getGridEntities = ____gridEntity.getGridEntities
11
+ local getMatchingGridEntities = ____gridEntity.getMatchingGridEntities
12
+ --- Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` in the room.
13
+ -- Specify a specific trapdoor variant to select only trapdoors of that variant.
14
+ function ____exports.getCrawlSpaces(self, crawlSpaceVariant)
15
+ if crawlSpaceVariant == nil then
16
+ return getGridEntities(nil, GridEntityType.CRAWL_SPACE)
17
+ end
18
+ return getMatchingGridEntities(nil, GridEntityType.CRAWL_SPACE, crawlSpaceVariant)
19
+ end
10
20
  --- Helper function to get all of the `GridEntityPit` in the room.
11
21
  function ____exports.getPits(self)
12
22
  local gridEntities = getGridEntities(nil)
@@ -79,6 +89,14 @@ function ____exports.getTNT(self)
79
89
  end
80
90
  return tntArray
81
91
  end
92
+ --- Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` in the room.
93
+ -- Specify a specific trapdoor variant to select only trapdoors of that variant.
94
+ function ____exports.getTrapdoors(self, trapdoorVariant)
95
+ if trapdoorVariant == nil then
96
+ return getGridEntities(nil, GridEntityType.TRAPDOOR)
97
+ end
98
+ return getMatchingGridEntities(nil, GridEntityType.TRAPDOOR, trapdoorVariant)
99
+ end
82
100
  --- Helper function to determine if all of the pressure plates in the current room are pushed.
83
101
  -- Returns true if there are no pressure plates in the room.
84
102
  function ____exports.isAllPressurePlatesPushed(self)
package/functions/log.lua CHANGED
@@ -14,6 +14,7 @@ local EffectVariant = ____isaac_2Dtypescript_2Ddefinitions.EffectVariant
14
14
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
15
15
  local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
16
16
  local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
17
+ local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
17
18
  local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
18
19
  local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
19
20
  local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
@@ -412,7 +413,12 @@ function ____exports.logRoom()
412
413
  ____exports.log((((("Current room type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
413
414
  ____exports.log("Current room name: " .. roomData.Name)
414
415
  end
415
- ____exports.log("Current room grid index: " .. tostring(roomGridIndex))
416
+ local roomGridIndexName = GridRoom[roomGridIndex]
417
+ if roomGridIndexName == nil then
418
+ ____exports.log("Current room grid index: " .. tostring(roomGridIndex))
419
+ else
420
+ ____exports.log(((("Current room grid index: " .. tostring(roomGridIndex)) .. " (GridRoom.") .. roomGridIndexName) .. ")")
421
+ end
416
422
  ____exports.log("Current room list index: " .. tostring(roomListIndex))
417
423
  end
418
424
  --- Helper function for printing out every seed effect (i.e. Easter Egg) that is turned on for the
@@ -0,0 +1,18 @@
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function to get the stage that a trapdoor or heaven door would take the player to, based
4
+ * on the current stage, room, and game state flags.
5
+ *
6
+ * Note that in non-upgraded mods, this function will not account for the player having visited
7
+ * Repentance floors in The Ascent. (Handling this requires stateful tracking as the player
8
+ * progresses through the run.)
9
+ */
10
+ export declare function getNextStage(): LevelStage;
11
+ /**
12
+ * Helper function to get the stage type that a trapdoor or heaven door would take the player to,
13
+ * based on the current stage, room, and game state flags.
14
+ *
15
+ * @param upwards Whether or not the player should go up to Cathedral in the case of being on Womb
16
+ * 2. Defaults to false.
17
+ */
18
+ export declare function getNextStageType(upwards?: boolean): StageType;
@@ -0,0 +1,245 @@
1
+ local ____exports = {}
2
+ local getNextStageBackwardsPath, getStageTypeBackwardsPath
3
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
4
+ local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
5
+ local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
6
+ local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
7
+ local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
8
+ local ____cachedClasses = require("cachedClasses")
9
+ local game = ____cachedClasses.game
10
+ local ____stageHistory = require("features.stageHistory")
11
+ local hasVisitedStage = ____stageHistory.hasVisitedStage
12
+ local ____featuresInitialized = require("featuresInitialized")
13
+ local areFeaturesInitialized = ____featuresInitialized.areFeaturesInitialized
14
+ local ____roomData = require("functions.roomData")
15
+ local getRoomGridIndex = ____roomData.getRoomGridIndex
16
+ local ____stage = require("functions.stage")
17
+ local calculateStageType = ____stage.calculateStageType
18
+ local calculateStageTypeRepentance = ____stage.calculateStageTypeRepentance
19
+ local onRepentanceStage = ____stage.onRepentanceStage
20
+ function getNextStageBackwardsPath(self, stage, repentanceStage)
21
+ if not areFeaturesInitialized(nil) then
22
+ return stage - 1
23
+ end
24
+ local visitedDownpour1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE)
25
+ local visitedDross1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE_B)
26
+ local visitedDownpour2 = hasVisitedStage(nil, LevelStage.BASEMENT_2, StageType.REPENTANCE)
27
+ local visitedDross2 = hasVisitedStage(nil, LevelStage.BASEMENT_2, StageType.REPENTANCE_B)
28
+ local visitedMines1 = hasVisitedStage(nil, LevelStage.CAVES_1, StageType.REPENTANCE)
29
+ local visitedAshpit1 = hasVisitedStage(nil, LevelStage.CAVES_1, StageType.REPENTANCE_B)
30
+ local visitedMines2 = hasVisitedStage(nil, LevelStage.DEPTHS_2, StageType.REPENTANCE)
31
+ local visitedAshpit2 = hasVisitedStage(nil, LevelStage.DEPTHS_2, StageType.REPENTANCE_B)
32
+ if stage == LevelStage.BASEMENT_1 then
33
+ if repentanceStage then
34
+ return LevelStage.BASEMENT_1
35
+ end
36
+ return LevelStage.HOME
37
+ end
38
+ if stage == LevelStage.BASEMENT_2 then
39
+ if repentanceStage then
40
+ if visitedDownpour1 or visitedDross1 then
41
+ return LevelStage.BASEMENT_1
42
+ end
43
+ return LevelStage.BASEMENT_2
44
+ end
45
+ return LevelStage.BASEMENT_1
46
+ end
47
+ if stage == LevelStage.CAVES_1 then
48
+ if repentanceStage then
49
+ if visitedDownpour2 or visitedDross2 then
50
+ return LevelStage.BASEMENT_2
51
+ end
52
+ return LevelStage.CAVES_1
53
+ end
54
+ return LevelStage.BASEMENT_2
55
+ end
56
+ if stage == LevelStage.CAVES_2 then
57
+ if repentanceStage then
58
+ if visitedMines1 or visitedAshpit1 then
59
+ return LevelStage.CAVES_1
60
+ end
61
+ return LevelStage.CAVES_2
62
+ end
63
+ return LevelStage.CAVES_1
64
+ end
65
+ if stage == LevelStage.DEPTHS_1 then
66
+ if repentanceStage then
67
+ if visitedMines2 or visitedAshpit2 then
68
+ return LevelStage.CAVES_2
69
+ end
70
+ return LevelStage.DEPTHS_1
71
+ end
72
+ return LevelStage.CAVES_2
73
+ end
74
+ if stage == LevelStage.DEPTHS_2 then
75
+ if repentanceStage then
76
+ return LevelStage.DEPTHS_2
77
+ end
78
+ return LevelStage.DEPTHS_1
79
+ end
80
+ return stage - 1
81
+ end
82
+ function getStageTypeBackwardsPath(self, stage, nextStage, repentanceStage)
83
+ local visitedDownpour1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE)
84
+ local visitedDross1 = hasVisitedStage(nil, LevelStage.BASEMENT_1, StageType.REPENTANCE_B)
85
+ local visitedDownpour2 = hasVisitedStage(nil, LevelStage.BASEMENT_2, StageType.REPENTANCE)
86
+ local visitedDross2 = hasVisitedStage(nil, LevelStage.BASEMENT_2, StageType.REPENTANCE_B)
87
+ local visitedMines1 = hasVisitedStage(nil, LevelStage.CAVES_1, StageType.REPENTANCE)
88
+ local visitedAshpit1 = hasVisitedStage(nil, LevelStage.CAVES_1, StageType.REPENTANCE_B)
89
+ local visitedMines2 = hasVisitedStage(nil, LevelStage.DEPTHS_2, StageType.REPENTANCE)
90
+ local visitedAshpit2 = hasVisitedStage(nil, LevelStage.DEPTHS_2, StageType.REPENTANCE_B)
91
+ if stage == LevelStage.BASEMENT_2 and repentanceStage then
92
+ if visitedDownpour1 then
93
+ return StageType.REPENTANCE
94
+ end
95
+ if visitedDross1 then
96
+ return StageType.REPENTANCE_B
97
+ end
98
+ end
99
+ if stage == LevelStage.CAVES_1 and repentanceStage then
100
+ if visitedDownpour2 then
101
+ return StageType.REPENTANCE
102
+ end
103
+ if visitedDross2 then
104
+ return StageType.REPENTANCE_B
105
+ end
106
+ end
107
+ if stage == LevelStage.CAVES_2 and not repentanceStage then
108
+ if visitedDownpour2 then
109
+ return StageType.REPENTANCE
110
+ end
111
+ if visitedDross2 then
112
+ return StageType.REPENTANCE_B
113
+ end
114
+ end
115
+ if stage == LevelStage.CAVES_2 and repentanceStage then
116
+ if visitedMines1 then
117
+ return StageType.REPENTANCE
118
+ end
119
+ if visitedAshpit1 then
120
+ return StageType.REPENTANCE_B
121
+ end
122
+ end
123
+ if stage == LevelStage.DEPTHS_2 and not repentanceStage then
124
+ if visitedAshpit2 then
125
+ return StageType.REPENTANCE_B
126
+ end
127
+ if visitedMines2 then
128
+ return StageType.REPENTANCE
129
+ end
130
+ end
131
+ return calculateStageType(nil, nextStage)
132
+ end
133
+ --- Helper function to get the stage that a trapdoor or heaven door would take the player to, based
134
+ -- on the current stage, room, and game state flags.
135
+ --
136
+ -- Note that in non-upgraded mods, this function will not account for the player having visited
137
+ -- Repentance floors in The Ascent. (Handling this requires stateful tracking as the player
138
+ -- progresses through the run.)
139
+ function ____exports.getNextStage(self)
140
+ local level = game:GetLevel()
141
+ local backwardsPath = game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
142
+ local mausoleumHeartKilled = game:GetStateFlag(GameStateFlag.MAUSOLEUM_HEART_KILLED)
143
+ local stage = level:GetStage()
144
+ local repentanceStage = onRepentanceStage(nil)
145
+ local roomGridIndex = getRoomGridIndex(nil)
146
+ if backwardsPath then
147
+ return getNextStageBackwardsPath(nil, stage, repentanceStage)
148
+ end
149
+ repeat
150
+ local ____switch4 = roomGridIndex
151
+ local ____cond4 = ____switch4 == GridRoom.BLUE_WOMB
152
+ if ____cond4 then
153
+ do
154
+ return LevelStage.BLUE_WOMB
155
+ end
156
+ end
157
+ ____cond4 = ____cond4 or ____switch4 == GridRoom.THE_VOID
158
+ if ____cond4 then
159
+ do
160
+ return LevelStage.THE_VOID
161
+ end
162
+ end
163
+ ____cond4 = ____cond4 or ____switch4 == GridRoom.SECRET_EXIT
164
+ if ____cond4 then
165
+ do
166
+ if repentanceStage then
167
+ return stage + 1
168
+ end
169
+ if stage == LevelStage.DEPTHS_2 then
170
+ return LevelStage.DEPTHS_2
171
+ end
172
+ return stage
173
+ end
174
+ end
175
+ until true
176
+ if repentanceStage and stage == LevelStage.BASEMENT_2 then
177
+ return LevelStage.CAVES_2
178
+ end
179
+ if repentanceStage and stage == LevelStage.CAVES_2 then
180
+ return LevelStage.DEPTHS_2
181
+ end
182
+ if repentanceStage and stage == LevelStage.DEPTHS_2 then
183
+ if mausoleumHeartKilled then
184
+ return LevelStage.WOMB_1
185
+ end
186
+ return LevelStage.WOMB_2
187
+ end
188
+ if stage == LevelStage.WOMB_2 then
189
+ return LevelStage.SHEOL_CATHEDRAL
190
+ end
191
+ if stage == LevelStage.DARK_ROOM_CHEST then
192
+ return LevelStage.DARK_ROOM_CHEST
193
+ end
194
+ if stage == LevelStage.THE_VOID then
195
+ return LevelStage.THE_VOID
196
+ end
197
+ return stage + 1
198
+ end
199
+ --- Helper function to get the stage type that a trapdoor or heaven door would take the player to,
200
+ -- based on the current stage, room, and game state flags.
201
+ --
202
+ -- @param upwards Whether or not the player should go up to Cathedral in the case of being on Womb
203
+ -- 2. Defaults to false.
204
+ function ____exports.getNextStageType(self, upwards)
205
+ if upwards == nil then
206
+ upwards = false
207
+ end
208
+ local backwardsPath = game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
209
+ local mausoleumHeartKilled = game:GetStateFlag(GameStateFlag.MAUSOLEUM_HEART_KILLED)
210
+ local level = game:GetLevel()
211
+ local stage = level:GetStage()
212
+ local stageType = level:GetStageType()
213
+ local repentanceStage = onRepentanceStage(nil)
214
+ local roomGridIndex = getRoomGridIndex(nil)
215
+ local nextStage = ____exports.getNextStage(nil)
216
+ if backwardsPath then
217
+ return getStageTypeBackwardsPath(nil, stage, nextStage, repentanceStage)
218
+ end
219
+ if roomGridIndex == GridRoom.SECRET_EXIT then
220
+ return calculateStageTypeRepentance(nil, nextStage)
221
+ end
222
+ if repentanceStage and (stage == LevelStage.BASEMENT_1 or stage == LevelStage.CAVES_1 or stage == LevelStage.DEPTHS_1 or stage == LevelStage.WOMB_1) then
223
+ return calculateStageTypeRepentance(nil, nextStage)
224
+ end
225
+ if repentanceStage and stage == LevelStage.DEPTHS_2 and mausoleumHeartKilled then
226
+ return calculateStageTypeRepentance(nil, nextStage)
227
+ end
228
+ if nextStage == LevelStage.BLUE_WOMB then
229
+ return StageType.ORIGINAL
230
+ end
231
+ if nextStage == LevelStage.SHEOL_CATHEDRAL then
232
+ if upwards then
233
+ return StageType.WRATH_OF_THE_LAMB
234
+ end
235
+ return StageType.ORIGINAL
236
+ end
237
+ if nextStage == LevelStage.DARK_ROOM_CHEST then
238
+ if stageType == StageType.ORIGINAL then
239
+ return StageType.ORIGINAL
240
+ end
241
+ return StageType.WRATH_OF_THE_LAMB
242
+ end
243
+ return calculateStageType(nil, nextStage)
244
+ end
245
+ return ____exports
@@ -79,11 +79,11 @@ export declare function inBeastRoom(): boolean;
79
79
  */
80
80
  export declare function inBossRoomOf(bossID: BossID): boolean;
81
81
  /**
82
- * Helper function for determining whether the current room is a crawlspace. Use this function over
82
+ * Helper function for determining whether the current room is a crawl space. Use this function over
83
83
  * comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of the
84
84
  * player being in a boss fight that take place in a dungeon.
85
85
  */
86
- export declare function inCrawlspace(): boolean;
86
+ export declare function inCrawlSpace(): boolean;
87
87
  /**
88
88
  * We cannot use the standard code in the `inDimension` function for this purpose since it is bugged
89
89
  * with the Death Certificate area.
@@ -253,10 +253,10 @@ function ____exports.inBossRoomOf(self, bossID)
253
253
  local roomSubType = getRoomSubType(nil)
254
254
  return roomType == RoomType.BOSS and roomStageID == StageID.SPECIAL_ROOMS and roomSubType == bossID
255
255
  end
256
- --- Helper function for determining whether the current room is a crawlspace. Use this function over
256
+ --- Helper function for determining whether the current room is a crawl space. Use this function over
257
257
  -- comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of the
258
258
  -- player being in a boss fight that take place in a dungeon.
259
- function ____exports.inCrawlspace(self)
259
+ function ____exports.inCrawlSpace(self)
260
260
  local room = game:GetRoom()
261
261
  local roomType = room:GetType()
262
262
  local roomSubType = getRoomSubType(nil)
@@ -1,4 +1,14 @@
1
1
  import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function that calculates what the stage type should be for the provided stage. This
4
+ * emulates what the game's internal code does.
5
+ */
6
+ export declare function calculateStageType(stage: LevelStage): StageType;
7
+ /**
8
+ * Helper function that calculates what the Repentance stage type should be for the provided stage.
9
+ * This emulates what the game's internal code does.
10
+ */
11
+ export declare function calculateStageTypeRepentance(stage: LevelStage): StageType;
2
12
  /**
3
13
  * Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
4
14
  * the third level of the run, but the game considers it to have a stage of 2. This function will
@@ -21,6 +21,34 @@ end
21
21
  function ____exports.stageTypeToLetter(self, stageType)
22
22
  return STAGE_TYPE_TO_LETTER[stageType]
23
23
  end
24
+ --- Helper function that calculates what the stage type should be for the provided stage. This
25
+ -- emulates what the game's internal code does.
26
+ function ____exports.calculateStageType(self, stage)
27
+ local seeds = game:GetSeeds()
28
+ local stageSeed = seeds:GetStageSeed(stage)
29
+ if stageSeed % 2 == 0 then
30
+ return StageType.WRATH_OF_THE_LAMB
31
+ end
32
+ if stageSeed % 3 == 0 then
33
+ return StageType.AFTERBIRTH
34
+ end
35
+ return StageType.ORIGINAL
36
+ end
37
+ --- Helper function that calculates what the Repentance stage type should be for the provided stage.
38
+ -- This emulates what the game's internal code does.
39
+ function ____exports.calculateStageTypeRepentance(self, stage)
40
+ if stage == LevelStage.WOMB_1 or stage == LevelStage.WOMB_2 then
41
+ return StageType.REPENTANCE
42
+ end
43
+ local seeds = game:GetSeeds()
44
+ local adjustedStage = stage + 1
45
+ local stageSeed = seeds:GetStageSeed(adjustedStage)
46
+ local halfStageSeed = math.floor(stageSeed / 2)
47
+ if halfStageSeed % 2 == 0 then
48
+ return StageType.REPENTANCE_B
49
+ end
50
+ return StageType.REPENTANCE
51
+ end
24
52
  --- Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
25
53
  -- the third level of the run, but the game considers it to have a stage of 2. This function will
26
54
  -- consider Downpour 2 to have a stage of 3.
package/index.d.ts CHANGED
@@ -11,6 +11,8 @@ export * from "./enums/PocketItemType";
11
11
  export * from "./enums/SerializationType";
12
12
  export { ConversionHeartSubType, registerCharacterHealthConversion, } from "./features/characterHealthConversion";
13
13
  export { registerCharacterStats } from "./features/characterStats";
14
+ export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
15
+ export * from "./features/customTrapdoor/exports";
14
16
  export * from "./features/debugDisplay/exports";
15
17
  export { deployJSONRoom, deployRandomJSONRoom, emptyRoom, } from "./features/deployJSONRoom";
16
18
  export { disableAllInputs, disableAllInputsExceptFor, disableMovementInputs, disableShootingInputs, enableAllInputs, enableAllInputsExceptFor, } from "./features/disableInputs";
@@ -19,14 +21,15 @@ export { addConsoleCommand, enableExtraConsoleCommands, removeConsoleCommand, }
19
21
  export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
20
22
  export { disableFastReset, enableFastReset } from "./features/fastReset";
21
23
  export { forgottenSwitch } from "./features/forgottenSwitch";
22
- export { getCollectibleItemPoolType } from "./features/getCollectibleItemPoolType";
23
24
  export { removePersistentEntity, spawnPersistentEntity, } from "./features/persistentEntities";
24
25
  export { getPlayerInventory } from "./features/playerInventory";
25
- export * from "./features/ponyDetection";
26
+ export { anyPlayerUsingPony, isPlayerUsingPony as isPonyActive, } from "./features/ponyDetection";
26
27
  export { preventCollectibleRotation } from "./features/preventCollectibleRotation";
28
+ export { getRoomClearGameFrame, getRoomClearRoomFrame, } from "./features/roomClearFrame";
27
29
  export { runInNGameFrames, runInNRenderFrames, runNextGameFrame, runNextRenderFrame, } from "./features/runInNFrames";
28
30
  export * from "./features/saveDataManager/exports";
29
31
  export { hasSirenStolenFamiliar, setFamiliarNoSirenSteal, } from "./features/sirenHelpers";
32
+ export { getStageHistory, hasVisitedStage } from "./features/stageHistory";
30
33
  export { getTaintedLazarusSubPlayer } from "./features/taintedLazarusPlayers";
31
34
  export * from "./functions/ambush";
32
35
  export * from "./functions/array";
@@ -46,8 +49,8 @@ export * from "./functions/collectibleSet";
46
49
  export * from "./functions/collectibleTag";
47
50
  export * from "./functions/color";
48
51
  export * from "./functions/debug";
49
- export { deepCopy } from "./functions/deepCopy";
50
- export { deepCopyTests } from "./functions/deepCopyTests";
52
+ export * from "./functions/deepCopy";
53
+ export * from "./functions/deepCopyTests";
51
54
  export * from "./functions/direction";
52
55
  export * from "./functions/doors";
53
56
  export * from "./functions/easing";
@@ -73,7 +76,8 @@ export * from "./functions/level";
73
76
  export * from "./functions/log";
74
77
  export * from "./functions/map";
75
78
  export * from "./functions/math";
76
- export { mergeTests } from "./functions/mergeTests";
79
+ export * from "./functions/mergeTests";
80
+ export * from "./functions/nextStage";
77
81
  export * from "./functions/npc";
78
82
  export * from "./functions/pickups";
79
83
  export * from "./functions/pickupVariants";
package/index.lua CHANGED
@@ -95,6 +95,19 @@ do
95
95
  local registerCharacterStats = ____characterStats.registerCharacterStats
96
96
  ____exports.registerCharacterStats = registerCharacterStats
97
97
  end
98
+ do
99
+ local ____collectibleItemPoolType = require("features.collectibleItemPoolType")
100
+ local getCollectibleItemPoolType = ____collectibleItemPoolType.getCollectibleItemPoolType
101
+ ____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
102
+ end
103
+ do
104
+ local ____export = require("features.customTrapdoor.exports")
105
+ for ____exportKey, ____exportValue in pairs(____export) do
106
+ if ____exportKey ~= "default" then
107
+ ____exports[____exportKey] = ____exportValue
108
+ end
109
+ end
110
+ end
98
111
  do
99
112
  local ____export = require("features.debugDisplay.exports")
100
113
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -162,11 +175,6 @@ do
162
175
  local forgottenSwitch = ____forgottenSwitch.forgottenSwitch
163
176
  ____exports.forgottenSwitch = forgottenSwitch
164
177
  end
165
- do
166
- local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
167
- local getCollectibleItemPoolType = ____getCollectibleItemPoolType.getCollectibleItemPoolType
168
- ____exports.getCollectibleItemPoolType = getCollectibleItemPoolType
169
- end
170
178
  do
171
179
  local ____persistentEntities = require("features.persistentEntities")
172
180
  local removePersistentEntity = ____persistentEntities.removePersistentEntity
@@ -180,18 +188,24 @@ do
180
188
  ____exports.getPlayerInventory = getPlayerInventory
181
189
  end
182
190
  do
183
- local ____export = require("features.ponyDetection")
184
- for ____exportKey, ____exportValue in pairs(____export) do
185
- if ____exportKey ~= "default" then
186
- ____exports[____exportKey] = ____exportValue
187
- end
188
- end
191
+ local ____ponyDetection = require("features.ponyDetection")
192
+ local anyPlayerUsingPony = ____ponyDetection.anyPlayerUsingPony
193
+ local isPonyActive = ____ponyDetection.isPlayerUsingPony
194
+ ____exports.anyPlayerUsingPony = anyPlayerUsingPony
195
+ ____exports.isPonyActive = isPonyActive
189
196
  end
190
197
  do
191
198
  local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
192
199
  local preventCollectibleRotation = ____preventCollectibleRotation.preventCollectibleRotation
193
200
  ____exports.preventCollectibleRotation = preventCollectibleRotation
194
201
  end
202
+ do
203
+ local ____roomClearFrame = require("features.roomClearFrame")
204
+ local getRoomClearGameFrame = ____roomClearFrame.getRoomClearGameFrame
205
+ local getRoomClearRoomFrame = ____roomClearFrame.getRoomClearRoomFrame
206
+ ____exports.getRoomClearGameFrame = getRoomClearGameFrame
207
+ ____exports.getRoomClearRoomFrame = getRoomClearRoomFrame
208
+ end
195
209
  do
196
210
  local ____runInNFrames = require("features.runInNFrames")
197
211
  local runInNGameFrames = ____runInNFrames.runInNGameFrames
@@ -218,6 +232,13 @@ do
218
232
  ____exports.hasSirenStolenFamiliar = hasSirenStolenFamiliar
219
233
  ____exports.setFamiliarNoSirenSteal = setFamiliarNoSirenSteal
220
234
  end
235
+ do
236
+ local ____stageHistory = require("features.stageHistory")
237
+ local getStageHistory = ____stageHistory.getStageHistory
238
+ local hasVisitedStage = ____stageHistory.hasVisitedStage
239
+ ____exports.getStageHistory = getStageHistory
240
+ ____exports.hasVisitedStage = hasVisitedStage
241
+ end
221
242
  do
222
243
  local ____taintedLazarusPlayers = require("features.taintedLazarusPlayers")
223
244
  local getTaintedLazarusSubPlayer = ____taintedLazarusPlayers.getTaintedLazarusSubPlayer
@@ -368,14 +389,20 @@ do
368
389
  end
369
390
  end
370
391
  do
371
- local ____deepCopy = require("functions.deepCopy")
372
- local deepCopy = ____deepCopy.deepCopy
373
- ____exports.deepCopy = deepCopy
392
+ local ____export = require("functions.deepCopy")
393
+ for ____exportKey, ____exportValue in pairs(____export) do
394
+ if ____exportKey ~= "default" then
395
+ ____exports[____exportKey] = ____exportValue
396
+ end
397
+ end
374
398
  end
375
399
  do
376
- local ____deepCopyTests = require("functions.deepCopyTests")
377
- local deepCopyTests = ____deepCopyTests.deepCopyTests
378
- ____exports.deepCopyTests = deepCopyTests
400
+ local ____export = require("functions.deepCopyTests")
401
+ for ____exportKey, ____exportValue in pairs(____export) do
402
+ if ____exportKey ~= "default" then
403
+ ____exports[____exportKey] = ____exportValue
404
+ end
405
+ end
379
406
  end
380
407
  do
381
408
  local ____export = require("functions.direction")
@@ -578,9 +605,20 @@ do
578
605
  end
579
606
  end
580
607
  do
581
- local ____mergeTests = require("functions.mergeTests")
582
- local mergeTests = ____mergeTests.mergeTests
583
- ____exports.mergeTests = mergeTests
608
+ local ____export = require("functions.mergeTests")
609
+ for ____exportKey, ____exportValue in pairs(____export) do
610
+ if ____exportKey ~= "default" then
611
+ ____exports[____exportKey] = ____exportValue
612
+ end
613
+ end
614
+ end
615
+ do
616
+ local ____export = require("functions.nextStage")
617
+ for ____exportKey, ____exportValue in pairs(____export) do
618
+ if ____exportKey ~= "default" then
619
+ ____exports[____exportKey] = ____exportValue
620
+ end
621
+ end
584
622
  end
585
623
  do
586
624
  local ____export = require("functions.npc")
package/initFeatures.lua CHANGED
@@ -3,6 +3,10 @@ local ____characterHealthConversion = require("features.characterHealthConversio
3
3
  local characterHealthConversionInit = ____characterHealthConversion.characterHealthConversionInit
4
4
  local ____characterStats = require("features.characterStats")
5
5
  local characterStatsInit = ____characterStats.characterStatsInit
6
+ local ____collectibleItemPoolType = require("features.collectibleItemPoolType")
7
+ local collectibleItemPoolTypeInit = ____collectibleItemPoolType.collectibleItemPoolTypeInit
8
+ local ____init = require("features.customTrapdoor.init")
9
+ local stageTravelInit = ____init.stageTravelInit
6
10
  local ____deployJSONRoom = require("features.deployJSONRoom")
7
11
  local deployJSONRoomInit = ____deployJSONRoom.deployJSONRoomInit
8
12
  local ____disableInputs = require("features.disableInputs")
@@ -15,8 +19,6 @@ local ____fastReset = require("features.fastReset")
15
19
  local fastResetInit = ____fastReset.fastResetInit
16
20
  local ____forgottenSwitch = require("features.forgottenSwitch")
17
21
  local forgottenSwitchInit = ____forgottenSwitch.forgottenSwitchInit
18
- local ____getCollectibleItemPoolType = require("features.getCollectibleItemPoolType")
19
- local getCollectibleItemPoolTypeInit = ____getCollectibleItemPoolType.getCollectibleItemPoolTypeInit
20
22
  local ____persistentEntities = require("features.persistentEntities")
21
23
  local persistentEntitiesInit = ____persistentEntities.persistentEntitiesInit
22
24
  local ____playerInventory = require("features.playerInventory")
@@ -25,10 +27,14 @@ local ____ponyDetection = require("features.ponyDetection")
25
27
  local ponyDetectionInit = ____ponyDetection.ponyDetectionInit
26
28
  local ____preventCollectibleRotation = require("features.preventCollectibleRotation")
27
29
  local preventCollectibleRotationInit = ____preventCollectibleRotation.preventCollectibleRotationInit
30
+ local ____roomClearFrame = require("features.roomClearFrame")
31
+ local roomClearFrameInit = ____roomClearFrame.roomClearFrameInit
28
32
  local ____runInNFrames = require("features.runInNFrames")
29
33
  local runInNFramesInit = ____runInNFrames.runInNFramesInit
30
34
  local ____sirenHelpers = require("features.sirenHelpers")
31
35
  local sirenHelpersInit = ____sirenHelpers.sirenHelpersInit
36
+ local ____stageHistory = require("features.stageHistory")
37
+ local stageHistoryInit = ____stageHistory.stageHistoryInit
32
38
  local ____taintedLazarusPlayers = require("features.taintedLazarusPlayers")
33
39
  local taintedLazarusPlayersInit = ____taintedLazarusPlayers.taintedLazarusPlayersInit
34
40
  function ____exports.initFeaturesMajor(self, mod)
@@ -43,12 +49,15 @@ function ____exports.initFeaturesMinor(self, mod)
43
49
  fadeInRemoverInit(nil, mod)
44
50
  fastResetInit(nil, mod)
45
51
  forgottenSwitchInit(nil, mod)
46
- getCollectibleItemPoolTypeInit(nil, mod)
52
+ collectibleItemPoolTypeInit(nil, mod)
47
53
  persistentEntitiesInit(nil, mod)
48
54
  playerInventoryInit(nil, mod)
49
55
  ponyDetectionInit(nil, mod)
50
56
  preventCollectibleRotationInit(nil, mod)
57
+ roomClearFrameInit(nil, mod)
51
58
  sirenHelpersInit(nil, mod)
59
+ stageHistoryInit(nil, mod)
60
+ stageTravelInit(nil)
52
61
  taintedLazarusPlayersInit(nil, mod)
53
62
  end
54
63
  return ____exports
@@ -0,0 +1,5 @@
1
+ import { StageTravelEntityState } from "../enums/StageTravelEntityState";
2
+ export interface StageTravelEntityDescription {
3
+ initial: boolean;
4
+ state: StageTravelEntityState;
5
+ }
@@ -0,0 +1,2 @@
1
+ local ____exports = {}
2
+ return ____exports
@@ -19,7 +19,7 @@ ____exports.ROOM_TYPE_NAMES = {
19
19
  [RoomType.SACRIFICE] = "Sacrifice Room",
20
20
  [RoomType.DEVIL] = "Devil Room",
21
21
  [RoomType.ANGEL] = "Angel Room",
22
- [RoomType.DUNGEON] = "Crawlspace",
22
+ [RoomType.DUNGEON] = "Crawl Space",
23
23
  [RoomType.BOSS_RUSH] = "Boss Rush",
24
24
  [RoomType.CLEAN_BEDROOM] = "Clean Bedroom",
25
25
  [RoomType.DIRTY_BEDROOM] = "Dirty Bedroom",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "4.2.8",
3
+ "version": "4.3.2",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "index",
23
23
  "types": "index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^3.0.12"
25
+ "isaac-typescript-definitions": "^3.0.13"
26
26
  }
27
27
  }