isaacscript-common 6.2.0 → 6.4.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.
Files changed (96) hide show
  1. package/cachedClasses.d.ts +15 -0
  2. package/cachedClasses.lua +20 -0
  3. package/callbacks/reorderedCallbacks.d.ts +9 -0
  4. package/callbacks/reorderedCallbacks.lua +9 -0
  5. package/constants.d.ts +26 -4
  6. package/constants.lua +20 -4
  7. package/enums/CornerType.d.ts +6 -0
  8. package/enums/CornerType.lua +11 -0
  9. package/features/customStage/backdrop.d.ts +2 -0
  10. package/features/customStage/backdrop.lua +202 -0
  11. package/features/customStage/customStageConstants.d.ts +1 -0
  12. package/features/customStage/customStageConstants.lua +3 -0
  13. package/features/customStage/exports.d.ts +28 -0
  14. package/features/customStage/exports.lua +58 -1
  15. package/features/customStage/init.d.ts +2 -1
  16. package/features/customStage/init.lua +45 -9
  17. package/features/customStage/streakText.d.ts +2 -0
  18. package/features/customStage/streakText.lua +22 -0
  19. package/features/customStage/v.d.ts +10 -0
  20. package/features/customStage/v.lua +4 -0
  21. package/features/customStage/versusScreen.d.ts +3 -0
  22. package/features/customStage/versusScreen.lua +193 -0
  23. package/features/debugDisplay/debugDisplay.lua +2 -0
  24. package/features/debugDisplay/exports.d.ts +108 -0
  25. package/features/debugDisplay/exports.lua +145 -0
  26. package/features/debugDisplay/v.d.ts +2 -0
  27. package/features/debugDisplay/v.lua +9 -0
  28. package/features/deployJSONRoom.lua +6 -2
  29. package/features/extraConsoleCommands/init.lua +8 -1
  30. package/features/extraConsoleCommands/listCommands.d.ts +12 -4
  31. package/features/extraConsoleCommands/listCommands.lua +30 -15
  32. package/features/extraConsoleCommands/v.d.ts +1 -0
  33. package/features/extraConsoleCommands/v.lua +2 -1
  34. package/features/pause.d.ts +11 -0
  35. package/features/pause.lua +71 -0
  36. package/features/runNextRoom.d.ts +8 -0
  37. package/features/runNextRoom.lua +40 -0
  38. package/features/saveDataManager/exports.lua +2 -2
  39. package/features/saveDataManager/load.lua +3 -3
  40. package/features/saveDataManager/main.lua +3 -3
  41. package/features/saveDataManager/merge.lua +2 -2
  42. package/features/saveDataManager/save.lua +3 -3
  43. package/features/saveDataManager/{constants.d.ts → saveDataManagerConstants.d.ts} +0 -0
  44. package/features/saveDataManager/{constants.lua → saveDataManagerConstants.lua} +0 -0
  45. package/functions/chargeBar.lua +4 -6
  46. package/functions/color.d.ts +0 -2
  47. package/functions/color.lua +0 -4
  48. package/functions/deepCopy.lua +2 -2
  49. package/functions/direction.d.ts +1 -1
  50. package/functions/doors.d.ts +2 -2
  51. package/functions/entity.d.ts +5 -0
  52. package/functions/entity.lua +13 -0
  53. package/functions/gridEntity.d.ts +5 -0
  54. package/functions/gridEntity.lua +7 -2
  55. package/functions/kColor.d.ts +0 -2
  56. package/functions/kColor.lua +0 -4
  57. package/functions/log.lua +2 -1
  58. package/functions/playerCenter.d.ts +5 -1
  59. package/functions/playerCenter.lua +15 -8
  60. package/functions/playerIndex.d.ts +3 -0
  61. package/functions/playerIndex.lua +3 -0
  62. package/functions/roomShape.d.ts +10 -4
  63. package/functions/roomShape.lua +15 -2
  64. package/functions/sprite.d.ts +1 -1
  65. package/functions/sprite.lua +1 -1
  66. package/functions/ui.d.ts +2 -0
  67. package/functions/ui.lua +8 -0
  68. package/functions/utils.d.ts +6 -4
  69. package/functions/utils.lua +6 -4
  70. package/index.d.ts +2 -1
  71. package/index.lua +10 -0
  72. package/initFeatures.lua +7 -1
  73. package/interfaces/Corner.d.ts +6 -0
  74. package/interfaces/Corner.lua +2 -0
  75. package/interfaces/CustomStageLua.d.ts +38 -9
  76. package/objects/bossNamePNGFileNames.d.ts +5 -0
  77. package/objects/bossNamePNGFileNames.lua +108 -0
  78. package/objects/bossPortraitPNGFileNames.d.ts +5 -0
  79. package/objects/bossPortraitPNGFileNames.lua +108 -0
  80. package/objects/colors.d.ts +15 -8
  81. package/objects/colors.lua +9 -2
  82. package/objects/playerNamePNGFileNames.d.ts +5 -0
  83. package/objects/playerNamePNGFileNames.lua +49 -0
  84. package/objects/playerPortraitPNGFileNames.d.ts +5 -0
  85. package/objects/playerPortraitPNGFileNames.lua +49 -0
  86. package/objects/roomShapeCorners.d.ts +6 -0
  87. package/objects/roomShapeCorners.lua +259 -0
  88. package/objects/roomShapeToBottomRightPosition.d.ts +1 -1
  89. package/objects/roomShapeToTopLeftPosition.d.ts +1 -1
  90. package/objects/versusScreenBackgroundColors.d.ts +5 -0
  91. package/objects/versusScreenBackgroundColors.lua +38 -0
  92. package/objects/versusScreenDirtSpotColors.d.ts +5 -0
  93. package/objects/versusScreenDirtSpotColors.lua +38 -0
  94. package/package.json +2 -2
  95. package/sets/narrowRoomShapesSet.d.ts +2 -0
  96. package/sets/narrowRoomShapesSet.lua +8 -0
@@ -4,219 +4,364 @@ local printEnabled = ____utils.printEnabled
4
4
  local ____v = require("features.debugDisplay.v")
5
5
  local v = ____v.default
6
6
  local debugDisplayTextCallbacks = ____v.debugDisplayTextCallbacks
7
+ local errorIfDebugDisplayNotInitialized = ____v.errorIfDebugDisplayNotInitialized
7
8
  --- After using the "playerDisplay" console command, text will be drawn on each player for debugging
8
9
  -- purposes. Use this function to specify a callback function that will returns the string that
9
10
  -- should be drawn.
11
+ --
12
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
13
+ -- mod in order for this console command to work.
10
14
  function ____exports.setPlayerDisplay(self, textCallback)
15
+ errorIfDebugDisplayNotInitialized(nil)
11
16
  debugDisplayTextCallbacks.player = textCallback
12
17
  end
13
18
  --- After using the "tearDisplay" console command, text will be drawn on each tear for debugging
14
19
  -- purposes. Use this function to specify a callback function that will returns the string that
15
20
  -- should be drawn.
21
+ --
22
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
23
+ -- mod in order for this console command to work.
16
24
  function ____exports.setTearDisplay(self, textCallback)
25
+ errorIfDebugDisplayNotInitialized(nil)
17
26
  debugDisplayTextCallbacks.tear = textCallback
18
27
  end
19
28
  --- After using the "familiarDisplay" console command, text will be drawn on each familiar for
20
29
  -- debugging purposes. Use this function to specify a callback function that will returns the string
21
30
  -- that should be drawn.
31
+ --
32
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
33
+ -- mod in order for this console command to work.
22
34
  function ____exports.setFamiliarDisplay(self, textCallback)
35
+ errorIfDebugDisplayNotInitialized(nil)
23
36
  debugDisplayTextCallbacks.familiar = textCallback
24
37
  end
25
38
  --- After using the "bombDisplay" console command, text will be drawn on each bomb for debugging
26
39
  -- purposes. Use this function to specify a callback function that will returns the string that
27
40
  -- should be drawn.
41
+ --
42
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
43
+ -- mod in order for this console command to work.
28
44
  function ____exports.setBombDisplay(self, textCallback)
45
+ errorIfDebugDisplayNotInitialized(nil)
29
46
  debugDisplayTextCallbacks.bomb = textCallback
30
47
  end
31
48
  --- After using the "pickupDisplay" console command, text will be drawn on each pickup for debugging
32
49
  -- purposes. Use this function to specify a callback function that will returns the string that
33
50
  -- should be drawn.
51
+ --
52
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
53
+ -- mod in order for this console command to work.
34
54
  function ____exports.setPickupDisplay(self, textCallback)
55
+ errorIfDebugDisplayNotInitialized(nil)
35
56
  debugDisplayTextCallbacks.pickup = textCallback
36
57
  end
37
58
  --- After using the "slotDisplay" console command, text will be drawn on each slot for debugging
38
59
  -- purposes. Use this function to specify a callback function that will returns the string that
39
60
  -- should be drawn.
61
+ --
62
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
63
+ -- mod in order for this console command to work.
40
64
  function ____exports.setSlotDisplay(self, textCallback)
65
+ errorIfDebugDisplayNotInitialized(nil)
41
66
  debugDisplayTextCallbacks.slot = textCallback
42
67
  end
43
68
  --- After using the "laserDisplay" console command, text will be drawn on each laser for debugging
44
69
  -- purposes. Use this function to specify a callback function that will returns the string that
45
70
  -- should be drawn.
71
+ --
72
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
73
+ -- mod in order for this console command to work.
46
74
  function ____exports.setLaserDisplay(self, textCallback)
75
+ errorIfDebugDisplayNotInitialized(nil)
47
76
  debugDisplayTextCallbacks.laser = textCallback
48
77
  end
49
78
  --- After using the "knifeDisplay" console command, text will be drawn on each knife for debugging
50
79
  -- purposes. Use this function to specify a callback function that will returns the string that
51
80
  -- should be drawn.
81
+ --
82
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
83
+ -- mod in order for this console command to work.
52
84
  function ____exports.setKnifeDisplay(self, textCallback)
85
+ errorIfDebugDisplayNotInitialized(nil)
53
86
  debugDisplayTextCallbacks.knife = textCallback
54
87
  end
55
88
  --- After using the "projectileDisplay" console command, text will be drawn on each projectile for
56
89
  -- debugging purposes. Use this function to specify a callback function that will returns the string
57
90
  -- that should be drawn.
91
+ --
92
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
93
+ -- mod in order for this console command to work.
58
94
  function ____exports.setProjectileDisplay(self, textCallback)
95
+ errorIfDebugDisplayNotInitialized(nil)
59
96
  debugDisplayTextCallbacks.projectile = textCallback
60
97
  end
61
98
  --- After using the "effectDisplay" console command, text will be drawn on each effect for debugging
62
99
  -- purposes. Use this function to specify a callback function that will returns the string that
63
100
  -- should be drawn.
101
+ --
102
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
103
+ -- mod in order for this console command to work.
64
104
  function ____exports.setEffectDisplay(self, textCallback)
105
+ errorIfDebugDisplayNotInitialized(nil)
65
106
  debugDisplayTextCallbacks.effect = textCallback
66
107
  end
67
108
  --- After using the "npcDisplay" console command, text will be drawn on each NPC for debugging
68
109
  -- purposes. Use this function to specify a callback function that will returns the string that
69
110
  -- should be drawn.
111
+ --
112
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
113
+ -- mod in order for this console command to work.
70
114
  function ____exports.setNPCDisplay(self, textCallback)
115
+ errorIfDebugDisplayNotInitialized(nil)
71
116
  debugDisplayTextCallbacks.npc = textCallback
72
117
  end
73
118
  --- After using the "rockDisplay" console command, text will be drawn on each rock for debugging
74
119
  -- purposes. Use this function to specify a callback function that will returns the string that
75
120
  -- should be drawn.
121
+ --
122
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
123
+ -- mod in order for this console command to work.
76
124
  function ____exports.setRockDisplay(self, textCallback)
125
+ errorIfDebugDisplayNotInitialized(nil)
77
126
  debugDisplayTextCallbacks.rock = textCallback
78
127
  end
79
128
  --- After using the "pitDisplay" console command, text will be drawn on each pit for debugging
80
129
  -- purposes. Use this function to specify a callback function that will returns the string that
81
130
  -- should be drawn.
131
+ --
132
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
133
+ -- mod in order for this console command to work.
82
134
  function ____exports.setPitDisplay(self, textCallback)
135
+ errorIfDebugDisplayNotInitialized(nil)
83
136
  debugDisplayTextCallbacks.pit = textCallback
84
137
  end
85
138
  --- After using the "spikesDisplay" console command, text will be drawn on each spikes for debugging
86
139
  -- purposes. Use this function to specify a callback function that will returns the string that
87
140
  -- should be drawn.
141
+ --
142
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
143
+ -- mod in order for this console command to work.
88
144
  function ____exports.setSpikesDisplay(self, textCallback)
145
+ errorIfDebugDisplayNotInitialized(nil)
89
146
  debugDisplayTextCallbacks.spikes = textCallback
90
147
  end
91
148
  --- After using the "tntDisplay" console command, text will be drawn on each TNT for debugging
92
149
  -- purposes. Use this function to specify a callback function that will returns the string that
93
150
  -- should be drawn.
151
+ --
152
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
153
+ -- mod in order for this console command to work.
94
154
  function ____exports.setTNTDisplay(self, textCallback)
155
+ errorIfDebugDisplayNotInitialized(nil)
95
156
  debugDisplayTextCallbacks.tnt = textCallback
96
157
  end
97
158
  --- After using the "poopDisplay" console command, text will be drawn on each poop for debugging
98
159
  -- purposes. Use this function to specify a callback function that will returns the string that
99
160
  -- should be drawn.
161
+ --
162
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
163
+ -- mod in order for this console command to work.
100
164
  function ____exports.setPoopDisplay(self, textCallback)
165
+ errorIfDebugDisplayNotInitialized(nil)
101
166
  debugDisplayTextCallbacks.poop = textCallback
102
167
  end
103
168
  --- After using the "poopDisplay" console command, text will be drawn on each poop for debugging
104
169
  -- purposes. Use this function to specify a callback function that will returns the string that
105
170
  -- should be drawn.
171
+ --
172
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
173
+ -- mod in order for this console command to work.
106
174
  function ____exports.setDoorDisplay(self, textCallback)
175
+ errorIfDebugDisplayNotInitialized(nil)
107
176
  debugDisplayTextCallbacks.door = textCallback
108
177
  end
109
178
  --- After using the "pressurePlateDisplay" console command, text will be drawn on each pressure plate
110
179
  -- for debugging purposes. Use this function to specify a callback function that will returns the
111
180
  -- string that should be drawn.
181
+ --
182
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
183
+ -- mod in order for this console command to work.
112
184
  function ____exports.setPressurePlateDisplay(self, textCallback)
185
+ errorIfDebugDisplayNotInitialized(nil)
113
186
  debugDisplayTextCallbacks.pressurePlate = textCallback
114
187
  end
115
188
  --- Toggles the debug display for players. This is the function that runs when you use the
116
189
  -- "playerDisplay" custom console command.
190
+ --
191
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
192
+ -- mod in order for this feature to work.
117
193
  function ____exports.togglePlayerDisplay(self)
194
+ errorIfDebugDisplayNotInitialized(nil)
118
195
  v.run.player = not v.run.player
119
196
  printEnabled(nil, v.run.player, "player display")
120
197
  end
121
198
  --- Toggles the debug display for tears. This is the function that runs when you use the
122
199
  -- "tearDisplay" custom console command.
200
+ --
201
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
202
+ -- mod in order for this feature to work.
123
203
  function ____exports.toggleTearDisplay(self)
204
+ errorIfDebugDisplayNotInitialized(nil)
124
205
  v.run.tear = not v.run.tear
125
206
  printEnabled(nil, v.run.tear, "tear display")
126
207
  end
127
208
  --- Toggles the debug display for familiars. This is the function that runs when you use the
128
209
  -- "familiarDisplay" custom console command.
210
+ --
211
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
212
+ -- mod in order for this feature to work.
129
213
  function ____exports.toggleFamiliarDisplay(self)
214
+ errorIfDebugDisplayNotInitialized(nil)
130
215
  v.run.familiar = not v.run.familiar
131
216
  printEnabled(nil, v.run.familiar, "familiar display")
132
217
  end
133
218
  --- Toggles the debug display for bombs. This is the function that runs when you use the
134
219
  -- "bombDisplay" custom console command.
220
+ --
221
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
222
+ -- mod in order for this feature to work.
135
223
  function ____exports.toggleBombDisplay(self)
224
+ errorIfDebugDisplayNotInitialized(nil)
136
225
  v.run.bomb = not v.run.bomb
137
226
  printEnabled(nil, v.run.bomb, "bomb display")
138
227
  end
139
228
  --- Toggles the debug display for pickups. This is the function that runs when you use the
140
229
  -- "pickupDisplay" custom console command.
230
+ --
231
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
232
+ -- mod in order for this feature to work.
141
233
  function ____exports.togglePickupDisplay(self)
234
+ errorIfDebugDisplayNotInitialized(nil)
142
235
  v.run.pickup = not v.run.pickup
143
236
  printEnabled(nil, v.run.pickup, "pickup display")
144
237
  end
145
238
  --- Toggles the debug display for slots. This is the function that runs when you use the
146
239
  -- "slotDisplay" custom console command.
240
+ --
241
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
242
+ -- mod in order for this feature to work.
147
243
  function ____exports.toggleSlotDisplay(self)
244
+ errorIfDebugDisplayNotInitialized(nil)
148
245
  v.run.slot = not v.run.slot
149
246
  printEnabled(nil, v.run.slot, "slot display")
150
247
  end
151
248
  --- Toggles the debug display for lasers. This is the function that runs when you use the
152
249
  -- "laserDisplay" custom console command.
250
+ --
251
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
252
+ -- mod in order for this feature to work.
153
253
  function ____exports.toggleLaserDisplay(self)
254
+ errorIfDebugDisplayNotInitialized(nil)
154
255
  v.run.laser = not v.run.laser
155
256
  printEnabled(nil, v.run.laser, "laser display")
156
257
  end
157
258
  --- Toggles the debug display for knives. This is the function that runs when you use the
158
259
  -- "knifeDisplay" custom console command.
260
+ --
261
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
262
+ -- mod in order for this feature to work.
159
263
  function ____exports.toggleKnifeDisplay(self)
264
+ errorIfDebugDisplayNotInitialized(nil)
160
265
  v.run.knife = not v.run.knife
161
266
  printEnabled(nil, v.run.knife, "knife display")
162
267
  end
163
268
  --- Toggles the debug display for projectiles. This is the function that runs when you use the
164
269
  -- "projectileDisplay" custom console command.
270
+ --
271
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
272
+ -- mod in order for this feature to work.
165
273
  function ____exports.toggleProjectileDisplay(self)
274
+ errorIfDebugDisplayNotInitialized(nil)
166
275
  v.run.projectile = not v.run.projectile
167
276
  printEnabled(nil, v.run.projectile, "projectile display")
168
277
  end
169
278
  --- Toggles the debug display for effects. This is the function that runs when you use the
170
279
  -- "effectDisplay" custom console command.
280
+ --
281
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
282
+ -- mod in order for this feature to work.
171
283
  function ____exports.toggleEffectDisplay(self)
284
+ errorIfDebugDisplayNotInitialized(nil)
172
285
  v.run.effect = not v.run.effect
173
286
  printEnabled(nil, v.run.effect, "effect display")
174
287
  end
175
288
  --- Toggles the debug display for NPCs. This is the function that runs when you use the "npcDisplay"
176
289
  -- custom console command.
290
+ --
291
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
292
+ -- mod in order for this feature to work.
177
293
  function ____exports.toggleNPCDisplay(self)
294
+ errorIfDebugDisplayNotInitialized(nil)
178
295
  v.run.npc = not v.run.npc
179
296
  printEnabled(nil, v.run.npc, "NPC display")
180
297
  end
181
298
  --- Toggles the debug display for rocks. This is the function that runs when you use the
182
299
  -- "rockDisplay" custom console command.
300
+ --
301
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
302
+ -- mod in order for this feature to work.
183
303
  function ____exports.toggleRockDisplay(self)
304
+ errorIfDebugDisplayNotInitialized(nil)
184
305
  v.run.rock = not v.run.rock
185
306
  printEnabled(nil, v.run.rock, "rock display")
186
307
  end
187
308
  --- Toggles the debug display for pits. This is the function that runs when you use the "pitDisplay"
188
309
  -- custom console command.
310
+ --
311
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
312
+ -- mod in order for this feature to work.
189
313
  function ____exports.togglePitDisplay(self)
314
+ errorIfDebugDisplayNotInitialized(nil)
190
315
  v.run.pit = not v.run.pit
191
316
  printEnabled(nil, v.run.pit, "pit display")
192
317
  end
193
318
  --- Toggles the debug display for spikes. This is the function that runs when you use the
194
319
  -- "spikesDisplay" custom console command.
320
+ --
321
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
322
+ -- mod in order for this feature to work.
195
323
  function ____exports.toggleSpikesDisplay(self)
324
+ errorIfDebugDisplayNotInitialized(nil)
196
325
  v.run.spikes = not v.run.spikes
197
326
  printEnabled(nil, v.run.spikes, "spikes display")
198
327
  end
199
328
  --- Toggles the debug display for TNT. This is the function that runs when you use the "tntDisplay"
200
329
  -- custom console command.
330
+ --
331
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
332
+ -- mod in order for this feature to work.
201
333
  function ____exports.toggleTNTDisplay(self)
334
+ errorIfDebugDisplayNotInitialized(nil)
202
335
  v.run.tnt = not v.run.tnt
203
336
  printEnabled(nil, v.run.tnt, "TNT display")
204
337
  end
205
338
  --- Toggles the debug display for poop. This is the function that runs when you use the "poopDisplay"
206
339
  -- custom console command.
340
+ --
341
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
342
+ -- mod in order for this feature to work.
207
343
  function ____exports.togglePoopDisplay(self)
344
+ errorIfDebugDisplayNotInitialized(nil)
208
345
  v.run.poop = not v.run.poop
209
346
  printEnabled(nil, v.run.poop, "poop display")
210
347
  end
211
348
  --- Toggles the debug display for doors. This is the function that runs when you use the
212
349
  -- "doorDisplay" custom console command.
350
+ --
351
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
352
+ -- mod in order for this feature to work.
213
353
  function ____exports.toggleDoorDisplay(self)
354
+ errorIfDebugDisplayNotInitialized(nil)
214
355
  v.run.door = not v.run.door
215
356
  printEnabled(nil, v.run.door, "door display")
216
357
  end
217
358
  --- Toggles the debug display for pressure plates. This is the function that runs when you use the
218
359
  -- "pressurePlateDisplay" custom console command.
360
+ --
361
+ -- Note that you have to run the `enableExtraConsoleCommands` function once at the beginning of your
362
+ -- mod in order for this feature to work.
219
363
  function ____exports.togglePressurePlateDisplay(self)
364
+ errorIfDebugDisplayNotInitialized(nil)
220
365
  v.run.pressurePlate = not v.run.pressurePlate
221
366
  printEnabled(nil, v.run.pressurePlate, "pressure plate display")
222
367
  end
@@ -1,3 +1,5 @@
1
+ export declare function setDebugDisplayEnabled(): void;
2
+ export declare function errorIfDebugDisplayNotInitialized(): void;
1
3
  declare const v: {
2
4
  run: {
3
5
  player: boolean;
@@ -10,6 +10,15 @@ end
10
10
  function defaultGridEntityDisplayCallback(self, gridEntity)
11
11
  return getGridEntityID(nil, gridEntity)
12
12
  end
13
+ local debugDisplayEnabled = false
14
+ function ____exports.setDebugDisplayEnabled(self)
15
+ debugDisplayEnabled = true
16
+ end
17
+ function ____exports.errorIfDebugDisplayNotInitialized(self)
18
+ if not debugDisplayEnabled then
19
+ error("The \"debugDisplay\" feature is not initialized. You must run the \"enableExtraConsoleCommands\" function once at the beginning of your mod in order for this feature to work.")
20
+ end
21
+ end
13
22
  local v = {run = {
14
23
  player = false,
15
24
  tear = false,
@@ -28,6 +28,7 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
28
28
  local ____array = require("functions.array")
29
29
  local emptyArray = ____array.emptyArray
30
30
  local ____entity = require("functions.entity")
31
+ local getEntityIDFromConstituents = ____entity.getEntityIDFromConstituents
31
32
  local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
32
33
  local spawn = ____entity.spawn
33
34
  local spawnWithSeed = ____entity.spawnWithSeed
@@ -39,6 +40,7 @@ local ____gridEntity = require("functions.gridEntity")
39
40
  local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
40
41
  local getAllGridIndexes = ____gridEntity.getAllGridIndexes
41
42
  local getGridEntities = ____gridEntity.getGridEntities
43
+ local getGridEntityIDFromConstituents = ____gridEntity.getGridEntityIDFromConstituents
42
44
  local removeAllGridExcept = ____gridEntity.removeAllGridExcept
43
45
  local removeGrid = ____gridEntity.removeGrid
44
46
  local setGridEntityInvisible = ____gridEntity.setGridEntityInvisible
@@ -239,7 +241,8 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
239
241
  end
240
242
  if entityType >= 1000 then
241
243
  if verbose then
242
- log(((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
244
+ local gridEntityID = getGridEntityIDFromConstituents(nil, entityType, variant)
245
+ log(((((("Spawning grid entity " .. gridEntityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
243
246
  end
244
247
  spawnGridEntityForJSONRoom(
245
248
  nil,
@@ -250,7 +253,8 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
250
253
  )
251
254
  else
252
255
  if verbose then
253
- log(((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
256
+ local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
257
+ log(((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
254
258
  end
255
259
  local entity = spawnNormalEntityForJSONRoom(
256
260
  nil,
@@ -1,7 +1,7 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local Map = ____lualib.Map
3
3
  local ____exports = {}
4
- local initMap, initCallbacks, postUpdate, evaluateCacheFireDelay, evaluateCacheSpeed, entityTakeDmgPlayer, postCurseEval, executeCmd, postFireTear
4
+ local initMap, initCallbacks, postUpdate, evaluateCacheFireDelay, evaluateCacheSpeed, evaluateCacheFlying, entityTakeDmgPlayer, postCurseEval, executeCmd, postFireTear
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
7
7
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
@@ -72,6 +72,7 @@ function initMap(self)
72
72
  extraConsoleCommandsFunctionMap:set("eternalHearts", commands.eternalHearts)
73
73
  extraConsoleCommandsFunctionMap:set("familiarDisplay", commandsDisplay.familiarDisplay)
74
74
  extraConsoleCommandsFunctionMap:set("familiarsDisplay", commandsDisplay.familiarsDisplay)
75
+ extraConsoleCommandsFunctionMap:set("flight", commands.flight)
75
76
  extraConsoleCommandsFunctionMap:set("fool", commands.fool)
76
77
  extraConsoleCommandsFunctionMap:set("getPosition", commands.getPosition)
77
78
  extraConsoleCommandsFunctionMap:set("gigaBomb", commands.gigaBomb)
@@ -174,6 +175,7 @@ function initCallbacks(self, mod)
174
175
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
175
176
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheFireDelay, CacheFlag.FIRE_DELAY)
176
177
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheSpeed, CacheFlag.SPEED)
178
+ mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheFlying, CacheFlag.FLYING)
177
179
  mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
178
180
  mod:AddCallback(ModCallback.POST_CURSE_EVAL, postCurseEval)
179
181
  mod:AddCallback(ModCallback.EXECUTE_CMD, executeCmd)
@@ -195,6 +197,11 @@ function evaluateCacheSpeed(self, player)
195
197
  player.MoveSpeed = MAX_SPEED_STAT
196
198
  end
197
199
  end
200
+ function evaluateCacheFlying(self, player)
201
+ if v.run.flight then
202
+ player.CanFly = true
203
+ end
204
+ end
198
205
  function entityTakeDmgPlayer(self)
199
206
  if v.run.spamBloodRights then
200
207
  return false
@@ -65,7 +65,10 @@ export declare function card(params: string): void;
65
65
  export declare function cards(): void;
66
66
  /** Alias for the "chaosCardTears" command. */
67
67
  export declare function cc(): void;
68
- /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
68
+ /**
69
+ * Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
70
+ * "debug 10".
71
+ */
69
72
  export declare function chaosCardTears(): void;
70
73
  /**
71
74
  * Restart as the specified character. Accepts either the character sub-type or the partial name of
@@ -96,7 +99,7 @@ export declare function crawlSpace(): void;
96
99
  export declare function d20(): void;
97
100
  /** Uses the D6. */
98
101
  export declare function d6(): void;
99
- /** Toggles extremely high-damage tears. */
102
+ /** Toggles extremely high-damage tears for the player. */
100
103
  export declare function damage(): void;
101
104
  /** Alias for the "devil" command. */
102
105
  export declare function dd(): void;
@@ -124,6 +127,8 @@ export declare function error(): void;
124
127
  * numbers to remove hearts.)
125
128
  */
126
129
  export declare function eternalHearts(params: string): void;
130
+ /** Toggles flight for the player. */
131
+ export declare function flight(params: string): void;
127
132
  /** Alias for the "startingRoom" command. */
128
133
  export declare function fool(): void;
129
134
  /** Prints the current position of all players. */
@@ -324,13 +329,16 @@ export declare function sounds(): void;
324
329
  export declare function spam(): void;
325
330
  /** Spawns a golden version of the specified trinket type. */
326
331
  export declare function spawnGoldenTrinket(params: string): void;
327
- /** Toggles maximum movement speed and flight. */
332
+ /** Toggles maximum movement speed and flight for the player. */
328
333
  export declare function speed(): void;
329
334
  /** Warps to the starting room of the floor. */
330
335
  export declare function startingRoom(): void;
331
336
  /** Warps to the first Super Secret Room on the floor. */
332
337
  export declare function superSecret(): void;
333
- /** Toggles extremely high tears stat (e.g. fire rate), equivalent of that to soy milk. */
338
+ /**
339
+ * Toggles an extremely high tears stat (e.g. fire rate) for the player, equivalent of that to soy
340
+ * milk.
341
+ */
334
342
  export declare function tears(): void;
335
343
  /** Creates a trapdoor next to the player. */
336
344
  export declare function trapdoorCommand(): void;
@@ -64,7 +64,9 @@ local spawnTrinket = ____pickups.spawnTrinket
64
64
  local ____pills = require("functions.pills")
65
65
  local getPillEffectName = ____pills.getPillEffectName
66
66
  local ____player = require("functions.player")
67
+ local addCollectibleCostume = ____player.addCollectibleCostume
67
68
  local getPlayerName = ____player.getPlayerName
69
+ local removeCollectibleCostume = ____player.removeCollectibleCostume
68
70
  local useActiveItemTemp = ____player.useActiveItemTemp
69
71
  local ____playerIndex = require("functions.playerIndex")
70
72
  local getPlayers = ____playerIndex.getPlayers
@@ -104,7 +106,8 @@ local v = ____v.default
104
106
  function ____exports.blackHearts(self, params)
105
107
  addHeart(nil, params, HealthType.BLACK)
106
108
  end
107
- --- Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10".
109
+ --- Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
110
+ -- "debug 10".
108
111
  function ____exports.chaosCardTears(self)
109
112
  v.run.chaosCardTears = not v.run.chaosCardTears
110
113
  printEnabled(nil, v.run.chaosCardTears, "Chaos Card tears")
@@ -480,7 +483,7 @@ function ____exports.d6(self)
480
483
  local player = Isaac.GetPlayer()
481
484
  useActiveItemTemp(nil, player, CollectibleType.D6)
482
485
  end
483
- --- Toggles extremely high-damage tears.
486
+ --- Toggles extremely high-damage tears for the player.
484
487
  function ____exports.damage(self)
485
488
  v.run.maxDamage = not v.run.maxDamage
486
489
  printEnabled(nil, v.run.maxDamage, "debug damage")
@@ -520,6 +523,25 @@ end
520
523
  function ____exports.error(self)
521
524
  ____exports.iAmError(nil)
522
525
  end
526
+ --- Toggles flight for the player.
527
+ function ____exports.flight(self, params)
528
+ local player = Isaac.GetPlayer()
529
+ v.run.flight = not v.run.flight
530
+ if params == "true" then
531
+ v.run.flight = true
532
+ elseif params == "false" then
533
+ v.run.flight = false
534
+ end
535
+ player:AddCacheFlags(CacheFlag.FLYING)
536
+ player:EvaluateItems()
537
+ local collectibleUsedToShowFlight = CollectibleType.FATE
538
+ if v.run.flight then
539
+ addCollectibleCostume(nil, player, collectibleUsedToShowFlight)
540
+ else
541
+ removeCollectibleCostume(nil, player, collectibleUsedToShowFlight)
542
+ end
543
+ printEnabled(nil, v.run.maxSpeed, "max speed")
544
+ end
523
545
  --- Alias for the "startingRoom" command.
524
546
  function ____exports.fool(self)
525
547
  ____exports.startingRoom(nil)
@@ -1018,29 +1040,22 @@ function ____exports.spawnGoldenTrinket(self, params)
1018
1040
  local centerPos = room:GetCenterPos()
1019
1041
  spawnTrinket(nil, goldenTrinketType, centerPos)
1020
1042
  end
1021
- --- Toggles maximum movement speed and flight.
1043
+ --- Toggles maximum movement speed and flight for the player.
1022
1044
  function ____exports.speed(self)
1023
1045
  local player = Isaac.GetPlayer()
1024
1046
  v.run.maxSpeed = not v.run.maxSpeed
1025
- if v.run.maxSpeed and not player.CanFly then
1026
- local numEternalHearts = player:GetEternalHearts()
1027
- if numEternalHearts == 0 then
1028
- player:AddCollectible(CollectibleType.FATE)
1029
- player:AddEternalHearts(-1)
1030
- else
1031
- player:AddEternalHearts(-1)
1032
- player:AddCollectible(CollectibleType.FATE)
1033
- end
1034
- end
1035
1047
  player:AddCacheFlags(CacheFlag.SPEED)
1036
1048
  player:EvaluateItems()
1037
- printEnabled(nil, v.run.maxSpeed, "max speed")
1049
+ local value = tostring(v.run.maxSpeed)
1050
+ ____exports.flight(nil, value)
1051
+ printEnabled(nil, v.run.maxSpeed, "max speed and flight")
1038
1052
  end
1039
1053
  --- Warps to the first Super Secret Room on the floor.
1040
1054
  function ____exports.superSecret(self)
1041
1055
  warpToRoomType(nil, RoomType.SUPER_SECRET)
1042
1056
  end
1043
- --- Toggles extremely high tears stat (e.g. fire rate), equivalent of that to soy milk.
1057
+ --- Toggles an extremely high tears stat (e.g. fire rate) for the player, equivalent of that to soy
1058
+ -- milk.
1044
1059
  function ____exports.tears(self)
1045
1060
  v.run.maxTears = not v.run.maxTears
1046
1061
  local player = Isaac.GetPlayer()
@@ -8,6 +8,7 @@ declare const v: {
8
8
  maxDamage: boolean;
9
9
  maxSpeed: boolean;
10
10
  maxTears: boolean;
11
+ flight: boolean;
11
12
  };
12
13
  };
13
14
  export default v;
@@ -7,7 +7,8 @@ local v = {persistent = {disableCurses = false}, run = {
7
7
  spamBloodRights = false,
8
8
  maxDamage = false,
9
9
  maxSpeed = false,
10
- maxTears = false
10
+ maxTears = false,
11
+ flight = false
11
12
  }}
12
13
  ____exports.default = v
13
14
  --- The contents of the map are initialized in the "init.ts" file.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Helper function to emulate what happens when the player pauses the game. Use the `unpause`
3
+ * function to return things back to normal.
4
+ *
5
+ * Under the hood, this function:
6
+ * - uses the Pause collectible on every game frame
7
+ * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
8
+ */
9
+ export declare function pause(): void;
10
+ /** Helper function to put things back to normal after the `pause` function was used. */
11
+ export declare function unpause(): void;