isaacscript-common 1.2.220 → 1.2.223
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/extraConsoleCommands/commands.lua +3 -2
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/functions/collectibles.d.ts +2 -2
- package/dist/functions/collectibles.lua +1 -1
- package/dist/functions/roomData.d.ts +7 -0
- package/dist/functions/roomData.lua +10 -0
- package/dist/functions/rooms.d.ts +4 -0
- package/dist/functions/rooms.lua +32 -6
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ local ____playerIndex = require("functions.playerIndex")
|
|
|
40
40
|
local getPlayers = ____playerIndex.getPlayers
|
|
41
41
|
local ____roomData = require("functions.roomData")
|
|
42
42
|
local getRoomData = ____roomData.getRoomData
|
|
43
|
+
local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
43
44
|
local ____rooms = require("functions.rooms")
|
|
44
45
|
local changeRoom = ____rooms.changeRoom
|
|
45
46
|
local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
|
|
@@ -129,8 +130,8 @@ function devilAngel(self, useDevil)
|
|
|
129
130
|
local roomType = devilAngelRoomData.Type
|
|
130
131
|
local conflictingType = useDevil and RoomType.ROOM_ANGEL or RoomType.ROOM_DEVIL
|
|
131
132
|
if roomType == conflictingType then
|
|
132
|
-
local
|
|
133
|
-
|
|
133
|
+
local roomDescriptor = getRoomDescriptor(nil, GridRooms.ROOM_DEVIL_IDX)
|
|
134
|
+
roomDescriptor.Data = nil
|
|
134
135
|
end
|
|
135
136
|
end
|
|
136
137
|
if useDevil then
|
|
@@ -77,7 +77,7 @@ function restoreDefaults(self, childTableName)
|
|
|
77
77
|
end
|
|
78
78
|
local childTableDefaults = saveDataDefaults[childTableName]
|
|
79
79
|
if childTableDefaults == nil then
|
|
80
|
-
logError((("Failed to find the default copy of the child table \"" .. childTableName) .. "\" for subscriber
|
|
80
|
+
logError(((("Failed to find the default copy of the child table \"" .. childTableName) .. "\" for subscriber \"") .. subscriberName) .. "\". This error usually means that your save data is out of date. You can try purging all of your save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data")
|
|
81
81
|
goto __continue14
|
|
82
82
|
end
|
|
83
83
|
local childTableDefaultsTable = childTableDefaults
|
|
@@ -17,8 +17,8 @@ export declare function getCollectibleDescription(collectibleType: CollectibleTy
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function getCollectibleDevilHeartPrice(collectibleType: CollectibleType | int, player: EntityPlayer): PickupPrice;
|
|
19
19
|
/**
|
|
20
|
-
* Helper function to get the path to a collectible's sprite. Returns
|
|
21
|
-
*
|
|
20
|
+
* Helper function to get the path to a collectible's sprite. Returns the path to the question mark
|
|
21
|
+
* sprite (i.e. from Curse of the Blind) if the provided collectible type was not valid.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getCollectibleGfxFilename(collectibleType: CollectibleType | int): string;
|
|
24
24
|
/**
|
|
@@ -114,7 +114,7 @@ end
|
|
|
114
114
|
function ____exports.getCollectibleGfxFilename(self, collectibleType)
|
|
115
115
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
116
116
|
if itemConfigItem == nil then
|
|
117
|
-
return
|
|
117
|
+
return BLIND_ITEM_PNG_PATH
|
|
118
118
|
end
|
|
119
119
|
return itemConfigItem.GfxFileName
|
|
120
120
|
end
|
|
@@ -56,6 +56,13 @@ export declare function getRoomListIndex(roomGridIndex?: int): int;
|
|
|
56
56
|
* @returns The room name. Returns "Unknown" if the type was not found.
|
|
57
57
|
*/
|
|
58
58
|
export declare function getRoomName(roomGridIndex?: int): string;
|
|
59
|
+
/**
|
|
60
|
+
* Helper function to get the name of the room as it appears in the STB/XML data.
|
|
61
|
+
*
|
|
62
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
63
|
+
* @returns The room name. Returns "Unknown" if the type was not found.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getRoomShape(roomGridIndex?: int): RoomShape | undefined;
|
|
59
66
|
/**
|
|
60
67
|
* Helper function to get the stage ID for a room from the XML/STB data. The room stage ID will
|
|
61
68
|
* correspond to the first number in the filename of the XML/STB file. For example, a Depths room
|
|
@@ -61,6 +61,16 @@ function ____exports.getRoomName(self, roomGridIndex)
|
|
|
61
61
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
62
62
|
return roomData == nil and "Unknown" or roomData.Name
|
|
63
63
|
end
|
|
64
|
+
function ____exports.getRoomShape(self, roomGridIndex)
|
|
65
|
+
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
66
|
+
local ____temp_0
|
|
67
|
+
if roomData == nil then
|
|
68
|
+
____temp_0 = nil
|
|
69
|
+
else
|
|
70
|
+
____temp_0 = roomData.Shape
|
|
71
|
+
end
|
|
72
|
+
return ____temp_0
|
|
73
|
+
end
|
|
64
74
|
function ____exports.getRoomStageID(self, roomGridIndex)
|
|
65
75
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
66
76
|
return roomData == nil and -1 or roomData.StageID
|
|
@@ -114,6 +114,8 @@ export declare function inStartingRoom(): boolean;
|
|
|
114
114
|
* default.
|
|
115
115
|
*/
|
|
116
116
|
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
|
|
117
|
+
export declare function isDoorSlotValidAtGridIndex(doorSlot: DoorSlot, roomGridIndex: int): boolean;
|
|
118
|
+
export declare function isDoorSlotValidAtGridIndexForRedRoom(doorSlot: DoorSlot, roomGridIndex: int): boolean;
|
|
117
119
|
/**
|
|
118
120
|
* Helper function to detect if the provided room was created by the Red Key item. Under the hood,
|
|
119
121
|
* this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
|
|
@@ -128,6 +130,8 @@ export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
|
|
|
128
130
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
129
131
|
*/
|
|
130
132
|
export declare function isRoomInsideMap(roomGridIndex?: int): boolean;
|
|
133
|
+
/** Helper function to check if a room exists at the given room grid index. */
|
|
134
|
+
export declare function roomExists(roomGridIndex: int): boolean;
|
|
131
135
|
/**
|
|
132
136
|
* If the `Room.Update` method is called in a PostNewRoom callback, then some entities will slide
|
|
133
137
|
* around (such as the player). Since those entity velocities are already at zero, setting them to
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -33,9 +33,11 @@ local setEntityPositions = ____positionVelocity.setEntityPositions
|
|
|
33
33
|
local setEntityVelocities = ____positionVelocity.setEntityVelocities
|
|
34
34
|
local ____roomData = require("functions.roomData")
|
|
35
35
|
local getCurrentRoomDescriptorReadOnly = ____roomData.getCurrentRoomDescriptorReadOnly
|
|
36
|
+
local getRoomAllowedDoors = ____roomData.getRoomAllowedDoors
|
|
36
37
|
local getRoomData = ____roomData.getRoomData
|
|
37
38
|
local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
38
39
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
40
|
+
local getRoomShape = ____roomData.getRoomShape
|
|
39
41
|
local getRoomStageID = ____roomData.getRoomStageID
|
|
40
42
|
local getRoomSubType = ____roomData.getRoomSubType
|
|
41
43
|
function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
@@ -75,6 +77,10 @@ function ____exports.inDeathCertificateArea(self)
|
|
|
75
77
|
local roomSubType = getRoomSubType(nil)
|
|
76
78
|
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 34)
|
|
77
79
|
end
|
|
80
|
+
function ____exports.roomExists(self, roomGridIndex)
|
|
81
|
+
local roomData = getRoomData(nil, roomGridIndex)
|
|
82
|
+
return roomData ~= nil
|
|
83
|
+
end
|
|
78
84
|
function ____exports.changeRoom(self, roomGridIndex)
|
|
79
85
|
local level = game:GetLevel()
|
|
80
86
|
local roomData = getRoomData(nil, roomGridIndex)
|
|
@@ -97,11 +103,11 @@ function ____exports.getCurrentDimension(self)
|
|
|
97
103
|
return 2
|
|
98
104
|
end
|
|
99
105
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
100
|
-
local
|
|
101
|
-
local startingRoomHash = GetPtrHash(
|
|
106
|
+
local startingRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, -1)
|
|
107
|
+
local startingRoomHash = GetPtrHash(startingRoomDescription)
|
|
102
108
|
for ____, dimension in ipairs(range(nil, 0, NUM_DIMENSIONS - 1)) do
|
|
103
|
-
local
|
|
104
|
-
local dimensionRoomHash = GetPtrHash(
|
|
109
|
+
local dimensionRoomDescription = level:GetRoomByIdx(startingRoomGridIndex, dimension)
|
|
110
|
+
local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
|
|
105
111
|
if dimensionRoomHash == startingRoomHash then
|
|
106
112
|
return dimension
|
|
107
113
|
end
|
|
@@ -226,6 +232,26 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
|
226
232
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
227
233
|
)
|
|
228
234
|
end
|
|
235
|
+
function ____exports.isDoorSlotValidAtGridIndex(self, doorSlot, roomGridIndex)
|
|
236
|
+
local allowedDoors = getRoomAllowedDoors(nil, roomGridIndex)
|
|
237
|
+
return allowedDoors:has(doorSlot)
|
|
238
|
+
end
|
|
239
|
+
function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGridIndex)
|
|
240
|
+
local doorSlotValidAtGridIndex = ____exports.isDoorSlotValidAtGridIndex(nil, doorSlot, roomGridIndex)
|
|
241
|
+
if not doorSlotValidAtGridIndex then
|
|
242
|
+
return false
|
|
243
|
+
end
|
|
244
|
+
local roomShape = getRoomShape(nil, roomGridIndex)
|
|
245
|
+
if roomShape == nil then
|
|
246
|
+
return false
|
|
247
|
+
end
|
|
248
|
+
local delta = ____exports.getGridIndexDelta(nil, roomShape, doorSlot)
|
|
249
|
+
if delta == nil then
|
|
250
|
+
return false
|
|
251
|
+
end
|
|
252
|
+
local redRoomGridIndex = roomGridIndex + delta
|
|
253
|
+
return not ____exports.roomExists(nil, redRoomGridIndex)
|
|
254
|
+
end
|
|
229
255
|
function ____exports.isRedKeyRoom(self, roomGridIndex)
|
|
230
256
|
local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
|
|
231
257
|
return hasFlag(nil, roomDescriptor.Flags, 1024)
|
|
@@ -255,12 +281,12 @@ function ____exports.setRoomCleared(self)
|
|
|
255
281
|
for ____, door in ipairs(getDoors(nil)) do
|
|
256
282
|
do
|
|
257
283
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
258
|
-
goto
|
|
284
|
+
goto __continue54
|
|
259
285
|
end
|
|
260
286
|
openDoorFast(nil, door)
|
|
261
287
|
door.ExtraVisible = false
|
|
262
288
|
end
|
|
263
|
-
::
|
|
289
|
+
::__continue54::
|
|
264
290
|
end
|
|
265
291
|
sfxManager:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
266
292
|
game:ShakeScreen(0)
|