isaacscript-common 6.11.2 → 6.14.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 (189) hide show
  1. package/dist/callbacks/postGridEntityCustomRender.d.ts +2 -0
  2. package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
  3. package/dist/callbacks/postGridEntityCustomRender.lua +36 -0
  4. package/dist/callbacks/postGridEntityCustomUpdate.d.ts +2 -0
  5. package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
  6. package/dist/callbacks/postGridEntityCustomUpdate.lua +36 -0
  7. package/dist/callbacks/postNewRoomEarly.lua +2 -2
  8. package/dist/callbacks/postPickupInitFirst.lua +1 -20
  9. package/dist/callbacks/reorderedCallbacks.d.ts +5 -5
  10. package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -1
  11. package/dist/callbacks/reorderedCallbacks.lua +5 -5
  12. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +6 -0
  13. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
  14. package/dist/callbacks/subscriptions/postGridEntityCustomRender.lua +29 -0
  15. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +6 -0
  16. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
  17. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.lua +29 -0
  18. package/dist/constants.d.ts +1 -5
  19. package/dist/constants.d.ts.map +1 -1
  20. package/dist/constants.lua +0 -7
  21. package/dist/constantsFirstLast.d.ts +5 -1
  22. package/dist/constantsFirstLast.d.ts.map +1 -1
  23. package/dist/constantsFirstLast.lua +6 -0
  24. package/dist/enums/ModCallbackCustom.d.ts +89 -66
  25. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  26. package/dist/enums/ModCallbackCustom.lua +62 -58
  27. package/dist/enums/private/SerializationBrand.d.ts +1 -1
  28. package/dist/enums/private/SerializationBrand.lua +1 -1
  29. package/dist/features/collectibleItemPoolType.d.ts +2 -2
  30. package/dist/features/collectibleItemPoolType.lua +2 -2
  31. package/dist/features/customGridEntity.d.ts +11 -2
  32. package/dist/features/customGridEntity.d.ts.map +1 -1
  33. package/dist/features/customGridEntity.lua +22 -2
  34. package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -1
  35. package/dist/features/customTrapdoor/blackSprite.lua +6 -6
  36. package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +2 -2
  37. package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -1
  38. package/dist/features/customTrapdoor/customTrapdoorConstants.lua +2 -2
  39. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  40. package/dist/features/customTrapdoor/init.lua +4 -3
  41. package/dist/features/customTrapdoor/touched.d.ts.map +1 -1
  42. package/dist/features/customTrapdoor/touched.lua +51 -33
  43. package/dist/features/deployJSONRoom.d.ts +2 -2
  44. package/dist/features/deployJSONRoom.lua +2 -2
  45. package/dist/features/extraConsoleCommands/exports.d.ts +4 -3
  46. package/dist/features/extraConsoleCommands/exports.d.ts.map +1 -1
  47. package/dist/features/extraConsoleCommands/exports.lua +4 -3
  48. package/dist/features/extraConsoleCommands/init.lua +12 -14
  49. package/dist/features/extraConsoleCommands/listCommands.d.ts +15 -19
  50. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  51. package/dist/features/extraConsoleCommands/listCommands.lua +34 -42
  52. package/dist/features/pause.d.ts +1 -1
  53. package/dist/features/pause.d.ts.map +1 -1
  54. package/dist/features/pause.lua +87 -8
  55. package/dist/features/persistentEntities.d.ts.map +1 -1
  56. package/dist/features/persistentEntities.lua +7 -7
  57. package/dist/features/pickupIndex.d.ts +19 -0
  58. package/dist/features/pickupIndex.d.ts.map +1 -0
  59. package/dist/features/pickupIndex.lua +197 -0
  60. package/dist/features/roomHistory.d.ts +24 -0
  61. package/dist/features/roomHistory.d.ts.map +1 -0
  62. package/dist/features/roomHistory.lua +89 -0
  63. package/dist/functions/collectibles.d.ts +26 -13
  64. package/dist/functions/collectibles.d.ts.map +1 -1
  65. package/dist/functions/collectibles.lua +26 -13
  66. package/dist/functions/color.d.ts +10 -0
  67. package/dist/functions/color.d.ts.map +1 -1
  68. package/dist/functions/color.lua +24 -0
  69. package/dist/functions/entities.d.ts +3 -3
  70. package/dist/functions/entities.d.ts.map +1 -1
  71. package/dist/functions/entities.lua +8 -3
  72. package/dist/functions/gridEntities.d.ts +4 -22
  73. package/dist/functions/gridEntities.d.ts.map +1 -1
  74. package/dist/functions/gridEntities.lua +4 -61
  75. package/dist/functions/isaacAPIClass.d.ts +64 -0
  76. package/dist/functions/isaacAPIClass.d.ts.map +1 -1
  77. package/dist/functions/isaacAPIClass.lua +84 -1
  78. package/dist/functions/kColor.d.ts +10 -0
  79. package/dist/functions/kColor.d.ts.map +1 -1
  80. package/dist/functions/kColor.lua +24 -0
  81. package/dist/functions/map.d.ts +2 -0
  82. package/dist/functions/map.d.ts.map +1 -1
  83. package/dist/functions/map.lua +7 -0
  84. package/dist/functions/npcs.d.ts +2 -2
  85. package/dist/functions/npcs.lua +2 -2
  86. package/dist/functions/pickupVariants.d.ts +2 -2
  87. package/dist/functions/pickupVariants.d.ts.map +1 -1
  88. package/dist/functions/pickupVariants.lua +2 -2
  89. package/dist/functions/playerCenter.lua +2 -2
  90. package/dist/functions/playerIndex.d.ts +0 -3
  91. package/dist/functions/playerIndex.d.ts.map +1 -1
  92. package/dist/functions/playerIndex.lua +4 -23
  93. package/dist/functions/random.d.ts +1 -1
  94. package/dist/functions/random.lua +1 -1
  95. package/dist/functions/rockAlt.d.ts +28 -0
  96. package/dist/functions/rockAlt.d.ts.map +1 -0
  97. package/dist/functions/rockAlt.lua +140 -0
  98. package/dist/functions/roomData.d.ts +3 -2
  99. package/dist/functions/roomData.d.ts.map +1 -1
  100. package/dist/functions/roomData.lua +3 -2
  101. package/dist/functions/rooms.d.ts +6 -6
  102. package/dist/functions/rooms.lua +6 -6
  103. package/dist/functions/set.d.ts +2 -0
  104. package/dist/functions/set.d.ts.map +1 -1
  105. package/dist/functions/set.lua +6 -0
  106. package/dist/functions/stage.d.ts +1 -0
  107. package/dist/functions/stage.d.ts.map +1 -1
  108. package/dist/functions/stage.lua +4 -0
  109. package/dist/functions/vector.d.ts +11 -0
  110. package/dist/functions/vector.d.ts.map +1 -1
  111. package/dist/functions/vector.lua +23 -0
  112. package/dist/index.d.ts +4 -0
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/index.lua +31 -0
  115. package/dist/initCustomCallbacks.d.ts.map +1 -1
  116. package/dist/initCustomCallbacks.lua +6 -0
  117. package/dist/initFeatures.d.ts.map +1 -1
  118. package/dist/initFeatures.lua +6 -0
  119. package/dist/interfaces/AddCallbackParameterCustom.d.ts +4 -0
  120. package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
  121. package/dist/interfaces/RoomDescription.d.ts +14 -0
  122. package/dist/interfaces/RoomDescription.d.ts.map +1 -0
  123. package/dist/interfaces/RoomDescription.lua +2 -0
  124. package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
  125. package/dist/objects/callbackRegisterFunctions.lua +6 -0
  126. package/dist/types/CollectibleIndex.d.ts +1 -1
  127. package/dist/types/PickupIndex.d.ts +17 -0
  128. package/dist/types/PickupIndex.d.ts.map +1 -0
  129. package/dist/types/PickupIndex.lua +2 -0
  130. package/dist/types/PlayerIndex.d.ts +1 -1
  131. package/dist/upgradeMod.d.ts.map +1 -1
  132. package/package.json +2 -2
  133. package/src/callbacks/postGridEntityCustomRender.ts +44 -0
  134. package/src/callbacks/postGridEntityCustomUpdate.ts +44 -0
  135. package/src/callbacks/postNewRoomEarly.ts +2 -2
  136. package/src/callbacks/postPickupInitFirst.ts +3 -32
  137. package/src/callbacks/postPlayerReorderedCallbacks.ts +3 -3
  138. package/src/callbacks/reorderedCallbacks.ts +9 -8
  139. package/src/callbacks/subscriptions/postGridEntityCustomRender.ts +41 -0
  140. package/src/callbacks/subscriptions/postGridEntityCustomUpdate.ts +41 -0
  141. package/src/constants.ts +1 -9
  142. package/src/constantsFirstLast.ts +16 -0
  143. package/src/enums/ModCallbackCustom.ts +33 -8
  144. package/src/enums/private/SerializationBrand.ts +1 -1
  145. package/src/features/collectibleItemPoolType.ts +3 -3
  146. package/src/features/customGridEntity.ts +27 -2
  147. package/src/features/customTrapdoor/blackSprite.ts +11 -5
  148. package/src/features/customTrapdoor/customTrapdoorConstants.ts +2 -2
  149. package/src/features/customTrapdoor/init.ts +7 -5
  150. package/src/features/customTrapdoor/touched.ts +59 -39
  151. package/src/features/deployJSONRoom.ts +4 -4
  152. package/src/features/extraConsoleCommands/exports.ts +4 -3
  153. package/src/features/extraConsoleCommands/init.ts +18 -14
  154. package/src/features/extraConsoleCommands/listCommands.ts +38 -43
  155. package/src/features/pause.ts +97 -7
  156. package/src/features/persistentEntities.ts +9 -8
  157. package/src/features/pickupIndex.ts +257 -0
  158. package/src/features/playerInventory.ts +2 -2
  159. package/src/features/roomHistory.ts +113 -0
  160. package/src/features/saveDataManager/main.ts +2 -2
  161. package/src/features/taintedLazarusPlayers.ts +5 -5
  162. package/src/functions/collectibles.ts +26 -13
  163. package/src/functions/color.ts +22 -0
  164. package/src/functions/entities.ts +6 -3
  165. package/src/functions/gridEntities.ts +4 -56
  166. package/src/functions/isaacAPIClass.ts +106 -1
  167. package/src/functions/kColor.ts +22 -0
  168. package/src/functions/map.ts +10 -0
  169. package/src/functions/npcs.ts +2 -2
  170. package/src/functions/pickupVariants.ts +2 -2
  171. package/src/functions/playerCenter.ts +2 -2
  172. package/src/functions/playerIndex.ts +8 -21
  173. package/src/functions/random.ts +1 -1
  174. package/src/functions/rockAlt.ts +117 -0
  175. package/src/functions/roomData.ts +3 -2
  176. package/src/functions/rooms.ts +6 -6
  177. package/src/functions/set.ts +7 -1
  178. package/src/functions/stage.ts +10 -1
  179. package/src/functions/vector.ts +23 -0
  180. package/src/index.ts +4 -0
  181. package/src/initCustomCallbacks.ts +4 -0
  182. package/src/initFeatures.ts +4 -0
  183. package/src/interfaces/AddCallbackParameterCustom.ts +4 -0
  184. package/src/interfaces/RoomDescription.ts +19 -0
  185. package/src/objects/callbackRegisterFunctions.ts +6 -0
  186. package/src/types/CollectibleIndex.ts +1 -1
  187. package/src/types/PickupIndex.ts +15 -0
  188. package/src/types/PlayerIndex.ts +1 -1
  189. package/src/upgradeMod.ts +2 -1
@@ -3,6 +3,8 @@ import { SerializationBrand } from "../enums/private/SerializationBrand";
3
3
  import { SerializationType } from "../enums/SerializationType";
4
4
  import { angleToDirection } from "./direction";
5
5
  import { isaacAPIClassEquals, isIsaacAPIClassOfType } from "./isaacAPIClass";
6
+ import { getRandomFloat } from "./random";
7
+ import { getRandomSeed, isRNG, newRNG } from "./rng";
6
8
  import { copyValuesToTable, getNumbersFromTable, tableHasKeys } from "./table";
7
9
  import { isTable } from "./types";
8
10
 
@@ -90,6 +92,27 @@ export function copyVector(
90
92
  }
91
93
  }
92
94
 
95
+ /**
96
+ * Helper function to get a random vector between (-1, -1) and (1, 1).
97
+ *
98
+ * To get random vectors with a bigger length, multiply this with a number.
99
+ *
100
+ * Use this over the `RandomVector` function when you need the vector to be seeded.
101
+ *
102
+ * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
103
+ * `RNG.Next` method will be called. Default is `getRandomSeed()`.
104
+ */
105
+ export function getRandomVector(
106
+ seedOrRNG: Seed | RNG = getRandomSeed(),
107
+ ): Vector {
108
+ const rng = isRNG(seedOrRNG) ? seedOrRNG : newRNG(seedOrRNG);
109
+
110
+ const x = getRandomFloat(-1, 1, rng);
111
+ const y = getRandomFloat(-1, 1, rng);
112
+
113
+ return Vector(x, y);
114
+ }
115
+
93
116
  /**
94
117
  * Used to determine is the given table is a serialized `Vector` object created by the save data
95
118
  * manager and/or the `deepCopy` function.
package/src/index.ts CHANGED
@@ -47,10 +47,12 @@ export * from "./features/extraConsoleCommands/exports";
47
47
  export { removeFadeIn, restoreFadeIn } from "./features/fadeInRemover";
48
48
  export { disableFastReset, enableFastReset } from "./features/fastReset";
49
49
  export { forgottenSwitch } from "./features/forgottenSwitch";
50
+ export { pause, unpause } from "./features/pause";
50
51
  export {
51
52
  removePersistentEntity,
52
53
  spawnPersistentEntity,
53
54
  } from "./features/persistentEntities";
55
+ export * from "./features/pickupIndex";
54
56
  export { getPlayerInventory } from "./features/playerInventory";
55
57
  export {
56
58
  anyPlayerUsingPony,
@@ -62,6 +64,7 @@ export {
62
64
  getRoomClearGameFrame,
63
65
  getRoomClearRoomFrame,
64
66
  } from "./features/roomClearFrame";
67
+ export * from "./features/roomHistory";
65
68
  export {
66
69
  runInNGameFrames,
67
70
  runInNRenderFrames,
@@ -141,6 +144,7 @@ export * from "./functions/pressurePlate";
141
144
  export * from "./functions/random";
142
145
  export * from "./functions/revive";
143
146
  export * from "./functions/rng";
147
+ export * from "./functions/rockAlt";
144
148
  export * from "./functions/roomData";
145
149
  export * from "./functions/roomGrid";
146
150
  export * from "./functions/rooms";
@@ -20,6 +20,8 @@ import { postFlipCallbacksInit } from "./callbacks/postFlip";
20
20
  import { postGreedModeWaveInit } from "./callbacks/postGreedModeWave";
21
21
  import { postGridEntityCallbacksInit } from "./callbacks/postGridEntity";
22
22
  import { postGridEntityCollisionInit } from "./callbacks/postGridEntityCollision";
23
+ import { postGridEntityCustomRenderInit } from "./callbacks/postGridEntityCustomRender";
24
+ import { postGridEntityCustomUpdateInit } from "./callbacks/postGridEntityCustomUpdate";
23
25
  import { postGridEntityRenderInit } from "./callbacks/postGridEntityRender";
24
26
  import { postHolyMantleRemovedInit } from "./callbacks/postHolyMantleRemoved";
25
27
  import { postItemDischargeInit } from "./callbacks/postItemDischarged";
@@ -89,6 +91,8 @@ export function initCustomCallbacks(mod: ModUpgraded): void {
89
91
  postGreedModeWaveInit(mod);
90
92
  postGridEntityCallbacksInit(mod);
91
93
  postGridEntityCollisionInit(mod);
94
+ postGridEntityCustomRenderInit(mod);
95
+ postGridEntityCustomUpdateInit(mod);
92
96
  postGridEntityRenderInit(mod);
93
97
  postHolyMantleRemovedInit(mod);
94
98
  postItemDischargeInit(mod);
@@ -13,11 +13,13 @@ import { fastResetInit } from "./features/fastReset";
13
13
  import { forgottenSwitchInit } from "./features/forgottenSwitch";
14
14
  import { pauseInit } from "./features/pause";
15
15
  import { persistentEntitiesInit } from "./features/persistentEntities";
16
+ import { pickupIndexInit } from "./features/pickupIndex";
16
17
  import { playerInventoryInit } from "./features/playerInventory";
17
18
  import { ponyDetectionInit } from "./features/ponyDetection";
18
19
  import { preventCollectibleRotationInit } from "./features/preventCollectibleRotation";
19
20
  import { registerHotkeyInit } from "./features/registerHotkey";
20
21
  import { roomClearFrameInit } from "./features/roomClearFrame";
22
+ import { roomHistoryInit } from "./features/roomHistory";
21
23
  import { runInNFramesInit } from "./features/runInNFrames";
22
24
  import { runNextRoomInit } from "./features/runNextRoom";
23
25
  import { sirenHelpersInit } from "./features/sirenHelpers";
@@ -48,11 +50,13 @@ function initFeaturesMinor(mod: ModUpgraded) {
48
50
  collectibleItemPoolTypeInit(mod);
49
51
  pauseInit(mod);
50
52
  persistentEntitiesInit(mod);
53
+ pickupIndexInit(mod);
51
54
  playerInventoryInit(mod);
52
55
  ponyDetectionInit(mod);
53
56
  preventCollectibleRotationInit(mod);
54
57
  registerHotkeyInit(mod);
55
58
  roomClearFrameInit(mod);
59
+ roomHistoryInit(mod);
56
60
  runNextRoomInit(mod);
57
61
  sirenHelpersInit(mod);
58
62
  stageHistoryInit(mod);
@@ -23,6 +23,8 @@ import { PostGameStartedReorderedRegisterParameters } from "../callbacks/subscri
23
23
  import { PostGreedModeWaveRegisterParameters } from "../callbacks/subscriptions/postGreedModeWave";
24
24
  import { PostGridEntityBrokenRegisterParameters } from "../callbacks/subscriptions/postGridEntityBroken";
25
25
  import { PostGridEntityCollisionRegisterParameters } from "../callbacks/subscriptions/postGridEntityCollision";
26
+ import { PostGridEntityCustomRenderRegisterParameters } from "../callbacks/subscriptions/postGridEntityCustomRender";
27
+ import { PostGridEntityCustomUpdateRegisterParameters } from "../callbacks/subscriptions/postGridEntityCustomUpdate";
26
28
  import { PostGridEntityInitRegisterParameters } from "../callbacks/subscriptions/postGridEntityInit";
27
29
  import { PostGridEntityRemoveRegisterParameters } from "../callbacks/subscriptions/postGridEntityRemove";
28
30
  import { PostGridEntityRenderRegisterParameters } from "../callbacks/subscriptions/postGridEntityRender";
@@ -109,6 +111,8 @@ export interface AddCallbackParameterCustom {
109
111
  [ModCallbackCustom.POST_GREED_MODE_WAVE]: PostGreedModeWaveRegisterParameters;
110
112
  [ModCallbackCustom.POST_GRID_ENTITY_BROKEN]: PostGridEntityBrokenRegisterParameters;
111
113
  [ModCallbackCustom.POST_GRID_ENTITY_COLLISION]: PostGridEntityCollisionRegisterParameters;
114
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]: PostGridEntityCustomRenderRegisterParameters;
115
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]: PostGridEntityCustomUpdateRegisterParameters;
112
116
  [ModCallbackCustom.POST_GRID_ENTITY_INIT]: PostGridEntityInitRegisterParameters;
113
117
  [ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: PostGridEntityRemoveRegisterParameters;
114
118
  [ModCallbackCustom.POST_GRID_ENTITY_RENDER]: PostGridEntityRenderRegisterParameters;
@@ -0,0 +1,19 @@
1
+ import {
2
+ LevelStage,
3
+ RoomType,
4
+ StageID,
5
+ StageType,
6
+ } from "isaac-typescript-definitions";
7
+
8
+ /** Used by the room history feature. */
9
+ export interface RoomDescription {
10
+ stage: LevelStage;
11
+ stageType: StageType;
12
+ stageID: StageID;
13
+ roomType: RoomType;
14
+ roomVariant: int;
15
+ roomSubType: int;
16
+ roomName: string;
17
+ roomGridIndex: int;
18
+ roomListIndex: int;
19
+ }
@@ -23,6 +23,8 @@ import { postGameStartedReorderedRegister } from "../callbacks/subscriptions/pos
23
23
  import { postGreedModeWaveRegister } from "../callbacks/subscriptions/postGreedModeWave";
24
24
  import { postGridEntityBrokenRegister } from "../callbacks/subscriptions/postGridEntityBroken";
25
25
  import { postGridEntityCollisionRegister } from "../callbacks/subscriptions/postGridEntityCollision";
26
+ import { postGridEntityCustomRenderRegister } from "../callbacks/subscriptions/postGridEntityCustomRender";
27
+ import { postGridEntityCustomUpdateRegister } from "../callbacks/subscriptions/postGridEntityCustomUpdate";
26
28
  import { postGridEntityInitRegister } from "../callbacks/subscriptions/postGridEntityInit";
27
29
  import { postGridEntityRemoveRegister } from "../callbacks/subscriptions/postGridEntityRemove";
28
30
  import { postGridEntityRenderRegister } from "../callbacks/subscriptions/postGridEntityRender";
@@ -118,6 +120,10 @@ export const CALLBACK_REGISTER_FUNCTIONS: {
118
120
  [ModCallbackCustom.POST_GRID_ENTITY_BROKEN]: postGridEntityBrokenRegister,
119
121
  [ModCallbackCustom.POST_GRID_ENTITY_COLLISION]:
120
122
  postGridEntityCollisionRegister,
123
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER]:
124
+ postGridEntityCustomRenderRegister,
125
+ [ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE]:
126
+ postGridEntityCustomUpdateRegister,
121
127
  [ModCallbackCustom.POST_GRID_ENTITY_INIT]: postGridEntityInitRegister,
122
128
  [ModCallbackCustom.POST_GRID_ENTITY_REMOVE]: postGridEntityRemoveRegister,
123
129
  [ModCallbackCustom.POST_GRID_ENTITY_RENDER]: postGridEntityRenderRegister,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * CollectibleIndex is a specific type of string; see the documentation for the
2
+ * `CollectibleIndex` is a specific type of string; see the documentation for the
3
3
  * `getCollectibleIndex` function. Mods can signify that data structures handle collectibles by
4
4
  * using this type.
5
5
  *
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `PickupIndex` is a specific type of string; see the documentation for the `getPickupIndex`
3
+ * function. Mods can signify that data structures handle collectibles by using this type.
4
+ *
5
+ * For example:
6
+ *
7
+ * ```ts
8
+ * const pickupNameMap = new Map<PickupIndex, string>();
9
+ * ```
10
+ *
11
+ * This type is branded for extra type safety.
12
+ */
13
+ export type PickupIndex = int & {
14
+ readonly __pickupIndexBrand: symbol;
15
+ };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PlayerIndex is a specific type of number that represents a unique identifier for a player. Mods
2
+ * `PlayerIndex` is a specific type of number that represents a unique identifier for a player. Mods
3
3
  * can signify that data structures handle `EntityPlayer` by using this type. For more information,
4
4
  * see the documentation for the `getPlayerIndex` function.
5
5
  *
package/src/upgradeMod.ts CHANGED
@@ -39,7 +39,8 @@ export function upgradeMod(modVanilla: Mod): ModUpgraded {
39
39
  patchErrorFunction();
40
40
  loadShaderCrashFix(modVanilla);
41
41
 
42
- // We initialize the PostNewRoomEarly callback first since it is used by the save data manager.
42
+ // We initialize the `POST_NEW_ROOM_EARLY` callback first since it is used by the save data
43
+ // manager.
43
44
  postNewRoomEarlyCallbackInit(mod);
44
45
 
45
46
  // We initialized the save data manager second since it is used by the other custom callbacks