isaacscript-common 7.2.2 → 7.4.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.
- package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
- package/dist/callbacks/postDiceRoomActivated.lua +4 -5
- package/dist/callbacks/postItemDischarged.d.ts.map +1 -1
- package/dist/callbacks/postItemDischarged.lua +3 -2
- package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
- package/dist/callbacks/postPlayerChangeStat.lua +10 -7
- package/dist/features/customStage/exports.d.ts +4 -6
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +4 -6
- package/dist/functions/types.d.ts +8 -1
- package/dist/functions/types.d.ts.map +1 -1
- package/dist/functions/types.lua +7 -0
- package/dist/index.d.ts +11034 -10
- package/dist/interfaces/CustomStageLua.d.ts +17 -33
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/callbacks/postDiceRoomActivated.ts +12 -7
- package/src/callbacks/postItemDischarged.ts +2 -3
- package/src/callbacks/postPlayerChangeStat.ts +4 -8
- package/src/features/customStage/exports.ts +4 -6
- package/src/functions/types.ts +11 -0
- package/src/interfaces/CustomStageLua.ts +17 -33
|
@@ -112,8 +112,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
112
112
|
* the floor.
|
|
113
113
|
*
|
|
114
114
|
* If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
|
|
115
|
-
* this is located at: `
|
|
116
|
-
* Rebirth\resources\gfx\grid\props_01_basement.png`
|
|
115
|
+
* this is located at: `resources/gfx/grid/props_01_basement.png`
|
|
117
116
|
*/
|
|
118
117
|
decorationsPNGPath?: string;
|
|
119
118
|
/**
|
|
@@ -126,8 +125,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
126
125
|
* a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
|
|
127
126
|
*
|
|
128
127
|
* If not specified, the vanilla Basement rocks spritesheet will be used. For reference, this is
|
|
129
|
-
* located at: `
|
|
130
|
-
* Rebirth\resources-dlc3\gfx\grid\rocks_basement.png`
|
|
128
|
+
* located at: `resources-dlc3/gfx/grid/rocks_basement.png`
|
|
131
129
|
*/
|
|
132
130
|
rocksPNGPath?: string;
|
|
133
131
|
/**
|
|
@@ -135,8 +133,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
135
133
|
* floor.
|
|
136
134
|
*
|
|
137
135
|
* If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
|
|
138
|
-
* located at: `
|
|
139
|
-
* Rebirth\resources\gfx\grid\grid_pit.png`
|
|
136
|
+
* located at: `resources/gfx/grid/grid_pit.png`
|
|
140
137
|
*/
|
|
141
138
|
pitsPNGPath?: string;
|
|
142
139
|
/**
|
|
@@ -149,8 +146,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
149
146
|
* the floor.
|
|
150
147
|
*
|
|
151
148
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
152
|
-
* located at: `
|
|
153
|
-
* Rebirth\resources\gfx\grid\door_01_normaldoor.png`
|
|
149
|
+
* located at: `resources/gfx/grid/door_01_normaldoor.png`
|
|
154
150
|
*/
|
|
155
151
|
normal?: string;
|
|
156
152
|
/**
|
|
@@ -158,8 +154,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
158
154
|
* doors for the floor.
|
|
159
155
|
*
|
|
160
156
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
161
|
-
* located at: `
|
|
162
|
-
* Rebirth\resources\gfx\grid\door_02_treasureroomdoor.png`
|
|
157
|
+
* located at: `resources/gfx/grid/door_02_treasureroomdoor.png`
|
|
163
158
|
*/
|
|
164
159
|
treasureRoom?: string;
|
|
165
160
|
/**
|
|
@@ -167,8 +162,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
167
162
|
* for the floor.
|
|
168
163
|
*
|
|
169
164
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
170
|
-
* located at: `
|
|
171
|
-
* Rebirth\resources\gfx\grid\door_10_bossroomdoor.png`
|
|
165
|
+
* located at: `resources/gfx/grid/door_10_bossroomdoor.png`
|
|
172
166
|
*/
|
|
173
167
|
bossRoom?: string;
|
|
174
168
|
/**
|
|
@@ -176,8 +170,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
176
170
|
* Super Secret Room doors for the floor.
|
|
177
171
|
*
|
|
178
172
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
179
|
-
* located at: `
|
|
180
|
-
* Rebirth\resources\gfx\grid\door_08_holeinwall.png`
|
|
173
|
+
* located at: `resources/gfx/grid/door_08_holeinwall.png`
|
|
181
174
|
*/
|
|
182
175
|
secretRoom?: string;
|
|
183
176
|
/**
|
|
@@ -185,8 +178,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
185
178
|
* the floor.
|
|
186
179
|
*
|
|
187
180
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
188
|
-
* located at: `
|
|
189
|
-
* Rebirth\resources\gfx\grid\door_05_arcaderoomdoor.png`
|
|
181
|
+
* located at: `resources/gfx/grid/door_05_arcaderoomdoor.png`
|
|
190
182
|
*/
|
|
191
183
|
arcade?: string;
|
|
192
184
|
/**
|
|
@@ -194,8 +186,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
194
186
|
* for the floor.
|
|
195
187
|
*
|
|
196
188
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
197
|
-
* located at: `
|
|
198
|
-
* Rebirth\resources\gfx\grid\door_04_selfsacrificeroomdoor.png`
|
|
189
|
+
* located at: `resources/gfx/grid/door_04_selfsacrificeroomdoor.png`
|
|
199
190
|
*/
|
|
200
191
|
curseRoom?: string;
|
|
201
192
|
/**
|
|
@@ -203,8 +194,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
203
194
|
* Room doors for the floor.
|
|
204
195
|
*
|
|
205
196
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
206
|
-
* located at: `
|
|
207
|
-
* Rebirth\resources\gfx\grid\door_03_ambushroomdoor.png`
|
|
197
|
+
* located at: `resources/gfx/grid/door_03_ambushroomdoor.png`
|
|
208
198
|
*/
|
|
209
199
|
normalChallengeRoom?: string;
|
|
210
200
|
/**
|
|
@@ -212,8 +202,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
212
202
|
* Room doors for the floor.
|
|
213
203
|
*
|
|
214
204
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
215
|
-
* located at: `
|
|
216
|
-
* Rebirth\resources\gfx\grid\door_09_bossambushroomdoor.png`
|
|
205
|
+
* located at: `resources/gfx/grid/door_09_bossambushroomdoor.png`
|
|
217
206
|
*/
|
|
218
207
|
bossChallengeRoom?: string;
|
|
219
208
|
/**
|
|
@@ -221,8 +210,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
221
210
|
* for the floor.
|
|
222
211
|
*
|
|
223
212
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
224
|
-
* located at: `
|
|
225
|
-
* Rebirth\resources\gfx\grid\door_07_devilroomdoor.png`
|
|
213
|
+
* located at: `resources/gfx/grid/door_07_devilroomdoor.png`
|
|
226
214
|
*/
|
|
227
215
|
devilRoom?: string;
|
|
228
216
|
/**
|
|
@@ -230,8 +218,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
230
218
|
* for the floor.
|
|
231
219
|
*
|
|
232
220
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
233
|
-
* located at: `
|
|
234
|
-
* Rebirth\resources\gfx\grid\door_07_holyroomdoor.png`
|
|
221
|
+
* located at: `resources/gfx/grid/door_07_holyroomdoor.png`
|
|
235
222
|
*/
|
|
236
223
|
angelRoom?: string;
|
|
237
224
|
/**
|
|
@@ -239,8 +226,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
239
226
|
* for the floor.
|
|
240
227
|
*
|
|
241
228
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
242
|
-
* located at: `
|
|
243
|
-
* Rebirth\resources\gfx\grid\door_15_bossrushdoor.png`
|
|
229
|
+
* located at: `resources/gfx/grid/door_15_bossrushdoor.png`
|
|
244
230
|
*/
|
|
245
231
|
bossRush?: string;
|
|
246
232
|
/**
|
|
@@ -248,8 +234,7 @@ export declare type CustomStageTSConfig = Readonly<{
|
|
|
248
234
|
* for the floor.
|
|
249
235
|
*
|
|
250
236
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
251
|
-
* located at: `
|
|
252
|
-
* Rebirth\resources\gfx\grid\door_02b_chestroomdoor.png`
|
|
237
|
+
* located at: `resources/gfx/grid/door_02b_chestroomdoor.png`
|
|
253
238
|
*/
|
|
254
239
|
chestRoom?: string;
|
|
255
240
|
}>;
|
|
@@ -371,9 +356,8 @@ export declare type CustomStageShadow = Readonly<{
|
|
|
371
356
|
/**
|
|
372
357
|
* The full path to the shadow overlay PNG file.
|
|
373
358
|
*
|
|
374
|
-
* For an example of a vanilla shadow overlay, see:
|
|
375
|
-
*
|
|
376
|
-
* Rebirth\resources\gfx\overlays\basement\1x1_overlay_1.png`
|
|
359
|
+
* For an example of a vanilla shadow overlay, see:
|
|
360
|
+
* `resources/gfx/overlays/basement/1x1_overlay_1.png`
|
|
377
361
|
*/
|
|
378
362
|
pngPath: string;
|
|
379
363
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomStageLua.d.ts","sourceRoot":"","sources":["../../src/interfaces/CustomStageLua.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oBAAY,mBAAmB,GAAG,QAAQ,CAAC;IACzC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;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Q,CAAC,aAAa,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC5D;AAED;;;GAGG;AACH,oBAAY,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DiceFloorSubType,
|
|
3
|
+
EffectVariant,
|
|
4
|
+
ModCallback,
|
|
5
|
+
} from "isaac-typescript-definitions";
|
|
2
6
|
import { saveDataManager } from "../features/saveDataManager/exports";
|
|
3
7
|
import { isCloseEnoughToTriggerDiceFloor } from "../functions/effects";
|
|
4
8
|
import { getClosestPlayer } from "../functions/players";
|
|
@@ -30,8 +34,6 @@ function hasSubscriptions() {
|
|
|
30
34
|
// ModCallback.POST_EFFECT_UPDATE (55)
|
|
31
35
|
// EffectVariant.DICE_FLOOR (76)
|
|
32
36
|
function postEffectUpdateDiceFloor(effect: EntityEffect) {
|
|
33
|
-
const diceFloor = effect as EntityEffectDiceFloor;
|
|
34
|
-
|
|
35
37
|
if (!hasSubscriptions()) {
|
|
36
38
|
return;
|
|
37
39
|
}
|
|
@@ -42,13 +44,16 @@ function postEffectUpdateDiceFloor(effect: EntityEffect) {
|
|
|
42
44
|
|
|
43
45
|
// When using the debug console to go to a dice room, the player can appear on top of the dice
|
|
44
46
|
// floor before they snap to the door.
|
|
45
|
-
if (
|
|
47
|
+
if (effect.FrameCount === 0) {
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
|
-
const closestPlayer = getClosestPlayer(
|
|
50
|
-
if (isCloseEnoughToTriggerDiceFloor(closestPlayer,
|
|
51
|
+
const closestPlayer = getClosestPlayer(effect.Position);
|
|
52
|
+
if (isCloseEnoughToTriggerDiceFloor(closestPlayer, effect)) {
|
|
51
53
|
v.room.diceRoomActivated = true;
|
|
52
|
-
postDiceRoomActivatedFire(
|
|
54
|
+
postDiceRoomActivatedFire(
|
|
55
|
+
closestPlayer,
|
|
56
|
+
effect.SubType as DiceFloorSubType,
|
|
57
|
+
);
|
|
53
58
|
}
|
|
54
59
|
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
mapGetPlayer,
|
|
17
17
|
mapSetPlayer,
|
|
18
18
|
} from "../functions/playerDataStructures";
|
|
19
|
+
import { asNumber } from "../functions/types";
|
|
19
20
|
import { PlayerIndex } from "../types/PlayerIndex";
|
|
20
21
|
import {
|
|
21
22
|
postItemDischargeFire,
|
|
@@ -131,13 +132,11 @@ function preNPCCollisionSucker(
|
|
|
131
132
|
npc: EntityNPC,
|
|
132
133
|
collider: Entity,
|
|
133
134
|
): boolean | undefined {
|
|
134
|
-
const sucker = npc as EntityNPCSucker;
|
|
135
|
-
|
|
136
135
|
if (!hasSubscriptions()) {
|
|
137
136
|
return undefined;
|
|
138
137
|
}
|
|
139
138
|
|
|
140
|
-
if (
|
|
139
|
+
if (npc.Variant !== asNumber(SuckerVariant.BULB)) {
|
|
141
140
|
return undefined;
|
|
142
141
|
}
|
|
143
142
|
|
|
@@ -4,16 +4,12 @@ import { ModUpgraded } from "../classes/ModUpgraded";
|
|
|
4
4
|
import { StatType } from "../enums";
|
|
5
5
|
import { ModCallbackCustom } from "../enums/ModCallbackCustom";
|
|
6
6
|
import { saveDataManager } from "../features/saveDataManager/exports";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
getPlayerStat,
|
|
10
|
-
isBitSet128,
|
|
11
|
-
isBoolean,
|
|
12
|
-
isColor,
|
|
13
|
-
isNumber,
|
|
14
|
-
} from "../functions";
|
|
7
|
+
import { isBitSet128 } from "../functions/bitSet128";
|
|
8
|
+
import { colorEquals, isColor } from "../functions/color";
|
|
15
9
|
import { getEnumValues } from "../functions/enums";
|
|
16
10
|
import { getPlayerIndex } from "../functions/playerIndex";
|
|
11
|
+
import { getPlayerStat } from "../functions/playerStats";
|
|
12
|
+
import { isBoolean, isNumber } from "../functions/types";
|
|
17
13
|
import { PlayerIndex } from "../types/PlayerIndex";
|
|
18
14
|
import {
|
|
19
15
|
postPlayerChangeStatFire,
|
|
@@ -193,12 +193,10 @@ function setStageRoomsData(
|
|
|
193
193
|
* files for them.
|
|
194
194
|
*
|
|
195
195
|
* For reference:
|
|
196
|
-
* - The vanilla name sprite for Monstro is located at
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* (x86)\Steam\steamapps\common\The Binding of Isaac
|
|
201
|
-
* Rebirth\resources\gfx\ui\boss\portrait_20.0_monstro.png".
|
|
196
|
+
* - The vanilla name sprite for Monstro is located at:
|
|
197
|
+
* `resources/gfx/ui/boss/bossname_20.0_monstro.png`
|
|
198
|
+
* - The vanilla portrait sprite for Monstro is located at:
|
|
199
|
+
* `resources/gfx/ui/boss/portrait_20.0_monstro.png`
|
|
202
200
|
*
|
|
203
201
|
* (Note that boss metadata like this cannot be specified with the rest of the custom stage metadata
|
|
204
202
|
* in the "tsconfig.json" file because there is not a way to retrieve the name of an entity at
|
package/src/functions/types.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
Card,
|
|
3
3
|
CollectibleType,
|
|
4
4
|
LevelStage,
|
|
5
|
+
NpcState,
|
|
5
6
|
PillColor,
|
|
6
7
|
PillEffect,
|
|
7
8
|
PlayerType,
|
|
@@ -38,6 +39,16 @@ export function asLevelStage(num: number): LevelStage {
|
|
|
38
39
|
return num;
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Helper function to safely cast a `number` to a `NpcState`. (This is better than using the `as`
|
|
44
|
+
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
45
|
+
*
|
|
46
|
+
* This is useful to satisfy the "isaacscript/strict-enums" ESLint rule.
|
|
47
|
+
*/
|
|
48
|
+
export function asNpcState(num: number): NpcState {
|
|
49
|
+
return num;
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
/**
|
|
42
53
|
* Helper function to safely cast an enum to a `number`. (This is better than using the `as`
|
|
43
54
|
* TypeScript keyword to do a type assertion, since that can obfuscate compiler errors. )
|
|
@@ -122,8 +122,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
122
122
|
* the floor.
|
|
123
123
|
*
|
|
124
124
|
* If not specified, the vanilla Basement decorations spritesheet will be used. For reference,
|
|
125
|
-
* this is located at: `
|
|
126
|
-
* Rebirth\resources\gfx\grid\props_01_basement.png`
|
|
125
|
+
* this is located at: `resources/gfx/grid/props_01_basement.png`
|
|
127
126
|
*/
|
|
128
127
|
decorationsPNGPath?: string;
|
|
129
128
|
|
|
@@ -137,8 +136,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
137
136
|
* a vanilla urn/mushroom/skull/polyp/bucket, use the `spawnRockAltReward` helper function.
|
|
138
137
|
*
|
|
139
138
|
* If not specified, the vanilla Basement rocks spritesheet will be used. For reference, this is
|
|
140
|
-
* located at: `
|
|
141
|
-
* Rebirth\resources-dlc3\gfx\grid\rocks_basement.png`
|
|
139
|
+
* located at: `resources-dlc3/gfx/grid/rocks_basement.png`
|
|
142
140
|
*/
|
|
143
141
|
rocksPNGPath?: string;
|
|
144
142
|
|
|
@@ -147,8 +145,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
147
145
|
* floor.
|
|
148
146
|
*
|
|
149
147
|
* If not specified, the vanilla Basement pits spritesheet will be used. For reference, this is
|
|
150
|
-
* located at: `
|
|
151
|
-
* Rebirth\resources\gfx\grid\grid_pit.png`
|
|
148
|
+
* located at: `resources/gfx/grid/grid_pit.png`
|
|
152
149
|
*/
|
|
153
150
|
pitsPNGPath?: string;
|
|
154
151
|
|
|
@@ -162,8 +159,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
162
159
|
* the floor.
|
|
163
160
|
*
|
|
164
161
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
165
|
-
* located at: `
|
|
166
|
-
* Rebirth\resources\gfx\grid\door_01_normaldoor.png`
|
|
162
|
+
* located at: `resources/gfx/grid/door_01_normaldoor.png`
|
|
167
163
|
*/
|
|
168
164
|
normal?: string; // RoomType.DEFAULT (1)
|
|
169
165
|
|
|
@@ -172,8 +168,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
172
168
|
* doors for the floor.
|
|
173
169
|
*
|
|
174
170
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
175
|
-
* located at: `
|
|
176
|
-
* Rebirth\resources\gfx\grid\door_02_treasureroomdoor.png`
|
|
171
|
+
* located at: `resources/gfx/grid/door_02_treasureroomdoor.png`
|
|
177
172
|
*/
|
|
178
173
|
treasureRoom?: string; // RoomType.TREASURE (4)
|
|
179
174
|
|
|
@@ -182,8 +177,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
182
177
|
* for the floor.
|
|
183
178
|
*
|
|
184
179
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
185
|
-
* located at: `
|
|
186
|
-
* Rebirth\resources\gfx\grid\door_10_bossroomdoor.png`
|
|
180
|
+
* located at: `resources/gfx/grid/door_10_bossroomdoor.png`
|
|
187
181
|
*/
|
|
188
182
|
bossRoom?: string; // RoomType.BOSS (5)
|
|
189
183
|
|
|
@@ -192,8 +186,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
192
186
|
* Super Secret Room doors for the floor.
|
|
193
187
|
*
|
|
194
188
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
195
|
-
* located at: `
|
|
196
|
-
* Rebirth\resources\gfx\grid\door_08_holeinwall.png`
|
|
189
|
+
* located at: `resources/gfx/grid/door_08_holeinwall.png`
|
|
197
190
|
*/
|
|
198
191
|
secretRoom?: string; // RoomType.SECRET (7) and RoomType.SUPER_SECRET (8)
|
|
199
192
|
|
|
@@ -202,8 +195,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
202
195
|
* the floor.
|
|
203
196
|
*
|
|
204
197
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
205
|
-
* located at: `
|
|
206
|
-
* Rebirth\resources\gfx\grid\door_05_arcaderoomdoor.png`
|
|
198
|
+
* located at: `resources/gfx/grid/door_05_arcaderoomdoor.png`
|
|
207
199
|
*/
|
|
208
200
|
arcade?: string; // RoomType.ARCADE (9)
|
|
209
201
|
|
|
@@ -212,8 +204,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
212
204
|
* for the floor.
|
|
213
205
|
*
|
|
214
206
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
215
|
-
* located at: `
|
|
216
|
-
* Rebirth\resources\gfx\grid\door_04_selfsacrificeroomdoor.png`
|
|
207
|
+
* located at: `resources/gfx/grid/door_04_selfsacrificeroomdoor.png`
|
|
217
208
|
*/
|
|
218
209
|
curseRoom?: string; // RoomType.CURSE (10)
|
|
219
210
|
|
|
@@ -222,8 +213,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
222
213
|
* Room doors for the floor.
|
|
223
214
|
*
|
|
224
215
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
225
|
-
* located at: `
|
|
226
|
-
* Rebirth\resources\gfx\grid\door_03_ambushroomdoor.png`
|
|
216
|
+
* located at: `resources/gfx/grid/door_03_ambushroomdoor.png`
|
|
227
217
|
*/
|
|
228
218
|
normalChallengeRoom?: string; // RoomType.CHALLENGE (11)
|
|
229
219
|
|
|
@@ -232,8 +222,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
232
222
|
* Room doors for the floor.
|
|
233
223
|
*
|
|
234
224
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
235
|
-
* located at: `
|
|
236
|
-
* Rebirth\resources\gfx\grid\door_09_bossambushroomdoor.png`
|
|
225
|
+
* located at: `resources/gfx/grid/door_09_bossambushroomdoor.png`
|
|
237
226
|
*/
|
|
238
227
|
bossChallengeRoom?: string; // RoomType.CHALLENGE (11)
|
|
239
228
|
|
|
@@ -242,8 +231,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
242
231
|
* for the floor.
|
|
243
232
|
*
|
|
244
233
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
245
|
-
* located at: `
|
|
246
|
-
* Rebirth\resources\gfx\grid\door_07_devilroomdoor.png`
|
|
234
|
+
* located at: `resources/gfx/grid/door_07_devilroomdoor.png`
|
|
247
235
|
*/
|
|
248
236
|
devilRoom?: string; // RoomType.DEVIL (14)
|
|
249
237
|
|
|
@@ -252,8 +240,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
252
240
|
* for the floor.
|
|
253
241
|
*
|
|
254
242
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
255
|
-
* located at: `
|
|
256
|
-
* Rebirth\resources\gfx\grid\door_07_holyroomdoor.png`
|
|
243
|
+
* located at: `resources/gfx/grid/door_07_holyroomdoor.png`
|
|
257
244
|
*/
|
|
258
245
|
angelRoom?: string; // RoomType.ANGEL (15)
|
|
259
246
|
|
|
@@ -262,8 +249,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
262
249
|
* for the floor.
|
|
263
250
|
*
|
|
264
251
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
265
|
-
* located at: `
|
|
266
|
-
* Rebirth\resources\gfx\grid\door_15_bossrushdoor.png`
|
|
252
|
+
* located at: `resources/gfx/grid/door_15_bossrushdoor.png`
|
|
267
253
|
*/
|
|
268
254
|
bossRush?: string; // RoomType.BOSS_RUSH (17)
|
|
269
255
|
|
|
@@ -272,8 +258,7 @@ export type CustomStageTSConfig = Readonly<{
|
|
|
272
258
|
* for the floor.
|
|
273
259
|
*
|
|
274
260
|
* If not specified, the vanilla Basement door spritesheet will be used. For reference, this is
|
|
275
|
-
* located at: `
|
|
276
|
-
* Rebirth\resources\gfx\grid\door_02b_chestroomdoor.png`
|
|
261
|
+
* located at: `resources/gfx/grid/door_02b_chestroomdoor.png`
|
|
277
262
|
*/
|
|
278
263
|
chestRoom?: string; // RoomType.CHEST (20)
|
|
279
264
|
}>;
|
|
@@ -410,9 +395,8 @@ export type CustomStageShadow = Readonly<{
|
|
|
410
395
|
/**
|
|
411
396
|
* The full path to the shadow overlay PNG file.
|
|
412
397
|
*
|
|
413
|
-
* For an example of a vanilla shadow overlay, see:
|
|
414
|
-
*
|
|
415
|
-
* Rebirth\resources\gfx\overlays\basement\1x1_overlay_1.png`
|
|
398
|
+
* For an example of a vanilla shadow overlay, see:
|
|
399
|
+
* `resources/gfx/overlays/basement/1x1_overlay_1.png`
|
|
416
400
|
*/
|
|
417
401
|
pngPath: string;
|
|
418
402
|
|