isaacscript-common 6.4.0 → 6.5.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.
@@ -9,119 +9,264 @@
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
+ backdrop?: Readonly<{
43
+ /**
44
+ * The beginning of the path that leads to the backdrop graphics. For example:
45
+ *
46
+ * ```sh
47
+ * gfx/backdrop/revelations/revelations_
48
+ * ```
49
+ */
50
+ prefix: string;
51
+ /**
52
+ * The end of the path that leads to the backdrop graphics. In most cases, this will be ".png".
53
+ */
54
+ suffix: string;
55
+ /**
56
+ * An array of strings that represent the graphic files that are used for the floors in narrow
57
+ * rooms. (The "n" stands for "narrow").
58
+ *
59
+ * You must have at least one string in this array, but you can specify more than one to
60
+ * randomly add extra variety (like the vanilla stages do).
61
+ *
62
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
63
+ */
64
+ nFloors: readonly string[];
65
+ /**
66
+ * An array of strings that represent the graphic files that are used for the floors in L rooms.
67
+ *
68
+ * You must have at least one string in this array, but you can specify more than one to
69
+ * randomly add extra variety (like the vanilla stages do).
70
+ *
71
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
72
+ */
73
+ lFloors: readonly string[];
74
+ /**
75
+ * An array of strings that represent the graphic files for the stage's walls.
76
+ *
77
+ * You must have at least one string in this array, but you can specify more than one to
78
+ * randomly add extra variety (like the vanilla stages do).
79
+ *
80
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
81
+ * the vanilla file, they concatenate all four variations together into one PNG file. However,
82
+ * for the custom stages feature, you must separate each wall variation into a separate file.)
83
+ */
84
+ walls: readonly string[];
85
+ /**
86
+ * An array of strings that represent the graphic files for the stage's corners. You must have
87
+ * at least one string in this array, but you can specify more than one to randomly add extra
88
+ * variety (like the vanilla stages do).
89
+ *
90
+ * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement.png". (In
91
+ * the vanilla file, they concatenate both variations together into one PNG file and put it in
92
+ * the top right hand corner. The corners are shown in the top right hand corner of the file,
93
+ * with two different variations concatenated together. However, for the custom stages feature,
94
+ * you must separate each corner variation into a separate file (and put it in a different file
95
+ * from the walls).
96
+ */
97
+ corners: readonly string[];
98
+ }>;
42
99
  /**
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.
100
+ * Optional. The path to the spritesheet that contains the graphics of the decorations for the
101
+ * floor.
45
102
  *
46
- * For a list of the colors that correspond to the vanilla stages, see
47
- * `versusScreenBackgroundColors.ts`.
103
+ * If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
104
+ * this is located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
105
+ * Rebirth\resources\gfx\grid\props_01_basement.png`
48
106
  */
49
- readonly versusScreenBackgroundColor?: {
50
- r: number;
51
- g: number;
52
- b: number;
53
- };
107
+ decorationsPNGPath?: string;
54
108
  /**
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.
109
+ * Optional. The path to the spritesheet that contains the graphics of the rocks/blocks/urns for
110
+ * the floor.
58
111
  *
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:
71
- *
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".
79
- */
80
- suffix: string;
81
- /**
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").
112
+ * If specified, it is assumed that you have your own custom rock alt type, and all vanilla
113
+ * rewards/enemies that spawn from urns will be automatically removed. Use the
114
+ * `POST_GRID_ENTITY_BROKEN` callback to make your own custom rewards. Or, if you want to emulate
115
+ * a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
84
116
  *
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).
87
- *
88
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
117
+ * If not specified, the vanilla Basement rocks 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-dlc3\gfx\grid\rocks_basement.png`
89
120
  */
90
- nFloors: string[];
121
+ rocksPNGPath?: 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).
123
+ * Optional. The path to the spritesheet that contains the graphics of the pits for the floor.
96
124
  *
97
- * For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
125
+ * If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
126
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
127
+ * Rebirth\resources\gfx\grid\grid_pit.png`
98
128
  */
99
- lFloors: string[];
100
- /**
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.)
109
- */
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
- }
129
+ pitsPNGPath?: string;
130
+ /** Optional. A collection of paths that contain graphics for the doors of the floor. */
131
+ doorPNGPaths?: Readonly<{
132
+ /**
133
+ * Optional. The path to the spritesheet that contains the graphics of the normal doors for the
134
+ * floor.
135
+ *
136
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
137
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
138
+ * Rebirth\resources\gfx\grid\door_01_normaldoor.png`
139
+ */
140
+ normal?: string;
141
+ /**
142
+ * Optional. The path to the spritesheet that contains the graphics of the Treasure Room doors
143
+ * for the floor.
144
+ *
145
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
146
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
147
+ * Rebirth\resources\gfx\grid\door_02_treasureroomdoor.png`
148
+ */
149
+ treasureRoom?: string;
150
+ /**
151
+ * Optional. The path to the spritesheet that contains the graphics of the Boss Room doors for
152
+ * the floor.
153
+ *
154
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
155
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
156
+ * Rebirth\resources\gfx\grid\door_10_bossroomdoor.png`
157
+ */
158
+ bossRoom?: string;
159
+ /**
160
+ * Optional. The path to the spritesheet that contains the graphics of the Secret Room and Super
161
+ * Secret Room doors for the floor.
162
+ *
163
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
164
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
165
+ * Rebirth\resources\gfx\grid\door_08_holeinwall.png`
166
+ */
167
+ secretRoom?: string;
168
+ /**
169
+ * Optional. The path to the spritesheet that contains the graphics of the arcade doors for the
170
+ * floor.
171
+ *
172
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
173
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
174
+ * Rebirth\resources\gfx\grid\door_05_arcaderoomdoor.png`
175
+ */
176
+ arcade?: string;
177
+ /**
178
+ * Optional. The path to the spritesheet that contains the graphics of the Curse Room doors for
179
+ * the floor.
180
+ *
181
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
182
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
183
+ * Rebirth\resources\gfx\grid\door_04_selfsacrificeroomdoor.png`
184
+ */
185
+ curseRoom?: string;
186
+ /**
187
+ * Optional. The path to the spritesheet that contains the graphics of the normal Challenge Room
188
+ * doors for the floor.
189
+ *
190
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
191
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
192
+ * Rebirth\resources\gfx\grid\door_03_ambushroomdoor.png`
193
+ */
194
+ normalChallengeRoom?: string;
195
+ /**
196
+ * Optional. The path to the spritesheet that contains the graphics of the Boss Challenge Room
197
+ * doors for the floor.
198
+ *
199
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
200
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
201
+ * Rebirth\resources\gfx\grid\door_09_bossambushroomdoor.png`
202
+ */
203
+ bossChallengeRoom?: string;
204
+ /**
205
+ * Optional. The path to the spritesheet that contains the graphics of the Devil Room doors for
206
+ * the floor.
207
+ *
208
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
209
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
210
+ * Rebirth\resources\gfx\grid\door_07_devilroomdoor.png`
211
+ */
212
+ devilRoom?: string;
213
+ /**
214
+ * Optional. The path to the spritesheet that contains the graphics of the Angel Room doors for
215
+ * the floor.
216
+ *
217
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
218
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
219
+ * Rebirth\resources\gfx\grid\door_07_holyroomdoor.png`
220
+ */
221
+ angelRoom?: string;
222
+ /**
223
+ * Optional. The path to the spritesheet that contains the graphics of the Boss Rush doors for
224
+ * the floor.
225
+ *
226
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
227
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
228
+ * Rebirth\resources\gfx\grid\door_15_bossrushdoor.png`
229
+ */
230
+ bossRush?: string;
231
+ /**
232
+ * Optional. The path to the spritesheet that contains the graphics of the Chest Room doors for
233
+ * the floor.
234
+ *
235
+ * If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
236
+ * located at: `C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac
237
+ * Rebirth\resources\gfx\grid\door_02b_chestroomdoor.png`
238
+ */
239
+ chestRoom?: string;
240
+ }>;
241
+ /** Optional. A collection of colors used in the boss "versus" screen. */
242
+ versusScreen?: Readonly<{
243
+ /**
244
+ * Optional. An object representing the color to use for the background of the boss "versus"
245
+ * screen. If not specified, the color for Basement 1 will be used.
246
+ *
247
+ * For a list of the colors that correspond to the vanilla stages, see
248
+ * `versusScreenBackgroundColors.ts`.
249
+ */
250
+ backgroundColor?: Readonly<{
251
+ r: number;
252
+ g: number;
253
+ b: number;
254
+ }>;
255
+ /**
256
+ * Optional. An object representing the color to use for the dirt spots in the boss "versus"
257
+ * screen. (There are two dirt spots; one for the player and one for the boss.) If not
258
+ * specified, the color for Basement 1 will be used.
259
+ *
260
+ * For a list of the colors that correspond to the vanilla stages, see
261
+ * `versusScreenDirtSpotColors.ts`.
262
+ */
263
+ dirtSpotColor?: Readonly<{
264
+ r: number;
265
+ g: number;
266
+ b: number;
267
+ }>;
268
+ }>;
269
+ }>;
125
270
  /**
126
271
  * An object that represents a custom stage. The "metadata.lua" file contains an array of these
127
272
  * objects. Besides the room metadata, the data is the same as what is specified inside the
@@ -136,12 +281,11 @@ export interface CustomStageLua extends CustomStageTSConfig {
136
281
  * Metadata about a custom stage room. Each custom stage object contains an array with metadata for
137
282
  * each room.
138
283
  */
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 {};
284
+ export declare type CustomStageRoomMetadata = Readonly<{
285
+ type: number;
286
+ variant: number;
287
+ subType: number;
288
+ shape: number;
289
+ doorSlotFlags: number;
290
+ weight: number;
291
+ }>;
@@ -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.5.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
  }