isaacscript-common 87.5.1 → 87.6.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.
- package/dist/callbackClasses.d.ts +1 -0
- package/dist/callbackClasses.d.ts.map +1 -1
- package/dist/callbackClasses.js +5 -3
- package/dist/callbackClasses.lua +4 -0
- package/dist/callbacks.d.ts +118 -117
- package/dist/callbacks.d.ts.map +1 -1
- package/dist/callbacks.js +1 -0
- package/dist/callbacks.lua +1 -0
- package/dist/classes/ModUpgraded.js +2 -2
- package/dist/classes/callbacks/InputActionFilter.js +3 -3
- package/dist/classes/callbacks/InputActionPlayer.js +6 -6
- package/dist/classes/callbacks/PostBoneSwing.js +2 -2
- package/dist/classes/callbacks/PostCollectibleEmpty.js +2 -2
- package/dist/classes/callbacks/PostCursedTeleport.js +5 -5
- package/dist/classes/callbacks/PostDiceRoomActivated.js +2 -2
- package/dist/classes/callbacks/PostEntityRemoveFilter.d.ts +9 -0
- package/dist/classes/callbacks/PostEntityRemoveFilter.d.ts.map +1 -0
- package/dist/classes/callbacks/PostEntityRemoveFilter.js +21 -0
- package/dist/classes/callbacks/PostEntityRemoveFilter.lua +23 -0
- package/dist/classes/callbacks/PostGridEntityCollision.js +10 -10
- package/dist/classes/callbacks/PostGridEntityCustomCollision.js +8 -8
- package/dist/classes/callbacks/PostGridEntityCustomRemove.js +2 -2
- package/dist/classes/callbacks/PostGridEntityRemove.js +3 -3
- package/dist/classes/callbacks/PostItemDischarge.js +2 -2
- package/dist/classes/callbacks/PostKeyboardChanged.js +2 -2
- package/dist/classes/callbacks/PostNewRoomEarly.js +2 -2
- package/dist/classes/callbacks/PostPickupSelectionFilter.d.ts.map +1 -1
- package/dist/classes/callbacks/PostPickupSelectionFilter.js +4 -3
- package/dist/classes/callbacks/PostPlayerChangeHealth.js +2 -2
- package/dist/classes/callbacks/PostPurchase.js +9 -9
- package/dist/classes/callbacks/PostUsePillFilter.js +2 -2
- package/dist/classes/callbacks/PreBerserkDeath.js +4 -4
- package/dist/classes/callbacks/PreEntitySpawnFilter.js +3 -3
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.js +5 -5
- package/dist/classes/features/callbackLogic/EsauJrDetection.js +2 -2
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +5 -5
- package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.js +4 -4
- package/dist/classes/features/callbackLogic/ItemPickupDetection.js +4 -4
- package/dist/classes/features/callbackLogic/PlayerCollectibleDetection.js +2 -2
- package/dist/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/classes/features/other/CustomTrapdoors.js +21 -21
- package/dist/classes/features/other/DeployJSONRoom.js +4 -4
- package/dist/classes/features/other/DisableInputs.js +3 -3
- package/dist/classes/features/other/ModdedElementSets.js +2 -2
- package/dist/classes/features/other/NoSirenSteal.js +4 -4
- package/dist/classes/features/other/PickupIndexCreation.js +5 -5
- package/dist/classes/features/other/PonyDetection.js +2 -2
- package/dist/classes/features/other/PressInput.js +2 -2
- package/dist/classes/features/other/PreventChildEntities.js +4 -4
- package/dist/classes/features/other/RoomHistory.js +5 -5
- package/dist/classes/features/other/SaveDataManager.js +2 -2
- package/dist/classes/features/other/StageHistory.js +2 -2
- package/dist/classes/features/other/StartAmbush.js +2 -2
- package/dist/classes/features/other/TaintedLazarusPlayers.js +2 -2
- package/dist/classes/features/other/customStages/gridEntities.js +4 -4
- package/dist/classes/features/other/customStages/streakText.js +4 -4
- package/dist/classes/features/other/extraConsoleCommands/commands.js +8 -8
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +2 -2
- package/dist/enums/ModCallbackCustom.d.ts +134 -117
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/enums/ModCallbackCustom.js +134 -117
- package/dist/enums/ModCallbackCustom.lua +119 -117
- package/dist/functions/bosses.js +2 -2
- package/dist/functions/charge.js +2 -2
- package/dist/functions/collectibles.js +2 -2
- package/dist/functions/deepCopy.js +6 -6
- package/dist/functions/doors.js +3 -3
- package/dist/functions/easing.js +2 -2
- package/dist/functions/emptyRoom.js +5 -5
- package/dist/functions/entities.js +8 -8
- package/dist/functions/familiars.js +2 -2
- package/dist/functions/flag.js +2 -2
- package/dist/functions/gridEntities.js +23 -23
- package/dist/functions/gridEntitiesSpecific.js +2 -2
- package/dist/functions/isaacAPIClass.js +2 -2
- package/dist/functions/level.js +3 -3
- package/dist/functions/levelGrid.js +6 -6
- package/dist/functions/logEntities.js +8 -8
- package/dist/functions/math.js +4 -4
- package/dist/functions/nextStage.js +10 -10
- package/dist/functions/npcs.js +10 -10
- package/dist/functions/pickupVariants.js +6 -6
- package/dist/functions/playerCollectibles.js +2 -2
- package/dist/functions/playerHealth.js +8 -8
- package/dist/functions/playerIndex.js +3 -3
- package/dist/functions/players.js +4 -4
- package/dist/functions/pocketItems.js +2 -2
- package/dist/functions/revive.js +15 -15
- package/dist/functions/roomGrid.js +2 -2
- package/dist/functions/rooms.d.ts +1 -2
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.js +39 -41
- package/dist/functions/rooms.lua +1 -2
- package/dist/functions/sort.js +2 -2
- package/dist/functions/spawnCollectible.js +3 -3
- package/dist/functions/stage.js +16 -16
- package/dist/functions/string.js +6 -6
- package/dist/functions/tears.js +2 -2
- package/dist/functions/trinketGive.js +4 -4
- package/dist/functions/types.js +3 -3
- package/dist/index.rollup.d.ts +151 -122
- package/dist/interfaces/private/AddCallbackParametersCustom.d.ts +6 -0
- package/dist/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
- package/dist/isaacscript-common.lua +159 -123
- package/dist/lib/jsonLua.js +32 -32
- package/dist/shouldFire.d.ts.map +1 -1
- package/dist/shouldFire.js +54 -57
- package/dist/types/Increment.d.ts.map +1 -1
- package/dist/types/PickingUpItem.d.ts +10 -3
- package/dist/types/PickingUpItem.d.ts.map +1 -1
- package/dist/types/PickingUpItem.js +10 -3
- package/dist/types/PickingUpItem.lua +8 -3
- package/package.json +1 -1
- package/src/callbackClasses.ts +1 -0
- package/src/callbacks.ts +1 -0
- package/src/classes/ModUpgraded.ts +2 -2
- package/src/classes/callbacks/InputActionFilter.ts +3 -3
- package/src/classes/callbacks/InputActionPlayer.ts +6 -6
- package/src/classes/callbacks/PostBoneSwing.ts +2 -2
- package/src/classes/callbacks/PostCollectibleEmpty.ts +2 -2
- package/src/classes/callbacks/PostCursedTeleport.ts +5 -5
- package/src/classes/callbacks/PostDiceRoomActivated.ts +2 -2
- package/src/classes/callbacks/PostEntityRemoveFilter.ts +22 -0
- package/src/classes/callbacks/PostGridEntityCollision.ts +10 -10
- package/src/classes/callbacks/PostGridEntityCustomCollision.ts +8 -8
- package/src/classes/callbacks/PostGridEntityCustomRemove.ts +2 -2
- package/src/classes/callbacks/PostGridEntityRemove.ts +3 -3
- package/src/classes/callbacks/PostItemDischarge.ts +2 -2
- package/src/classes/callbacks/PostKeyboardChanged.ts +2 -2
- package/src/classes/callbacks/PostNewRoomEarly.ts +2 -2
- package/src/classes/callbacks/PostPickupSelectionFilter.ts +4 -3
- package/src/classes/callbacks/PostPlayerChangeHealth.ts +2 -2
- package/src/classes/callbacks/PostPurchase.ts +9 -9
- package/src/classes/callbacks/PostUsePillFilter.ts +2 -2
- package/src/classes/callbacks/PreBerserkDeath.ts +4 -4
- package/src/classes/callbacks/PreEntitySpawnFilter.ts +3 -3
- package/src/classes/callbacks/PreRoomEntitySpawnFilter.ts +5 -5
- package/src/classes/features/callbackLogic/EsauJrDetection.ts +2 -2
- package/src/classes/features/callbackLogic/GameReorderedCallbacks.ts +5 -5
- package/src/classes/features/callbackLogic/GridEntityUpdateDetection.ts +4 -4
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +4 -4
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +2 -2
- package/src/classes/features/other/CustomTrapdoors.ts +23 -21
- package/src/classes/features/other/DeployJSONRoom.ts +4 -4
- package/src/classes/features/other/DisableInputs.ts +3 -3
- package/src/classes/features/other/ModdedElementSets.ts +2 -2
- package/src/classes/features/other/NoSirenSteal.ts +4 -4
- package/src/classes/features/other/PickupIndexCreation.ts +5 -5
- package/src/classes/features/other/PonyDetection.ts +2 -2
- package/src/classes/features/other/PressInput.ts +2 -2
- package/src/classes/features/other/PreventChildEntities.ts +4 -4
- package/src/classes/features/other/RoomHistory.ts +5 -5
- package/src/classes/features/other/SaveDataManager.ts +2 -2
- package/src/classes/features/other/StageHistory.ts +2 -2
- package/src/classes/features/other/StartAmbush.ts +2 -2
- package/src/classes/features/other/TaintedLazarusPlayers.ts +2 -2
- package/src/classes/features/other/customStages/gridEntities.ts +4 -4
- package/src/classes/features/other/customStages/streakText.ts +4 -4
- package/src/classes/features/other/extraConsoleCommands/commands.ts +8 -8
- package/src/classes/features/other/saveDataManager/glowingHourGlass.ts +4 -2
- package/src/enums/ModCallbackCustom.ts +18 -0
- package/src/functions/bosses.ts +2 -2
- package/src/functions/charge.ts +2 -2
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/deepCopy.ts +6 -6
- package/src/functions/doors.ts +3 -3
- package/src/functions/easing.ts +2 -2
- package/src/functions/emptyRoom.ts +5 -5
- package/src/functions/entities.ts +8 -8
- package/src/functions/familiars.ts +2 -2
- package/src/functions/flag.ts +2 -2
- package/src/functions/gridEntities.ts +23 -23
- package/src/functions/gridEntitiesSpecific.ts +2 -2
- package/src/functions/isaacAPIClass.ts +2 -2
- package/src/functions/level.ts +3 -3
- package/src/functions/levelGrid.ts +6 -6
- package/src/functions/logEntities.ts +8 -8
- package/src/functions/math.ts +4 -4
- package/src/functions/nextStage.ts +10 -10
- package/src/functions/npcs.ts +10 -10
- package/src/functions/pickupVariants.ts +6 -6
- package/src/functions/playerCollectibles.ts +2 -2
- package/src/functions/playerHealth.ts +8 -8
- package/src/functions/playerIndex.ts +3 -3
- package/src/functions/players.ts +4 -4
- package/src/functions/pocketItems.ts +2 -2
- package/src/functions/revive.ts +15 -15
- package/src/functions/roomGrid.ts +2 -2
- package/src/functions/rooms.ts +39 -41
- package/src/functions/sort.ts +2 -2
- package/src/functions/spawnCollectible.ts +3 -3
- package/src/functions/stage.ts +16 -16
- package/src/functions/string.ts +6 -6
- package/src/functions/tears.ts +2 -2
- package/src/functions/trinketGive.ts +4 -4
- package/src/functions/types.ts +3 -3
- package/src/interfaces/private/AddCallbackParametersCustom.ts +7 -0
- package/src/lib/jsonLua.js +32 -32
- package/src/shouldFire.ts +54 -57
- package/src/types/Increment.ts +2 -2
- package/src/types/PickingUpItem.ts +10 -3
package/dist/functions/rooms.js
CHANGED
|
@@ -121,8 +121,8 @@ function getReadOnlyRooms() {
|
|
|
121
121
|
const readOnlyRoomDescriptors = [];
|
|
122
122
|
for (let i = 0; i < roomList.Size; i++) {
|
|
123
123
|
const readOnlyRoomDescriptor = roomList.Get(i);
|
|
124
|
-
if (readOnlyRoomDescriptor !== undefined
|
|
125
|
-
readOnlyRoomDescriptor.Data !== undefined) {
|
|
124
|
+
if (readOnlyRoomDescriptor !== undefined
|
|
125
|
+
&& readOnlyRoomDescriptor.Data !== undefined) {
|
|
126
126
|
readOnlyRoomDescriptors.push(readOnlyRoomDescriptor);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -210,8 +210,7 @@ function getRooms(includeExtraDimensionalRooms = false) {
|
|
|
210
210
|
* Room descriptors without any data are assumed to be non-existent and are not included.
|
|
211
211
|
*
|
|
212
212
|
* @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
|
|
213
|
-
* extra-dimensional rooms
|
|
214
|
-
* is false.
|
|
213
|
+
* extra-dimensional rooms will be generated. Default is false.
|
|
215
214
|
*/
|
|
216
215
|
function getRoomsInsideGrid(includeExtraDimensionalRooms = false) {
|
|
217
216
|
const level = cachedClasses_1.game.GetLevel();
|
|
@@ -502,20 +501,20 @@ function isAllRoomsClear(onlyCheckRoomTypes, includeSecretRoom = false, includeS
|
|
|
502
501
|
}
|
|
503
502
|
else {
|
|
504
503
|
const roomTypeWhitelist = new ReadonlySet_1.ReadonlySet(onlyCheckRoomTypes);
|
|
505
|
-
matchingRooms = roomsInsideGrid.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
506
|
-
roomTypeWhitelist.has(roomDescriptor.Data.Type));
|
|
504
|
+
matchingRooms = roomsInsideGrid.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
505
|
+
&& roomTypeWhitelist.has(roomDescriptor.Data.Type));
|
|
507
506
|
}
|
|
508
507
|
if (!includeSecretRoom) {
|
|
509
|
-
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
510
|
-
roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.SECRET);
|
|
508
|
+
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
509
|
+
&& roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.SECRET);
|
|
511
510
|
}
|
|
512
511
|
if (!includeSuperSecretRoom) {
|
|
513
|
-
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
514
|
-
roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.SUPER_SECRET);
|
|
512
|
+
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
513
|
+
&& roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.SUPER_SECRET);
|
|
515
514
|
}
|
|
516
515
|
if (!includeUltraSecretRoom) {
|
|
517
|
-
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
518
|
-
roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.ULTRA_SECRET);
|
|
516
|
+
matchingRooms = matchingRooms.filter((roomDescriptor) => roomDescriptor.Data !== undefined
|
|
517
|
+
&& roomDescriptor.Data.Type !== isaac_typescript_definitions_1.RoomType.ULTRA_SECRET);
|
|
519
518
|
}
|
|
520
519
|
return matchingRooms.every((roomDescriptor) => roomDescriptor.Clear);
|
|
521
520
|
}
|
|
@@ -526,9 +525,9 @@ function isAllRoomsClear(onlyCheckRoomTypes, includeSecretRoom = false, includeS
|
|
|
526
525
|
* being equal to `AngelRoomSubType.SHOP` (1).
|
|
527
526
|
*/
|
|
528
527
|
function isAngelShop(roomData) {
|
|
529
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.ANGEL
|
|
528
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.ANGEL
|
|
530
529
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
531
|
-
roomData.Subtype === isaac_typescript_definitions_1.AngelRoomSubType.SHOP);
|
|
530
|
+
&& roomData.Subtype === isaac_typescript_definitions_1.AngelRoomSubType.SHOP);
|
|
532
531
|
}
|
|
533
532
|
/**
|
|
534
533
|
* Helper function to check to see if the provided room is the Boss Room for The Beast.
|
|
@@ -539,9 +538,9 @@ function isAngelShop(roomData) {
|
|
|
539
538
|
* being equal to `DungeonSubType.BEAST_ROOM` (4).
|
|
540
539
|
*/
|
|
541
540
|
function isBeastRoom(roomData) {
|
|
542
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DUNGEON
|
|
541
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DUNGEON
|
|
543
542
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
544
|
-
roomData.Subtype === isaac_typescript_definitions_1.DungeonSubType.BEAST_ROOM);
|
|
543
|
+
&& roomData.Subtype === isaac_typescript_definitions_1.DungeonSubType.BEAST_ROOM);
|
|
545
544
|
}
|
|
546
545
|
/**
|
|
547
546
|
* Helper function to detect if the provided room is big. Specifically, this is all 1x2 rooms, 2x2
|
|
@@ -555,10 +554,10 @@ function isBigRoom(roomData) {
|
|
|
555
554
|
* only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
556
555
|
*/
|
|
557
556
|
function isBossRoomOf(roomData, bossID) {
|
|
558
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.BOSS
|
|
559
|
-
roomData.StageID === isaac_typescript_definitions_1.StageID.SPECIAL_ROOMS
|
|
557
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.BOSS
|
|
558
|
+
&& roomData.StageID === isaac_typescript_definitions_1.StageID.SPECIAL_ROOMS
|
|
560
559
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
561
|
-
roomData.Subtype === bossID);
|
|
560
|
+
&& roomData.Subtype === bossID);
|
|
562
561
|
}
|
|
563
562
|
/**
|
|
564
563
|
* Helper function for determining whether the provided room is a crawl space. Use this function
|
|
@@ -566,9 +565,9 @@ function isBossRoomOf(roomData, bossID) {
|
|
|
566
565
|
* the player being in a boss fight that takes place in a dungeon.
|
|
567
566
|
*/
|
|
568
567
|
function isCrawlSpace(roomData) {
|
|
569
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DUNGEON
|
|
568
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DUNGEON
|
|
570
569
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
571
|
-
roomData.Subtype === isaac_typescript_definitions_1.DungeonSubType.NORMAL);
|
|
570
|
+
&& roomData.Subtype === isaac_typescript_definitions_1.DungeonSubType.NORMAL);
|
|
572
571
|
}
|
|
573
572
|
/**
|
|
574
573
|
* Helper function for checking whether the provided room is a crawl space with a door corresponding
|
|
@@ -581,11 +580,11 @@ function isCrawlSpaceWithBlackMarketEntrance(roomData) {
|
|
|
581
580
|
* Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
|
|
582
581
|
*/
|
|
583
582
|
function isDeathCertificateArea(roomData) {
|
|
584
|
-
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
583
|
+
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
585
584
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
586
|
-
(roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE
|
|
585
|
+
&& (roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE
|
|
587
586
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
588
|
-
roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.DEATH_CERTIFICATE_ITEMS));
|
|
587
|
+
|| roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.DEATH_CERTIFICATE_ITEMS));
|
|
589
588
|
}
|
|
590
589
|
/**
|
|
591
590
|
* Helper function to detect if the provided room is a Treasure Room created when entering with a
|
|
@@ -610,11 +609,11 @@ function isDevilsCrownTreasureRoom(roomDescriptor) {
|
|
|
610
609
|
* `HomeRoomSubType.LIVING_ROOM` (3).
|
|
611
610
|
*/
|
|
612
611
|
function isDogmaRoom(roomData) {
|
|
613
|
-
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
614
|
-
roomData.Type === isaac_typescript_definitions_1.RoomType.DEFAULT
|
|
615
|
-
roomData.Variant === 1000
|
|
612
|
+
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
613
|
+
&& roomData.Type === isaac_typescript_definitions_1.RoomType.DEFAULT
|
|
614
|
+
&& roomData.Variant === 1000
|
|
616
615
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
617
|
-
roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.LIVING_ROOM);
|
|
616
|
+
&& roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.LIVING_ROOM);
|
|
618
617
|
}
|
|
619
618
|
/**
|
|
620
619
|
* Helper function to detect if the provided room is a Double Trouble Boss Room.
|
|
@@ -644,11 +643,11 @@ function isGenesisRoom(roomGridIndex) {
|
|
|
644
643
|
* Home closets have a unique shape that is different from any other room in the game.
|
|
645
644
|
*/
|
|
646
645
|
function isHomeCloset(roomData) {
|
|
647
|
-
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
646
|
+
return (roomData.StageID === isaac_typescript_definitions_1.StageID.HOME
|
|
648
647
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
649
|
-
(roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.CLOSET_LEFT
|
|
648
|
+
&& (roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.CLOSET_LEFT
|
|
650
649
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
651
|
-
roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.CLOSET_RIGHT));
|
|
650
|
+
|| roomData.Subtype === isaac_typescript_definitions_1.HomeRoomSubType.CLOSET_RIGHT));
|
|
652
651
|
}
|
|
653
652
|
/** Helper function to determine if the provided room is one of the four L room shapes. */
|
|
654
653
|
function isLRoom(roomData) {
|
|
@@ -666,31 +665,30 @@ function isMegaSatanRoom(roomGridIndex) {
|
|
|
666
665
|
* the Mines/Ashpit.
|
|
667
666
|
*/
|
|
668
667
|
function isMineShaft(roomData) {
|
|
669
|
-
return ((roomData.StageID === isaac_typescript_definitions_1.StageID.MINES ||
|
|
670
|
-
roomData.StageID === isaac_typescript_definitions_1.StageID.ASHPIT) &&
|
|
668
|
+
return ((roomData.StageID === isaac_typescript_definitions_1.StageID.MINES || roomData.StageID === isaac_typescript_definitions_1.StageID.ASHPIT)
|
|
671
669
|
// eslint-disable-next-line complete/strict-enums
|
|
672
|
-
mineShaftRoomSubTypesSet_1.MINE_SHAFT_ROOM_SUB_TYPE_SET.has(roomData.Subtype));
|
|
670
|
+
&& mineShaftRoomSubTypesSet_1.MINE_SHAFT_ROOM_SUB_TYPE_SET.has(roomData.Subtype));
|
|
673
671
|
}
|
|
674
672
|
/**
|
|
675
673
|
* Helper function to check if the provided room is a miniboss room for a particular miniboss. This
|
|
676
674
|
* will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
677
675
|
*/
|
|
678
676
|
function isMinibossRoomOf(roomData, minibossID) {
|
|
679
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.MINI_BOSS
|
|
680
|
-
roomData.StageID === isaac_typescript_definitions_1.StageID.SPECIAL_ROOMS
|
|
677
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.MINI_BOSS
|
|
678
|
+
&& roomData.StageID === isaac_typescript_definitions_1.StageID.SPECIAL_ROOMS
|
|
681
679
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
682
|
-
roomData.Subtype === minibossID);
|
|
680
|
+
&& roomData.Subtype === minibossID);
|
|
683
681
|
}
|
|
684
682
|
/**
|
|
685
683
|
* Helper function to check if the provided room is a "mirror room" in Downpour or Dross. (These
|
|
686
684
|
* rooms are marked with a specific sub-type.)
|
|
687
685
|
*/
|
|
688
686
|
function isMirrorRoom(roomData) {
|
|
689
|
-
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DEFAULT
|
|
690
|
-
(roomData.StageID === isaac_typescript_definitions_1.StageID.DOWNPOUR
|
|
691
|
-
roomData.StageID === isaac_typescript_definitions_1.StageID.DROSS)
|
|
687
|
+
return (roomData.Type === isaac_typescript_definitions_1.RoomType.DEFAULT
|
|
688
|
+
&& (roomData.StageID === isaac_typescript_definitions_1.StageID.DOWNPOUR
|
|
689
|
+
|| roomData.StageID === isaac_typescript_definitions_1.StageID.DROSS)
|
|
692
690
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
693
|
-
roomData.Subtype === isaac_typescript_definitions_1.DownpourRoomSubType.MIRROR);
|
|
691
|
+
&& roomData.Subtype === isaac_typescript_definitions_1.DownpourRoomSubType.MIRROR);
|
|
694
692
|
}
|
|
695
693
|
/**
|
|
696
694
|
* Helper function to check if the provided room matches one of the given room shapes.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -99,8 +99,7 @@ end
|
|
|
99
99
|
-- Room descriptors without any data are assumed to be non-existent and are not included.
|
|
100
100
|
--
|
|
101
101
|
-- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
|
|
102
|
-
-- extra-dimensional rooms
|
|
103
|
-
-- is false.
|
|
102
|
+
-- extra-dimensional rooms will be generated. Default is false.
|
|
104
103
|
function ____exports.getRoomsInsideGrid(self, includeExtraDimensionalRooms)
|
|
105
104
|
if includeExtraDimensionalRooms == nil then
|
|
106
105
|
includeExtraDimensionalRooms = false
|
package/dist/functions/sort.js
CHANGED
|
@@ -124,8 +124,8 @@ array, sortFunc = sortNormal) {
|
|
|
124
124
|
const mergedArray = [];
|
|
125
125
|
let leftIndex = 0;
|
|
126
126
|
let rightIndex = 0;
|
|
127
|
-
while (leftIndex < sortedLeftArray.length
|
|
128
|
-
rightIndex < sortedRightArray.length) {
|
|
127
|
+
while (leftIndex < sortedLeftArray.length
|
|
128
|
+
&& rightIndex < sortedRightArray.length) {
|
|
129
129
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
130
130
|
const left = sortedLeftArray[leftIndex];
|
|
131
131
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -42,9 +42,9 @@ function spawnCollectible(collectibleType, positionOrGridIndex, seedOrRNG, optio
|
|
|
42
42
|
if (options) {
|
|
43
43
|
collectible.OptionsPickupIndex = 1;
|
|
44
44
|
}
|
|
45
|
-
if ((0, players_1.anyPlayerIs)(isaac_typescript_definitions_1.PlayerType.KEEPER_B)
|
|
46
|
-
!(0, collectibleTag_1.isQuestCollectible)(collectibleType)
|
|
47
|
-
!forceFreeItem) {
|
|
45
|
+
if ((0, players_1.anyPlayerIs)(isaac_typescript_definitions_1.PlayerType.KEEPER_B)
|
|
46
|
+
&& !(0, collectibleTag_1.isQuestCollectible)(collectibleType)
|
|
47
|
+
&& !forceFreeItem) {
|
|
48
48
|
// When playing Tainted Keeper, collectibles are supposed to have a price, and manually spawned
|
|
49
49
|
// items will not have a price, so we have to set it manually.
|
|
50
50
|
// Setting the shop item ID in this way prevents the bug where the item will sometimes change to
|
package/dist/functions/stage.js
CHANGED
|
@@ -235,10 +235,10 @@ function getStageTypeSuffix(stageType) {
|
|
|
235
235
|
* I AM ERROR room is never entered into the list of possibilities.
|
|
236
236
|
*/
|
|
237
237
|
function isFinalFloor(stage, stageType) {
|
|
238
|
-
return (stage === isaac_typescript_definitions_1.LevelStage.DARK_ROOM_CHEST
|
|
239
|
-
stage === isaac_typescript_definitions_1.LevelStage.VOID
|
|
240
|
-
stage === isaac_typescript_definitions_1.LevelStage.HOME
|
|
241
|
-
(stage === isaac_typescript_definitions_1.LevelStage.WOMB_2 && isRepentanceStage(stageType)) // Corpse 2
|
|
238
|
+
return (stage === isaac_typescript_definitions_1.LevelStage.DARK_ROOM_CHEST
|
|
239
|
+
|| stage === isaac_typescript_definitions_1.LevelStage.VOID
|
|
240
|
+
|| stage === isaac_typescript_definitions_1.LevelStage.HOME
|
|
241
|
+
|| (stage === isaac_typescript_definitions_1.LevelStage.WOMB_2 && isRepentanceStage(stageType)) // Corpse 2
|
|
242
242
|
);
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
@@ -257,8 +257,8 @@ function isRepentanceStage(stageType) {
|
|
|
257
257
|
* the `Level.GetStage` method).
|
|
258
258
|
*/
|
|
259
259
|
function isStageWithNaturalDevilRoom(effectiveStage) {
|
|
260
|
-
return ((0, utils_1.inRange)(effectiveStage, isaac_typescript_definitions_1.LevelStage.BASEMENT_2, isaac_typescript_definitions_1.LevelStage.WOMB_2)
|
|
261
|
-
effectiveStage !== isaac_typescript_definitions_1.LevelStage.BLUE_WOMB);
|
|
260
|
+
return ((0, utils_1.inRange)(effectiveStage, isaac_typescript_definitions_1.LevelStage.BASEMENT_2, isaac_typescript_definitions_1.LevelStage.WOMB_2)
|
|
261
|
+
&& effectiveStage !== isaac_typescript_definitions_1.LevelStage.BLUE_WOMB);
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
264
264
|
* Helper function to check if the provided stage is one that will have a random collectible drop
|
|
@@ -287,8 +287,8 @@ function isStageWithSecretExitToDownpour(stage) {
|
|
|
287
287
|
*/
|
|
288
288
|
function isStageWithSecretExitToMausoleum(stage, stageType) {
|
|
289
289
|
const repentanceStage = isRepentanceStage(stageType);
|
|
290
|
-
return ((stage === isaac_typescript_definitions_1.LevelStage.DEPTHS_1 && !repentanceStage)
|
|
291
|
-
(stage === isaac_typescript_definitions_1.LevelStage.CAVES_2 && repentanceStage));
|
|
290
|
+
return ((stage === isaac_typescript_definitions_1.LevelStage.DEPTHS_1 && !repentanceStage)
|
|
291
|
+
|| (stage === isaac_typescript_definitions_1.LevelStage.CAVES_2 && repentanceStage));
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
294
|
* Helper function to check if the provided stage and stage type will spawn a wooden door to
|
|
@@ -296,8 +296,8 @@ function isStageWithSecretExitToMausoleum(stage, stageType) {
|
|
|
296
296
|
*/
|
|
297
297
|
function isStageWithSecretExitToMines(stage, stageType) {
|
|
298
298
|
const repentanceStage = isRepentanceStage(stageType);
|
|
299
|
-
return ((stage === isaac_typescript_definitions_1.LevelStage.CAVES_1 && !repentanceStage)
|
|
300
|
-
(stage === isaac_typescript_definitions_1.LevelStage.BASEMENT_2 && repentanceStage));
|
|
299
|
+
return ((stage === isaac_typescript_definitions_1.LevelStage.CAVES_1 && !repentanceStage)
|
|
300
|
+
|| (stage === isaac_typescript_definitions_1.LevelStage.BASEMENT_2 && repentanceStage));
|
|
301
301
|
}
|
|
302
302
|
/**
|
|
303
303
|
* Helper function to check if the current stage is one that would create a trapdoor if We Need to
|
|
@@ -305,8 +305,8 @@ function isStageWithSecretExitToMines(stage, stageType) {
|
|
|
305
305
|
*/
|
|
306
306
|
function isStageWithShovelTrapdoors(stage, stageType) {
|
|
307
307
|
const repentanceStage = isRepentanceStage(stageType);
|
|
308
|
-
return (stage < isaac_typescript_definitions_1.LevelStage.WOMB_2
|
|
309
|
-
(stage === isaac_typescript_definitions_1.LevelStage.WOMB_2 && !repentanceStage));
|
|
308
|
+
return (stage < isaac_typescript_definitions_1.LevelStage.WOMB_2
|
|
309
|
+
|| (stage === isaac_typescript_definitions_1.LevelStage.WOMB_2 && !repentanceStage));
|
|
310
310
|
}
|
|
311
311
|
/**
|
|
312
312
|
* Helper function to check if the provided stage is one with a story boss. Specifically, this is
|
|
@@ -328,15 +328,15 @@ function onCathedral() {
|
|
|
328
328
|
const level = cachedClasses_1.game.GetLevel();
|
|
329
329
|
const stage = level.GetStage();
|
|
330
330
|
const stageType = level.GetStageType();
|
|
331
|
-
return (stage === isaac_typescript_definitions_1.LevelStage.SHEOL_CATHEDRAL
|
|
332
|
-
stageType === isaac_typescript_definitions_1.StageType.WRATH_OF_THE_LAMB);
|
|
331
|
+
return (stage === isaac_typescript_definitions_1.LevelStage.SHEOL_CATHEDRAL
|
|
332
|
+
&& stageType === isaac_typescript_definitions_1.StageType.WRATH_OF_THE_LAMB);
|
|
333
333
|
}
|
|
334
334
|
function onChest() {
|
|
335
335
|
const level = cachedClasses_1.game.GetLevel();
|
|
336
336
|
const stage = level.GetStage();
|
|
337
337
|
const stageType = level.GetStageType();
|
|
338
|
-
return (stage === isaac_typescript_definitions_1.LevelStage.DARK_ROOM_CHEST
|
|
339
|
-
stageType === isaac_typescript_definitions_1.StageType.WRATH_OF_THE_LAMB);
|
|
338
|
+
return (stage === isaac_typescript_definitions_1.LevelStage.DARK_ROOM_CHEST
|
|
339
|
+
&& stageType === isaac_typescript_definitions_1.StageType.WRATH_OF_THE_LAMB);
|
|
340
340
|
}
|
|
341
341
|
function onDarkRoom() {
|
|
342
342
|
const level = cachedClasses_1.game.GetLevel();
|
package/dist/functions/string.js
CHANGED
|
@@ -124,17 +124,17 @@ function getPartialMatch(searchText, array) {
|
|
|
124
124
|
*/
|
|
125
125
|
function parseSemanticVersion(versionString) {
|
|
126
126
|
const [majorVersionString, minorVersionString, patchVersionString] = string.match(versionString, "(%d+).(%d+).(%d+)");
|
|
127
|
-
if (majorVersionString === undefined
|
|
128
|
-
minorVersionString === undefined
|
|
129
|
-
patchVersionString === undefined) {
|
|
127
|
+
if (majorVersionString === undefined
|
|
128
|
+
|| minorVersionString === undefined
|
|
129
|
+
|| patchVersionString === undefined) {
|
|
130
130
|
return undefined;
|
|
131
131
|
}
|
|
132
132
|
const majorVersion = (0, types_1.parseIntSafe)(majorVersionString);
|
|
133
133
|
const minorVersion = (0, types_1.parseIntSafe)(minorVersionString);
|
|
134
134
|
const patchVersion = (0, types_1.parseIntSafe)(patchVersionString);
|
|
135
|
-
if (majorVersion === undefined
|
|
136
|
-
minorVersion === undefined
|
|
137
|
-
patchVersion === undefined) {
|
|
135
|
+
if (majorVersion === undefined
|
|
136
|
+
|| minorVersion === undefined
|
|
137
|
+
|| patchVersion === undefined) {
|
|
138
138
|
return undefined;
|
|
139
139
|
}
|
|
140
140
|
return { majorVersion, minorVersion, patchVersion };
|
package/dist/functions/tears.js
CHANGED
|
@@ -95,8 +95,8 @@ function isTearFromFamiliar(tear, familiarVariant, subType) {
|
|
|
95
95
|
if (familiar === undefined) {
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
|
-
return ((familiarVariant === undefined || familiarVariant === familiar.Variant)
|
|
99
|
-
(subType === undefined || subType === familiar.SubType));
|
|
98
|
+
return ((familiarVariant === undefined || familiarVariant === familiar.Variant)
|
|
99
|
+
&& (subType === undefined || subType === familiar.SubType));
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* Helper function to check if a given tear is from a player (as opposed to e.g. a familiar). This
|
|
@@ -99,13 +99,13 @@ function temporarilyRemoveTrinket(player, trinketType) {
|
|
|
99
99
|
numTrinkets++;
|
|
100
100
|
}
|
|
101
101
|
let numSmeltedTrinkets = numTrinkets;
|
|
102
|
-
const trinketWasInSlot1 = trinketType1 === trinketType
|
|
103
|
-
trinketType1 === (0, trinkets_1.getGoldenTrinketType)(trinketType);
|
|
102
|
+
const trinketWasInSlot1 = trinketType1 === trinketType
|
|
103
|
+
|| trinketType1 === (0, trinkets_1.getGoldenTrinketType)(trinketType);
|
|
104
104
|
if (trinketWasInSlot1) {
|
|
105
105
|
numSmeltedTrinkets--;
|
|
106
106
|
}
|
|
107
|
-
const trinketWasInSlot2 = trinketType2 === trinketType
|
|
108
|
-
trinketType2 === (0, trinkets_1.getGoldenTrinketType)(trinketType);
|
|
107
|
+
const trinketWasInSlot2 = trinketType2 === trinketType
|
|
108
|
+
|| trinketType2 === (0, trinkets_1.getGoldenTrinketType)(trinketType);
|
|
109
109
|
if (trinketWasInSlot2) {
|
|
110
110
|
numSmeltedTrinkets--;
|
|
111
111
|
}
|
package/dist/functions/types.js
CHANGED
|
@@ -187,9 +187,9 @@ function isNumber(variable) {
|
|
|
187
187
|
/** Helper function to detect if a variable is a boolean, number, or string. */
|
|
188
188
|
function isPrimitive(variable) {
|
|
189
189
|
const variableType = typeof variable;
|
|
190
|
-
return (variableType === "boolean"
|
|
191
|
-
variableType === "number"
|
|
192
|
-
variableType === "string");
|
|
190
|
+
return (variableType === "boolean"
|
|
191
|
+
|| variableType === "number"
|
|
192
|
+
|| variableType === "string");
|
|
193
193
|
}
|
|
194
194
|
function isString(variable) {
|
|
195
195
|
return typeof variable === "string";
|