isaacscript-common 6.20.0 → 6.21.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 (106) hide show
  1. package/dist/constants.d.ts +5 -0
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.lua +4 -0
  4. package/dist/constantsFirstLast.d.ts +2 -2
  5. package/dist/constantsFirstLast.lua +2 -2
  6. package/dist/enums/RockAltType.d.ts +12 -1
  7. package/dist/enums/RockAltType.d.ts.map +1 -1
  8. package/dist/enums/RockAltType.lua +4 -2
  9. package/dist/features/customStage/backdrop.d.ts.map +1 -1
  10. package/dist/features/customStage/backdrop.lua +3 -2
  11. package/dist/features/customStage/customStageConstants.d.ts +11 -0
  12. package/dist/features/customStage/customStageConstants.d.ts.map +1 -1
  13. package/dist/features/customStage/customStageConstants.lua +10 -0
  14. package/dist/features/customStage/customStageGridEntities.d.ts +1 -0
  15. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  16. package/dist/features/customStage/customStageGridEntities.lua +58 -23
  17. package/dist/features/customStage/exports.d.ts +6 -2
  18. package/dist/features/customStage/exports.d.ts.map +1 -1
  19. package/dist/features/customStage/exports.lua +51 -45
  20. package/dist/features/customStage/init.d.ts.map +1 -1
  21. package/dist/features/customStage/init.lua +7 -12
  22. package/dist/features/customStage/shadows.d.ts.map +1 -1
  23. package/dist/features/customStage/shadows.lua +2 -1
  24. package/dist/features/customStage/streakText.d.ts +0 -7
  25. package/dist/features/customStage/streakText.d.ts.map +1 -1
  26. package/dist/features/customStage/streakText.lua +51 -84
  27. package/dist/features/customStage/v.d.ts +13 -0
  28. package/dist/features/customStage/v.d.ts.map +1 -1
  29. package/dist/features/customStage/v.lua +6 -1
  30. package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -1
  31. package/dist/features/customTrapdoor/blackSprite.lua +1 -0
  32. package/dist/features/customTrapdoor/exports.d.ts +7 -6
  33. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  34. package/dist/features/customTrapdoor/exports.lua +6 -5
  35. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  36. package/dist/features/customTrapdoor/init.lua +11 -6
  37. package/dist/features/customTrapdoor/touched.lua +0 -1
  38. package/dist/features/customTrapdoor/v.d.ts +1 -1
  39. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
  40. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  41. package/dist/features/saveDataManager/exports.d.ts +3 -0
  42. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  43. package/dist/features/saveDataManager/exports.lua +3 -0
  44. package/dist/functions/collectibleSet.d.ts +1 -1
  45. package/dist/functions/collectibleSet.lua +1 -1
  46. package/dist/functions/doors.d.ts +10 -0
  47. package/dist/functions/doors.d.ts.map +1 -1
  48. package/dist/functions/doors.lua +6 -0
  49. package/dist/functions/levelGrid.d.ts +5 -2
  50. package/dist/functions/levelGrid.d.ts.map +1 -1
  51. package/dist/functions/levelGrid.lua +29 -6
  52. package/dist/functions/log.d.ts +1 -15
  53. package/dist/functions/log.d.ts.map +1 -1
  54. package/dist/functions/log.lua +3 -218
  55. package/dist/functions/logEntities.d.ts +16 -0
  56. package/dist/functions/logEntities.d.ts.map +1 -0
  57. package/dist/functions/logEntities.lua +220 -0
  58. package/dist/functions/rockAlt.d.ts +6 -5
  59. package/dist/functions/rockAlt.d.ts.map +1 -1
  60. package/dist/functions/rockAlt.lua +147 -18
  61. package/dist/functions/roomData.d.ts +2 -2
  62. package/dist/functions/roomData.d.ts.map +1 -1
  63. package/dist/functions/roomData.lua +2 -2
  64. package/dist/functions/roomTransition.d.ts +26 -0
  65. package/dist/functions/roomTransition.d.ts.map +1 -0
  66. package/dist/functions/roomTransition.lua +75 -0
  67. package/dist/functions/rooms.d.ts +39 -35
  68. package/dist/functions/rooms.d.ts.map +1 -1
  69. package/dist/functions/rooms.lua +97 -99
  70. package/dist/index.d.ts +1 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.lua +8 -0
  73. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +1 -1
  74. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  75. package/dist/objects/backdropTypeToRockAltType.lua +3 -3
  76. package/package.json +2 -2
  77. package/src/constants.ts +8 -0
  78. package/src/constantsFirstLast.ts +2 -2
  79. package/src/enums/RockAltType.ts +14 -1
  80. package/src/features/customStage/backdrop.ts +2 -1
  81. package/src/features/customStage/customStageConstants.ts +16 -0
  82. package/src/features/customStage/customStageGridEntities.ts +47 -0
  83. package/src/features/customStage/exports.ts +56 -40
  84. package/src/features/customStage/init.ts +7 -18
  85. package/src/features/customStage/shadows.ts +2 -1
  86. package/src/features/customStage/streakText.ts +58 -95
  87. package/src/features/customStage/v.ts +17 -0
  88. package/src/features/customTrapdoor/blackSprite.ts +1 -0
  89. package/src/features/customTrapdoor/exports.ts +9 -6
  90. package/src/features/customTrapdoor/init.ts +16 -5
  91. package/src/features/customTrapdoor/touched.ts +0 -2
  92. package/src/features/customTrapdoor/v.ts +1 -1
  93. package/src/features/extraConsoleCommands/commandsSubroutines.ts +4 -1
  94. package/src/features/saveDataManager/exports.ts +3 -0
  95. package/src/functions/collectibleSet.ts +1 -1
  96. package/src/functions/doors.ts +10 -0
  97. package/src/functions/levelGrid.ts +54 -10
  98. package/src/functions/log.ts +1 -279
  99. package/src/functions/logEntities.ts +276 -0
  100. package/src/functions/rockAlt.ts +147 -19
  101. package/src/functions/roomData.ts +3 -3
  102. package/src/functions/roomTransition.ts +78 -0
  103. package/src/functions/rooms.ts +107 -107
  104. package/src/index.ts +1 -0
  105. package/src/interfaces/private/CustomTrapdoorDescription.ts +3 -1
  106. package/src/objects/backdropTypeToRockAltType.ts +3 -3
@@ -1,4 +1,4 @@
1
- import { BossID, Dimension, Direction, ItemPoolType, MinibossID, RoomTransitionAnim, RoomType } from "isaac-typescript-definitions";
1
+ import { BackdropType, BossID, Dimension, ItemPoolType, MinibossID, RoomType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function for quickly switching to a new room without playing a particular animation. Use
4
4
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -10,11 +10,26 @@ export declare function changeRoom(roomGridIndex: int): void;
10
10
  * include off-grid rooms, like the Devil Room.
11
11
  */
12
12
  export declare function getNumRooms(): int;
13
+ /**
14
+ * Helper function to get a read-only copy of the room descriptor for every room on the level. This
15
+ * includes off-grid rooms, such as the Devil Room, and extra-dimensional rooms, if they are
16
+ * generated and exist.
17
+ *
18
+ * Room descriptors without any data are assumed to be non-existent and are not included.
19
+ *
20
+ * Under the hood, this is performed by iterating over the `RoomList` from the `Level.GetRooms`
21
+ * method. This is the best way to see if off-grid rooms have been initialized, since it is possible
22
+ * for mods to insert room data at non-official negative room grid indexes.
23
+ */
24
+ export declare function getReadOnlyRooms(): Array<Readonly<RoomDescriptor>>;
13
25
  /**
14
26
  * Helper function to get the room data for a specific room type and variant combination. This is
15
27
  * accomplished by using the "goto" console command to load the specified room into the
16
28
  * `GridRoom.DEBUG` slot.
17
29
  *
30
+ * Returns undefined if the provided room type and variant combination were not found. (A warning
31
+ * message will also appear on the console, since the "goto" command will fail.)
32
+ *
18
33
  * Note that the side effect of using the "goto" console command is that it will trigger a room
19
34
  * transition after a short delay. By default, this function cancels the incoming room transition by
20
35
  * using the `Game.StartRoomTransition` method to travel to the same room.
@@ -42,39 +57,43 @@ export declare function getRoomItemPoolType(): ItemPoolType;
42
57
  export declare function getRoomTypeName(roomType: RoomType): string;
43
58
  /**
44
59
  * Helper function to get the room descriptor for every room on the level. This includes off-grid
45
- * rooms, such as the Devil Room. (Off-grid rooms will only be included if they the data exists,
46
- * which only usually happens once they have been visited at least once.)
60
+ * rooms, such as the Devil Room.
61
+ *
62
+ * Room descriptors without any data are assumed to be non-existent and are not included.
47
63
  *
48
- * Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
49
- * data are assumed to be non-existent and are not added to the list.
64
+ * - If you want just the rooms inside of the grid, use the `getRoomsInGrid` helper function.
65
+ * - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
50
66
  *
51
67
  * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
52
- * extra-dimensional rooms are automatically generated and can be
53
- * seen when you iterate over the `RoomList`. Default is false.
68
+ * extra-dimensional rooms are automatically generated. Default is
69
+ * false.
54
70
  */
55
71
  export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
56
72
  /**
57
- * Helper function to get the room descriptor for every room on the level except for rooms that are
58
- * not on the grid.
73
+ * Helper function to get the room descriptor for every room on the level that is on the grid. (For
74
+ * example, Devil Rooms are excluded.)
59
75
  *
60
- * Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
61
- * data are assumed to be non-existent and are not added to the list.
76
+ * Room descriptors without any data are assumed to be non-existent and are not included.
62
77
  *
63
78
  * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
64
- * extra-dimensional rooms are automatically be generated and can be
65
- * seen when you iterate over the `RoomList`. Default is false.
79
+ * extra-dimensional rooms are automatically be generated. Default
80
+ * is false.
66
81
  */
67
82
  export declare function getRoomsInGrid(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
68
83
  /**
69
84
  * Helper function to get the room descriptor for every room on the level in a specific dimension.
70
85
  * This will not include any off-grid rooms, such as the Devil Room.
71
86
  *
72
- * Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
73
- * data are assumed to be non-existent and are not added to the list.
74
- *
75
- * @returns A map of room ListIndex to RoomDescriptor.
87
+ * Room descriptors without any data are assumed to be non-existent and are not included.
76
88
  */
77
89
  export declare function getRoomsOfDimension(dimension: Dimension): RoomDescriptor[];
90
+ /**
91
+ * Helper function to get the room descriptor for every room on the level that is outside of the
92
+ * grid (like a Devil Room).
93
+ *
94
+ * Room descriptors without any data are assumed to be non-existent and are not included.
95
+ */
96
+ export declare function getRoomsOutsideGrid(): RoomDescriptor[];
78
97
  /**
79
98
  * Helper function to determine if the current room shape is equal to `RoomShape.1x2` or
80
99
  * `RoomShape.2x1`.
@@ -136,7 +155,7 @@ export declare function inStartingRoom(): boolean;
136
155
  /**
137
156
  * Helper function to loop through every room on the floor and see if it has been cleared.
138
157
  *
139
- * This function will only check rooms in the current dimension.
158
+ * This function will only check rooms inside the gird and inside the current dimension.
140
159
  *
141
160
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
142
161
  * the array will be ignored. If not specified, then all rooms will be
@@ -150,6 +169,8 @@ export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolea
150
169
  * positions/velocities before updating the room, and then restore those positions/velocities.
151
170
  */
152
171
  export declare function roomUpdateSafe(): void;
172
+ /** Helper function to set the backdrop of the current room. */
173
+ export declare function setBackdrop(backdropType: BackdropType): void;
153
174
  /**
154
175
  * Helper function to convert an uncleared room to a cleared room in the `POST_NEW_ROOM` callback.
155
176
  * This is useful because if enemies are removed in this callback, a room drop will be awarded and
@@ -161,21 +182,4 @@ export declare function setRoomCleared(): void;
161
182
  * spawns an NPC.
162
183
  */
163
184
  export declare function setRoomUncleared(): void;
164
- /**
165
- * Helper function to change the current room. It can be used for both teleportation and "normal"
166
- * room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
167
- * arguments.
168
- *
169
- * Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
170
- * - you do not forget to set `Level.LeaveDoor` property
171
- * - to prevent crashing on invalid room grid indexes
172
- * - to automatically handle Curse of the Maze
173
- *
174
- * @param roomGridIndex The room grid index of the destination room.
175
- * @param direction Optional. Default is `Direction.NO_DIRECTION`.
176
- * @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
177
- * @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
178
- * to false, then this function may not go to the provided room grid index.
179
- */
180
- export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim, force?: boolean): void;
181
185
  //# sourceMappingURL=rooms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,SAAS,EACT,SAAS,EAKT,YAAY,EAEZ,UAAU,EAGV,kBAAkB,EAClB,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAgCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,GAC1B,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAgBlC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAwBlB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAGlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,cAAc,EAAE,CAc1E;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAKnC;AAED,wBAAgB,WAAW,IAAI,OAAO,CAOrC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAWpD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAOt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OAAO,IAAI,OAAO,CAUjC;AAED,wBAAgB,eAAe,IAAI,OAAO,CAKzC;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAWhE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -1,8 +1,12 @@
1
1
  local ____lualib = require("lualib_bundle")
2
+ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
3
+ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
4
+ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
2
5
  local Map = ____lualib.Map
3
6
  local __TS__New = ____lualib.__TS__New
4
7
  local __TS__Spread = ____lualib.__TS__Spread
5
8
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
9
+ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
6
10
  local __TS__StringIncludes = ____lualib.__TS__StringIncludes
7
11
  local Set = ____lualib.Set
8
12
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
@@ -10,15 +14,12 @@ local ____exports = {}
10
14
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
11
15
  local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
12
16
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
13
- local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
14
17
  local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
15
18
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
16
19
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
17
20
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
18
- local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
19
21
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
20
22
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
21
- local RoomTransitionAnim = ____isaac_2Dtypescript_2Ddefinitions.RoomTransitionAnim
22
23
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
23
24
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
24
25
  local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
@@ -27,12 +28,11 @@ local game = ____cachedClasses.game
27
28
  local sfxManager = ____cachedClasses.sfxManager
28
29
  local ____constants = require("constants")
29
30
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
31
+ local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
30
32
  local ____roomTypeNames = require("objects.roomTypeNames")
31
33
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
32
34
  local ____mineShaftRoomSubTypesSet = require("sets.mineShaftRoomSubTypesSet")
33
35
  local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROOM_SUB_TYPE_SET
34
- local ____curses = require("functions.curses")
35
- local hasCurse = ____curses.hasCurse
36
36
  local ____dimensions = require("functions.dimensions")
37
37
  local inDimension = ____dimensions.inDimension
38
38
  local ____doors = require("functions.doors")
@@ -51,109 +51,85 @@ local setEntityPositions = ____positionVelocity.setEntityPositions
51
51
  local setEntityVelocities = ____positionVelocity.setEntityVelocities
52
52
  local ____roomData = require("functions.roomData")
53
53
  local getRoomData = ____roomData.getRoomData
54
+ local getRoomDescriptor = ____roomData.getRoomDescriptor
54
55
  local getRoomDescriptorReadOnly = ____roomData.getRoomDescriptorReadOnly
55
56
  local getRoomGridIndex = ____roomData.getRoomGridIndex
56
57
  local getRoomName = ____roomData.getRoomName
57
58
  local getRoomStageID = ____roomData.getRoomStageID
58
59
  local getRoomSubType = ____roomData.getRoomSubType
60
+ local ____roomTransition = require("functions.roomTransition")
61
+ local reloadRoom = ____roomTransition.reloadRoom
59
62
  local ____stage = require("functions.stage")
60
63
  local getGotoCommand = ____stage.getGotoCommand
61
64
  local ____utils = require("functions.utils")
65
+ local erange = ____utils.erange
62
66
  local irange = ____utils.irange
63
- --- Helper function to get the room descriptor for every room on the level. This includes off-grid
64
- -- rooms, such as the Devil Room. (Off-grid rooms will only be included if they the data exists,
65
- -- which only usually happens once they have been visited at least once.)
67
+ --- Helper function to get a read-only copy of the room descriptor for every room on the level. This
68
+ -- includes off-grid rooms, such as the Devil Room, and extra-dimensional rooms, if they are
69
+ -- generated and exist.
66
70
  --
67
- -- Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
68
- -- data are assumed to be non-existent and are not added to the list.
71
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
69
72
  --
70
- -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
71
- -- extra-dimensional rooms are automatically generated and can be
72
- -- seen when you iterate over the `RoomList`. Default is false.
73
- function ____exports.getRooms(self, includeExtraDimensionalRooms)
74
- if includeExtraDimensionalRooms == nil then
75
- includeExtraDimensionalRooms = false
76
- end
73
+ -- Under the hood, this is performed by iterating over the `RoomList` from the `Level.GetRooms`
74
+ -- method. This is the best way to see if off-grid rooms have been initialized, since it is possible
75
+ -- for mods to insert room data at non-official negative room grid indexes.
76
+ function ____exports.getReadOnlyRooms(self)
77
77
  local level = game:GetLevel()
78
78
  local roomList = level:GetRooms()
79
- --- Indexed by room safe grid index. We use a map to avoid adding extra dimensional rooms.
80
- local roomsMap = __TS__New(Map)
79
+ local readOnlyRoomDescriptors = {}
81
80
  do
82
81
  local i = 0
83
82
  while i < roomList.Size do
84
- do
85
- local roomDescriptor = roomList:Get(i)
86
- if roomDescriptor == nil or roomDescriptor.Data == nil then
87
- goto __continue10
88
- end
89
- if not includeExtraDimensionalRooms and roomsMap:has(roomDescriptor.SafeGridIndex) then
90
- goto __continue10
91
- end
92
- roomsMap:set(roomDescriptor.SafeGridIndex, roomDescriptor)
83
+ local readOnlyRoomDescriptor = roomList:Get(i)
84
+ if readOnlyRoomDescriptor ~= nil and readOnlyRoomDescriptor.Data ~= nil then
85
+ readOnlyRoomDescriptors[#readOnlyRoomDescriptors + 1] = readOnlyRoomDescriptor
93
86
  end
94
- ::__continue10::
95
87
  i = i + 1
96
88
  end
97
89
  end
98
- return {__TS__Spread(roomsMap:values())}
90
+ return readOnlyRoomDescriptors
99
91
  end
100
- --- Helper function to get the room descriptor for every room on the level except for rooms that are
101
- -- not on the grid.
92
+ --- Helper function to get the room descriptor for every room on the level that is on the grid. (For
93
+ -- example, Devil Rooms are excluded.)
102
94
  --
103
- -- Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
104
- -- data are assumed to be non-existent and are not added to the list.
95
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
105
96
  --
106
97
  -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
107
- -- extra-dimensional rooms are automatically be generated and can be
108
- -- seen when you iterate over the `RoomList`. Default is false.
98
+ -- extra-dimensional rooms are automatically be generated. Default
99
+ -- is false.
109
100
  function ____exports.getRoomsInGrid(self, includeExtraDimensionalRooms)
110
101
  if includeExtraDimensionalRooms == nil then
111
102
  includeExtraDimensionalRooms = false
112
103
  end
113
- local rooms = ____exports.getRooms(nil, includeExtraDimensionalRooms)
114
- return __TS__ArrayFilter(
115
- rooms,
116
- function(____, roomDescriptor) return roomDescriptor.SafeGridIndex >= 0 end
117
- )
118
- end
119
- --- Helper function to change the current room. It can be used for both teleportation and "normal"
120
- -- room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
121
- -- arguments.
122
- --
123
- -- Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
124
- -- - you do not forget to set `Level.LeaveDoor` property
125
- -- - to prevent crashing on invalid room grid indexes
126
- -- - to automatically handle Curse of the Maze
127
- --
128
- -- @param roomGridIndex The room grid index of the destination room.
129
- -- @param direction Optional. Default is `Direction.NO_DIRECTION`.
130
- -- @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
131
- -- @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
132
- -- to false, then this function may not go to the provided room grid index.
133
- function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim, force)
134
- if direction == nil then
135
- direction = Direction.NO_DIRECTION
136
- end
137
- if roomTransitionAnim == nil then
138
- roomTransitionAnim = RoomTransitionAnim.TELEPORT
139
- end
140
- if force == nil then
141
- force = false
142
- end
143
104
  local level = game:GetLevel()
144
- local shouldTempDisableCurse = force and hasCurse(nil, LevelCurse.MAZE)
145
- if shouldTempDisableCurse then
146
- level:RemoveCurses(LevelCurse.MAZE)
147
- end
148
- local roomData = getRoomData(nil, roomGridIndex)
149
- if roomData == nil then
150
- error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
151
- end
152
- level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
153
- game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
154
- if shouldTempDisableCurse then
155
- level:AddCurse(LevelCurse.MAZE, false)
105
+ local dimensions = includeExtraDimensionalRooms and erange(nil, NUM_DIMENSIONS) or ({Dimension.CURRENT})
106
+ --- We use a map instead of an array because room shapes occupy more than one room grid index.
107
+ local roomDescriptorMap = __TS__New(Map)
108
+ for ____, dimension in ipairs(dimensions) do
109
+ for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
110
+ local roomDescriptor = level:GetRoomByIdx(roomGridIndex, dimension)
111
+ if roomDescriptor.Data ~= nil then
112
+ local ptrHash = GetPtrHash(roomDescriptor)
113
+ roomDescriptorMap:set(ptrHash, roomDescriptor)
114
+ end
115
+ end
156
116
  end
117
+ return {__TS__Spread(roomDescriptorMap:values())}
118
+ end
119
+ --- Helper function to get the room descriptor for every room on the level that is outside of the
120
+ -- grid (like a Devil Room).
121
+ --
122
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
123
+ function ____exports.getRoomsOutsideGrid(self)
124
+ local readOnlyRooms = ____exports.getReadOnlyRooms(nil)
125
+ local readOnlyRoomsOffGrid = __TS__ArrayFilter(
126
+ readOnlyRooms,
127
+ function(____, readOnlyRoomDescriptor) return readOnlyRoomDescriptor.SafeGridIndex < 0 end
128
+ )
129
+ return __TS__ArrayMap(
130
+ readOnlyRoomsOffGrid,
131
+ function(____, readOnlyRoomDescriptor) return getRoomDescriptor(nil, readOnlyRoomDescriptor.SafeGridIndex) end
132
+ )
157
133
  end
158
134
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
159
135
  -- this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -177,6 +153,9 @@ end
177
153
  -- accomplished by using the "goto" console command to load the specified room into the
178
154
  -- `GridRoom.DEBUG` slot.
179
155
  --
156
+ -- Returns undefined if the provided room type and variant combination were not found. (A warning
157
+ -- message will also appear on the console, since the "goto" command will fail.)
158
+ --
180
159
  -- Note that the side effect of using the "goto" console command is that it will trigger a room
181
160
  -- transition after a short delay. By default, this function cancels the incoming room transition by
182
161
  -- using the `Game.StartRoomTransition` method to travel to the same room.
@@ -197,14 +176,7 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
197
176
  Isaac.ExecuteCommand(command)
198
177
  local newRoomData = getRoomData(nil, GridRoom.DEBUG)
199
178
  if cancelRoomTransition then
200
- local roomGridIndex = getRoomGridIndex(nil)
201
- ____exports.teleport(
202
- nil,
203
- roomGridIndex,
204
- Direction.NO_DIRECTION,
205
- RoomTransitionAnim.FADE,
206
- true
207
- )
179
+ reloadRoom(nil)
208
180
  end
209
181
  return newRoomData
210
182
  end
@@ -223,13 +195,34 @@ end
223
195
  function ____exports.getRoomTypeName(self, roomType)
224
196
  return ROOM_TYPE_NAMES[roomType]
225
197
  end
198
+ --- Helper function to get the room descriptor for every room on the level. This includes off-grid
199
+ -- rooms, such as the Devil Room.
200
+ --
201
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
202
+ --
203
+ -- - If you want just the rooms inside of the grid, use the `getRoomsInGrid` helper function.
204
+ -- - If you want just the rooms outside of the grid, use the `getRoomsOutsideGrid` helper function.
205
+ --
206
+ -- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
207
+ -- extra-dimensional rooms are automatically generated. Default is
208
+ -- false.
209
+ function ____exports.getRooms(self, includeExtraDimensionalRooms)
210
+ if includeExtraDimensionalRooms == nil then
211
+ includeExtraDimensionalRooms = false
212
+ end
213
+ local roomsInGrid = ____exports.getRoomsInGrid(nil, includeExtraDimensionalRooms)
214
+ local roomsOutsideGrid = ____exports.getRoomsOutsideGrid(nil)
215
+ local ____array_0 = __TS__SparseArrayNew(table.unpack(roomsInGrid))
216
+ __TS__SparseArrayPush(
217
+ ____array_0,
218
+ table.unpack(roomsOutsideGrid)
219
+ )
220
+ return {__TS__SparseArraySpread(____array_0)}
221
+ end
226
222
  --- Helper function to get the room descriptor for every room on the level in a specific dimension.
227
223
  -- This will not include any off-grid rooms, such as the Devil Room.
228
224
  --
229
- -- Under the hood, this function uses the `Level.GetRooms` method to accomplish this. Rooms without
230
- -- data are assumed to be non-existent and are not added to the list.
231
- --
232
- -- @returns A map of room ListIndex to RoomDescriptor.
225
+ -- Room descriptors without any data are assumed to be non-existent and are not included.
233
226
  function ____exports.getRoomsOfDimension(self, dimension)
234
227
  local level = game:GetLevel()
235
228
  --- We use a map instead of an array because room shapes occupy more than one room grid index.
@@ -237,7 +230,8 @@ function ____exports.getRoomsOfDimension(self, dimension)
237
230
  for ____, roomGridIndex in ipairs(irange(nil, MAX_LEVEL_GRID_INDEX)) do
238
231
  local roomDescriptor = level:GetRoomByIdx(roomGridIndex, dimension)
239
232
  if roomDescriptor.Data ~= nil then
240
- roomsMap:set(roomDescriptor.ListIndex, roomDescriptor)
233
+ local ptrHash = GetPtrHash(roomDescriptor)
234
+ roomsMap:set(ptrHash, roomDescriptor)
241
235
  end
242
236
  end
243
237
  return {__TS__Spread(roomsMap:values())}
@@ -349,20 +343,20 @@ function ____exports.inStartingRoom(self)
349
343
  end
350
344
  --- Helper function to loop through every room on the floor and see if it has been cleared.
351
345
  --
352
- -- This function will only check rooms in the current dimension.
346
+ -- This function will only check rooms inside the gird and inside the current dimension.
353
347
  --
354
348
  -- @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
355
349
  -- the array will be ignored. If not specified, then all rooms will be
356
350
  -- checked. Undefined by default.
357
351
  function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
358
- local ____temp_0
352
+ local ____temp_1
359
353
  if onlyCheckRoomTypes == nil then
360
- ____temp_0 = nil
354
+ ____temp_1 = nil
361
355
  else
362
- ____temp_0 = __TS__New(Set, onlyCheckRoomTypes)
356
+ ____temp_1 = __TS__New(Set, onlyCheckRoomTypes)
363
357
  end
364
- local roomTypeWhitelist = ____temp_0
365
- local rooms = ____exports.getRooms(nil)
358
+ local roomTypeWhitelist = ____temp_1
359
+ local rooms = ____exports.getRoomsInGrid(nil)
366
360
  local matchingRooms = roomTypeWhitelist == nil and rooms or __TS__ArrayFilter(
367
361
  rooms,
368
362
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
@@ -385,6 +379,10 @@ function ____exports.roomUpdateSafe(self)
385
379
  setEntityPositions(nil, entityPositions, entities)
386
380
  setEntityVelocities(nil, entityVelocities, entities)
387
381
  end
382
+ --- Helper function to set the backdrop of the current room.
383
+ function ____exports.setBackdrop(self, backdropType)
384
+ game:ShowHallucination(0, backdropType)
385
+ end
388
386
  --- Helper function to convert an uncleared room to a cleared room in the `POST_NEW_ROOM` callback.
389
387
  -- This is useful because if enemies are removed in this callback, a room drop will be awarded and
390
388
  -- the doors will start closed and then open.
@@ -398,12 +396,12 @@ function ____exports.setRoomCleared(self)
398
396
  for ____, door in ipairs(getDoors(nil)) do
399
397
  do
400
398
  if isHiddenSecretRoomDoor(nil, door) then
401
- goto __continue40
399
+ goto __continue48
402
400
  end
403
401
  openDoorFast(nil, door)
404
402
  door.ExtraVisible = false
405
403
  end
406
- ::__continue40::
404
+ ::__continue48::
407
405
  end
408
406
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
409
407
  game:ShakeScreen(0)
package/dist/index.d.ts CHANGED
@@ -84,6 +84,7 @@ export * from "./functions/language";
84
84
  export * from "./functions/level";
85
85
  export * from "./functions/levelGrid";
86
86
  export * from "./functions/log";
87
+ export * from "./functions/logEntities";
87
88
  export * from "./functions/map";
88
89
  export * from "./functions/math";
89
90
  export * from "./functions/mergeTests";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AA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sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
package/dist/index.lua CHANGED
@@ -670,6 +670,14 @@ do
670
670
  end
671
671
  end
672
672
  end
673
+ do
674
+ local ____export = require("functions.logEntities")
675
+ for ____exportKey, ____exportValue in pairs(____export) do
676
+ if ____exportKey ~= "default" then
677
+ ____exports[____exportKey] = ____exportValue
678
+ end
679
+ end
680
+ end
673
681
  do
674
682
  local ____export = require("functions.map")
675
683
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -1,7 +1,7 @@
1
1
  import { LevelStage, StageType } from "isaac-typescript-definitions";
2
2
  export interface CustomTrapdoorDescription {
3
3
  open: boolean;
4
- destination: [stage: LevelStage, stageType: StageType] | string;
4
+ destination: [stage: LevelStage, stageType: StageType] | [customStageName: string, floorNum: int];
5
5
  firstSpawn: boolean;
6
6
  }
7
7
  //# sourceMappingURL=CustomTrapdoorDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EACP,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7C,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -35,12 +35,12 @@ ____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
35
35
  [BackdropType.GREED_SHOP] = RockAltType.URN,
36
36
  [BackdropType.DUNGEON] = RockAltType.URN,
37
37
  [BackdropType.SACRIFICE] = RockAltType.SKULL,
38
- [BackdropType.DOWNPOUR] = RockAltType.BUCKET,
38
+ [BackdropType.DOWNPOUR] = RockAltType.BUCKET_DOWNPOUR,
39
39
  [BackdropType.MINES] = RockAltType.MUSHROOM,
40
40
  [BackdropType.MAUSOLEUM] = RockAltType.SKULL,
41
41
  [BackdropType.CORPSE] = RockAltType.POLYP,
42
42
  [BackdropType.PLANETARIUM] = RockAltType.URN,
43
- [BackdropType.DOWNPOUR_ENTRANCE] = RockAltType.BUCKET,
43
+ [BackdropType.DOWNPOUR_ENTRANCE] = RockAltType.BUCKET_DOWNPOUR,
44
44
  [BackdropType.MINES_ENTRANCE] = RockAltType.MUSHROOM,
45
45
  [BackdropType.MAUSOLEUM_ENTRANCE] = RockAltType.SKULL,
46
46
  [BackdropType.CORPSE_ENTRANCE] = RockAltType.SKULL,
@@ -49,7 +49,7 @@ ____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
49
49
  [BackdropType.MAUSOLEUM_4] = RockAltType.SKULL,
50
50
  [BackdropType.CORPSE_2] = RockAltType.POLYP,
51
51
  [BackdropType.CORPSE_3] = RockAltType.POLYP,
52
- [BackdropType.DROSS] = RockAltType.BUCKET,
52
+ [BackdropType.DROSS] = RockAltType.BUCKET_DROSS,
53
53
  [BackdropType.ASHPIT] = RockAltType.MUSHROOM,
54
54
  [BackdropType.GEHENNA] = RockAltType.SKULL,
55
55
  [BackdropType.MORTIS] = RockAltType.POLYP,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.20.0",
3
+ "version": "6.21.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/index",
23
23
  "types": "dist/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^3.1.1"
25
+ "isaac-typescript-definitions": "^3.1.3"
26
26
  }
27
27
  }
package/src/constants.ts CHANGED
@@ -1,11 +1,19 @@
1
1
  import {
2
2
  CollectibleType,
3
3
  Dimension,
4
+ DisplayFlag,
4
5
  ItemPoolType,
5
6
  TrinketSlot,
6
7
  } from "isaac-typescript-definitions";
7
8
  import { NUM_NORMAL_PILL_COLORS } from "./constantsFirstLast";
8
9
  import { getEnumLength } from "./functions/enums";
10
+ import { addFlag } from "./functions/flag";
11
+
12
+ export const ALL_DISPLAY_FLAGS = addFlag(
13
+ DisplayFlag.VISIBLE,
14
+ DisplayFlag.SHADOW,
15
+ DisplayFlag.SHOW_ICON,
16
+ );
9
17
 
10
18
  /**
11
19
  * The distance of the laser when Azazel does not have any range up items yet. For more info, see
@@ -21,8 +21,8 @@ export const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
21
21
  /**
22
22
  * Will change depending on how many modded collectibles there are.
23
23
  *
24
- * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles. We
25
- * subtract one to account for `CollectibleType.NULL`.)
24
+ * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
25
+ * 666. We subtract one to account for `CollectibleType.NULL`.)
26
26
  */
27
27
  export const LAST_COLLECTIBLE_TYPE = (itemConfig.GetCollectibles().Size -
28
28
  1) as CollectibleType;
@@ -3,5 +3,18 @@ export enum RockAltType {
3
3
  MUSHROOM,
4
4
  SKULL,
5
5
  POLYP,
6
- BUCKET,
6
+
7
+ /**
8
+ * Destroying buckets in Downpour give different outcomes than in Dross.
9
+ *
10
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
11
+ */
12
+ BUCKET_DOWNPOUR,
13
+
14
+ /**
15
+ * Destroying buckets in Dross give different outcomes than in Downpour.
16
+ *
17
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
18
+ */
19
+ BUCKET_DROSS,
7
20
  }