isaacscript-common 1.0.514 → 1.0.515
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.
|
@@ -133,6 +133,13 @@ export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
|
|
|
133
133
|
* starting room of the mirror world does not count).
|
|
134
134
|
*/
|
|
135
135
|
export declare function inStartingRoom(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Helper function to loop through every room on the floor and see if it has been cleared.
|
|
138
|
+
*
|
|
139
|
+
* @param onlyCheckRoomTypes Optional. A whitelist of room types. Room types not in the provided
|
|
140
|
+
* array will be ignored. If not specified, then all rooms will be checked. Undefined by default.
|
|
141
|
+
*/
|
|
142
|
+
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
|
|
136
143
|
/**
|
|
137
144
|
* Helper function to determine whether or not the current room is part of the floor layout. For
|
|
138
145
|
* example, Devil Rooms and the Mega Satan room are not considered to be inside the map.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -231,6 +231,37 @@ function ____exports.inStartingRoom(self)
|
|
|
231
231
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
232
232
|
return (roomSafeGridIndex == startingRoomGridIndex) and ____exports.inDimension(nil, 0)
|
|
233
233
|
end
|
|
234
|
+
function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
235
|
+
local game = Game()
|
|
236
|
+
local level = game:GetLevel()
|
|
237
|
+
local rooms = level:GetRooms()
|
|
238
|
+
local roomTypeWhitelist = (((onlyCheckRoomTypes == nil) and (function() return nil end)) or (function() return __TS__New(Set, onlyCheckRoomTypes) end))()
|
|
239
|
+
do
|
|
240
|
+
local i = 0
|
|
241
|
+
while i < rooms.Size do
|
|
242
|
+
do
|
|
243
|
+
local roomDesc = rooms:Get(i)
|
|
244
|
+
if roomDesc == nil then
|
|
245
|
+
goto __continue42
|
|
246
|
+
end
|
|
247
|
+
local roomData = roomDesc.Data
|
|
248
|
+
if roomData == nil then
|
|
249
|
+
goto __continue42
|
|
250
|
+
end
|
|
251
|
+
local roomType = roomData.Type
|
|
252
|
+
if (roomTypeWhitelist ~= nil) and (not roomTypeWhitelist:has(roomType)) then
|
|
253
|
+
goto __continue42
|
|
254
|
+
end
|
|
255
|
+
if not roomDesc.Clear then
|
|
256
|
+
return false
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
::__continue42::
|
|
260
|
+
i = i + 1
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
return true
|
|
264
|
+
end
|
|
234
265
|
function ____exports.isRoomInsideMap(self)
|
|
235
266
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
236
267
|
return roomSafeGridIndex >= 0
|
|
@@ -259,14 +290,14 @@ function ____exports.setRoomCleared(self)
|
|
|
259
290
|
) do
|
|
260
291
|
do
|
|
261
292
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
262
|
-
goto
|
|
293
|
+
goto __continue51
|
|
263
294
|
end
|
|
264
295
|
door.State = DoorState.STATE_OPEN
|
|
265
296
|
local sprite = door:GetSprite()
|
|
266
297
|
sprite:Play("Opened", true)
|
|
267
298
|
door.ExtraVisible = false
|
|
268
299
|
end
|
|
269
|
-
::
|
|
300
|
+
::__continue51::
|
|
270
301
|
end
|
|
271
302
|
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
272
303
|
game:ShakeScreen(0)
|