isaacscript-common 6.4.0 → 6.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/enums/DecorationVariant.d.ts +9 -0
  2. package/enums/DecorationVariant.lua +7 -0
  3. package/enums/RockAltType.d.ts +7 -0
  4. package/enums/RockAltType.lua +13 -0
  5. package/features/customGridEntity.d.ts +2 -2
  6. package/features/customGridEntity.lua +7 -5
  7. package/features/customStage/backdrop.lua +7 -16
  8. package/features/customStage/gridEntities.d.ts +18 -0
  9. package/features/customStage/gridEntities.lua +215 -0
  10. package/features/customStage/init.lua +43 -1
  11. package/features/customStage/shadows.d.ts +3 -0
  12. package/features/customStage/shadows.lua +59 -0
  13. package/features/customStage/streakText.d.ts +1 -0
  14. package/features/customStage/streakText.lua +7 -0
  15. package/features/customStage/v.d.ts +3 -0
  16. package/features/customStage/v.lua +1 -1
  17. package/features/customStage/versusScreen.lua +18 -10
  18. package/features/extraConsoleCommands/init.lua +2 -0
  19. package/features/extraConsoleCommands/listCommands.d.ts +9 -2
  20. package/features/extraConsoleCommands/listCommands.lua +20 -4
  21. package/functions/doors.d.ts +10 -5
  22. package/functions/doors.lua +20 -17
  23. package/functions/gridEntity.d.ts +34 -0
  24. package/functions/gridEntity.lua +76 -0
  25. package/functions/pickups.d.ts +9 -9
  26. package/functions/run.d.ts +7 -0
  27. package/functions/run.lua +16 -4
  28. package/interfaces/CustomStageLua.d.ts +271 -88
  29. package/objects/backdropTypeToRockAltType.d.ts +6 -0
  30. package/objects/backdropTypeToRockAltType.lua +69 -0
  31. package/package.json +2 -2
  32. package/shaderCrashFix.d.ts +7 -0
  33. package/shaderCrashFix.lua +18 -0
  34. package/upgradeMod.lua +4 -1
@@ -9,119 +9,303 @@
9
9
  *
10
10
  * The `CustomStageLua` interface extends this, adding room metadata.
11
11
  */
12
- export interface CustomStageTSConfig {
12
+ export declare type CustomStageTSConfig = Readonly<{
13
13
  /** The name of the custom stage. Mandatory. */
14
- readonly name: string;
14
+ name: string;
15
15
  /**
16
16
  * Path to the XML file that contains the rooms for the custom stage (created with Basement
17
17
  * Renovator). Mandatory.
18
18
  */
19
- readonly xmlPath: string;
19
+ xmlPath: string;
20
20
  /** An arbitrarily chosen prefix in the range of 101-999. Mandatory. */
21
- readonly roomVariantPrefix: number;
21
+ roomVariantPrefix: number;
22
22
  /**
23
23
  * An integer between 2 and 13, corresponding to the `LevelStage` enum. This is the number of the
24
24
  * stage that will be warped to and used as a basis for the stage by the level generation
25
25
  * algorithm. Mandatory.
26
26
  *
27
- * (It is not possible to use Basement 1 as a base due to conflicts with the `Game.SetStage`
27
+ * (It is not possible to use Basement 1 as a base stage due to conflicts with the `Game.SetStage`
28
28
  * method.)
29
29
  */
30
- readonly baseStage: number;
30
+ baseStage: number;
31
31
  /**
32
32
  * An integer between 0 and 5, corresponding to the `StageType` enum. This is the number of the
33
33
  * stage type that will be warped to and used as a basis for the stage by the level generation
34
34
  * algorithm. Mandatory.
35
35
  */
36
- readonly baseStageType: number;
36
+ baseStageType: number;
37
37
  /**
38
- * An object containing the paths to the backdrop for the stage. (A backdrop is the graphics for
39
- * the walls and floor.) Mandatory.
38
+ * Optional. An object containing the paths to the backdrop graphics for the stage. (A backdrop is
39
+ * the graphics for the walls and floor.) If not specified, the graphics for Basement will be
40
+ * used.
40
41
  */
41
- readonly backdrop: CustomStageBackdrop;
42
+ backdropPNGPaths?: Readonly<{
43
+ /**
44
+ * An array that contains the full paths to the graphic files that are used for the floor in
45
+ * narrow rooms. (The "n" stands for "narrow").
46
+ *
47
+ * You must have at least one path in this array, but you can specify more than one to randomly
48
+ * add extra variety (like the vanilla stages do).
49
+ *
50
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
51
+ */
52
+ nFloors: readonly string[];
53
+ /**
54
+ * An array that contains the full paths to the graphic files that are used for the floor in L
55
+ * rooms.
56
+ *
57
+ * You must have at least one path in this array, but you can specify more than one to randomly
58
+ * add extra variety (like the vanilla stages do).
59
+ *
60
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
61
+ */
62
+ lFloors: readonly string[];
63
+ /**
64
+ * An array that contains the full paths to the graphic files that are used for the walls of the
65
+ * floor.
66
+ *
67
+ * You must have at least one path in this array, but you can specify more than one to randomly
68
+ * add extra variety (like the vanilla stages do).
69
+ *
70
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
71
+ * the vanilla file, they concatenate all four variations together into one PNG file. However,
72
+ * for the custom stages feature, you must separate each wall variation into a separate file.)
73
+ */
74
+ walls: readonly string[];
75
+ /**
76
+ * An array that contains the full paths to the graphic files for the stage's corners.
77
+ *
78
+ * You must have at least one path in this array, but you can specify more than one to randomly
79
+ * add extra variety (like the vanilla stages do).
80
+ *
81
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
82
+ * the vanilla file, they concatenate both variations together into one PNG file and put it in
83
+ * the top right hand corner. The corners are shown in the top right hand corner of the file,
84
+ * with two different variations concatenated together. However, for the custom stages feature,
85
+ * you must separate each corner variation into a separate file (and put it in a different file
86
+ * from the walls).
87
+ */
88
+ corners: readonly string[];
89
+ }>;
42
90
  /**
43
- * Optional. An object representing the color to use for the background of the boss "versus"
44
- * screen. If not specified, the color for Basement 1 will be used.
91
+ * Optional. The full path to the spritesheet that contains the graphics of the decorations for
92
+ * the floor.
45
93
  *
46
- * For a list of the colors that correspond to the vanilla stages, see
47
- * `versusScreenBackgroundColors.ts`.
94
+ * If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
95
+ * this is located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
96
+ * Rebirth\resources\gfx\grid\props_01_basement.png`
48
97
  */
49
- readonly versusScreenBackgroundColor?: {
50
- r: number;
51
- g: number;
52
- b: number;
53
- };
98
+ decorationsPNGPath?: string;
54
99
  /**
55
- * Optional. An object representing the color to use for the dirt spots in the boss "versus"
56
- * screen. (There are two dirt spots; one for the player and one for the boss.) If not specified,
57
- * the color for Basement 1 will be used.
100
+ * Optional. The full path to the spritesheet that contains the graphics of the rocks/blocks/urns
101
+ * for the floor.
58
102
  *
59
- * For a list of the colors that correspond to the vanilla stages, see
60
- * `versusScreenDirtSpotColors.ts`.
61
- */
62
- readonly versusScreenDirtSpotColor?: {
63
- r: number;
64
- g: number;
65
- b: number;
66
- };
67
- }
68
- interface CustomStageBackdrop {
69
- /**
70
- * The beginning of the path that leads to the backdrop graphics. For example:
103
+ * If specified, it is assumed that you have your own custom rock alt type, and all vanilla
104
+ * rewards/enemies that spawn from urns will be automatically removed. Use the
105
+ * `POST_GRID_ENTITY_BROKEN` callback to make your own custom rewards. Or, if you want to emulate
106
+ * a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
71
107
  *
72
- * ```sh
73
- * gfx/backdrop/revelations/revelations_
74
- * ```
75
- */
76
- prefix: string;
77
- /**
78
- * The end of the path that leads to the backdrop graphics. In most cases, this will be ".png".
108
+ * If not specified, the vanilla Basement rocks spritesheet will be used. For reference, this is
109
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
110
+ * Rebirth\resources-dlc3\gfx\grid\rocks_basement.png`
79
111
  */
80
- suffix: string;
112
+ rocksPNGPath?: string;
81
113
  /**
82
- * An array of strings that represent the graphic files that are used for the floors in narrow
83
- * rooms. (The "n" stands for "narrow").
84
- *
85
- * You must have at least one string in this array, but you can specify more than one to randomly
86
- * add extra variety (like the vanilla stages do).
114
+ * Optional. The full path to the spritesheet that contains the graphics of the pits for the
115
+ * floor.
87
116
  *
88
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
117
+ * If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
118
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
119
+ * Rebirth\resources\gfx\grid\grid_pit.png`
89
120
  */
90
- nFloors: string[];
121
+ pitsPNGPath?: string;
91
122
  /**
92
- * An array of strings that represent the graphic files that are used for the floors in L rooms.
93
- *
94
- * You must have at least one string in this array, but you can specify more than one to randomly
95
- * add extra variety (like the vanilla stages do).
96
- *
97
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
123
+ * Optional. A collection of paths that contain graphics for the doors of the floor. If not
124
+ * specified, the doors for Basement will be used.
98
125
  */
99
- lFloors: string[];
126
+ doorPNGPaths?: Readonly<{
127
+ /**
128
+ * Optional. The full path to the spritesheet that contains the graphics of the normal doors for
129
+ * the floor.
130
+ *
131
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
132
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
133
+ * Rebirth\resources\gfx\grid\door_01_normaldoor.png`
134
+ */
135
+ normal?: string;
136
+ /**
137
+ * Optional. The full path to the spritesheet that contains the graphics of the Treasure Room
138
+ * doors for the floor.
139
+ *
140
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
141
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
142
+ * Rebirth\resources\gfx\grid\door_02_treasureroomdoor.png`
143
+ */
144
+ treasureRoom?: string;
145
+ /**
146
+ * Optional. The full path to the spritesheet that contains the graphics of the Boss Room doors
147
+ * for the floor.
148
+ *
149
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
150
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
151
+ * Rebirth\resources\gfx\grid\door_10_bossroomdoor.png`
152
+ */
153
+ bossRoom?: string;
154
+ /**
155
+ * Optional. The full path to the spritesheet that contains the graphics of the Secret Room and
156
+ * Super Secret Room doors for the floor.
157
+ *
158
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
159
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
160
+ * Rebirth\resources\gfx\grid\door_08_holeinwall.png`
161
+ */
162
+ secretRoom?: string;
163
+ /**
164
+ * Optional. The full path to the spritesheet that contains the graphics of the arcade doors for
165
+ * the floor.
166
+ *
167
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
168
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
169
+ * Rebirth\resources\gfx\grid\door_05_arcaderoomdoor.png`
170
+ */
171
+ arcade?: string;
172
+ /**
173
+ * Optional. The full path to the spritesheet that contains the graphics of the Curse Room doors
174
+ * for the floor.
175
+ *
176
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
177
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
178
+ * Rebirth\resources\gfx\grid\door_04_selfsacrificeroomdoor.png`
179
+ */
180
+ curseRoom?: string;
181
+ /**
182
+ * Optional. The full path to the spritesheet that contains the graphics of the normal Challenge
183
+ * Room doors for the floor.
184
+ *
185
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
186
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
187
+ * Rebirth\resources\gfx\grid\door_03_ambushroomdoor.png`
188
+ */
189
+ normalChallengeRoom?: string;
190
+ /**
191
+ * Optional. The full path to the spritesheet that contains the graphics of the Boss Challenge
192
+ * Room doors for the floor.
193
+ *
194
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
195
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
196
+ * Rebirth\resources\gfx\grid\door_09_bossambushroomdoor.png`
197
+ */
198
+ bossChallengeRoom?: string;
199
+ /**
200
+ * Optional. The full path to the spritesheet that contains the graphics of the Devil Room doors
201
+ * for the floor.
202
+ *
203
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
204
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
205
+ * Rebirth\resources\gfx\grid\door_07_devilroomdoor.png`
206
+ */
207
+ devilRoom?: string;
208
+ /**
209
+ * Optional. The full path to the spritesheet that contains the graphics of the Angel Room doors
210
+ * for the floor.
211
+ *
212
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
213
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
214
+ * Rebirth\resources\gfx\grid\door_07_holyroomdoor.png`
215
+ */
216
+ angelRoom?: string;
217
+ /**
218
+ * Optional. The full path to the spritesheet that contains the graphics of the Boss Rush doors
219
+ * for the floor.
220
+ *
221
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
222
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
223
+ * Rebirth\resources\gfx\grid\door_15_bossrushdoor.png`
224
+ */
225
+ bossRush?: string;
226
+ /**
227
+ * Optional. The full path to the spritesheet that contains the graphics of the Chest Room doors
228
+ * for the floor.
229
+ *
230
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
231
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
232
+ * Rebirth\resources\gfx\grid\door_02b_chestroomdoor.png`
233
+ */
234
+ chestRoom?: string;
235
+ }>;
100
236
  /**
101
- * An array of strings that represent the graphic files for the stage's walls.
102
- *
103
- * You must have at least one string in this array, but you can specify more than one to randomly
104
- * add extra variety (like the vanilla stages do).
105
- *
106
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In the
107
- * vanilla file, they concatenate all four variations together into one PNG file. However, for the
108
- * custom stages feature, you must separate each wall variation into a separate file.)
237
+ * Optional. A collection of paths that contain graphics for the custom shadows of the floor. (In
238
+ * this context, "shadows" are the outlines from things on the roof. For example, in Basement, a
239
+ * shadow of a sideways V is used.) If not specified, no extra shadows will be drawn.
109
240
  */
110
- walls: string[];
111
- /**
112
- * An array of strings that represent the graphic files for the stage's corners. You must have at
113
- * least one string in this array, but you can specify more than one to randomly add extra variety
114
- * (like the vanilla stages do).
115
- *
116
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In the
117
- * vanilla file, they concatenate both variations together into one PNG file and put it in the top
118
- * right hand corner. The corners are shown in the top right hand corner of the file, with two
119
- * different variations concatenated together. However, for the custom stages feature, you must
120
- * separate each corner variation into a separate file (and put it in a different file from the
121
- * walls).
122
- */
123
- corners: string[];
124
- }
241
+ shadowPNGPaths?: Readonly<{
242
+ /**
243
+ * An array containing the full paths to the shadows that are used in rooms of shape
244
+ * `RoomShape.SHAPE_1x1` (1), `RoomShape.IH` (2), and `RoomShape.IV` (3).
245
+ *
246
+ * If more than one shadow is specified, one will be randomly chosen for each room.
247
+ *
248
+ * If not specified, no extra shadows will be drawn in these room shapes.
249
+ */
250
+ "1x1"?: readonly string[];
251
+ /**
252
+ * An array containing the full paths to the shadows that are used in rooms of shape
253
+ * `RoomShape.SHAPE_1x2` (4) and `RoomShape.IIV` (5).
254
+ *
255
+ * If more than one shadow is specified, one will be randomly chosen for each room.
256
+ *
257
+ * If not specified, no extra shadows will be drawn in these room shapes.
258
+ */
259
+ "1x2"?: readonly string[];
260
+ /**
261
+ * An array containing the full paths to the shadows that are used in rooms of shape
262
+ * `RoomShape.SHAPE_2x1` (6) and `RoomShape.IIH` (7).
263
+ *
264
+ * If more than one shadow is specified, one will be randomly chosen for each room.
265
+ *
266
+ * If not specified, no extra shadows will be drawn in these room shapes.
267
+ */
268
+ "2x1"?: readonly string[];
269
+ /**
270
+ * An array containing the full paths to the shadows that are used in rooms of shape
271
+ * `RoomShape.SHAPE_2x2` (8), `RoomShape.LTL` (9), `RoomShape.LTR` (10), `RoomShape.LBL` (11),
272
+ * and `RoomShape.LBR` (12).
273
+ *
274
+ * If more than one shadow is specified, one will be randomly chosen for each room.
275
+ *
276
+ * If not specified, no extra shadows will be drawn in these room shapes.
277
+ */
278
+ "2x2"?: readonly string[];
279
+ }>;
280
+ /** Optional. A collection of colors used in the boss "versus" screen. */
281
+ versusScreen?: Readonly<{
282
+ /**
283
+ * Optional. An object representing the color to use for the background of the boss "versus"
284
+ * screen. If not specified, the color for Basement 1 will be used.
285
+ *
286
+ * For a list of the colors that correspond to the vanilla stages, see
287
+ * `versusScreenBackgroundColors.ts`.
288
+ */
289
+ backgroundColor?: Readonly<{
290
+ r: number;
291
+ g: number;
292
+ b: number;
293
+ }>;
294
+ /**
295
+ * Optional. An object representing the color to use for the dirt spots in the boss "versus"
296
+ * screen. (There are two dirt spots; one for the player and one for the boss.) If not
297
+ * specified, the color for Basement 1 will be used.
298
+ *
299
+ * For a list of the colors that correspond to the vanilla stages, see
300
+ * `versusScreenDirtSpotColors.ts`.
301
+ */
302
+ dirtSpotColor?: Readonly<{
303
+ r: number;
304
+ g: number;
305
+ b: number;
306
+ }>;
307
+ }>;
308
+ }>;
125
309
  /**
126
310
  * An object that represents a custom stage. The "metadata.lua" file contains an array of these
127
311
  * objects. Besides the room metadata, the data is the same as what is specified inside the
@@ -136,12 +320,11 @@ export interface CustomStageLua extends CustomStageTSConfig {
136
320
  * Metadata about a custom stage room. Each custom stage object contains an array with metadata for
137
321
  * each room.
138
322
  */
139
- export interface CustomStageRoomMetadata {
140
- readonly type: number;
141
- readonly variant: number;
142
- readonly subType: number;
143
- readonly shape: number;
144
- readonly doorSlotFlags: number;
145
- readonly weight: number;
146
- }
147
- export {};
323
+ export declare type CustomStageRoomMetadata = Readonly<{
324
+ type: number;
325
+ variant: number;
326
+ subType: number;
327
+ shape: number;
328
+ doorSlotFlags: number;
329
+ weight: number;
330
+ }>;
@@ -0,0 +1,6 @@
1
+ import { BackdropType } from "isaac-typescript-definitions";
2
+ import { RockAltType } from "../enums/RockAltType";
3
+ /** Used by the `getRockAltType` function. */
4
+ export declare const BACKDROP_TYPE_TO_ROCK_ALT_TYPE: {
5
+ readonly [key in BackdropType]: RockAltType;
6
+ };
@@ -0,0 +1,69 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local BackdropType = ____isaac_2Dtypescript_2Ddefinitions.BackdropType
4
+ local ____RockAltType = require("enums.RockAltType")
5
+ local RockAltType = ____RockAltType.RockAltType
6
+ --- Used by the `getRockAltType` function.
7
+ ____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
8
+ [BackdropType.BASEMENT] = RockAltType.URN,
9
+ [BackdropType.CELLAR] = RockAltType.URN,
10
+ [BackdropType.BURNT_BASEMENT] = RockAltType.URN,
11
+ [BackdropType.CAVES] = RockAltType.MUSHROOM,
12
+ [BackdropType.CATACOMBS] = RockAltType.MUSHROOM,
13
+ [BackdropType.FLOODED_CAVES] = RockAltType.MUSHROOM,
14
+ [BackdropType.DEPTHS] = RockAltType.SKULL,
15
+ [BackdropType.NECROPOLIS] = RockAltType.SKULL,
16
+ [BackdropType.DANK_DEPTHS] = RockAltType.SKULL,
17
+ [BackdropType.WOMB] = RockAltType.POLYP,
18
+ [BackdropType.UTERO] = RockAltType.POLYP,
19
+ [BackdropType.SCARRED_WOMB] = RockAltType.POLYP,
20
+ [BackdropType.BLUE_WOMB] = RockAltType.POLYP,
21
+ [BackdropType.SHEOL] = RockAltType.SKULL,
22
+ [BackdropType.CATHEDRAL] = RockAltType.URN,
23
+ [BackdropType.DARK_ROOM] = RockAltType.SKULL,
24
+ [BackdropType.CHEST] = RockAltType.URN,
25
+ [BackdropType.MEGA_SATAN] = RockAltType.URN,
26
+ [BackdropType.LIBRARY] = RockAltType.URN,
27
+ [BackdropType.SHOP] = RockAltType.URN,
28
+ [BackdropType.CLEAN_BEDROOM] = RockAltType.URN,
29
+ [BackdropType.DIRTY_BEDROOM] = RockAltType.URN,
30
+ [BackdropType.SECRET] = RockAltType.MUSHROOM,
31
+ [BackdropType.DICE] = RockAltType.URN,
32
+ [BackdropType.ARCADE] = RockAltType.URN,
33
+ [BackdropType.ERROR_ROOM] = RockAltType.URN,
34
+ [BackdropType.BLUE_WOMB_PASS] = RockAltType.POLYP,
35
+ [BackdropType.GREED_SHOP] = RockAltType.URN,
36
+ [BackdropType.DUNGEON] = RockAltType.URN,
37
+ [BackdropType.SACRIFICE] = RockAltType.SKULL,
38
+ [BackdropType.DOWNPOUR] = RockAltType.BUCKET,
39
+ [BackdropType.MINES] = RockAltType.MUSHROOM,
40
+ [BackdropType.MAUSOLEUM] = RockAltType.SKULL,
41
+ [BackdropType.CORPSE] = RockAltType.POLYP,
42
+ [BackdropType.PLANETARIUM] = RockAltType.URN,
43
+ [BackdropType.DOWNPOUR_ENTRANCE] = RockAltType.BUCKET,
44
+ [BackdropType.MINES_ENTRANCE] = RockAltType.MUSHROOM,
45
+ [BackdropType.MAUSOLEUM_ENTRANCE] = RockAltType.SKULL,
46
+ [BackdropType.CORPSE_ENTRANCE] = RockAltType.SKULL,
47
+ [BackdropType.MAUSOLEUM_2] = RockAltType.SKULL,
48
+ [BackdropType.MAUSOLEUM_3] = RockAltType.SKULL,
49
+ [BackdropType.MAUSOLEUM_4] = RockAltType.SKULL,
50
+ [BackdropType.CORPSE_2] = RockAltType.POLYP,
51
+ [BackdropType.CORPSE_3] = RockAltType.POLYP,
52
+ [BackdropType.DROSS] = RockAltType.BUCKET,
53
+ [BackdropType.ASHPIT] = RockAltType.MUSHROOM,
54
+ [BackdropType.GEHENNA] = RockAltType.SKULL,
55
+ [BackdropType.MORTIS] = RockAltType.POLYP,
56
+ [BackdropType.ISAACS_BEDROOM] = RockAltType.URN,
57
+ [BackdropType.HALLWAY] = RockAltType.URN,
58
+ [BackdropType.MOMS_BEDROOM] = RockAltType.URN,
59
+ [BackdropType.CLOSET] = RockAltType.URN,
60
+ [BackdropType.CLOSET_B] = RockAltType.URN,
61
+ [BackdropType.DOGMA] = RockAltType.URN,
62
+ [BackdropType.DUNGEON_GIDEON] = RockAltType.URN,
63
+ [BackdropType.DUNGEON_ROTGUT] = RockAltType.URN,
64
+ [BackdropType.DUNGEON_BEAST] = RockAltType.URN,
65
+ [BackdropType.MINES_SHAFT] = RockAltType.MUSHROOM,
66
+ [BackdropType.ASHPIT_SHAFT] = RockAltType.MUSHROOM,
67
+ [BackdropType.DARK_CLOSET] = RockAltType.SKULL
68
+ }
69
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.4.0",
3
+ "version": "6.6.0",
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.22"
25
+ "isaac-typescript-definitions": "^3.0.24"
26
26
  }
27
27
  }
@@ -0,0 +1,7 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Using the "luamod" console command with a mod that has custom shaders can crash the game. A
4
+ * simple fix for this is automatically applied to any upgraded mods. This method was originally
5
+ * discovered by AgentCucco.
6
+ */
7
+ export declare function loadShaderCrashFix(mod: Mod): void;
@@ -0,0 +1,18 @@
1
+ local ____exports = {}
2
+ local postPlayerInit
3
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
4
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
5
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
6
+ function postPlayerInit(self)
7
+ local players = Isaac.FindByType(EntityType.PLAYER)
8
+ if #players == 0 then
9
+ Isaac.ExecuteCommand("reloadshaders")
10
+ end
11
+ end
12
+ --- Using the "luamod" console command with a mod that has custom shaders can crash the game. A
13
+ -- simple fix for this is automatically applied to any upgraded mods. This method was originally
14
+ -- discovered by AgentCucco.
15
+ function ____exports.loadShaderCrashFix(self, mod)
16
+ mod:AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit)
17
+ end
18
+ return ____exports
package/upgradeMod.lua CHANGED
@@ -17,6 +17,8 @@ local initFeaturesMajor = ____initFeatures.initFeaturesMajor
17
17
  local initFeaturesMinor = ____initFeatures.initFeaturesMinor
18
18
  local ____patchErrorFunctions = require("patchErrorFunctions")
19
19
  local patchErrorFunction = ____patchErrorFunctions.patchErrorFunction
20
+ local ____shaderCrashFix = require("shaderCrashFix")
21
+ local loadShaderCrashFix = ____shaderCrashFix.loadShaderCrashFix
20
22
  --- Use this function to enable the custom callbacks and other optional features provided by
21
23
  -- `isaacscript-common`.
22
24
  --
@@ -36,10 +38,11 @@ local patchErrorFunction = ____patchErrorFunctions.patchErrorFunction
36
38
  -- @param modVanilla The mod object returned by the `RegisterMod` function.
37
39
  -- @returns The upgraded mod object.
38
40
  function ____exports.upgradeMod(self, modVanilla)
39
- patchErrorFunction(nil)
40
41
  local mod = __TS__New(ModUpgraded, modVanilla)
41
42
  if not areFeaturesInitialized(nil) then
42
43
  setFeaturesInitialized(nil)
44
+ patchErrorFunction(nil)
45
+ loadShaderCrashFix(nil, modVanilla)
43
46
  postNewRoomEarlyCallbackInit(nil, mod)
44
47
  saveDataManagerInit(nil, mod)
45
48
  initCustomCallbacks(nil, mod)