isaacscript-common 7.4.3 → 7.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 (183) hide show
  1. package/dist/callbacks/postGridEntity.d.ts.map +1 -1
  2. package/dist/callbacks/postGridEntity.lua +53 -6
  3. package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
  4. package/dist/callbacks/postPlayerChangeStat.lua +9 -2
  5. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts +1 -0
  6. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts.map +1 -1
  7. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.lua +5 -2
  8. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts +9 -0
  9. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts.map +1 -0
  10. package/dist/callbacks/subscriptions/postGridEntityCustomInit.lua +23 -0
  11. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts +9 -0
  12. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts.map +1 -0
  13. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.lua +23 -0
  14. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts +9 -0
  15. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts.map +1 -0
  16. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.lua +29 -0
  17. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +3 -2
  18. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -1
  19. package/dist/classes/DefaultMap.d.ts +3 -2
  20. package/dist/classes/DefaultMap.d.ts.map +1 -1
  21. package/dist/classes/DefaultMap.lua +2 -1
  22. package/dist/enums/ModCallbackCustom.d.ts +131 -81
  23. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  24. package/dist/enums/ModCallbackCustom.lua +67 -61
  25. package/dist/enums/StatType.d.ts +3 -1
  26. package/dist/enums/StatType.d.ts.map +1 -1
  27. package/dist/enums/StatType.lua +2 -0
  28. package/dist/features/customGridEntity.d.ts +30 -13
  29. package/dist/features/customGridEntity.d.ts.map +1 -1
  30. package/dist/features/customGridEntity.lua +67 -48
  31. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  32. package/dist/features/customStage/customStageGridEntities.lua +46 -36
  33. package/dist/features/customStage/customStageUtils.d.ts +2 -1
  34. package/dist/features/customStage/customStageUtils.d.ts.map +1 -1
  35. package/dist/features/customStage/customStageUtils.lua +40 -1
  36. package/dist/features/customStage/exports.d.ts +1 -25
  37. package/dist/features/customStage/exports.d.ts.map +1 -1
  38. package/dist/features/customStage/exports.lua +28 -29
  39. package/dist/features/customStage/v.d.ts +0 -2
  40. package/dist/features/customStage/v.d.ts.map +1 -1
  41. package/dist/features/customStage/v.lua +0 -2
  42. package/dist/features/customStage/versusScreen.d.ts.map +1 -1
  43. package/dist/features/customStage/versusScreen.lua +74 -60
  44. package/dist/features/customTrapdoor/exports.d.ts +28 -16
  45. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  46. package/dist/features/customTrapdoor/exports.lua +45 -61
  47. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  48. package/dist/features/customTrapdoor/init.lua +12 -10
  49. package/dist/features/customTrapdoor/spawn.d.ts +6 -0
  50. package/dist/features/customTrapdoor/spawn.d.ts.map +1 -0
  51. package/dist/features/customTrapdoor/spawn.lua +52 -0
  52. package/dist/features/customTrapdoor/v.d.ts +2 -2
  53. package/dist/features/customTrapdoor/v.d.ts.map +1 -1
  54. package/dist/functions/dev.d.ts +20 -0
  55. package/dist/functions/dev.d.ts.map +1 -0
  56. package/dist/functions/dev.lua +34 -0
  57. package/dist/functions/doors.d.ts +6 -5
  58. package/dist/functions/doors.d.ts.map +1 -1
  59. package/dist/functions/doors.lua +25 -12
  60. package/dist/functions/enums.d.ts +3 -3
  61. package/dist/functions/enums.lua +3 -3
  62. package/dist/functions/playerStats.d.ts.map +1 -1
  63. package/dist/functions/playerStats.lua +2 -1
  64. package/dist/functions/players.d.ts.map +1 -1
  65. package/dist/functions/players.lua +3 -2
  66. package/dist/functions/rooms.d.ts +5 -0
  67. package/dist/functions/rooms.d.ts.map +1 -1
  68. package/dist/functions/rooms.lua +12 -2
  69. package/dist/index.d.ts +172 -11037
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.lua +1134 -8
  72. package/dist/interfaces/{CustomStageLua.d.ts → CustomStageTSConfig.d.ts} +86 -60
  73. package/dist/interfaces/CustomStageTSConfig.d.ts.map +1 -0
  74. package/dist/interfaces/{CustomStageLua.lua → CustomStageTSConfig.lua} +0 -0
  75. package/dist/interfaces/JSONRoomsFile.d.ts +6 -5
  76. package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
  77. package/dist/interfaces/StatTypeType.d.ts +1 -0
  78. package/dist/interfaces/StatTypeType.d.ts.map +1 -1
  79. package/dist/interfaces/private/AddCallbackParameterCustom.d.ts +6 -0
  80. package/dist/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
  81. package/dist/interfaces/private/CustomStage.d.ts +1 -1
  82. package/dist/interfaces/private/CustomStage.d.ts.map +1 -1
  83. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +2 -2
  84. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  85. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts +14 -0
  86. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts.map +1 -0
  87. package/dist/interfaces/{index.lua → private/CustomTrapdoorDestination.lua} +0 -0
  88. package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
  89. package/dist/objects/callbackRegisterFunctions.lua +9 -0
  90. package/dist/types/PossibleStatType.d.ts +7 -0
  91. package/dist/types/PossibleStatType.d.ts.map +1 -0
  92. package/dist/types/{TrapdoorDestination.lua → PossibleStatType.lua} +0 -0
  93. package/package.json +1 -1
  94. package/src/callbacks/postGridEntity.ts +75 -10
  95. package/src/callbacks/postPlayerChangeStat.ts +8 -4
  96. package/src/callbacks/subscriptions/postGridEntityCustomBroken.ts +4 -0
  97. package/src/callbacks/subscriptions/postGridEntityCustomInit.ts +38 -0
  98. package/src/callbacks/subscriptions/postGridEntityCustomRemove.ts +35 -0
  99. package/src/callbacks/subscriptions/postGridEntityCustomStateChanged.ts +42 -0
  100. package/src/callbacks/subscriptions/postPlayerChangeStat.ts +4 -7
  101. package/src/classes/DefaultMap.ts +3 -2
  102. package/src/enums/ModCallbackCustom.ts +73 -20
  103. package/src/enums/StatType.ts +3 -3
  104. package/src/features/customGridEntity.ts +87 -61
  105. package/src/features/customStage/customStageGridEntities.ts +36 -23
  106. package/src/features/customStage/customStageUtils.ts +52 -1
  107. package/src/features/customStage/exports.ts +33 -45
  108. package/src/features/customStage/init.ts +1 -1
  109. package/src/features/customStage/v.ts +0 -6
  110. package/src/features/customStage/versusScreen.ts +70 -55
  111. package/src/features/customTrapdoor/exports.ts +60 -66
  112. package/src/features/customTrapdoor/init.ts +12 -11
  113. package/src/features/customTrapdoor/spawn.ts +54 -0
  114. package/src/features/customTrapdoor/v.ts +2 -2
  115. package/src/functions/dev.ts +31 -0
  116. package/src/functions/doors.ts +37 -21
  117. package/src/functions/enums.ts +3 -3
  118. package/src/functions/playerStats.ts +1 -0
  119. package/src/functions/players.ts +7 -3
  120. package/src/functions/rooms.ts +18 -0
  121. package/src/index.ts +207 -9
  122. package/src/interfaces/{CustomStageLua.ts → CustomStageTSConfig.ts} +107 -41
  123. package/src/interfaces/JSONRoomsFile.ts +6 -5
  124. package/src/interfaces/StatTypeType.ts +1 -0
  125. package/src/interfaces/private/AddCallbackParameterCustom.ts +6 -0
  126. package/src/interfaces/private/CustomStage.ts +4 -1
  127. package/src/interfaces/private/CustomTrapdoorDescription.ts +2 -2
  128. package/src/interfaces/private/CustomTrapdoorDestination.ts +14 -0
  129. package/src/objects/callbackRegisterFunctions.ts +9 -0
  130. package/src/types/PossibleStatType.ts +12 -0
  131. package/dist/classes/index.d.ts +0 -3
  132. package/dist/classes/index.d.ts.map +0 -1
  133. package/dist/classes/index.lua +0 -18
  134. package/dist/core/index.d.ts +0 -5
  135. package/dist/core/index.d.ts.map +0 -1
  136. package/dist/core/index.lua +0 -34
  137. package/dist/enums/DecorationVariant.d.ts +0 -10
  138. package/dist/enums/DecorationVariant.d.ts.map +0 -1
  139. package/dist/enums/DecorationVariant.lua +0 -7
  140. package/dist/enums/index.d.ts +0 -11
  141. package/dist/enums/index.d.ts.map +0 -1
  142. package/dist/enums/index.lua +0 -82
  143. package/dist/features/index.d.ts +0 -30
  144. package/dist/features/index.d.ts.map +0 -1
  145. package/dist/features/index.lua +0 -216
  146. package/dist/functions/index.d.ts +0 -100
  147. package/dist/functions/index.d.ts.map +0 -1
  148. package/dist/functions/index.lua +0 -794
  149. package/dist/interfaces/CustomStageLua.d.ts.map +0 -1
  150. package/dist/interfaces/index.d.ts +0 -12
  151. package/dist/interfaces/index.d.ts.map +0 -1
  152. package/dist/maps/index.d.ts +0 -5
  153. package/dist/maps/index.d.ts.map +0 -1
  154. package/dist/maps/index.lua +0 -34
  155. package/dist/objects/index.d.ts +0 -2
  156. package/dist/objects/index.d.ts.map +0 -1
  157. package/dist/objects/index.lua +0 -10
  158. package/dist/types/TrapdoorDestination.d.ts +0 -6
  159. package/dist/types/TrapdoorDestination.d.ts.map +0 -1
  160. package/dist/types/index.d.ts +0 -11
  161. package/dist/types/index.d.ts.map +0 -1
  162. package/dist/types/index.lua +0 -10
  163. package/src/classes/index.ts +0 -2
  164. package/src/classes/indexTypeDoc.ts +0 -2
  165. package/src/core/index.ts +0 -4
  166. package/src/core/indexTypeDoc.ts +0 -4
  167. package/src/enums/DecorationVariant.ts +0 -10
  168. package/src/enums/index.ts +0 -10
  169. package/src/enums/indexTypeDoc.ts +0 -10
  170. package/src/features/index.ts +0 -59
  171. package/src/features/indexTypeDoc.ts +0 -30
  172. package/src/functions/index.ts +0 -101
  173. package/src/functions/indexTypeDoc.ts +0 -101
  174. package/src/indexTypeDoc.ts +0 -13
  175. package/src/interfaces/index.ts +0 -11
  176. package/src/interfaces/indexTypeDoc.ts +0 -11
  177. package/src/maps/index.ts +0 -4
  178. package/src/maps/indexTypeDoc.ts +0 -4
  179. package/src/objects/index.ts +0 -1
  180. package/src/objects/indexTypeDoc.ts +0 -1
  181. package/src/types/TrapdoorDestination.ts +0 -8
  182. package/src/types/index.ts +0 -10
  183. package/src/types/indexTypeDoc.ts +0 -10
@@ -4,6 +4,7 @@ import {
4
4
  BossID,
5
5
  Dimension,
6
6
  DoorSlot,
7
+ DownpourRoomSubType,
7
8
  DungeonSubType,
8
9
  GridRoom,
9
10
  HomeRoomSubType,
@@ -425,6 +426,23 @@ export function inMinibossRoomOf(minibossID: MinibossID): boolean {
425
426
  );
426
427
  }
427
428
 
429
+ /**
430
+ * Helper function to check if the current room is a "mirror room" in Downpour or Dross. (These
431
+ * rooms are marked with a specific sub-type.)
432
+ */
433
+ export function inMirrorRoom(): boolean {
434
+ const room = game.GetRoom();
435
+ const roomType = room.GetType();
436
+ const roomStageID = getRoomStageID();
437
+ const roomSubType = getRoomSubType();
438
+
439
+ return (
440
+ roomType === RoomType.DEFAULT &&
441
+ (roomStageID === StageID.DOWNPOUR || roomStageID === StageID.DROSS) &&
442
+ roomSubType === asNumber(DownpourRoomSubType.MIRROR)
443
+ );
444
+ }
445
+
428
446
  /**
429
447
  * Helper function for checking if the room is a secret shop (from the Member Card collectible).
430
448
  *
package/src/index.ts CHANGED
@@ -1,9 +1,207 @@
1
- export * from "./classes/index";
2
- export * from "./core/index";
3
- export * from "./enums/index";
4
- export * from "./features/index";
5
- export * from "./functions/index";
6
- export * from "./interfaces/index";
7
- export * from "./maps/index";
8
- export * from "./objects/index";
9
- export * from "./types/index";
1
+ export * from "./classes/DefaultMap";
2
+ export * from "./classes/ModUpgraded";
3
+ export * from "./core/cachedClasses";
4
+ export * from "./core/constants";
5
+ export * from "./core/constantsFirstLast";
6
+ export * from "./core/upgradeMod";
7
+ export * from "./enums/AmbushType";
8
+ export * from "./enums/CornerType";
9
+ export * from "./enums/HealthType";
10
+ export * from "./enums/ModCallbackCustom";
11
+ export * from "./enums/PocketItemType";
12
+ export * from "./enums/RockAltType";
13
+ export * from "./enums/SaveDataKey";
14
+ export * from "./enums/SerializationType";
15
+ export * from "./enums/SlotDestructionType";
16
+ export * from "./enums/StatType";
17
+ export {
18
+ ConversionHeartSubType,
19
+ registerCharacterHealthConversion,
20
+ } from "./features/characterHealthConversion";
21
+ export { registerCharacterStats } from "./features/characterStats";
22
+ export { getCollectibleItemPoolType } from "./features/collectibleItemPoolType";
23
+ export { initCustomDoor, spawnCustomDoor } from "./features/customDoor";
24
+ export {
25
+ removeCustomGridEntity,
26
+ spawnCustomGridEntity,
27
+ } from "./features/customGridEntity";
28
+ export * from "./features/customStage/exports";
29
+ export * from "./features/customTrapdoor/exports";
30
+ export * from "./features/debugDisplay/exports";
31
+ export {
32
+ deployJSONRoom,
33
+ deployRandomJSONRoom,
34
+ emptyRoom,
35
+ } from "./features/deployJSONRoom";
36
+ export { disableAllSound, enableAllSound } from "./features/disableAllSound";
37
+ export {
38
+ disableAllInputs,
39
+ disableAllInputsExceptFor,
40
+ disableMovementInputs,
41
+ disableShootingInputs,
42
+ enableAllInputs,
43
+ enableAllInputsExceptFor,
44
+ } from "./features/disableInputs";
45
+ export * from "./features/extraConsoleCommands/exports";
46
+ export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
47
+ export { disableFastReset, enableFastReset } from "./features/fastReset";
48
+ export { forgottenSwitch } from "./features/forgottenSwitch";
49
+ export { pause, unpause } from "./features/pause";
50
+ export {
51
+ removePersistentEntity,
52
+ spawnPersistentEntity,
53
+ } from "./features/persistentEntities";
54
+ export * from "./features/pickupIndex";
55
+ export { getPlayerInventory } from "./features/playerInventory";
56
+ export {
57
+ anyPlayerUsingPony,
58
+ isPlayerUsingPony,
59
+ } from "./features/ponyDetection";
60
+ export { preventCollectibleRotation } from "./features/preventCollectibleRotation";
61
+ export { registerHotkey, unregisterHotkey } from "./features/registerHotkey";
62
+ export {
63
+ getRoomClearGameFrame,
64
+ getRoomClearRoomFrame,
65
+ } from "./features/roomClearFrame";
66
+ export * from "./features/roomHistory";
67
+ export {
68
+ runInNGameFrames,
69
+ runInNRenderFrames,
70
+ runNextGameFrame,
71
+ runNextRenderFrame,
72
+ setIntervalGameFrames,
73
+ setIntervalRenderFrames,
74
+ } from "./features/runInNFrames";
75
+ export * from "./features/saveDataManager/exports";
76
+ export {
77
+ hasSirenStolenFamiliar,
78
+ setFamiliarNoSirenSteal,
79
+ } from "./features/sirenHelpers";
80
+ export { getStageHistory, hasVisitedStage } from "./features/stageHistory";
81
+ export { getTaintedLazarusSubPlayer } from "./features/taintedLazarusPlayers";
82
+ export * from "./functions/ambush";
83
+ export * from "./functions/array";
84
+ export * from "./functions/benchmark";
85
+ export * from "./functions/bitSet128";
86
+ export * from "./functions/bitwise";
87
+ export * from "./functions/bombs";
88
+ export * from "./functions/bosses";
89
+ export * from "./functions/cacheFlag";
90
+ export * from "./functions/cards";
91
+ export * from "./functions/challenges";
92
+ export * from "./functions/characters";
93
+ export * from "./functions/charge";
94
+ export * from "./functions/chargeBar";
95
+ export * from "./functions/collectibles";
96
+ export * from "./functions/collectibleSet";
97
+ export * from "./functions/collectibleTag";
98
+ export * from "./functions/color";
99
+ export * from "./functions/curses";
100
+ export * from "./functions/debug";
101
+ export * from "./functions/deepCopy";
102
+ export * from "./functions/deepCopyTests";
103
+ export * from "./functions/dev";
104
+ export * from "./functions/dimensions";
105
+ export * from "./functions/direction";
106
+ export * from "./functions/doors";
107
+ export * from "./functions/easing";
108
+ export * from "./functions/eden";
109
+ export * from "./functions/effects";
110
+ export * from "./functions/entities";
111
+ export * from "./functions/entitiesSpecific";
112
+ export * from "./functions/entityTypes";
113
+ export * from "./functions/enums";
114
+ export * from "./functions/familiars";
115
+ export * from "./functions/flag";
116
+ export * from "./functions/flying";
117
+ export * from "./functions/globals";
118
+ export * from "./functions/gridEntities";
119
+ export * from "./functions/gridEntitiesSpecific";
120
+ export * from "./functions/input";
121
+ export * from "./functions/isaacAPIClass";
122
+ export * from "./functions/itemPool";
123
+ export * from "./functions/jsonHelpers";
124
+ export * from "./functions/jsonRoom";
125
+ export * from "./functions/kColor";
126
+ export * from "./functions/language";
127
+ export * from "./functions/level";
128
+ export * from "./functions/levelGrid";
129
+ export * from "./functions/log";
130
+ export * from "./functions/logEntities";
131
+ export * from "./functions/map";
132
+ export * from "./functions/math";
133
+ export * from "./functions/mergeTests";
134
+ export * from "./functions/minimap";
135
+ export * from "./functions/nextStage";
136
+ export * from "./functions/npcs";
137
+ export * from "./functions/pickups";
138
+ export * from "./functions/pickupsSpecific";
139
+ export * from "./functions/pickupVariants";
140
+ export * from "./functions/pills";
141
+ export * from "./functions/playerCenter";
142
+ export * from "./functions/playerDataStructures";
143
+ export * from "./functions/playerHealth";
144
+ export * from "./functions/playerIndex";
145
+ export * from "./functions/players";
146
+ export * from "./functions/playerStats";
147
+ export * from "./functions/pocketItems";
148
+ export * from "./functions/positionVelocity";
149
+ export * from "./functions/pressurePlate";
150
+ export * from "./functions/projectiles";
151
+ export * from "./functions/random";
152
+ export * from "./functions/reorderedCallbacks";
153
+ export * from "./functions/revive";
154
+ export * from "./functions/rng";
155
+ export * from "./functions/rockAlt";
156
+ export * from "./functions/roomData";
157
+ export * from "./functions/roomGrid";
158
+ export * from "./functions/rooms";
159
+ export * from "./functions/roomShape";
160
+ export * from "./functions/roomTransition";
161
+ export * from "./functions/run";
162
+ export * from "./functions/saveFile";
163
+ export * from "./functions/seeds";
164
+ export * from "./functions/serialization";
165
+ export * from "./functions/set";
166
+ export * from "./functions/sound";
167
+ export * from "./functions/spawnCollectible";
168
+ export * from "./functions/sprites";
169
+ export * from "./functions/stage";
170
+ export * from "./functions/string";
171
+ export * from "./functions/table";
172
+ export * from "./functions/tears";
173
+ export * from "./functions/transformations";
174
+ export * from "./functions/trinketCacheFlag";
175
+ export * from "./functions/trinketGive";
176
+ export * from "./functions/trinkets";
177
+ export * from "./functions/tstlClass";
178
+ export * from "./functions/types";
179
+ export * from "./functions/ui";
180
+ export * from "./functions/utils";
181
+ export * from "./functions/vector";
182
+ export * from "./interfaces/ChargeBarSprites";
183
+ export * from "./interfaces/Corner";
184
+ export * from "./interfaces/CustomStageTSConfig";
185
+ export * from "./interfaces/GridEntityCustomData";
186
+ export * from "./interfaces/JSONRoomsFile";
187
+ export * from "./interfaces/PlayerHealth";
188
+ export * from "./interfaces/PocketItemDescription";
189
+ export * from "./interfaces/RoomDescription";
190
+ export * from "./interfaces/SaveData";
191
+ export * from "./interfaces/StatTypeType";
192
+ export * from "./interfaces/TrinketSituation";
193
+ export * from "./maps/cardMap";
194
+ export * from "./maps/characterMap";
195
+ export * from "./maps/pillEffectMap";
196
+ export * from "./maps/roomTypeMap";
197
+ export * from "./objects/colors";
198
+ export * from "./types/AnyEntity";
199
+ export * from "./types/AnyGridEntity";
200
+ export * from "./types/CollectibleIndex";
201
+ export * from "./types/Immutable";
202
+ export * from "./types/PickingUpItem";
203
+ export * from "./types/PickupIndex";
204
+ export * from "./types/PlayerIndex";
205
+ export * from "./types/PossibleStatType";
206
+ export * from "./types/SerializedIsaacAPIClass";
207
+ export * from "./types/TSTLClass";
@@ -9,8 +9,11 @@
9
9
  *
10
10
  * The `CustomStageLua` interface extends this, adding room metadata.
11
11
  */
12
+
13
+ import { Immutable } from "../types/Immutable";
14
+
12
15
  // ts-prune-ignore-next
13
- export type CustomStageTSConfig = Readonly<{
16
+ export interface CustomStageTSConfig {
14
17
  /** Mandatory. The name of the custom stage. */
15
18
  name: string;
16
19
 
@@ -38,8 +41,14 @@ export type CustomStageTSConfig = Readonly<{
38
41
  * number of the stage that will be warped to and used as a basis for the stage by the level
39
42
  * generation algorithm.
40
43
  *
41
- * (It is not possible to use Basement 1 as a base stage due to conflicts with the `Game.SetStage`
42
- * method.)
44
+ * For example, if you wanted to have a custom stage with a small amount of rooms per floor, then
45
+ * you should choose 2 as a base. (This would copy the number of rooms that would appear in
46
+ * Basement 2.) And if you wanted to have a custom stage with the maximum amount of rooms, then
47
+ * you should choose 13 as a base. (This would copy the number of rooms that would appear on The
48
+ * Void.)
49
+ *
50
+ * It is not possible to use Basement 1 as a base stage due to conflicts with the `Game.SetStage`
51
+ * method.
43
52
  *
44
53
  * If not specified, `LevelStage.BASEMENT_2` (2) will be used.
45
54
  *
@@ -65,7 +74,7 @@ export type CustomStageTSConfig = Readonly<{
65
74
  * the graphics for the walls and floor.) If not specified, the graphics for Basement will be
66
75
  * used.
67
76
  */
68
- backdropPNGPaths?: Readonly<{
77
+ backdropPNGPaths?: {
69
78
  /**
70
79
  * An array that contains the full paths to the graphic files that are used for the floor in
71
80
  * narrow rooms. (The "n" stands for "narrow").
@@ -75,7 +84,7 @@ export type CustomStageTSConfig = Readonly<{
75
84
  *
76
85
  * For an example of this, see the vanilla file "resources/gfx/backdrop/01_basement_nfloor.png".
77
86
  */
78
- nFloors: readonly string[];
87
+ nFloors: string[];
79
88
 
80
89
  /**
81
90
  * An array that contains the full paths to the graphic files that are used for the floor in L
@@ -86,7 +95,7 @@ export type CustomStageTSConfig = Readonly<{
86
95
  *
87
96
  * For an example of this, see the vanilla file "resources/gfx/backdrop/01_lbasementfloor.png".
88
97
  */
89
- lFloors: readonly string[];
98
+ lFloors: string[];
90
99
 
91
100
  /**
92
101
  * An array that contains the full paths to the graphic files that are used for the walls of the
@@ -99,7 +108,7 @@ export type CustomStageTSConfig = Readonly<{
99
108
  * the vanilla file, they concatenate all four variations together into one PNG file. However,
100
109
  * for the custom stages feature, you must separate each wall variation into a separate file.)
101
110
  */
102
- walls: readonly string[];
111
+ walls: string[];
103
112
 
104
113
  /**
105
114
  * An array that contains the full paths to the graphic files for the stage's corners.
@@ -114,8 +123,8 @@ export type CustomStageTSConfig = Readonly<{
114
123
  * you must separate each corner variation into a separate file (and put it in a different file
115
124
  * from the walls).
116
125
  */
117
- corners: readonly string[];
118
- }>;
126
+ corners: string[];
127
+ };
119
128
 
120
129
  /**
121
130
  * Optional. The full path to the spritesheet that contains the graphics of the decorations for
@@ -153,7 +162,7 @@ export type CustomStageTSConfig = Readonly<{
153
162
  * Optional. A collection of paths that contain graphics for the doors of the floor. If not
154
163
  * specified, the doors for Basement will be used.
155
164
  */
156
- doorPNGPaths?: Readonly<{
165
+ doorPNGPaths?: {
157
166
  /**
158
167
  * Optional. The full path to the spritesheet that contains the graphics of the normal doors for
159
168
  * the floor.
@@ -261,7 +270,7 @@ export type CustomStageTSConfig = Readonly<{
261
270
  * located at: `resources/gfx/grid/door_02b_chestroomdoor.png`
262
271
  */
263
272
  chestRoom?: string; // RoomType.CHEST (20)
264
- }>;
273
+ };
265
274
 
266
275
  /**
267
276
  * Optional. An array of shadow objects that describe the graphics for the custom shadows of the
@@ -269,7 +278,7 @@ export type CustomStageTSConfig = Readonly<{
269
278
  * Basement, a shadow of a sideways V is used, among others.) If not specified, no extra shadows
270
279
  * will be drawn.
271
280
  */
272
- shadows?: Readonly<{
281
+ shadows?: {
273
282
  /**
274
283
  * Optional. An array containing the shadows that will be used in rooms of shape
275
284
  * `RoomShape.SHAPE_1x1` (1), `RoomShape.IH` (2), and `RoomShape.IV` (3).
@@ -278,7 +287,7 @@ export type CustomStageTSConfig = Readonly<{
278
287
  *
279
288
  * If not specified, no extra shadows will be drawn in these room shapes.
280
289
  */
281
- "1x1"?: readonly CustomStageShadow[];
290
+ "1x1"?: CustomStageShadow[];
282
291
 
283
292
  /**
284
293
  * Optional. An array containing the shadows that will be used in rooms of shape
@@ -288,7 +297,7 @@ export type CustomStageTSConfig = Readonly<{
288
297
  *
289
298
  * If not specified, no extra shadows will be drawn in these room shapes.
290
299
  */
291
- "1x2"?: readonly CustomStageShadow[];
300
+ "1x2"?: CustomStageShadow[];
292
301
 
293
302
  /**
294
303
  * Optional. An array containing the shadows that will be used in rooms of shape
@@ -298,7 +307,7 @@ export type CustomStageTSConfig = Readonly<{
298
307
  *
299
308
  * If not specified, no extra shadows will be drawn in these room shapes.
300
309
  */
301
- "2x1"?: readonly CustomStageShadow[];
310
+ "2x1"?: CustomStageShadow[];
302
311
 
303
312
  /**
304
313
  * Optional. An array containing the shadows that will be used in rooms of shape
@@ -309,14 +318,22 @@ export type CustomStageTSConfig = Readonly<{
309
318
  *
310
319
  * If not specified, no extra shadows will be drawn in these room shapes.
311
320
  */
312
- "2x2"?: readonly CustomStageShadow[];
313
- }>;
321
+ "2x2"?: CustomStageShadow[];
322
+ };
314
323
 
315
- /** Optional. An array containing the bosses that should be used for the stage. */
316
- bossPool?: readonly CustomStageBossPoolEntry[];
324
+ /**
325
+ * Optional. An array containing the bosses that should be used for the stage. This can include
326
+ * both vanilla bosses and modded bosses.
327
+ */
328
+ bossPool?: CustomStageBossPoolEntry[];
317
329
 
318
- /** Optional. A collection of colors used in the boss "versus" screen. */
319
- versusScreen?: Readonly<{
330
+ /**
331
+ * Optional. A collection of colors used for in the boss "versus" screen for all of the bosses.
332
+ *
333
+ * Note that these graphics will only be applied if one or more bosses are specified in the
334
+ * `bossPool` field.
335
+ */
336
+ versusScreen?: {
320
337
  /**
321
338
  * Optional. An object representing the color to use for the background of the boss "versus"
322
339
  * screen. If not specified, the color for Basement 1 will be used.
@@ -324,7 +341,7 @@ export type CustomStageTSConfig = Readonly<{
324
341
  * For a list of the colors that correspond to the vanilla stages, see
325
342
  * `versusScreenBackgroundColors.ts`.
326
343
  */
327
- backgroundColor?: Readonly<{
344
+ backgroundColor?: {
328
345
  /**
329
346
  * @minimum 0
330
347
  * @maximum 1
@@ -348,7 +365,7 @@ export type CustomStageTSConfig = Readonly<{
348
365
  * @maximum 1
349
366
  */
350
367
  a: number;
351
- }>;
368
+ };
352
369
 
353
370
  /**
354
371
  * Optional. An object representing the color to use for the dirt spots in the boss "versus"
@@ -358,7 +375,7 @@ export type CustomStageTSConfig = Readonly<{
358
375
  * For a list of the colors that correspond to the vanilla stages, see
359
376
  * `versusScreenDirtSpotColors.ts`.
360
377
  */
361
- dirtSpotColor?: Readonly<{
378
+ dirtSpotColor?: {
362
379
  /**
363
380
  * @minimum 0
364
381
  * @maximum 1
@@ -382,16 +399,16 @@ export type CustomStageTSConfig = Readonly<{
382
399
  * @maximum 1
383
400
  */
384
401
  a: number;
385
- }>;
386
- }>;
387
- }>;
402
+ };
403
+ };
404
+ }
388
405
 
389
406
  /**
390
407
  * A description of a custom stage shadow. (In this context, "shadows" are the outlines from things
391
408
  * on the roof. For example, in Basement, a shadow of a sideways V is used, among others.)
392
409
  */
393
410
  // ts-prune-ignore-next
394
- export type CustomStageShadow = Readonly<{
411
+ export interface CustomStageShadow {
395
412
  /**
396
413
  * The full path to the shadow overlay PNG file.
397
414
  *
@@ -406,7 +423,7 @@ export type CustomStageShadow = Readonly<{
406
423
  * If not specified, an object of `{ r: 0, g: 0, b: 0, a: 0.25 }` will be used (which corresponds
407
424
  * to 75% faded black).
408
425
  */
409
- color?: Readonly<{
426
+ color?: {
410
427
  /**
411
428
  * @minimum 0
412
429
  * @maximum 1
@@ -430,27 +447,66 @@ export type CustomStageShadow = Readonly<{
430
447
  * @maximum 1
431
448
  */
432
449
  a: number;
433
- }>;
434
- }>;
450
+ };
451
+ }
435
452
 
436
- /** An object that represents a possible boss for a custom stage. */
453
+ /**
454
+ * An object that represents a possible boss for a custom stage. This can be for a vanilla boss or a
455
+ * custom boss.
456
+ */
437
457
  // ts-prune-ignore-next
438
458
  export interface CustomStageBossPoolEntry {
439
459
  /**
440
- * The name of the boss. This must correspond to the entry in "entities2.xml".
441
- *
442
- * Note that since there is no way to determine the corresponding `EntityType` of the boss during
443
- * compile-time, you must specify the `EntityType` at run-time when your mod first loads using the
444
- * `registerCustomBoss` helper function.
460
+ * The name of the boss. This should correspond to the entry for the boss in the "entities2.xml"
461
+ * file.
445
462
  */
446
463
  name: string;
447
464
 
465
+ /**
466
+ * The arbitrary sub-type chosen for this boss, ranging between 1 and 999. You must set the boss
467
+ * rooms for this boss to this sub-type in Basement Renovator by right-clicking on the room on the
468
+ * right-hand-side.
469
+ *
470
+ * It does not matter if the arbitrary sub-type overlaps with any of the vanilla `BossID` values
471
+ * (e.g. vanilla Boss Room sub-types in "00.special_rooms.stb"). It also does not matter if this
472
+ * value overlaps with the values from other mods.
473
+ *
474
+ * If you are creating an entry for a vanilla boss, it is recommended that you match the sub-type
475
+ * with the corresponding vanilla `BossID` value. This will make things a bit easier to understand
476
+ * for people working on your mod, but is not a hard requirement.
477
+ *
478
+ * @minimum 1
479
+ * @maximum 999
480
+ */
481
+ subType: number;
482
+
448
483
  /**
449
484
  * The weight of the boss. This is used when randomly selecting which boss to use for the floor.
450
485
  * For example, use a value of 1 if you want this boss to be equally likely as any other boss, 0.5
451
486
  * if you want it to be half as likely, 2 if you want it to be twice as likely, and so on.
452
487
  */
453
488
  weight: number;
489
+
490
+ /** Optional. A collection of sprites used for the boss on the "versus" screen. */
491
+ versusScreen?: {
492
+ // eslint-disable-next-line isaacscript/complete-sentences-jsdoc
493
+ /**
494
+ * Mandatory. The full path to the spritesheet that contains the graphics of the name of the
495
+ * boss that will be displayed on the top of the boss "versus" screen.
496
+ *
497
+ * If not specified, a sprite showing "???" will be used.
498
+ */
499
+ namePNGPath: string;
500
+
501
+ // eslint-disable-next-line isaacscript/complete-sentences-jsdoc
502
+ /**
503
+ * Mandatory. The full path to the spritesheet that contains the portrait of the boss that will
504
+ * be displayed on the right side of the boss "versus" screen.
505
+ *
506
+ * If not specified, a sprite showing "???" will be used.
507
+ */
508
+ portraitPNGPath: string;
509
+ };
454
510
  }
455
511
 
456
512
  /**
@@ -460,19 +516,29 @@ export interface CustomStageBossPoolEntry {
460
516
  *
461
517
  * The `CustomStage` interface extends this, adding more data.
462
518
  */
463
- export interface CustomStageLua extends CustomStageTSConfig {
464
- readonly roomsMetadata: readonly CustomStageRoomMetadata[];
519
+ interface CustomStageLuaUnsafe extends CustomStageTSConfig {
520
+ /**
521
+ * This contains metadata about each room in a custom stage, which is used at run-time.
522
+ * (Internally, the IsaacScript standard library uses this as a basis for determining which rooms
523
+ * should randomly appear on the floor.)
524
+ */
525
+ roomsMetadata: CustomStageRoomMetadata[];
465
526
  }
466
527
 
528
+ /** @internal */
529
+ export type CustomStageLua = Immutable<CustomStageLuaUnsafe>;
530
+
467
531
  /**
468
532
  * Metadata about a custom stage room. Each custom stage object contains an array with metadata for
469
533
  * each room.
534
+ *
535
+ * @internal
470
536
  */
471
- export type CustomStageRoomMetadata = Readonly<{
537
+ export interface CustomStageRoomMetadata {
472
538
  type: number;
473
539
  variant: number;
474
540
  subType: number;
475
541
  shape: number;
476
542
  doorSlotFlags: number;
477
543
  weight: number;
478
- }>;
544
+ }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The standard library has the feature to deploy a new room on-the-fly with the `deployJSONRoom`
3
3
  * helper function. It requires a `JSONRoomsFile` as an argument, which is simply an XML file
4
- * converted to JSON. (You create XML room files using the Basement Renovator program.)
4
+ * converted to JSON. (You can create XML room files using the Basement Renovator program.)
5
5
  *
6
6
  * You can convert your XML files using the following command:
7
7
  *
@@ -17,11 +17,12 @@ export interface JSONRoomsFile {
17
17
  rooms: JSONRooms;
18
18
  }
19
19
 
20
+ /** Part of `JSONRoomsFile`. */
20
21
  export interface JSONRooms {
21
22
  room: JSONRoom[];
22
23
  }
23
24
 
24
- /** Part of `JSONRooms`. */
25
+ /** Part of `JSONRoomsFile`. */
25
26
  export interface JSONRoom {
26
27
  $: {
27
28
  /** Needs to be converted to an `int`. */
@@ -55,7 +56,7 @@ export interface JSONRoom {
55
56
  spawn: JSONSpawn[];
56
57
  }
57
58
 
58
- /** Part of `JSONRooms`. */
59
+ /** Part of `JSONRoomsFile`. */
59
60
  export interface JSONDoor {
60
61
  $: {
61
62
  /** Equal to "True" or "False". Needs to be converted to an `boolean`. */
@@ -69,7 +70,7 @@ export interface JSONDoor {
69
70
  };
70
71
  }
71
72
 
72
- /** Part of `JSONRooms`. */
73
+ /** Part of `JSONRoomsFile`. */
73
74
  export interface JSONSpawn {
74
75
  $: {
75
76
  /** Needs to be converted to an `int`. */
@@ -82,7 +83,7 @@ export interface JSONSpawn {
82
83
  entity: JSONEntity[];
83
84
  }
84
85
 
85
- /** Part of `JSONRooms`. */
86
+ /** Part of `JSONRoomsFile`. */
86
87
  export interface JSONEntity {
87
88
  $: {
88
89
  /** Needs to be converted to an `int`. */
@@ -18,4 +18,5 @@ export interface StatTypeType {
18
18
  [StatType.TEAR_COLOR]: Color;
19
19
  [StatType.FLYING]: boolean;
20
20
  [StatType.LUCK]: float;
21
+ [StatType.SIZE]: Vector;
21
22
  }
@@ -25,7 +25,10 @@ import { PostGridEntityBrokenRegisterParameters } from "../../callbacks/subscrip
25
25
  import { PostGridEntityCollisionRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCollision";
26
26
  import { PostGridEntityCustomBrokenRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomBroken";
27
27
  import { PostGridEntityCustomCollisionRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomCollision";
28
+ import { PostGridEntityCustomInitRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomInit";
29
+ import { PostGridEntityCustomRemoveRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomRemove";
28
30
  import { PostGridEntityCustomRenderRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomRender";
31
+ import { PostGridEntityCustomStateChangedRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomStateChanged";
29
32
  import { PostGridEntityCustomUpdateRegisterParameters } from "../../callbacks/subscriptions/postGridEntityCustomUpdate";
30
33
  import { PostGridEntityInitRegisterParameters } from "../../callbacks/subscriptions/postGridEntityInit";
31
34
  import { PostGridEntityRemoveRegisterParameters } from "../../callbacks/subscriptions/postGridEntityRemove";
@@ -116,7 +119,10 @@ export interface AddCallbackParameterCustom {
116
119
  [ModCallbackCustom.POST_GRID_ENTITY_COLLISION]: PostGridEntityCollisionRegisterParameters;
117
120
  [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN]: PostGridEntityCustomBrokenRegisterParameters;
118
121
  [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION]: PostGridEntityCustomCollisionRegisterParameters;
122
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_INIT]: PostGridEntityCustomInitRegisterParameters;
123
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE]: PostGridEntityCustomRemoveRegisterParameters;
119
124
  [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]: PostGridEntityCustomRenderRegisterParameters;
125
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED]: PostGridEntityCustomStateChangedRegisterParameters;
120
126
  [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]: PostGridEntityCustomUpdateRegisterParameters;
121
127
  [ModCallbackCustom.POST_GRID_ENTITY_INIT]: PostGridEntityInitRegisterParameters;
122
128
  [ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: PostGridEntityRemoveRegisterParameters;
@@ -3,7 +3,10 @@ import {
3
3
  RoomShape,
4
4
  RoomType,
5
5
  } from "isaac-typescript-definitions";
6
- import { CustomStageLua, CustomStageRoomMetadata } from "../CustomStageLua";
6
+ import {
7
+ CustomStageLua,
8
+ CustomStageRoomMetadata,
9
+ } from "../CustomStageTSConfig";
7
10
 
8
11
  export interface CustomStage extends CustomStageLua {
9
12
  /** A map that makes it easier to select certain room type/shape/door combinations. */
@@ -1,7 +1,7 @@
1
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
1
+ import { CustomTrapdoorDestination } from "./CustomTrapdoorDestination";
2
2
 
3
3
  export interface CustomTrapdoorDescription {
4
4
  open: boolean;
5
- destination: TrapdoorDestination;
5
+ destination: CustomTrapdoorDestination;
6
6
  firstSpawn: boolean;
7
7
  }