isaacscript-common 1.0.548 → 1.0.549
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.
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
export declare function changeRoom(roomGridIndex: int): void;
|
|
8
8
|
export declare function getAllRoomGridIndexes(): int[];
|
|
9
9
|
export declare function getCurrentDimension(): Dimension;
|
|
10
|
+
/** An alias to the `Level.GetCurrentRoomDesc()` method. */
|
|
11
|
+
export declare function getCurrentRoomDescReadOnly(): RoomDescriptorReadOnly;
|
|
10
12
|
export declare function getRoomData(): RoomConfig | undefined;
|
|
11
13
|
/**
|
|
12
14
|
* Helper function to get the type for the room from the XML/STB data. The room data type will
|
|
@@ -126,6 +128,11 @@ export declare function inCrawlspace(): boolean;
|
|
|
126
128
|
* with the Death Certificate area.
|
|
127
129
|
*/
|
|
128
130
|
export declare function inDeathCertificateArea(): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Helper function to detect if the current room is a Treasure Room created when entering with a
|
|
133
|
+
* Devil's Crown trinket. Under the hood, this checks for the `RoomDescriptorFlag.DEVIL_TREASURE`
|
|
134
|
+
* flag.
|
|
135
|
+
*/
|
|
129
136
|
export declare function inDevilsCrownTreasureRoom(): boolean;
|
|
130
137
|
export declare function inDimension(dimension: Dimension): boolean;
|
|
131
138
|
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
@@ -152,6 +159,11 @@ export declare function inStartingRoom(): boolean;
|
|
|
152
159
|
* default.
|
|
153
160
|
*/
|
|
154
161
|
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Helper function to detect if the current room was created by the Red Key item. Under the hood,
|
|
164
|
+
* this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
|
|
165
|
+
*/
|
|
166
|
+
export declare function isRedKeyRoom(): boolean;
|
|
155
167
|
/**
|
|
156
168
|
* Helper function to determine whether or not the current room is part of the floor layout. For
|
|
157
169
|
* example, Devil Rooms and the Mega Satan room are not considered to be inside the map.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -17,6 +17,11 @@ local setEntityPositions = ____entity.setEntityPositions
|
|
|
17
17
|
local setEntityVelocities = ____entity.setEntityVelocities
|
|
18
18
|
local ____flag = require("functions.flag")
|
|
19
19
|
local hasFlag = ____flag.hasFlag
|
|
20
|
+
function ____exports.getCurrentRoomDescReadOnly(self)
|
|
21
|
+
local game = Game()
|
|
22
|
+
local level = game:GetLevel()
|
|
23
|
+
return level:GetCurrentRoomDesc()
|
|
24
|
+
end
|
|
20
25
|
function ____exports.getRoomData(self)
|
|
21
26
|
local game = Game()
|
|
22
27
|
local level = game:GetLevel()
|
|
@@ -25,9 +30,7 @@ function ____exports.getRoomData(self)
|
|
|
25
30
|
return roomDesc.Data
|
|
26
31
|
end
|
|
27
32
|
function ____exports.getRoomSafeGridIndex(self)
|
|
28
|
-
local
|
|
29
|
-
local level = game:GetLevel()
|
|
30
|
-
local roomDesc = level:GetCurrentRoomDesc()
|
|
33
|
+
local roomDesc = ____exports.getCurrentRoomDescReadOnly(nil)
|
|
31
34
|
return roomDesc.SafeGridIndex
|
|
32
35
|
end
|
|
33
36
|
function ____exports.getRoomStageID(self)
|
|
@@ -130,9 +133,7 @@ function ____exports.getRoomDataType(self)
|
|
|
130
133
|
return roomData.Type
|
|
131
134
|
end
|
|
132
135
|
function ____exports.getRoomListIndex(self)
|
|
133
|
-
local
|
|
134
|
-
local level = game:GetLevel()
|
|
135
|
-
local roomDesc = level:GetCurrentRoomDesc()
|
|
136
|
+
local roomDesc = ____exports.getCurrentRoomDescReadOnly(nil)
|
|
136
137
|
return roomDesc.ListIndex
|
|
137
138
|
end
|
|
138
139
|
function ____exports.getRoomGridIndexesForType(self, roomType)
|
|
@@ -169,9 +170,7 @@ function ____exports.getRoomVariant(self)
|
|
|
169
170
|
return roomData.Variant
|
|
170
171
|
end
|
|
171
172
|
function ____exports.getRoomVisitedCount(self)
|
|
172
|
-
local
|
|
173
|
-
local level = game:GetLevel()
|
|
174
|
-
local roomDesc = level:GetCurrentRoomDesc()
|
|
173
|
+
local roomDesc = ____exports.getCurrentRoomDescReadOnly(nil)
|
|
175
174
|
return roomDesc.VisitedCount
|
|
176
175
|
end
|
|
177
176
|
function ____exports.gridToPos(self, x, y)
|
|
@@ -214,9 +213,7 @@ function ____exports.inCrawlspace(self)
|
|
|
214
213
|
return (roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType ~= 4)
|
|
215
214
|
end
|
|
216
215
|
function ____exports.inDevilsCrownTreasureRoom(self)
|
|
217
|
-
local
|
|
218
|
-
local level = game:GetLevel()
|
|
219
|
-
local roomDesc = level:GetCurrentRoomDesc()
|
|
216
|
+
local roomDesc = ____exports.getCurrentRoomDescReadOnly(nil)
|
|
220
217
|
return hasFlag(nil, roomDesc.Flags, 2048)
|
|
221
218
|
end
|
|
222
219
|
function ____exports.inDimension(self, dimension)
|
|
@@ -259,20 +256,24 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
|
259
256
|
do
|
|
260
257
|
local roomData = roomDesc.Data
|
|
261
258
|
if roomData == nil then
|
|
262
|
-
goto
|
|
259
|
+
goto __continue49
|
|
263
260
|
end
|
|
264
261
|
local roomType = roomData.Type
|
|
265
262
|
if (roomTypeWhitelist ~= nil) and (not roomTypeWhitelist:has(roomType)) then
|
|
266
|
-
goto
|
|
263
|
+
goto __continue49
|
|
267
264
|
end
|
|
268
265
|
if not roomDesc.Clear then
|
|
269
266
|
return false
|
|
270
267
|
end
|
|
271
268
|
end
|
|
272
|
-
::
|
|
269
|
+
::__continue49::
|
|
273
270
|
end
|
|
274
271
|
return true
|
|
275
272
|
end
|
|
273
|
+
function ____exports.isRedKeyRoom(self)
|
|
274
|
+
local roomDesc = ____exports.getCurrentRoomDescReadOnly(nil)
|
|
275
|
+
return hasFlag(nil, roomDesc.Flags, 1024)
|
|
276
|
+
end
|
|
276
277
|
function ____exports.isRoomInsideMap(self)
|
|
277
278
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
278
279
|
return roomSafeGridIndex >= 0
|
|
@@ -301,14 +302,14 @@ function ____exports.setRoomCleared(self)
|
|
|
301
302
|
) do
|
|
302
303
|
do
|
|
303
304
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
304
|
-
goto
|
|
305
|
+
goto __continue58
|
|
305
306
|
end
|
|
306
307
|
door.State = DoorState.STATE_OPEN
|
|
307
308
|
local sprite = door:GetSprite()
|
|
308
309
|
sprite:Play("Opened", true)
|
|
309
310
|
door.ExtraVisible = false
|
|
310
311
|
end
|
|
311
|
-
::
|
|
312
|
+
::__continue58::
|
|
312
313
|
end
|
|
313
314
|
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
314
315
|
game:ShakeScreen(0)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Alias for the `Seeds.GetStartSeedString` method. */
|
|
2
2
|
export declare function getStartSeedString(): string;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* consider Downpour 2 to have a stage of 3.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getEffectiveStage(): int;
|
|
8
|
-
/**
|
|
8
|
+
/** Alias for the `Level.GetStage` method. */
|
|
9
9
|
export declare function getStage(): LevelStage;
|
|
10
|
-
/**
|
|
10
|
+
/** Alias for the `Level.GetStageType` method. */
|
|
11
11
|
export declare function getStageType(): StageType;
|
|
12
12
|
/** Helper function to directly warp to a specific stage using the "stage" console command. */
|
|
13
13
|
export declare function goToStage(stage: LevelStage, stageType: StageType): void;
|