isaacscript-common 20.18.0 → 21.0.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/index.d.ts +23 -33
- package/dist/isaacscript-common.lua +676 -508
- package/dist/src/callbacks.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostBoneSwing.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostBoneSwing.lua +3 -2
- package/dist/src/classes/callbacks/PreNewLevel.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PreNewLevel.lua +3 -2
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.lua +4 -2
- package/dist/src/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
- package/dist/src/classes/features/other/DeployJSONRoom.lua +3 -2
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +7 -4
- package/dist/src/classes/features/other/SaveDataManager.d.ts.map +1 -1
- package/dist/src/classes/features/other/SaveDataManager.lua +3 -2
- package/dist/src/classes/features/other/customStages/backdrop.lua +3 -2
- package/dist/src/classes/features/other/customStages/shadows.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/streakText.d.ts.map +1 -1
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.d.ts.map +1 -1
- package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +3 -2
- package/dist/src/core/constants.d.ts +4 -6
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +17 -13
- package/dist/src/features.d.ts.map +1 -1
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/bosses.lua +3 -2
- package/dist/src/functions/cards.lua +3 -3
- package/dist/src/functions/characters.d.ts.map +1 -1
- package/dist/src/functions/characters.lua +3 -2
- package/dist/src/functions/doors.d.ts.map +1 -1
- package/dist/src/functions/doors.lua +9 -7
- package/dist/src/functions/emptyRoom.d.ts.map +1 -1
- package/dist/src/functions/emptyRoom.lua +3 -2
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +67 -64
- package/dist/src/functions/globals.d.ts.map +1 -1
- package/dist/src/functions/globals.lua +6 -4
- package/dist/src/functions/gridEntities.d.ts.map +1 -1
- package/dist/src/functions/gridEntities.lua +5 -3
- package/dist/src/functions/input.d.ts.map +1 -1
- package/dist/src/functions/input.lua +4 -3
- package/dist/src/functions/logEntities.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +3 -2
- package/dist/src/functions/npcs.d.ts.map +1 -1
- package/dist/src/functions/npcs.lua +4 -3
- package/dist/src/functions/playerIndex.d.ts.map +1 -1
- package/dist/src/functions/playerIndex.lua +3 -2
- package/dist/src/functions/readOnly.d.ts +26 -0
- package/dist/src/functions/readOnly.d.ts.map +1 -0
- package/dist/src/functions/readOnly.lua +31 -0
- package/dist/src/functions/roomGrid.lua +4 -1
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -1
- package/dist/src/functions/roomShapeWalls.lua +9 -10
- package/dist/src/functions/serialization.d.ts.map +1 -1
- package/dist/src/functions/serialization.lua +3 -2
- package/dist/src/functions/slots.d.ts.map +1 -1
- package/dist/src/functions/slots.lua +3 -2
- package/dist/src/functions/stats.d.ts.map +1 -1
- package/dist/src/functions/stats.lua +3 -2
- package/dist/src/functions/transformations.d.ts.map +1 -1
- package/dist/src/functions/transformations.lua +6 -3
- package/dist/src/functions/utils.d.ts +1 -1
- package/dist/src/functions/utils.lua +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +16 -0
- package/dist/src/maps/PHDPillConversions.d.ts.map +1 -1
- package/dist/src/maps/PHDPillConversions.lua +3 -2
- package/dist/src/maps/cardNameToTypeMap.d.ts.map +1 -1
- package/dist/src/maps/cardNameToTypeMap.lua +3 -2
- package/dist/src/maps/characterNameToTypeMap.d.ts.map +1 -1
- package/dist/src/maps/characterNameToTypeMap.lua +3 -2
- package/dist/src/maps/collectibleDescriptionMap.d.ts.map +1 -1
- package/dist/src/maps/collectibleDescriptionMap.lua +3 -2
- package/dist/src/maps/collectibleNameToTypeMap.d.ts +5 -0
- package/dist/src/maps/collectibleNameToTypeMap.d.ts.map +1 -1
- package/dist/src/maps/collectibleNameToTypeMap.lua +10 -8
- package/dist/src/maps/collectibleTypeToNameMap.d.ts.map +1 -1
- package/dist/src/maps/collectibleTypeToNameMap.lua +3 -2
- package/dist/src/maps/defaultPlayerStatMap.d.ts +5 -2
- package/dist/src/maps/defaultPlayerStatMap.d.ts.map +1 -1
- package/dist/src/maps/defaultPlayerStatMap.lua +3 -2
- package/dist/src/maps/falsePHDPillConversions.d.ts.map +1 -1
- package/dist/src/maps/falsePHDPillConversions.lua +3 -2
- package/dist/src/maps/gridEntityTypeToBrokenStateMap.d.ts +1 -1
- package/dist/src/maps/gridEntityTypeToBrokenStateMap.d.ts.map +1 -1
- package/dist/src/maps/gridEntityTypeToBrokenStateMap.lua +3 -2
- package/dist/src/maps/gridEntityXMLMap.d.ts +1 -4
- package/dist/src/maps/gridEntityXMLMap.d.ts.map +1 -1
- package/dist/src/maps/gridEntityXMLMap.lua +3 -2
- package/dist/src/maps/keyboardToString.d.ts.map +1 -1
- package/dist/src/maps/keyboardToString.lua +3 -2
- package/dist/src/maps/pillNameToEffectMap.d.ts.map +1 -1
- package/dist/src/maps/pillNameToEffectMap.lua +3 -2
- package/dist/src/maps/roomNameToTypeMap.d.ts.map +1 -1
- package/dist/src/maps/roomNameToTypeMap.lua +3 -2
- package/dist/src/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +1 -1
- package/dist/src/maps/roomShapeToTopLeftWallGridIndexMap.d.ts.map +1 -1
- package/dist/src/maps/roomShapeToTopLeftWallGridIndexMap.lua +3 -2
- package/dist/src/maps/transformationNameToPlayerFormMap.d.ts.map +1 -1
- package/dist/src/maps/transformationNameToPlayerFormMap.lua +3 -2
- package/dist/src/maps/trinketDescriptionMap.d.ts.map +1 -1
- package/dist/src/maps/trinketDescriptionMap.lua +3 -2
- package/dist/src/maps/trinketNameToTypeMap.d.ts +5 -0
- package/dist/src/maps/trinketNameToTypeMap.d.ts.map +1 -1
- package/dist/src/maps/trinketNameToTypeMap.lua +10 -8
- package/dist/src/maps/trinketTypeToNameMap.d.ts.map +1 -1
- package/dist/src/maps/trinketTypeToNameMap.lua +3 -2
- package/dist/src/objects/LRoomShapeToRectangles.d.ts +8 -6
- package/dist/src/objects/LRoomShapeToRectangles.d.ts.map +1 -1
- package/dist/src/objects/LRoomShapeToRectangles.lua +19 -17
- package/dist/src/objects/backdropTypeToRockAltType.d.ts.map +1 -1
- package/dist/src/objects/bossNamePNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/bossPortraitPNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/cardDescriptions.d.ts.map +1 -1
- package/dist/src/objects/cardNames.d.ts.map +1 -1
- package/dist/src/objects/challengeNames.d.ts.map +1 -1
- package/dist/src/objects/characterDamageMultipliers.d.ts.map +1 -1
- package/dist/src/objects/characterNames.d.ts.map +1 -1
- package/dist/src/objects/coinSubTypeToValue.d.ts.map +1 -1
- package/dist/src/objects/directionNames.d.ts.map +1 -1
- package/dist/src/objects/directionToDegrees.d.ts.map +1 -1
- package/dist/src/objects/directionToMoveAction.d.ts.map +1 -1
- package/dist/src/objects/directionToShootAction.d.ts.map +1 -1
- package/dist/src/objects/directionToVector.d.ts +5 -2
- package/dist/src/objects/directionToVector.d.ts.map +1 -1
- package/dist/src/objects/directionToVector.lua +6 -4
- package/dist/src/objects/doorSlotFlagToDoorSlot.d.ts.map +1 -1
- package/dist/src/objects/doorSlotToDirection.d.ts.map +1 -1
- package/dist/src/objects/doorSlotToDoorSlotFlag.d.ts.map +1 -1
- package/dist/src/objects/isaacAPIClassTypeToBrand.d.ts.map +1 -1
- package/dist/src/objects/languageNames.d.ts.map +1 -1
- package/dist/src/objects/oppositeDoorSlots.d.ts.map +1 -1
- package/dist/src/objects/pillEffectClasses.d.ts.map +1 -1
- package/dist/src/objects/pillEffectNames.d.ts.map +1 -1
- package/dist/src/objects/pillEffectTypes.d.ts.map +1 -1
- package/dist/src/objects/playerNamePNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/playerPortraitPNGFileNames.d.ts.map +1 -1
- package/dist/src/objects/roomShapeBounds.d.ts +12 -2
- package/dist/src/objects/roomShapeBounds.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts +237 -3
- package/dist/src/objects/roomShapeCorners.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.lua +58 -56
- package/dist/src/objects/roomShapeLayoutSizes.d.ts +12 -2
- package/dist/src/objects/roomShapeLayoutSizes.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToBottomRightPosition.d.ts +12 -2
- package/dist/src/objects/roomShapeToBottomRightPosition.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToBottomRightPosition.lua +10 -8
- package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts +88 -2
- package/dist/src/objects/roomShapeToDoorSlotCoordinates.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlotCoordinates.lua +71 -74
- package/dist/src/objects/roomShapeToDoorSlots.d.ts +13 -2
- package/dist/src/objects/roomShapeToDoorSlots.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlots.lua +10 -9
- package/dist/src/objects/roomShapeToDoorSlotsToGridIndexDelta.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +14 -13
- package/dist/src/objects/roomShapeToGridWidth.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToTopLeftPosition.d.ts +12 -2
- package/dist/src/objects/roomShapeToTopLeftPosition.d.ts.map +1 -1
- package/dist/src/objects/roomShapeToTopLeftPosition.lua +5 -3
- package/dist/src/objects/roomShapeVolumes.d.ts.map +1 -1
- package/dist/src/objects/roomTypeGotoPrefixes.d.ts.map +1 -1
- package/dist/src/objects/roomTypeNames.d.ts.map +1 -1
- package/dist/src/objects/stageToMusic.d.ts.map +1 -1
- package/dist/src/objects/stageTypeSuffixes.d.ts.map +1 -1
- package/dist/src/objects/stageTypeToLetter.d.ts.map +1 -1
- package/dist/src/objects/transformationNames.d.ts.map +1 -1
- package/dist/src/objects/versusScreenBackgroundColors.d.ts +29 -2
- package/dist/src/objects/versusScreenBackgroundColors.d.ts.map +1 -1
- package/dist/src/objects/versusScreenBackgroundColors.lua +29 -27
- package/dist/src/objects/versusScreenDirtSpotColors.d.ts +29 -2
- package/dist/src/objects/versusScreenDirtSpotColors.d.ts.map +1 -1
- package/dist/src/objects/versusScreenDirtSpotColors.lua +29 -27
- package/dist/src/sets/LRoomShapesSet.d.ts.map +1 -1
- package/dist/src/sets/LRoomShapesSet.lua +3 -2
- package/dist/src/sets/bossSets.d.ts +2 -3
- package/dist/src/sets/bossSets.d.ts.map +1 -1
- package/dist/src/sets/bossSets.lua +52 -49
- package/dist/src/sets/charactersThatStartWithAnActiveItemSet.d.ts.map +1 -1
- package/dist/src/sets/charactersThatStartWithAnActiveItemSet.lua +3 -2
- package/dist/src/sets/charactersWithBlackHeartFromEternalHeartSet.d.ts.map +1 -1
- package/dist/src/sets/charactersWithBlackHeartFromEternalHeartSet.lua +3 -2
- package/dist/src/sets/charactersWithFreeDevilDealsSet.d.ts.map +1 -1
- package/dist/src/sets/charactersWithFreeDevilDealsSet.lua +3 -2
- package/dist/src/sets/charactersWithNoRedHeartsSet.d.ts.map +1 -1
- package/dist/src/sets/charactersWithNoRedHeartsSet.lua +3 -2
- package/dist/src/sets/charactersWithNoSoulHeartsSet.d.ts.map +1 -1
- package/dist/src/sets/charactersWithNoSoulHeartsSet.lua +3 -2
- package/dist/src/sets/chestPickupVariantsSet.d.ts.map +1 -1
- package/dist/src/sets/chestPickupVariantsSet.lua +3 -2
- package/dist/src/sets/consoleCommandsSet.d.ts.map +1 -1
- package/dist/src/sets/consoleCommandsSet.lua +3 -2
- package/dist/src/sets/entitiesWithArmorSet.d.ts.map +1 -1
- package/dist/src/sets/entitiesWithArmorSet.lua +3 -2
- package/dist/src/sets/familiarsThatShootPlayerTearsSet.d.ts.map +1 -1
- package/dist/src/sets/familiarsThatShootPlayerTearsSet.lua +3 -2
- package/dist/src/sets/itemConfigCardTypesForCardsSet.d.ts +4 -0
- package/dist/src/sets/itemConfigCardTypesForCardsSet.d.ts.map +1 -0
- package/dist/src/sets/itemConfigCardTypesForCardsSet.lua +10 -0
- package/dist/src/sets/lostStyleCharactersSet.d.ts.map +1 -1
- package/dist/src/sets/lostStyleCharactersSet.lua +3 -2
- package/dist/src/sets/mineShaftRoomSubTypesSet.d.ts.map +1 -1
- package/dist/src/sets/mineShaftRoomSubTypesSet.lua +3 -2
- package/dist/src/sets/narrowRoomShapesSet.d.ts.map +1 -1
- package/dist/src/sets/narrowRoomShapesSet.lua +3 -2
- package/dist/src/sets/redHeartSubTypesSet.d.ts.map +1 -1
- package/dist/src/sets/redHeartSubTypesSet.lua +3 -2
- package/dist/src/sets/sinEntityTypesSet.d.ts.map +1 -1
- package/dist/src/sets/sinEntityTypesSet.lua +3 -2
- package/dist/src/sets/singleUseActiveCollectibleTypesSet.d.ts.map +1 -1
- package/dist/src/sets/singleUseActiveCollectibleTypesSet.lua +3 -2
- package/dist/src/sets/storyBossesSet.d.ts.map +1 -1
- package/dist/src/sets/storyBossesSet.lua +3 -2
- package/dist/src/types/PickingUpItem.d.ts.map +1 -1
- package/dist/src/types/PickingUpItem.lua +3 -2
- package/dist/src/types/ReadonlyMap.d.ts +9 -0
- package/dist/src/types/ReadonlyMap.d.ts.map +1 -0
- package/dist/src/types/ReadonlyMap.lua +6 -0
- package/dist/src/types/ReadonlySet.d.ts +8 -0
- package/dist/src/types/ReadonlySet.d.ts.map +1 -0
- package/dist/src/types/ReadonlySet.lua +6 -0
- package/package.json +1 -1
- package/src/callbacks.ts +1 -2
- package/src/classes/callbacks/PostBoneSwing.ts +2 -1
- package/src/classes/callbacks/PreNewLevel.ts +2 -1
- package/src/classes/features/other/CustomTrapdoors.ts +2 -1
- package/src/classes/features/other/DeployJSONRoom.ts +5 -2
- package/src/classes/features/other/ModdedElementSets.ts +20 -22
- package/src/classes/features/other/SaveDataManager.ts +2 -1
- package/src/classes/features/other/customStages/backdrop.ts +3 -3
- package/src/classes/features/other/customStages/shadows.ts +1 -2
- package/src/classes/features/other/customStages/streakText.ts +1 -2
- package/src/classes/features/other/saveDataManager/restoreDefaults.ts +2 -1
- package/src/core/constants.ts +18 -17
- package/src/features.ts +1 -2
- package/src/functions/bosses.ts +2 -1
- package/src/functions/cards.ts +2 -2
- package/src/functions/characters.ts +2 -1
- package/src/functions/doors.ts +15 -4
- package/src/functions/emptyRoom.ts +2 -1
- package/src/functions/entities.ts +3 -2
- package/src/functions/globals.ts +4 -3
- package/src/functions/gridEntities.ts +5 -4
- package/src/functions/input.ts +3 -2
- package/src/functions/logEntities.ts +2 -1
- package/src/functions/npcs.ts +3 -2
- package/src/functions/playerIndex.ts +2 -1
- package/src/functions/readOnly.ts +42 -0
- package/src/functions/roomGrid.ts +2 -2
- package/src/functions/roomShapeWalls.ts +3 -5
- package/src/functions/serialization.ts +2 -3
- package/src/functions/slots.ts +2 -1
- package/src/functions/stats.ts +2 -1
- package/src/functions/transformations.ts +19 -18
- package/src/functions/utils.ts +1 -1
- package/src/index.ts +2 -1
- package/src/maps/PHDPillConversions.ts +19 -19
- package/src/maps/cardNameToTypeMap.ts +2 -1
- package/src/maps/characterNameToTypeMap.ts +86 -86
- package/src/maps/collectibleDescriptionMap.ts +726 -724
- package/src/maps/collectibleNameToTypeMap.ts +10 -7
- package/src/maps/collectibleTypeToNameMap.ts +3 -4
- package/src/maps/defaultPlayerStatMap.ts +2 -1
- package/src/maps/falsePHDPillConversions.ts +36 -33
- package/src/maps/gridEntityTypeToBrokenStateMap.ts +3 -2
- package/src/maps/gridEntityXMLMap.ts +3 -2
- package/src/maps/keyboardToString.ts +3 -2
- package/src/maps/pillNameToEffectMap.ts +85 -86
- package/src/maps/roomNameToTypeMap.ts +2 -1
- package/src/maps/roomShapeToTopLeftWallGridIndexMap.ts +3 -2
- package/src/maps/transformationNameToPlayerFormMap.ts +3 -2
- package/src/maps/trinketDescriptionMap.ts +191 -192
- package/src/maps/trinketNameToTypeMap.ts +10 -7
- package/src/maps/trinketTypeToNameMap.ts +191 -193
- package/src/objects/LRoomShapeToRectangles.ts +35 -28
- package/src/objects/backdropTypeToRockAltType.ts +1 -2
- package/src/objects/bossNamePNGFileNames.ts +1 -2
- package/src/objects/bossPortraitPNGFileNames.ts +1 -2
- package/src/objects/cardDescriptions.ts +1 -2
- package/src/objects/cardNames.ts +1 -2
- package/src/objects/challengeNames.ts +1 -2
- package/src/objects/characterDamageMultipliers.ts +1 -2
- package/src/objects/characterNames.ts +1 -2
- package/src/objects/coinSubTypeToValue.ts +1 -2
- package/src/objects/directionNames.ts +1 -2
- package/src/objects/directionToDegrees.ts +1 -2
- package/src/objects/directionToMoveAction.ts +1 -2
- package/src/objects/directionToShootAction.ts +1 -2
- package/src/objects/directionToVector.ts +7 -10
- package/src/objects/doorSlotFlagToDoorSlot.ts +1 -2
- package/src/objects/doorSlotToDirection.ts +1 -2
- package/src/objects/doorSlotToDoorSlotFlag.ts +1 -2
- package/src/objects/isaacAPIClassTypeToBrand.ts +1 -5
- package/src/objects/languageNames.ts +1 -2
- package/src/objects/oppositeDoorSlots.ts +1 -2
- package/src/objects/pillEffectClasses.ts +1 -2
- package/src/objects/pillEffectNames.ts +1 -2
- package/src/objects/pillEffectTypes.ts +1 -2
- package/src/objects/playerNamePNGFileNames.ts +1 -2
- package/src/objects/playerPortraitPNGFileNames.ts +1 -2
- package/src/objects/roomShapeBounds.ts +3 -7
- package/src/objects/roomShapeCorners.ts +59 -62
- package/src/objects/roomShapeLayoutSizes.ts +6 -10
- package/src/objects/roomShapeToBottomRightPosition.ts +11 -17
- package/src/objects/roomShapeToDoorSlotCoordinates.ts +93 -94
- package/src/objects/roomShapeToDoorSlots.ts +11 -14
- package/src/objects/roomShapeToDoorSlotsToGridIndexDelta.ts +15 -14
- package/src/objects/roomShapeToGridWidth.ts +1 -2
- package/src/objects/roomShapeToTopLeftPosition.ts +6 -9
- package/src/objects/roomShapeVolumes.ts +1 -2
- package/src/objects/roomTypeGotoPrefixes.ts +1 -2
- package/src/objects/roomTypeNames.ts +1 -2
- package/src/objects/stageToMusic.ts +10 -11
- package/src/objects/stageTypeSuffixes.ts +1 -2
- package/src/objects/stageTypeToLetter.ts +1 -2
- package/src/objects/transformationNames.ts +1 -2
- package/src/objects/versusScreenBackgroundColors.ts +30 -33
- package/src/objects/versusScreenDirtSpotColors.ts +30 -33
- package/src/sets/LRoomShapesSet.ts +2 -1
- package/src/sets/bossSets.ts +51 -49
- package/src/sets/charactersThatStartWithAnActiveItemSet.ts +3 -2
- package/src/sets/charactersWithBlackHeartFromEternalHeartSet.ts +3 -2
- package/src/sets/charactersWithFreeDevilDealsSet.ts +4 -2
- package/src/sets/charactersWithNoRedHeartsSet.ts +11 -11
- package/src/sets/charactersWithNoSoulHeartsSet.ts +8 -8
- package/src/sets/chestPickupVariantsSet.ts +2 -1
- package/src/sets/consoleCommandsSet.ts +3 -1
- package/src/sets/entitiesWithArmorSet.ts +2 -1
- package/src/sets/familiarsThatShootPlayerTearsSet.ts +3 -2
- package/src/sets/itemConfigCardTypesForCardsSet.ts +11 -0
- package/src/sets/lostStyleCharactersSet.ts +2 -1
- package/src/sets/mineShaftRoomSubTypesSet.ts +8 -8
- package/src/sets/narrowRoomShapesSet.ts +2 -1
- package/src/sets/redHeartSubTypesSet.ts +2 -1
- package/src/sets/sinEntityTypesSet.ts +2 -1
- package/src/sets/singleUseActiveCollectibleTypesSet.ts +3 -2
- package/src/sets/storyBossesSet.ts +2 -1
- package/src/types/PickingUpItem.ts +2 -1
- package/src/types/ReadonlyMap.ts +13 -0
- package/src/types/ReadonlySet.ts +9 -0
- package/dist/src/types/HasAllEnumKeys.d.ts +0 -26
- package/dist/src/types/HasAllEnumKeys.d.ts.map +0 -1
- package/dist/src/types/HasAllEnumKeys.lua +0 -2
- package/src/types/HasAllEnumKeys.ts +0 -25
package/src/functions/bosses.ts
CHANGED
|
@@ -11,13 +11,14 @@ import {
|
|
|
11
11
|
STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP,
|
|
12
12
|
} from "../sets/bossSets";
|
|
13
13
|
import { SIN_ENTITY_TYPES_SET } from "../sets/sinEntityTypesSet";
|
|
14
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
14
15
|
import { getNPCs, spawnNPC } from "./entitiesSpecific";
|
|
15
16
|
import { getAliveNPCs } from "./npcs";
|
|
16
17
|
import { isRNG } from "./rng";
|
|
17
18
|
import { asNumber } from "./types";
|
|
18
19
|
import { repeat } from "./utils";
|
|
19
20
|
|
|
20
|
-
const BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS
|
|
21
|
+
const BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS = new ReadonlySet<EntityType>([
|
|
21
22
|
EntityType.LARRY_JR, // 19 (and The Hollow / Tuff Twins / The Shell)
|
|
22
23
|
EntityType.CHUB, // 28 (and C.H.A.D. / The Carrion Queen)
|
|
23
24
|
EntityType.LOKI, // 69 (only for Lokii)
|
package/src/functions/cards.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CardType, ItemConfigCardType } from "isaac-typescript-definitions";
|
|
2
2
|
import { itemConfig } from "../core/cachedClasses";
|
|
3
|
-
import { ITEM_CONFIG_CARD_TYPES_FOR_CARDS } from "../core/constants";
|
|
4
3
|
import {
|
|
5
4
|
FIRST_CARD_TYPE,
|
|
6
5
|
LAST_VANILLA_CARD_TYPE,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
DEFAULT_CARD_DESCRIPTION,
|
|
11
10
|
} from "../objects/cardDescriptions";
|
|
12
11
|
import { CARD_NAMES, DEFAULT_CARD_NAME } from "../objects/cardNames";
|
|
12
|
+
import { ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET } from "../sets/itemConfigCardTypesForCardsSet";
|
|
13
13
|
import { iRange } from "./utils";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -98,7 +98,7 @@ export function isCard(cardType: CardType): boolean {
|
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
return
|
|
101
|
+
return ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET.has(itemConfigCardType);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/** Returns whether or not the given card type matches the specified item config card type. */
|
|
@@ -8,8 +8,9 @@ import { CHARACTERS_WITH_FREE_DEVIL_DEALS_SET } from "../sets/charactersWithFree
|
|
|
8
8
|
import { CHARACTERS_WITH_NO_RED_HEARTS_SET } from "../sets/charactersWithNoRedHeartsSet";
|
|
9
9
|
import { CHARACTERS_WITH_NO_SOUL_HEARTS_SET } from "../sets/charactersWithNoSoulHeartsSet";
|
|
10
10
|
import { LOST_STYLE_CHARACTERS_SET } from "../sets/lostStyleCharactersSet";
|
|
11
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
11
12
|
|
|
12
|
-
const FLYING_CHARACTERS
|
|
13
|
+
const FLYING_CHARACTERS = new ReadonlySet<PlayerType>([
|
|
13
14
|
PlayerType.AZAZEL, // 7
|
|
14
15
|
PlayerType.LOST, // 10
|
|
15
16
|
PlayerType.SOUL, // 17
|
package/src/functions/doors.ts
CHANGED
|
@@ -248,8 +248,16 @@ export function getRoomShapeDoorSlot(
|
|
|
248
248
|
x: int,
|
|
249
249
|
y: int,
|
|
250
250
|
): DoorSlot | undefined {
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
// The type assertion is necessary for some reason.
|
|
252
|
+
const doorSlotCoordinates = ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES[
|
|
253
|
+
roomShape
|
|
254
|
+
] as Record<DoorSlot, readonly [x: int, y: int]>;
|
|
255
|
+
|
|
256
|
+
for (const [doorSlotString, coordinates] of Object.entries(
|
|
257
|
+
doorSlotCoordinates,
|
|
258
|
+
)) {
|
|
259
|
+
const doorSlot = tonumber(doorSlotString) as DoorSlot;
|
|
260
|
+
const [doorX, doorY] = coordinates;
|
|
253
261
|
if (x === doorX && y === doorY) {
|
|
254
262
|
return doorSlot;
|
|
255
263
|
}
|
|
@@ -266,8 +274,11 @@ export function getRoomShapeDoorSlotCoordinates(
|
|
|
266
274
|
roomShape: RoomShape,
|
|
267
275
|
doorSlot: DoorSlot,
|
|
268
276
|
): readonly [x: int, y: int] | undefined {
|
|
269
|
-
|
|
270
|
-
|
|
277
|
+
// The type assertion is necessary for some reason.
|
|
278
|
+
const doorSlotCoordinates = ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES[
|
|
279
|
+
roomShape
|
|
280
|
+
] as Record<DoorSlot, readonly [x: int, y: int]>;
|
|
281
|
+
return doorSlotCoordinates[doorSlot];
|
|
271
282
|
}
|
|
272
283
|
|
|
273
284
|
/**
|
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
GridEntityType,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
6
|
import { game } from "../core/cachedClasses";
|
|
7
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
7
8
|
import { getEntities } from "./entities";
|
|
8
9
|
import { getGridEntities, removeGridEntity } from "./gridEntities";
|
|
9
10
|
import { roomUpdateSafe } from "./rooms";
|
|
10
11
|
import { isVanillaWallGridIndex } from "./roomShapeWalls";
|
|
11
12
|
|
|
12
|
-
const EMPTY_ROOM_BLACKLIST_ENTITY_SET
|
|
13
|
+
const EMPTY_ROOM_BLACKLIST_ENTITY_SET = new ReadonlySet<EntityType>([
|
|
13
14
|
EntityType.PLAYER, // 1
|
|
14
15
|
EntityType.TEAR, // 2
|
|
15
16
|
EntityType.FAMILIAR, // 3
|
|
@@ -7,6 +7,7 @@ import { AnyEntity } from "../types/AnyEntity";
|
|
|
7
7
|
import { EntityID } from "../types/EntityID";
|
|
8
8
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
9
9
|
import { getRandom } from "./random";
|
|
10
|
+
import { newReadonlyColor } from "./readOnly";
|
|
10
11
|
import { isRNG, newRNG } from "./rng";
|
|
11
12
|
import { setSpriteOpacity } from "./sprites";
|
|
12
13
|
import { isTSTLSet } from "./tstlClass";
|
|
@@ -14,7 +15,7 @@ import { asNumber, isPrimitive } from "./types";
|
|
|
14
15
|
import { doesVectorHaveLength, isVector, vectorToString } from "./vector";
|
|
15
16
|
|
|
16
17
|
/** From DeadInfinity. */
|
|
17
|
-
const DAMAGE_FLASH_COLOR
|
|
18
|
+
const DAMAGE_FLASH_COLOR = newReadonlyColor(
|
|
18
19
|
0.5,
|
|
19
20
|
0.5,
|
|
20
21
|
0.5,
|
|
@@ -76,7 +77,7 @@ export function doesAnyEntityExist(
|
|
|
76
77
|
: (entityTypes as EntityType[]);
|
|
77
78
|
|
|
78
79
|
return entityTypesArray.some((entityType) =>
|
|
79
|
-
|
|
80
|
+
doesEntityExist(entityType, -1, -1, ignoreFriendly),
|
|
80
81
|
);
|
|
81
82
|
}
|
|
82
83
|
|
package/src/functions/globals.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
1
2
|
import { getTraceback, isLuaDebugEnabled, traceback } from "./debugFunctions";
|
|
2
3
|
import * as logExports from "./log";
|
|
3
4
|
import { log } from "./log";
|
|
@@ -6,7 +7,7 @@ import * as logMiscExports from "./logMisc";
|
|
|
6
7
|
import { addSetsToSet, copySet } from "./set";
|
|
7
8
|
import { twoDimensionalSort } from "./utils";
|
|
8
9
|
|
|
9
|
-
const DEFAULT_GLOBALS
|
|
10
|
+
const DEFAULT_GLOBALS = new ReadonlySet<string>([
|
|
10
11
|
"ActionTriggers",
|
|
11
12
|
"ActiveSlot",
|
|
12
13
|
"BabySubType",
|
|
@@ -171,7 +172,7 @@ const DEFAULT_GLOBALS: ReadonlySet<string> = new Set([
|
|
|
171
172
|
"xpcall",
|
|
172
173
|
]);
|
|
173
174
|
|
|
174
|
-
const LUA_DEBUG_ADDED_GLOBALS
|
|
175
|
+
const LUA_DEBUG_ADDED_GLOBALS = new ReadonlySet<string>([
|
|
175
176
|
"debug",
|
|
176
177
|
"dofile",
|
|
177
178
|
"loadfile",
|
|
@@ -180,7 +181,7 @@ const LUA_DEBUG_ADDED_GLOBALS: ReadonlySet<string> = new Set([
|
|
|
180
181
|
"package",
|
|
181
182
|
]);
|
|
182
183
|
|
|
183
|
-
const RACING_PLUS_SANDBOX_ADDED_GLOBALS
|
|
184
|
+
const RACING_PLUS_SANDBOX_ADDED_GLOBALS = new ReadonlySet<string>([
|
|
184
185
|
"sandboxTraceback",
|
|
185
186
|
"sandboxGetTraceback",
|
|
186
187
|
"getParentFunctionDescription",
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from "../maps/roomShapeToTopLeftWallGridIndexMap";
|
|
18
18
|
import { AnyGridEntity } from "../types/AnyGridEntity";
|
|
19
19
|
import { GridEntityID } from "../types/GridEntityID";
|
|
20
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
20
21
|
import { removeEntities } from "./entities";
|
|
21
22
|
import { getEffects } from "./entitiesSpecific";
|
|
22
23
|
import { isCircleIntersectingRectangle } from "./math";
|
|
@@ -25,8 +26,8 @@ import { asNumber, isNumber } from "./types";
|
|
|
25
26
|
import { eRange, iRange } from "./utils";
|
|
26
27
|
import { isVector, vectorEquals } from "./vector";
|
|
27
28
|
|
|
28
|
-
const BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS
|
|
29
|
-
new
|
|
29
|
+
const BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS =
|
|
30
|
+
new ReadonlySet<GridEntityType>([
|
|
30
31
|
GridEntityType.ROCK, // 2
|
|
31
32
|
GridEntityType.ROCK_TINTED, // 4
|
|
32
33
|
GridEntityType.ROCK_BOMB, // 5
|
|
@@ -44,8 +45,8 @@ const BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS: ReadonlySet<GridEntityType> =
|
|
|
44
45
|
GridEntityType.ROCK_GOLD, // 27
|
|
45
46
|
]);
|
|
46
47
|
|
|
47
|
-
const BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS
|
|
48
|
-
new
|
|
48
|
+
const BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS =
|
|
49
|
+
new ReadonlySet<string>([`${GridEntityType.STATUE}.${StatueVariant.ANGEL}`]);
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Helper function to convert the grid entity type found in a room XML file to the corresponding
|
package/src/functions/input.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Keyboard,
|
|
6
6
|
} from "isaac-typescript-definitions";
|
|
7
7
|
import { KEYBOARD_TO_STRING } from "../maps/keyboardToString";
|
|
8
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
8
9
|
import { getEnumValues } from "./enums";
|
|
9
10
|
import { trimPrefix } from "./string";
|
|
10
11
|
|
|
@@ -26,7 +27,7 @@ const MOVEMENT_ACTIONS = [
|
|
|
26
27
|
ButtonAction.DOWN, // 3
|
|
27
28
|
] as const;
|
|
28
29
|
|
|
29
|
-
export const MOVEMENT_ACTIONS_SET
|
|
30
|
+
export const MOVEMENT_ACTIONS_SET = new ReadonlySet<ButtonAction>(
|
|
30
31
|
MOVEMENT_ACTIONS,
|
|
31
32
|
);
|
|
32
33
|
|
|
@@ -37,7 +38,7 @@ const SHOOTING_ACTIONS = [
|
|
|
37
38
|
ButtonAction.SHOOT_DOWN, // 7
|
|
38
39
|
] as const;
|
|
39
40
|
|
|
40
|
-
export const SHOOTING_ACTIONS_SET
|
|
41
|
+
export const SHOOTING_ACTIONS_SET = new ReadonlySet<ButtonAction>(
|
|
41
42
|
SHOOTING_ACTIONS,
|
|
42
43
|
);
|
|
43
44
|
|
|
@@ -11,11 +11,12 @@ import {
|
|
|
11
11
|
ProjectileVariant,
|
|
12
12
|
TearVariant,
|
|
13
13
|
} from "isaac-typescript-definitions";
|
|
14
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
14
15
|
import { getEntities, getEntityFromPtrHash, getEntityID } from "./entities";
|
|
15
16
|
import { getGridEntities, getGridEntityID } from "./gridEntities";
|
|
16
17
|
import { log } from "./log";
|
|
17
18
|
|
|
18
|
-
const IGNORE_EFFECT_VARIANTS
|
|
19
|
+
const IGNORE_EFFECT_VARIANTS = new ReadonlySet<EffectVariant>([
|
|
19
20
|
EffectVariant.BLOOD_EXPLOSION, // 2
|
|
20
21
|
EffectVariant.BLOOD_PARTICLE, // 5
|
|
21
22
|
EffectVariant.TINY_BUG, // 21
|
package/src/functions/npcs.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
VisVariant,
|
|
18
18
|
} from "isaac-typescript-definitions";
|
|
19
19
|
import { EGGY_STATE_FRAME_OF_FINAL_SPIDER } from "../core/constants";
|
|
20
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
20
21
|
import { getNPCs } from "./entitiesSpecific";
|
|
21
22
|
import { asNumber } from "./types";
|
|
22
23
|
|
|
@@ -24,7 +25,7 @@ import { asNumber } from "./types";
|
|
|
24
25
|
* Used to filter out certain NPCs when determining of an NPC is "alive" and/or should keep the
|
|
25
26
|
* doors open.
|
|
26
27
|
*/
|
|
27
|
-
const NON_ALIVE_NPCS_TYPE_VARIANT
|
|
28
|
+
const NON_ALIVE_NPCS_TYPE_VARIANT = new ReadonlySet<string>([
|
|
28
29
|
`${EntityType.VIS}.${VisVariant.CHUBBER_PROJECTILE}`, // 39.22
|
|
29
30
|
`${EntityType.DEATH}.${DeathVariant.DEATH_SCYTHE}`, // 66.10
|
|
30
31
|
`${EntityType.PEEP}.${PeepVariant.PEEP_EYE}`, // 68.10
|
|
@@ -42,7 +43,7 @@ const NON_ALIVE_NPCS_TYPE_VARIANT: ReadonlySet<string> = new Set([
|
|
|
42
43
|
* Used to filter out certain NPCs when determining of an NPC is "alive" and/or should keep the
|
|
43
44
|
* doors open.
|
|
44
45
|
*/
|
|
45
|
-
const NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE
|
|
46
|
+
const NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE = new ReadonlySet<string>([
|
|
46
47
|
`${EntityType.CHARGER}.${ChargerVariant.CHARGER}.${ChargerSubType.MY_SHADOW}`, // 23.0.1
|
|
47
48
|
`${EntityType.MOTHER}.${MotherVariant.MOTHER_1}.${MotherSubType.PHASE_2}`, // 912
|
|
48
49
|
]);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { CollectibleType, PlayerType } from "isaac-typescript-definitions";
|
|
2
2
|
import { game } from "../core/cachedClasses";
|
|
3
3
|
import { PlayerIndex } from "../types/PlayerIndex";
|
|
4
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
4
5
|
|
|
5
6
|
const DEFAULT_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
6
7
|
|
|
7
|
-
const EXCLUDED_CHARACTERS
|
|
8
|
+
const EXCLUDED_CHARACTERS = new ReadonlySet<PlayerType>([
|
|
8
9
|
PlayerType.ESAU, // 20
|
|
9
10
|
PlayerType.SOUL_B, // 40
|
|
10
11
|
]);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to create a read-only `Color` object. (Otherwise, you would have to manually
|
|
3
|
+
* specify both the type and the constructor.)
|
|
4
|
+
*
|
|
5
|
+
* Note that read-only colors will be writable at run-time.
|
|
6
|
+
*/
|
|
7
|
+
export function newReadonlyColor(
|
|
8
|
+
r: float,
|
|
9
|
+
g: float,
|
|
10
|
+
b: float,
|
|
11
|
+
a?: float,
|
|
12
|
+
ro?: int,
|
|
13
|
+
go?: int,
|
|
14
|
+
bo?: int,
|
|
15
|
+
): Readonly<Color> {
|
|
16
|
+
return Color(r, g, b, a, ro, go, bo);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to create a read-only `KColor` object. (Otherwise, you would have to manually
|
|
21
|
+
* specify both the type and the constructor.)
|
|
22
|
+
*
|
|
23
|
+
* Note that read-only colors will be writable at run-time.
|
|
24
|
+
*/
|
|
25
|
+
export function newReadonlyKColor(
|
|
26
|
+
r: float,
|
|
27
|
+
g: float,
|
|
28
|
+
b: float,
|
|
29
|
+
a: float,
|
|
30
|
+
): Readonly<KColor> {
|
|
31
|
+
return KColor(r, g, b, a);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Helper function to create a read-only `Vector` object. (Otherwise, you would have to manually
|
|
36
|
+
* specify both the type and the constructor.)
|
|
37
|
+
*
|
|
38
|
+
* Note that read-only vectors will be writable at run-time.
|
|
39
|
+
*/
|
|
40
|
+
export function newReadonlyVector(x: float, y: float): Readonly<Vector> {
|
|
41
|
+
return Vector(x, y);
|
|
42
|
+
}
|
|
@@ -81,12 +81,12 @@ function isValidGridPositionLRoom(gridPosition: Vector, roomShape: RoomShape) {
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
const
|
|
84
|
+
const {
|
|
85
85
|
verticalTopLeft,
|
|
86
86
|
verticalBottomRight,
|
|
87
87
|
horizontalTopLeft,
|
|
88
88
|
horizontalBottomRight,
|
|
89
|
-
|
|
89
|
+
} = rectangles;
|
|
90
90
|
return (
|
|
91
91
|
inRectangle(gridPosition, verticalTopLeft, verticalBottomRight) ||
|
|
92
92
|
inRectangle(gridPosition, horizontalTopLeft, horizontalBottomRight)
|
|
@@ -7,12 +7,10 @@ import { getGridIndexesBetween } from "./gridIndex";
|
|
|
7
7
|
import { inBossRoomOf, inHomeCloset } from "./rooms";
|
|
8
8
|
import { getRoomShapeCorners, isLRoom } from "./roomShape";
|
|
9
9
|
|
|
10
|
-
const ROOM_SHAPE_TO_WALL_GRID_INDEX_SET
|
|
11
|
-
|
|
12
|
-
function getRoomShapeToWallGridIndexSet(): ReadonlyMap<
|
|
10
|
+
const ROOM_SHAPE_TO_WALL_GRID_INDEX_SET: ReadonlyMap<
|
|
13
11
|
RoomShape,
|
|
14
12
|
ReadonlySet<int>
|
|
15
|
-
> {
|
|
13
|
+
> = (() => {
|
|
16
14
|
const roomShapeToWallGridIndexSet = new Map<RoomShape, ReadonlySet<int>>();
|
|
17
15
|
|
|
18
16
|
for (const roomShape of getEnumValues(RoomShape)) {
|
|
@@ -21,7 +19,7 @@ function getRoomShapeToWallGridIndexSet(): ReadonlyMap<
|
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
return roomShapeToWallGridIndexSet;
|
|
24
|
-
}
|
|
22
|
+
})();
|
|
25
23
|
|
|
26
24
|
function getVanillaWallGridIndexSetForRoomShape(
|
|
27
25
|
roomShape: RoomShape,
|
|
@@ -9,14 +9,13 @@ import {
|
|
|
9
9
|
ISAAC_API_CLASS_TYPE_TO_FUNCTIONS,
|
|
10
10
|
SerializedIsaacAPIClass,
|
|
11
11
|
} from "../objects/isaacAPIClassTypeToFunctions";
|
|
12
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
12
13
|
import { getEnumValues } from "./enums";
|
|
13
14
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
14
15
|
import { isString, isTable, isUserdata } from "./types";
|
|
15
16
|
|
|
16
17
|
const SERIALIZATION_BRANDS = getEnumValues(SerializationBrand);
|
|
17
|
-
const SERIALIZATION_BRAND_SET
|
|
18
|
-
SERIALIZATION_BRANDS,
|
|
19
|
-
);
|
|
18
|
+
const SERIALIZATION_BRAND_SET = new ReadonlySet<string>(SERIALIZATION_BRANDS);
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Helper function to generically copy an Isaac API class without knowing what specific type of
|
package/src/functions/slots.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SlotVariant } from "isaac-typescript-definitions";
|
|
2
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
2
3
|
import { isSlot } from "./entityTypes";
|
|
3
4
|
|
|
4
|
-
const SLOT_MACHINE_VARIANTS
|
|
5
|
+
const SLOT_MACHINE_VARIANTS = new ReadonlySet<SlotVariant>([
|
|
5
6
|
SlotVariant.SLOT_MACHINE, // 1
|
|
6
7
|
SlotVariant.BLOOD_DONATION_MACHINE, // 2,
|
|
7
8
|
SlotVariant.FORTUNE_TELLING_MACHINE, // 3
|
package/src/functions/stats.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CacheFlag } from "isaac-typescript-definitions";
|
|
2
2
|
import { DEFAULT_PLAYER_STAT_MAP } from "../maps/defaultPlayerStatMap";
|
|
3
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
3
4
|
import { addTearsStat } from "./tears";
|
|
4
5
|
|
|
5
|
-
const STAT_CACHE_FLAGS_SET
|
|
6
|
+
const STAT_CACHE_FLAGS_SET = new ReadonlySet<CacheFlag>([
|
|
6
7
|
CacheFlag.DAMAGE, // 1 << 0
|
|
7
8
|
CacheFlag.FIRE_DELAY, // 1 << 1
|
|
8
9
|
CacheFlag.SHOT_SPEED, // 1 << 2
|
|
@@ -4,29 +4,30 @@ import {
|
|
|
4
4
|
PlayerForm,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
6
|
import { TRANSFORMATION_NAMES } from "../objects/transformationNames";
|
|
7
|
+
import { ReadonlyMap } from "../types/ReadonlyMap";
|
|
8
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
7
9
|
import { getCollectibleTags } from "./collectibles";
|
|
8
10
|
import { getEnumValues } from "./enums";
|
|
9
11
|
import { hasFlag } from "./flag";
|
|
10
12
|
|
|
11
|
-
const TRANSFORMATION_TO_TAG_MAP
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]);
|
|
13
|
+
const TRANSFORMATION_TO_TAG_MAP = new ReadonlyMap<PlayerForm, ItemConfigTag>([
|
|
14
|
+
[PlayerForm.GUPPY, ItemConfigTag.GUPPY], // 0
|
|
15
|
+
[PlayerForm.BEELZEBUB, ItemConfigTag.FLY], // 1
|
|
16
|
+
[PlayerForm.FUN_GUY, ItemConfigTag.MUSHROOM], // 2
|
|
17
|
+
[PlayerForm.SERAPHIM, ItemConfigTag.ANGEL], // 3
|
|
18
|
+
[PlayerForm.BOB, ItemConfigTag.BOB], // 4
|
|
19
|
+
[PlayerForm.SPUN, ItemConfigTag.SYRINGE], // 5
|
|
20
|
+
[PlayerForm.YES_MOTHER, ItemConfigTag.MOM], // 6
|
|
21
|
+
[PlayerForm.CONJOINED, ItemConfigTag.BABY], // 7
|
|
22
|
+
[PlayerForm.LEVIATHAN, ItemConfigTag.DEVIL], // 8
|
|
23
|
+
[PlayerForm.OH_CRAP, ItemConfigTag.POOP], // 9
|
|
24
|
+
[PlayerForm.BOOKWORM, ItemConfigTag.BOOK], // 10
|
|
25
|
+
// PlayerForm.ADULTHOOD (11) is based on pill usage.
|
|
26
|
+
[PlayerForm.SPIDER_BABY, ItemConfigTag.SPIDER], // 12
|
|
27
|
+
// PlayerForm.STOMPY (13) is based on size.
|
|
28
|
+
]);
|
|
28
29
|
|
|
29
|
-
const TRANSFORMATIONS_THAT_GRANT_FLYING
|
|
30
|
+
const TRANSFORMATIONS_THAT_GRANT_FLYING = new ReadonlySet<PlayerForm>([
|
|
30
31
|
PlayerForm.GUPPY, // 0
|
|
31
32
|
PlayerForm.BEELZEBUB, // 1
|
|
32
33
|
PlayerForm.SERAPHIM, // 3
|
package/src/functions/utils.ts
CHANGED
|
@@ -251,7 +251,7 @@ export function twoDimensionalSort<T>(array1: T[], array2: T[]): -1 | 0 | 1 {
|
|
|
251
251
|
*
|
|
252
252
|
* This function is only meant to be used with interfaces (i.e. types that will not exist at
|
|
253
253
|
* run-time). If you are generating an object that will contain all of the keys of an enum, use the
|
|
254
|
-
* `satisfies` operator with the `
|
|
254
|
+
* `satisfies` operator with the `Record` type instead.
|
|
255
255
|
*/
|
|
256
256
|
export function validateInterfaceMatchesEnum<
|
|
257
257
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
package/src/index.ts
CHANGED
|
@@ -152,7 +152,6 @@ export * from "./types/ConversionHeartSubType";
|
|
|
152
152
|
export * from "./types/EntityID";
|
|
153
153
|
export * from "./types/FunctionTuple";
|
|
154
154
|
export * from "./types/GridEntityID";
|
|
155
|
-
export * from "./types/HasAllEnumKeys";
|
|
156
155
|
export * from "./types/HasFunction";
|
|
157
156
|
export * from "./types/Immutable";
|
|
158
157
|
export * from "./types/LowercaseKeys";
|
|
@@ -162,6 +161,8 @@ export * from "./types/PickupIndex";
|
|
|
162
161
|
export * from "./types/PlayerIndex";
|
|
163
162
|
export * from "./types/PossibleStatType";
|
|
164
163
|
export * from "./types/PublicInterface";
|
|
164
|
+
export * from "./types/ReadonlyMap";
|
|
165
|
+
export * from "./types/ReadonlySet";
|
|
165
166
|
export * from "./types/StartsWithLowercase";
|
|
166
167
|
export * from "./types/StartsWithUppercase";
|
|
167
168
|
export * from "./types/TSTLClass";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { PillEffect } from "isaac-typescript-definitions";
|
|
2
|
+
import { ReadonlyMap } from "../types/ReadonlyMap";
|
|
2
3
|
|
|
3
|
-
export const PHD_PILL_CONVERSIONS
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
]);
|
|
4
|
+
export const PHD_PILL_CONVERSIONS = new ReadonlyMap<PillEffect, PillEffect>([
|
|
5
|
+
[PillEffect.BAD_TRIP, PillEffect.BALLS_OF_STEEL], // 1
|
|
6
|
+
[PillEffect.HEALTH_DOWN, PillEffect.HEALTH_UP], // 6
|
|
7
|
+
[PillEffect.RANGE_DOWN, PillEffect.RANGE_UP], // 11
|
|
8
|
+
[PillEffect.SPEED_DOWN, PillEffect.SPEED_UP], // 13
|
|
9
|
+
[PillEffect.TEARS_DOWN, PillEffect.TEARS_UP], // 15
|
|
10
|
+
[PillEffect.LUCK_DOWN, PillEffect.LUCK_UP], // 17
|
|
11
|
+
[PillEffect.PARALYSIS, PillEffect.PHEROMONES], // 22
|
|
12
|
+
[PillEffect.AMNESIA, PillEffect.I_CAN_SEE_FOREVER], // 25
|
|
13
|
+
[PillEffect.R_U_A_WIZARD, PillEffect.POWER], // 27
|
|
14
|
+
[PillEffect.ADDICTED, PillEffect.PERCS], // 29
|
|
15
|
+
[PillEffect.QUESTION_MARKS, PillEffect.TELEPILLS], // 31
|
|
16
|
+
[PillEffect.RETRO_VISION, PillEffect.I_CAN_SEE_FOREVER], // 37
|
|
17
|
+
[PillEffect.X_LAX, PillEffect.SOMETHINGS_WRONG], // 39
|
|
18
|
+
[PillEffect.IM_EXCITED, PillEffect.IM_DROWSY], // 42
|
|
19
|
+
[PillEffect.HORF, PillEffect.GULP], // 44
|
|
20
|
+
[PillEffect.SHOT_SPEED_DOWN, PillEffect.SHOT_SPEED_UP], // 47
|
|
21
|
+
]);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CardType } from "isaac-typescript-definitions";
|
|
2
|
+
import { ReadonlyMap } from "../types/ReadonlyMap";
|
|
2
3
|
|
|
3
4
|
// cspell:ignore hiero
|
|
4
5
|
|
|
5
6
|
/** Maps card names to the values of the `CardType` enum. */
|
|
6
|
-
export const CARD_NAME_TO_TYPE_MAP
|
|
7
|
+
export const CARD_NAME_TO_TYPE_MAP = new ReadonlyMap<string, CardType>([
|
|
7
8
|
["fool", CardType.FOOL], // 1
|
|
8
9
|
["magician", CardType.MAGICIAN], // 2
|
|
9
10
|
["mag", CardType.MAGICIAN], // 2 - Needed since we have "mag?"
|