isaacscript-common 29.5.4 → 29.5.5

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.
@@ -7541,9 +7541,13 @@ export declare function isAllPressurePlatesPushed(): boolean;
7541
7541
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
7542
7542
  * the array will be ignored. If not specified, then all rooms will be
7543
7543
  * checked. Undefined by default.
7544
+ * @param includeSecretAndSuperSecretRoom Optional. Whether or not to include the Secret Room and
7545
+ * the Super Secret Room. Default is false.
7546
+ * @param includeUltraSecretRoom Optional. Whether or not to include the Ultra Secret Room. Default
7547
+ * is false.
7544
7548
  * @allowEmptyVariadic
7545
7549
  */
7546
- export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
7550
+ export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[], includeSecretAndSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean;
7547
7551
 
7548
7552
  export declare function isAngelRoomDoor(door: GridEntityDoor): boolean;
7549
7553
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 29.5.4
3
+ isaacscript-common 29.5.5
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -27395,7 +27395,13 @@ function ____exports.inStartingRoom(self)
27395
27395
  local roomGridIndex = getRoomGridIndex(nil)
27396
27396
  return roomGridIndex == startingRoomGridIndex and inDimension(nil, Dimension.MAIN)
27397
27397
  end
27398
- function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
27398
+ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretAndSuperSecretRoom, includeUltraSecretRoom)
27399
+ if includeSecretAndSuperSecretRoom == nil then
27400
+ includeSecretAndSuperSecretRoom = false
27401
+ end
27402
+ if includeUltraSecretRoom == nil then
27403
+ includeUltraSecretRoom = false
27404
+ end
27399
27405
  local rooms = ____exports.getRoomsInsideGrid(nil)
27400
27406
  local matchingRooms
27401
27407
  if onlyCheckRoomTypes == nil then
@@ -27407,6 +27413,18 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
27407
27413
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
27408
27414
  )
27409
27415
  end
27416
+ if not includeSecretAndSuperSecretRoom then
27417
+ matchingRooms = __TS__ArrayFilter(
27418
+ matchingRooms,
27419
+ function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomDescriptor.Data.Type ~= RoomType.SECRET and roomDescriptor.Data.Type ~= RoomType.SUPER_SECRET end
27420
+ )
27421
+ end
27422
+ if not includeUltraSecretRoom then
27423
+ matchingRooms = __TS__ArrayFilter(
27424
+ matchingRooms,
27425
+ function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomDescriptor.Data.Type ~= RoomType.ULTRA_SECRET end
27426
+ )
27427
+ end
27410
27428
  return __TS__ArrayEvery(
27411
27429
  matchingRooms,
27412
27430
  function(____, roomDescriptor) return roomDescriptor.Clear end
@@ -27438,12 +27456,12 @@ function ____exports.setRoomCleared(self)
27438
27456
  for ____, door in ipairs(getDoors(nil)) do
27439
27457
  do
27440
27458
  if isHiddenSecretRoomDoor(nil, door) then
27441
- goto __continue56
27459
+ goto __continue60
27442
27460
  end
27443
27461
  openDoorFast(nil, door)
27444
27462
  door.ExtraVisible = false
27445
27463
  end
27446
- ::__continue56::
27464
+ ::__continue60::
27447
27465
  end
27448
27466
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
27449
27467
  game:ShakeScreen(0)
@@ -195,9 +195,13 @@ export declare function inStartingRoom(): boolean;
195
195
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
196
196
  * the array will be ignored. If not specified, then all rooms will be
197
197
  * checked. Undefined by default.
198
+ * @param includeSecretAndSuperSecretRoom Optional. Whether or not to include the Secret Room and
199
+ * the Super Secret Room. Default is false.
200
+ * @param includeUltraSecretRoom Optional. Whether or not to include the Ultra Secret Room. Default
201
+ * is false.
198
202
  * @allowEmptyVariadic
199
203
  */
200
- export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
204
+ export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[], includeSecretAndSuperSecretRoom?: boolean, includeUltraSecretRoom?: boolean): boolean;
201
205
  /**
202
206
  * Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
203
207
  * Secret Room.
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAyCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAclC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAOlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,4BAA4B,UAAQ,GACnC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AAY,IAAI,OAAO,CAItC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAMxC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAC/B,+BAA+B,UAAQ,EACvC,sBAAsB,UAAQ,GAC7B,OAAO,CAiCT;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
@@ -404,8 +404,18 @@ end
404
404
  -- @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
405
405
  -- the array will be ignored. If not specified, then all rooms will be
406
406
  -- checked. Undefined by default.
407
+ -- @param includeSecretAndSuperSecretRoom Optional. Whether or not to include the Secret Room and
408
+ -- the Super Secret Room. Default is false.
409
+ -- @param includeUltraSecretRoom Optional. Whether or not to include the Ultra Secret Room. Default
410
+ -- is false.
407
411
  -- @allowEmptyVariadic
408
- function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
412
+ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretAndSuperSecretRoom, includeUltraSecretRoom)
413
+ if includeSecretAndSuperSecretRoom == nil then
414
+ includeSecretAndSuperSecretRoom = false
415
+ end
416
+ if includeUltraSecretRoom == nil then
417
+ includeUltraSecretRoom = false
418
+ end
409
419
  local rooms = ____exports.getRoomsInsideGrid(nil)
410
420
  local matchingRooms
411
421
  if onlyCheckRoomTypes == nil then
@@ -417,6 +427,18 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
417
427
  function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
418
428
  )
419
429
  end
430
+ if not includeSecretAndSuperSecretRoom then
431
+ matchingRooms = __TS__ArrayFilter(
432
+ matchingRooms,
433
+ function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomDescriptor.Data.Type ~= RoomType.SECRET and roomDescriptor.Data.Type ~= RoomType.SUPER_SECRET end
434
+ )
435
+ end
436
+ if not includeUltraSecretRoom then
437
+ matchingRooms = __TS__ArrayFilter(
438
+ matchingRooms,
439
+ function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomDescriptor.Data.Type ~= RoomType.ULTRA_SECRET end
440
+ )
441
+ end
420
442
  return __TS__ArrayEvery(
421
443
  matchingRooms,
422
444
  function(____, roomDescriptor) return roomDescriptor.Clear end
@@ -458,12 +480,12 @@ function ____exports.setRoomCleared(self)
458
480
  for ____, door in ipairs(getDoors(nil)) do
459
481
  do
460
482
  if isHiddenSecretRoomDoor(nil, door) then
461
- goto __continue56
483
+ goto __continue60
462
484
  end
463
485
  openDoorFast(nil, door)
464
486
  door.ExtraVisible = false
465
487
  end
466
- ::__continue56::
488
+ ::__continue60::
467
489
  end
468
490
  sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
469
491
  game:ShakeScreen(0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "29.5.4",
3
+ "version": "29.5.5",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -541,9 +541,17 @@ export function inStartingRoom(): boolean {
541
541
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
542
542
  * the array will be ignored. If not specified, then all rooms will be
543
543
  * checked. Undefined by default.
544
+ * @param includeSecretAndSuperSecretRoom Optional. Whether or not to include the Secret Room and
545
+ * the Super Secret Room. Default is false.
546
+ * @param includeUltraSecretRoom Optional. Whether or not to include the Ultra Secret Room. Default
547
+ * is false.
544
548
  * @allowEmptyVariadic
545
549
  */
546
- export function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean {
550
+ export function isAllRoomsClear(
551
+ onlyCheckRoomTypes?: RoomType[],
552
+ includeSecretAndSuperSecretRoom = false,
553
+ includeUltraSecretRoom = false,
554
+ ): boolean {
547
555
  const rooms = getRoomsInsideGrid();
548
556
 
549
557
  let matchingRooms: RoomDescriptor[];
@@ -558,6 +566,23 @@ export function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean {
558
566
  );
559
567
  }
560
568
 
569
+ if (!includeSecretAndSuperSecretRoom) {
570
+ matchingRooms = matchingRooms.filter(
571
+ (roomDescriptor) =>
572
+ roomDescriptor.Data !== undefined &&
573
+ roomDescriptor.Data.Type !== RoomType.SECRET &&
574
+ roomDescriptor.Data.Type !== RoomType.SUPER_SECRET,
575
+ );
576
+ }
577
+
578
+ if (!includeUltraSecretRoom) {
579
+ matchingRooms = matchingRooms.filter(
580
+ (roomDescriptor) =>
581
+ roomDescriptor.Data !== undefined &&
582
+ roomDescriptor.Data.Type !== RoomType.ULTRA_SECRET,
583
+ );
584
+ }
585
+
561
586
  return matchingRooms.every((roomDescriptor) => roomDescriptor.Clear);
562
587
  }
563
588