isaacscript-common 1.2.290 → 2.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/README.md +2 -2
- package/dist/cachedClasses.d.ts +1 -1
- package/dist/cachedClasses.lua +0 -1
- package/dist/callbacks/customRevive.lua +13 -8
- package/dist/callbacks/itemPickup.lua +3 -1
- package/dist/callbacks/postBombInitLate.lua +3 -1
- package/dist/callbacks/postBoneSwing.lua +5 -2
- package/dist/callbacks/postCollectibleInitFirst.lua +4 -1
- package/dist/callbacks/postCursedTeleport.lua +16 -8
- package/dist/callbacks/postCustomDoorEnter.d.ts +1 -1
- package/dist/callbacks/postCustomDoorEnter.lua +20 -14
- package/dist/callbacks/postEffectInitLate.lua +3 -1
- package/dist/callbacks/postEffectStateChanged.lua +3 -1
- package/dist/callbacks/postEsauJr.lua +5 -2
- package/dist/callbacks/postFamiliarInitLate.lua +3 -1
- package/dist/callbacks/postFamiliarStateChanged.lua +3 -1
- package/dist/callbacks/postFlip.lua +9 -5
- package/dist/callbacks/postGreedModeWave.d.ts +1 -0
- package/dist/callbacks/postGreedModeWave.lua +32 -0
- package/dist/callbacks/postGreedWave.d.ts +1 -0
- package/dist/callbacks/postGreedWave.lua +31 -0
- package/dist/callbacks/postGridEntity.lua +9 -7
- package/dist/callbacks/postGridEntityCollision.lua +5 -2
- package/dist/callbacks/postHolyMantleRemoved.d.ts +1 -0
- package/dist/callbacks/postHolyMantleRemoved.lua +39 -0
- package/dist/callbacks/postItemDischarged.lua +35 -14
- package/dist/callbacks/postKnifeInitLate.lua +3 -1
- package/dist/callbacks/postLaserInitLate.lua +3 -1
- package/dist/callbacks/postNPCInitLate.lua +3 -1
- package/dist/callbacks/postNPCStateChanged.lua +3 -1
- package/dist/callbacks/postNewRoomEarly.lua +7 -5
- package/dist/callbacks/postPickupCollect.lua +3 -1
- package/dist/callbacks/postPickupInitLate.lua +3 -1
- package/dist/callbacks/postPickupStateChanged.lua +3 -1
- package/dist/callbacks/postPlayerChangeHealth.lua +2 -2
- package/dist/callbacks/postPlayerFatalDamage.lua +4 -1
- package/dist/callbacks/postPlayerInitLate.lua +3 -1
- package/dist/callbacks/postPlayerReordered.lua +7 -6
- package/dist/callbacks/postProjectileInitLate.lua +3 -1
- package/dist/callbacks/postRoomClearChanged.d.ts +1 -0
- package/dist/callbacks/postRoomClearChanged.lua +40 -0
- package/dist/callbacks/postSacrifice.lua +8 -4
- package/dist/callbacks/postSlotInitUpdate.lua +4 -2
- package/dist/callbacks/postSlotRender.lua +3 -1
- package/dist/callbacks/postTearInitLate.lua +3 -1
- package/dist/callbacks/postTearInitVeryLate.lua +3 -1
- package/dist/callbacks/postTransformation.lua +7 -12
- package/dist/callbacks/postTrinketBreak.lua +8 -3
- package/dist/callbacks/preBerserkDeath.lua +3 -2
- package/dist/callbacks/preNewLevel.lua +5 -3
- package/dist/callbacks/reorderedCallbacks.lua +7 -5
- package/dist/callbacks/subscriptions/postBombInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postBoneSwing.d.ts +3 -1
- package/dist/callbacks/subscriptions/postBoneSwing.lua +3 -3
- package/dist/callbacks/subscriptions/postCollectibleInitFirst.d.ts +5 -2
- package/dist/callbacks/subscriptions/postCollectibleInitFirst.lua +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.d.ts +3 -1
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +3 -3
- package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +5 -2
- package/dist/callbacks/subscriptions/postCustomDoorEnter.lua +3 -3
- package/dist/callbacks/subscriptions/postCustomRevive.d.ts +4 -1
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectStateChanged.d.ts +5 -2
- package/dist/callbacks/subscriptions/postEffectStateChanged.lua +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.d.ts +3 -1
- package/dist/callbacks/subscriptions/postEsauJr.lua +3 -3
- package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postFamiliarStateChanged.d.ts +5 -2
- package/dist/callbacks/subscriptions/postFamiliarStateChanged.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.d.ts +3 -1
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstFlip.d.ts +3 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +3 -3
- package/dist/callbacks/subscriptions/postFlip.d.ts +3 -1
- package/dist/callbacks/subscriptions/postFlip.lua +3 -3
- package/dist/callbacks/subscriptions/postGameStartedReordered.d.ts +3 -1
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postGreedModeWave.d.ts +4 -0
- package/dist/callbacks/subscriptions/postGreedModeWave.lua +16 -0
- package/dist/callbacks/subscriptions/postGreedWave.d.ts +2 -0
- package/dist/callbacks/subscriptions/postGreedWave.lua +16 -0
- package/dist/callbacks/subscriptions/postGridEntityBroken.d.ts +5 -2
- package/dist/callbacks/subscriptions/postGridEntityBroken.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +5 -2
- package/dist/callbacks/subscriptions/postGridEntityCollision.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +5 -2
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +5 -2
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +5 -0
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.lua +23 -0
- package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts +6 -0
- package/dist/callbacks/subscriptions/postHolyMantleRemoved.lua +28 -0
- package/dist/callbacks/subscriptions/postItemDischarged.d.ts +5 -2
- package/dist/callbacks/subscriptions/postItemDischarged.lua +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.d.ts +6 -2
- package/dist/callbacks/subscriptions/postItemPickup.lua +3 -3
- package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts +6 -2
- package/dist/callbacks/subscriptions/postNPCStateChanged.lua +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.d.ts +1 -1
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts +1 -1
- package/dist/callbacks/subscriptions/postNewRoomEarly.lua +3 -3
- package/dist/callbacks/subscriptions/postNewRoomReordered.d.ts +1 -1
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPEffectUpdateReordered.d.ts +6 -2
- package/dist/callbacks/subscriptions/postPEffectUpdateReordered.lua +8 -4
- package/dist/callbacks/subscriptions/postPickupCollect.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupStateChanged.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPickupStateChanged.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +4 -2
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +5 -2
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPurchase.d.ts +6 -2
- package/dist/callbacks/subscriptions/postPurchase.lua +3 -3
- package/dist/callbacks/subscriptions/postRoomClearChanged.d.ts +3 -0
- package/dist/callbacks/subscriptions/postRoomClearChanged.lua +16 -0
- package/dist/callbacks/subscriptions/postSacrifice.d.ts +3 -1
- package/dist/callbacks/subscriptions/postSacrifice.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotAnimationChanged.d.ts +5 -2
- package/dist/callbacks/subscriptions/postSlotAnimationChanged.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +5 -2
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.d.ts +5 -2
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.d.ts +5 -2
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitVeryLate.d.ts +5 -2
- package/dist/callbacks/subscriptions/postTearInitVeryLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTransformation.d.ts +5 -2
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
- package/dist/callbacks/subscriptions/postTrinketBreak.d.ts +5 -2
- package/dist/callbacks/subscriptions/postTrinketBreak.lua +3 -3
- package/dist/callbacks/subscriptions/preBerserkDeath.d.ts +5 -2
- package/dist/callbacks/subscriptions/preBerserkDeath.lua +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.d.ts +3 -1
- package/dist/callbacks/subscriptions/preCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/preItemPickup.d.ts +6 -2
- package/dist/callbacks/subscriptions/preItemPickup.lua +3 -3
- package/dist/callbacks/subscriptions/preNewLevel.d.ts +3 -1
- package/dist/callbacks/subscriptions/preNewLevel.lua +3 -3
- package/dist/classes/ModUpgraded.d.ts +5 -5
- package/dist/constants.d.ts +9 -43
- package/dist/constants.lua +16 -13
- package/dist/constantsMax.d.ts +16 -0
- package/dist/constantsMax.lua +27 -0
- package/dist/enums/CardType.lua +1 -1
- package/dist/enums/CollectiblePedestalType.lua +1 -1
- package/dist/enums/HealthType.d.ts +3 -3
- package/dist/enums/HealthType.lua +1 -2
- package/dist/enums/ModCallbacksCustom.d.ts +89 -59
- package/dist/enums/ModCallbacksCustom.lua +110 -107
- package/dist/enums/PillEffectClass.lua +1 -1
- package/dist/enums/PillEffectType.lua +1 -1
- package/dist/enums/PocketItemType.lua +1 -2
- package/dist/enums/SerializationType.lua +1 -2
- package/dist/enums/private/CopyableIsaacAPIClassType.d.ts +1 -1
- package/dist/enums/private/CopyableIsaacAPIClassType.lua +2 -3
- package/dist/enums/private/SaveDataKeys.d.ts +4 -4
- package/dist/enums/private/SaveDataKeys.lua +5 -6
- package/dist/enums/private/SerializationBrand.d.ts +3 -4
- package/dist/enums/private/SerializationBrand.lua +2 -15
- package/dist/features/characterHealthConversion.d.ts +2 -2
- package/dist/features/characterHealthConversion.lua +8 -4
- package/dist/features/characterStats.d.ts +4 -4
- package/dist/features/characterStats.lua +3 -1
- package/dist/features/debugDisplay.lua +12 -11
- package/dist/features/deployJSONRoom.d.ts +3 -3
- package/dist/features/deployJSONRoom.lua +35 -21
- package/dist/features/disableInputs.d.ts +1 -1
- package/dist/features/disableInputs.lua +6 -3
- package/dist/features/disableSound.lua +3 -1
- package/dist/features/extraConsoleCommands/commands.d.ts +5 -3
- package/dist/features/extraConsoleCommands/commands.lua +96 -56
- package/dist/features/extraConsoleCommands/commandsDisplay.lua +0 -1
- package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts +1 -1
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +13 -10
- package/dist/features/extraConsoleCommands/init.lua +17 -9
- package/dist/features/extraConsoleCommands/v.lua +0 -1
- package/dist/features/fadeInRemover.lua +3 -2
- package/dist/features/fastReset.lua +7 -5
- package/dist/features/forgottenSwitch.lua +6 -3
- package/dist/features/getCollectibleItemPoolType.d.ts +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +6 -2
- package/dist/features/isPonyActive.lua +5 -2
- package/dist/features/playerInventory.d.ts +1 -1
- package/dist/features/playerInventory.lua +7 -3
- package/dist/features/preventCollectibleRotate.d.ts +1 -1
- package/dist/features/preventCollectibleRotate.lua +9 -4
- package/dist/features/runInNFrames.lua +4 -2
- package/dist/features/saveDataManager/constants.lua +0 -1
- package/dist/features/saveDataManager/exports.d.ts +9 -8
- package/dist/features/saveDataManager/main.lua +11 -9
- package/dist/features/saveDataManager/maps.d.ts +5 -0
- package/dist/features/saveDataManager/merge.d.ts +1 -1
- package/dist/features/saveDataManager/merge.lua +2 -1
- package/dist/features/saveDataManager/serializationBrand.d.ts +1 -0
- package/dist/features/saveDataManager/serializationBrand.lua +17 -0
- package/dist/features/sirenHelpers.d.ts +1 -1
- package/dist/features/sirenHelpers.lua +5 -2
- package/dist/features/taintedLazarusPlayers.lua +6 -3
- package/dist/featuresInitialized.lua +0 -1
- package/dist/functions/array.d.ts +18 -2
- package/dist/functions/array.lua +29 -3
- package/dist/functions/bitwise.lua +0 -1
- package/dist/functions/boss.d.ts +1 -1
- package/dist/functions/boss.lua +12 -9
- package/dist/functions/cacheFlag.d.ts +2 -2
- package/dist/functions/cacheFlag.lua +0 -1
- package/dist/functions/cards.d.ts +9 -17
- package/dist/functions/cards.lua +22 -23
- package/dist/functions/challenges.d.ts +1 -1
- package/dist/functions/challenges.lua +0 -1
- package/dist/functions/character.d.ts +6 -4
- package/dist/functions/character.lua +16 -7
- package/dist/functions/charge.d.ts +1 -1
- package/dist/functions/charge.lua +14 -9
- package/dist/functions/chargeBar.lua +0 -1
- package/dist/functions/collectibleCacheFlag.d.ts +4 -4
- package/dist/functions/collectibleCacheFlag.lua +8 -5
- package/dist/functions/collectibleSet.d.ts +1 -1
- package/dist/functions/collectibleSet.lua +4 -5
- package/dist/functions/collectibleTag.d.ts +1 -2
- package/dist/functions/collectibleTag.lua +12 -10
- package/dist/functions/collectibles.d.ts +21 -28
- package/dist/functions/collectibles.lua +29 -26
- package/dist/functions/color.lua +9 -1
- package/dist/functions/debug.d.ts +12 -0
- package/dist/functions/debug.lua +3 -1
- package/dist/functions/deepCopy.d.ts +1 -1
- package/dist/functions/deepCopy.lua +4 -2
- package/dist/functions/direction.d.ts +4 -0
- package/dist/functions/direction.lua +17 -0
- package/dist/functions/doors.d.ts +12 -16
- package/dist/functions/doors.lua +34 -26
- package/dist/functions/easing.lua +0 -1
- package/dist/functions/entity.d.ts +4 -5
- package/dist/functions/entity.lua +4 -12
- package/dist/functions/entitySpecific.d.ts +35 -33
- package/dist/functions/entitySpecific.lua +20 -19
- package/dist/functions/enums.d.ts +70 -0
- package/dist/functions/enums.lua +71 -0
- package/dist/functions/familiars.d.ts +2 -2
- package/dist/functions/familiars.lua +0 -1
- package/dist/functions/flag.d.ts +42 -10
- package/dist/functions/flag.lua +31 -13
- package/dist/functions/flying.d.ts +2 -2
- package/dist/functions/flying.lua +20 -14
- package/dist/functions/globals.lua +5 -2
- package/dist/functions/gridEntity.d.ts +18 -16
- package/dist/functions/gridEntity.lua +39 -26
- package/dist/functions/input.d.ts +14 -4
- package/dist/functions/input.lua +38 -80
- package/dist/functions/jsonHelpers.d.ts +9 -7
- package/dist/functions/jsonHelpers.lua +0 -1
- package/dist/functions/kColor.lua +14 -3
- package/dist/functions/language.lua +9 -8
- package/dist/functions/log.d.ts +21 -15
- package/dist/functions/log.lua +61 -36
- package/dist/functions/math.d.ts +19 -8
- package/dist/functions/math.lua +33 -22
- package/dist/functions/mergeTests.lua +0 -1
- package/dist/functions/npc.d.ts +1 -1
- package/dist/functions/npc.lua +32 -16
- package/dist/functions/pickups.d.ts +10 -26
- package/dist/functions/pickups.lua +31 -29
- package/dist/functions/pills.d.ts +14 -13
- package/dist/functions/pills.lua +9 -3
- package/dist/functions/player.d.ts +11 -11
- package/dist/functions/player.lua +79 -66
- package/dist/functions/playerHealth.lua +19 -16
- package/dist/functions/playerIndex.d.ts +3 -3
- package/dist/functions/playerIndex.lua +9 -6
- package/dist/functions/pocketItems.d.ts +6 -1
- package/dist/functions/pocketItems.lua +30 -12
- package/dist/functions/positionVelocity.lua +4 -1
- package/dist/functions/random.d.ts +2 -3
- package/dist/functions/random.lua +0 -1
- package/dist/functions/revive.lua +18 -13
- package/dist/functions/roomData.d.ts +2 -2
- package/dist/functions/roomData.lua +11 -13
- package/dist/functions/roomGrid.d.ts +2 -2
- package/dist/functions/roomGrid.lua +0 -1
- package/dist/functions/roomShape.d.ts +2 -2
- package/dist/functions/rooms.d.ts +19 -14
- package/dist/functions/rooms.lua +42 -22
- package/dist/functions/run.d.ts +1 -1
- package/dist/functions/run.lua +3 -2
- package/dist/functions/seeds.d.ts +7 -0
- package/dist/functions/seeds.lua +7 -1
- package/dist/functions/sound.lua +4 -3
- package/dist/functions/spawnCollectible.d.ts +5 -5
- package/dist/functions/spawnCollectible.lua +7 -4
- package/dist/functions/sprite.d.ts +1 -1
- package/dist/functions/sprite.lua +3 -4
- package/dist/functions/stage.d.ts +4 -4
- package/dist/functions/stage.lua +3 -2
- package/dist/functions/string.d.ts +8 -1
- package/dist/functions/string.lua +10 -2
- package/dist/functions/tears.d.ts +4 -4
- package/dist/functions/tears.lua +0 -1
- package/dist/functions/transformations.d.ts +5 -3
- package/dist/functions/transformations.lua +31 -20
- package/dist/functions/trinketCacheFlag.d.ts +1 -1
- package/dist/functions/trinketCacheFlag.lua +8 -6
- package/dist/functions/trinketGive.d.ts +14 -3
- package/dist/functions/trinketGive.lua +46 -28
- package/dist/functions/trinketSet.d.ts +1 -1
- package/dist/functions/trinketSet.lua +4 -5
- package/dist/functions/trinkets.d.ts +8 -17
- package/dist/functions/trinkets.lua +17 -34
- package/dist/functions/ui.lua +7 -5
- package/dist/functions/utils.d.ts +1 -61
- package/dist/functions/utils.lua +3 -50
- package/dist/functions/vector.d.ts +1 -2
- package/dist/functions/vector.lua +8 -6
- package/dist/index.d.ts +4 -6
- package/dist/index.lua +17 -34
- package/dist/initCustomCallbacks.d.ts +2 -0
- package/dist/initCustomCallbacks.lua +133 -0
- package/dist/initFeatures.d.ts +3 -0
- package/dist/initFeatures.lua +54 -0
- package/dist/lualib_bundle.lua +14 -1
- package/dist/maps/cardMap.d.ts +1 -1
- package/dist/maps/characterMap.d.ts +1 -1
- package/dist/maps/collectibleDescriptionMap.d.ts +1 -1
- package/dist/maps/collectibleNameMap.d.ts +1 -1
- package/dist/maps/defaultPlayerStatMap.d.ts +1 -1
- package/dist/maps/defaultPlayerStatMap.lua +8 -6
- package/dist/maps/gridEntityTypeToBrokenStateMap.d.ts +1 -1
- package/dist/maps/gridEntityTypeToBrokenStateMap.lua +19 -12
- package/dist/maps/gridEntityXMLMap.d.ts +1 -1
- package/dist/maps/gridEntityXMLMap.lua +44 -34
- package/dist/maps/pillEffectMap.d.ts +1 -1
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +1 -1
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +7 -5
- package/dist/maps/roomTypeMap.d.ts +1 -1
- package/dist/maps/roomTypeMap.lua +37 -35
- package/dist/maps/trinketDescriptionMap.d.ts +1 -1
- package/dist/maps/trinketNameMap.d.ts +1 -1
- package/dist/objects/LRoomShapeToRectangles.d.ts +1 -1
- package/dist/objects/LRoomShapeToRectangles.lua +6 -5
- package/dist/objects/callbackRegisterFunctions.d.ts +2 -2
- package/dist/objects/callbackRegisterFunctions.lua +57 -52
- package/dist/objects/cardDescriptions.d.ts +1 -1
- package/dist/objects/cardDescriptions.lua +89 -90
- package/dist/objects/cardNames.d.ts +1 -1
- package/dist/objects/cardNames.lua +89 -90
- package/dist/objects/cardTypes.d.ts +3 -4
- package/dist/objects/cardTypes.lua +102 -104
- package/dist/objects/challengeNames.d.ts +1 -1
- package/dist/objects/challengeNames.lua +48 -48
- package/dist/objects/characterNames.d.ts +1 -1
- package/dist/objects/characterNames.lua +44 -44
- package/dist/objects/coinSubTypeToValue.d.ts +1 -1
- package/dist/objects/coinSubTypeToValue.lua +10 -8
- package/dist/objects/colors.lua +0 -1
- package/dist/objects/directionNames.d.ts +1 -1
- package/dist/objects/directionNames.lua +2 -1
- package/dist/objects/directionToDegrees.d.ts +1 -1
- package/dist/objects/directionToDegrees.lua +2 -1
- package/dist/objects/directionToVector.d.ts +1 -1
- package/dist/objects/directionToVector.lua +2 -1
- package/dist/objects/doorSlotFlagToDoorSlot.d.ts +5 -0
- package/dist/objects/doorSlotFlagToDoorSlot.lua +16 -0
- package/dist/objects/doorSlotToDirection.d.ts +1 -1
- package/dist/objects/doorSlotToDirection.lua +11 -10
- package/dist/objects/isaacAPIClassTypeToBrand.lua +1 -2
- package/dist/objects/isaacAPIClassTypeToCopyFunction.lua +1 -2
- package/dist/objects/pillEffectClasses.d.ts +3 -4
- package/dist/objects/pillEffectClasses.lua +55 -57
- package/dist/objects/pillEffectNames.d.ts +1 -1
- package/dist/objects/pillEffectNames.lua +52 -53
- package/dist/objects/pillEffectTypes.d.ts +3 -4
- package/dist/objects/pillEffectTypes.lua +54 -56
- package/dist/objects/roomShapeBounds.d.ts +1 -1
- package/dist/objects/roomShapeBounds.lua +14 -16
- package/dist/objects/roomShapeLayoutSizes.d.ts +1 -1
- package/dist/objects/roomShapeLayoutSizes.lua +14 -14
- package/dist/objects/roomShapeToBottomRightPosition.d.ts +1 -1
- package/dist/objects/roomShapeToBottomRightPosition.lua +14 -16
- package/dist/objects/roomShapeToDoorSlots.d.ts +1 -1
- package/dist/objects/roomShapeToDoorSlots.lua +35 -33
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.d.ts +2 -2
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.lua +68 -66
- package/dist/objects/roomShapeToGridWidth.d.ts +1 -1
- package/dist/objects/roomShapeToGridWidth.lua +14 -14
- package/dist/objects/roomShapeToTopLeftPosition.d.ts +1 -1
- package/dist/objects/roomShapeToTopLeftPosition.lua +14 -14
- package/dist/objects/roomShapeVolumes.d.ts +1 -1
- package/dist/objects/roomShapeVolumes.lua +14 -14
- package/dist/objects/roomTypeNames.d.ts +1 -1
- package/dist/objects/roomTypeNames.lua +32 -32
- package/dist/objects/serializedIsaacAPIClassTypeToIdentityFunction.lua +1 -2
- package/dist/objects/stageTypeToLetter.d.ts +1 -1
- package/dist/objects/stageTypeToLetter.lua +8 -7
- package/dist/objects/transformationNames.d.ts +1 -1
- package/dist/objects/transformationNames.lua +16 -17
- package/dist/patchErrorFunctions.lua +1 -2
- package/dist/sets/LRoomShapesSet.d.ts +1 -1
- package/dist/sets/LRoomShapesSet.lua +3 -1
- package/dist/sets/bossSets.lua +241 -211
- package/dist/sets/charactersThatStartWithAnActiveItemSet.d.ts +1 -1
- package/dist/sets/charactersThatStartWithAnActiveItemSet.lua +13 -11
- package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.d.ts +1 -1
- package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.lua +3 -1
- package/dist/sets/charactersWithFreeDevilDealsSet.d.ts +1 -1
- package/dist/sets/charactersWithFreeDevilDealsSet.lua +3 -1
- package/dist/sets/charactersWithNoRedHeartsSet.d.ts +1 -1
- package/dist/sets/charactersWithNoRedHeartsSet.lua +10 -8
- package/dist/sets/charactersWithNoSoulHeartsSet.d.ts +1 -1
- package/dist/sets/charactersWithNoSoulHeartsSet.lua +7 -5
- package/dist/sets/chestPickupVariantsSet.d.ts +1 -1
- package/dist/sets/chestPickupVariantsSet.lua +14 -12
- package/dist/sets/familiarsThatShootPlayerTearsSet.d.ts +1 -1
- package/dist/sets/familiarsThatShootPlayerTearsSet.lua +2 -0
- package/dist/sets/lostStyleCharactersSet.d.ts +1 -1
- package/dist/sets/lostStyleCharactersSet.lua +7 -5
- package/dist/sets/redHeartSubTypesSet.d.ts +1 -1
- package/dist/sets/redHeartSubTypesSet.lua +3 -1
- package/dist/sets/sinEntityTypesSet.d.ts +1 -1
- package/dist/sets/sinEntityTypesSet.lua +9 -7
- package/dist/sets/singleUseActiveCollectibleTypesSet.d.ts +1 -1
- package/dist/sets/singleUseActiveCollectibleTypesSet.lua +10 -8
- package/dist/sets/storyBossesSet.d.ts +1 -1
- package/dist/sets/storyBossesSet.lua +15 -13
- package/dist/types/AddCallbackParameterCustom.d.ts +123 -0
- package/dist/types/AddCallbackParameterCustom.lua +4 -0
- package/dist/types/AddCallbackParametersCustom.d.ts +120 -271
- package/dist/types/AnyEntity.lua +0 -1
- package/dist/types/CollectibleIndex.lua +0 -1
- package/dist/types/EntityTypeNonNPC.lua +0 -1
- package/dist/types/JSONDoor.lua +0 -1
- package/dist/types/JSONEntity.lua +0 -1
- package/dist/types/JSONRoom.lua +0 -1
- package/dist/types/JSONRooms.lua +0 -1
- package/dist/types/JSONSpawn.lua +0 -1
- package/dist/types/PickingUpItem.d.ts +1 -1
- package/dist/types/PickingUpItem.lua +5 -3
- package/dist/types/PlayerHealth.d.ts +1 -1
- package/dist/types/PlayerHealth.lua +0 -1
- package/dist/types/PlayerIndex.lua +0 -1
- package/dist/types/PocketItemDescription.d.ts +1 -1
- package/dist/types/PocketItemDescription.lua +0 -1
- package/dist/types/Primitive.lua +0 -1
- package/dist/types/TrinketSituation.d.ts +1 -1
- package/dist/types/TrinketSituation.lua +0 -1
- package/dist/types/private/IsaacAPIClass.lua +0 -1
- package/dist/types/private/SaveData.lua +0 -1
- package/dist/types/private/SerializedIsaacAPIClass.lua +0 -1
- package/dist/types/private/TSTLClass.lua +0 -1
- package/dist/types/private/TSTLClassMetatable.lua +0 -1
- package/dist/upgradeMod.d.ts +1 -1
- package/dist/upgradeMod.lua +5 -178
- package/package.json +11 -6
package/dist/functions/flag.lua
CHANGED
|
@@ -1,29 +1,47 @@
|
|
|
1
|
-
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
1
|
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local DamageFlag = ____isaac_2Dtypescript_2Ddefinitions.DamageFlag
|
|
3
4
|
function ____exports.addFlag(self, flags, ...)
|
|
4
|
-
local
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
local flagsToAdd = {...}
|
|
6
|
+
local flagsAsInt = flags
|
|
7
|
+
for ____, flagToAdd in ipairs(flagsToAdd) do
|
|
8
|
+
flagsAsInt = flagsAsInt | flagToAdd
|
|
7
9
|
end
|
|
8
|
-
return
|
|
10
|
+
return flagsAsInt
|
|
11
|
+
end
|
|
12
|
+
function ____exports.bitFlags(self, flag)
|
|
13
|
+
return flag
|
|
14
|
+
end
|
|
15
|
+
function ____exports.getFlagName(self, flag, flagEnum)
|
|
16
|
+
for key, value in pairs(flagEnum) do
|
|
17
|
+
if value == flag then
|
|
18
|
+
return key
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
return nil
|
|
9
22
|
end
|
|
10
23
|
function ____exports.hasFlag(self, flags, ...)
|
|
11
|
-
local
|
|
12
|
-
|
|
13
|
-
|
|
24
|
+
local flagsToCheck = {...}
|
|
25
|
+
local flagsAsInt = flags
|
|
26
|
+
for ____, flagToCheck in ipairs(flagsToCheck) do
|
|
27
|
+
if not (flagsAsInt & flagToCheck == flagToCheck) then
|
|
14
28
|
return false
|
|
15
29
|
end
|
|
16
30
|
end
|
|
17
31
|
return true
|
|
18
32
|
end
|
|
33
|
+
function ____exports.isEmptyFlag(self, flag)
|
|
34
|
+
return flag == 0
|
|
35
|
+
end
|
|
19
36
|
function ____exports.isSelfDamage(self, damageFlags)
|
|
20
|
-
return ____exports.hasFlag(nil, damageFlags, DamageFlag.
|
|
37
|
+
return ____exports.hasFlag(nil, damageFlags, DamageFlag.NO_PENALTIES) or ____exports.hasFlag(nil, damageFlags, DamageFlag.RED_HEARTS)
|
|
21
38
|
end
|
|
22
39
|
function ____exports.removeFlag(self, flags, ...)
|
|
23
|
-
local
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
local flagsToRemove = {...}
|
|
41
|
+
local flagsAsInt = flags
|
|
42
|
+
for ____, flagToRemove in ipairs(flagsToRemove) do
|
|
43
|
+
flagsAsInt = flagsAsInt & ~flagToRemove
|
|
26
44
|
end
|
|
27
|
-
return
|
|
45
|
+
return flagsAsInt
|
|
28
46
|
end
|
|
29
47
|
return ____exports
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { CollectibleType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a set of all of the collectibles that grant flight. This is derived from collectibles
|
|
4
|
-
* that have `CacheFlag.
|
|
4
|
+
* that have `CacheFlag.FLYING` set in the "items.xml" file.
|
|
5
5
|
*
|
|
6
6
|
* Collectibles that only grant flight conditionally are manually pruned. Collectibles such as Empty
|
|
7
7
|
* Vessel should be checked for via the `hasFlyingTemporaryEffect` function.
|
|
@@ -3,30 +3,36 @@ local Set = ____lualib.Set
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
5
|
local ____exports = {}
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
|
|
8
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
|
+
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
10
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
11
|
+
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
6
12
|
local ____collectibleCacheFlag = require("functions.collectibleCacheFlag")
|
|
7
13
|
local getCollectiblesForCacheFlag = ____collectibleCacheFlag.getCollectiblesForCacheFlag
|
|
8
14
|
local ____set = require("functions.set")
|
|
9
15
|
local copySet = ____set.copySet
|
|
10
16
|
local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
11
17
|
local FLYING_CHARACTERS = __TS__New(Set, {
|
|
12
|
-
PlayerType.
|
|
13
|
-
PlayerType.
|
|
14
|
-
PlayerType.
|
|
15
|
-
PlayerType.
|
|
16
|
-
PlayerType.
|
|
17
|
-
PlayerType.
|
|
18
|
+
PlayerType.AZAZEL,
|
|
19
|
+
PlayerType.THE_LOST,
|
|
20
|
+
PlayerType.THE_SOUL,
|
|
21
|
+
PlayerType.THE_LOST_B,
|
|
22
|
+
PlayerType.JACOB_2_B,
|
|
23
|
+
PlayerType.THE_SOUL_B
|
|
18
24
|
})
|
|
19
|
-
local FLYING_TRINKETS = __TS__New(Set, {TrinketType.
|
|
20
|
-
local FLYING_NULL_ITEMS = {NullItemID.
|
|
25
|
+
local FLYING_TRINKETS = __TS__New(Set, {TrinketType.BAT_WING, TrinketType.AZAZELS_STUMP})
|
|
26
|
+
local FLYING_NULL_ITEMS = {NullItemID.REVERSE_SUN, NullItemID.SPIRIT_SHACKLES_SOUL, NullItemID.LOST_CURSE}
|
|
27
|
+
local CONDITIONAL_FLYING_COLLECTIBLE_TYPES = {CollectibleType.BIBLE, CollectibleType.EMPTY_VESSEL, CollectibleType.ASTRAL_PROJECTION, CollectibleType.RECALL}
|
|
21
28
|
function ____exports.getFlyingCollectibles(self, pruneConditionalItems)
|
|
22
|
-
local collectiblesWithFlyingCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.
|
|
23
|
-
local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.
|
|
29
|
+
local collectiblesWithFlyingCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.FLYING)
|
|
30
|
+
local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.ALL)
|
|
24
31
|
deleteSetsFromSet(nil, collectiblesWithFlyingCacheFlag, collectiblesWithAllCacheFlag)
|
|
25
32
|
if pruneConditionalItems then
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
collectiblesWithFlyingCacheFlag:delete(CollectibleType.COLLECTIBLE_RECALL)
|
|
33
|
+
for ____, collectibleType in ipairs(CONDITIONAL_FLYING_COLLECTIBLE_TYPES) do
|
|
34
|
+
collectiblesWithFlyingCacheFlag:delete(collectibleType)
|
|
35
|
+
end
|
|
30
36
|
end
|
|
31
37
|
return collectiblesWithFlyingCacheFlag
|
|
32
38
|
end
|
|
@@ -5,14 +5,17 @@ local __TS__ArraySort = ____lualib.__TS__ArraySort
|
|
|
5
5
|
local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
|
|
6
6
|
local ____exports = {}
|
|
7
7
|
local twoDimensionalSort
|
|
8
|
+
local ____debug = require("functions.debug")
|
|
9
|
+
local isLuaDebugEnabled = ____debug.isLuaDebugEnabled
|
|
8
10
|
local ____log = require("functions.log")
|
|
9
11
|
local log = ____log.log
|
|
10
12
|
local ____set = require("functions.set")
|
|
11
13
|
local addSetsToSet = ____set.addSetsToSet
|
|
12
14
|
local copySet = ____set.copySet
|
|
13
|
-
local ____utils = require("functions.utils")
|
|
14
|
-
local isLuaDebugEnabled = ____utils.isLuaDebugEnabled
|
|
15
15
|
function twoDimensionalSort(self, a, b)
|
|
16
|
+
if a[1] == nil or b[1] == nil then
|
|
17
|
+
error("Failed to two-dimensional sort since the first element of the array was undefined.")
|
|
18
|
+
end
|
|
16
19
|
if a[1] == b[1] then
|
|
17
20
|
return 0
|
|
18
21
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { GridEntityType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to convert the grid entity type found in a room XML file to the corresponding
|
|
4
4
|
* grid entity type and variant normally used by the game. For example, a rock is represented as
|
|
5
|
-
* 1000.0 in a room XML file, but `GridEntityType.
|
|
5
|
+
* 1000.0 in a room XML file, but `GridEntityType.ROCK` is equal to 2.
|
|
6
6
|
*/
|
|
7
7
|
export declare function convertXMLGridEntityType(gridEntityXMLType: int, gridEntityXMLVariant: int): [int, int] | undefined;
|
|
8
8
|
/**
|
|
@@ -29,9 +29,9 @@ export declare function getCollidingEntitiesWithGridEntity(gridEntity: GridEntit
|
|
|
29
29
|
* Example:
|
|
30
30
|
* ```ts
|
|
31
31
|
* const rocks = getGridEntities(
|
|
32
|
-
* GridEntityType.
|
|
33
|
-
* GridEntityType.
|
|
34
|
-
* GridEntityType.
|
|
32
|
+
* GridEntityType.ROCK,
|
|
33
|
+
* GridEntityType.BLOCK,
|
|
34
|
+
* GridEntityType.ROCK_TINTED,
|
|
35
35
|
* );
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
@@ -44,11 +44,13 @@ export declare function getGridEntities(...gridEntityTypes: GridEntityType[]): G
|
|
|
44
44
|
* arguments to match specific grid entity types.
|
|
45
45
|
*/
|
|
46
46
|
export declare function getGridEntitiesMap(...gridEntityTypes: GridEntityType[]): Map<int, GridEntity>;
|
|
47
|
+
/** Helper function to return a string containing the grid entity's type and variant. */
|
|
48
|
+
export declare function getGridEntityID(gridEntity: GridEntity): string;
|
|
47
49
|
export declare function getSurroundingGridEntities(gridEntity: GridEntity): GridEntity[];
|
|
48
50
|
export declare function getTopLeftWall(): GridEntity | undefined;
|
|
49
51
|
/**
|
|
50
|
-
* Helper function to get the grid index of the top left wall.
|
|
51
|
-
*
|
|
52
|
+
* Helper function to get the grid index of the top left wall. (This will depend on what the current
|
|
53
|
+
* room shape is.)
|
|
52
54
|
*/
|
|
53
55
|
export declare function getTopLeftWallGridIndex(): int;
|
|
54
56
|
/**
|
|
@@ -61,8 +63,8 @@ export declare function isGridEntityBreakableByExplosion(gridEntity: GridEntity)
|
|
|
61
63
|
* Helper function to see if the provided gridEntity is in its respective broken state. See the
|
|
62
64
|
* `GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP` constant for more details.
|
|
63
65
|
*
|
|
64
|
-
* Note that in the case of `GridEntityType.
|
|
65
|
-
*
|
|
66
|
+
* Note that in the case of `GridEntityType.LOCK` (11), the state will turn to being broken before
|
|
67
|
+
* the actual collision for the entity is removed.
|
|
66
68
|
*/
|
|
67
69
|
export declare function isGridEntityBroken(gridEntity: GridEntity): boolean;
|
|
68
70
|
/**
|
|
@@ -78,8 +80,8 @@ export declare function isPostBossVoidPortal(gridEntity: GridEntity): boolean;
|
|
|
78
80
|
* Example:
|
|
79
81
|
* ```ts
|
|
80
82
|
* removeAllGridEntitiesExceptFor(
|
|
81
|
-
* GridEntityType.
|
|
82
|
-
* GridEntityType.
|
|
83
|
+
* GridEntityType.WALL,
|
|
84
|
+
* GridEntityType.DOOR,
|
|
83
85
|
* );
|
|
84
86
|
* ```
|
|
85
87
|
*
|
|
@@ -93,9 +95,9 @@ export declare function removeAllGridExcept(...gridEntityTypes: GridEntityType[]
|
|
|
93
95
|
* Example:
|
|
94
96
|
* ```ts
|
|
95
97
|
* removeAllMatchingGridEntities(
|
|
96
|
-
* GridEntityType.
|
|
97
|
-
* GridEntityType.
|
|
98
|
-
* GridEntityType.
|
|
98
|
+
* GridEntityType.ROCK,
|
|
99
|
+
* GridEntityType.BLOCK,
|
|
100
|
+
* GridEntityType.ROCK_TINTED,
|
|
99
101
|
* );
|
|
100
102
|
* ```
|
|
101
103
|
*
|
|
@@ -114,8 +116,8 @@ export declare function removeAllMatchingGridEntities(...gridEntityType: GridEnt
|
|
|
114
116
|
*/
|
|
115
117
|
export declare function removeGrid(gridEntity: GridEntity, updateRoom?: boolean): void;
|
|
116
118
|
/**
|
|
117
|
-
* Helper function to make a grid entity invisible. This is accomplished by setting its sprite to
|
|
118
|
-
*
|
|
119
|
+
* Helper function to make a grid entity invisible. This is accomplished by setting its sprite to an
|
|
120
|
+
* empty/missing PNG file.
|
|
119
121
|
*
|
|
120
122
|
* For more information, see the documentation for the `clearSprite` helper function.
|
|
121
123
|
*/
|
|
@@ -6,6 +6,14 @@ local Map = ____lualib.Map
|
|
|
6
6
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
7
7
|
local ____exports = {}
|
|
8
8
|
local getAllGridEntities
|
|
9
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
10
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
11
|
+
local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
|
|
12
|
+
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
13
|
+
local PoopGridEntityVariant = ____isaac_2Dtypescript_2Ddefinitions.PoopGridEntityVariant
|
|
14
|
+
local PressurePlateState = ____isaac_2Dtypescript_2Ddefinitions.PressurePlateState
|
|
15
|
+
local StatueVariant = ____isaac_2Dtypescript_2Ddefinitions.StatueVariant
|
|
16
|
+
local TrapdoorVariant = ____isaac_2Dtypescript_2Ddefinitions.TrapdoorVariant
|
|
9
17
|
local ____cachedClasses = require("cachedClasses")
|
|
10
18
|
local game = ____cachedClasses.game
|
|
11
19
|
local ____constants = require("constants")
|
|
@@ -18,8 +26,8 @@ local ____roomShapeToTopLeftWallGridIndexMap = require("maps.roomShapeToTopLeftW
|
|
|
18
26
|
local DEFAULT_TOP_LEFT_WALL_GRID_INDEX = ____roomShapeToTopLeftWallGridIndexMap.DEFAULT_TOP_LEFT_WALL_GRID_INDEX
|
|
19
27
|
local ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP = ____roomShapeToTopLeftWallGridIndexMap.ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP
|
|
20
28
|
local ____math = require("functions.math")
|
|
29
|
+
local erange = ____math.erange
|
|
21
30
|
local isCircleIntersectingRectangle = ____math.isCircleIntersectingRectangle
|
|
22
|
-
local range = ____math.range
|
|
23
31
|
local ____rooms = require("functions.rooms")
|
|
24
32
|
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
25
33
|
local ____sprite = require("functions.sprite")
|
|
@@ -30,7 +38,7 @@ function getAllGridEntities(self)
|
|
|
30
38
|
local room = game:GetRoom()
|
|
31
39
|
local gridSize = room:GetGridSize()
|
|
32
40
|
local gridEntities = {}
|
|
33
|
-
for ____, gridIndex in ipairs(
|
|
41
|
+
for ____, gridIndex in ipairs(erange(nil, gridSize)) do
|
|
34
42
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
35
43
|
if gridEntity ~= nil then
|
|
36
44
|
gridEntities[#gridEntities + 1] = gridEntity
|
|
@@ -72,35 +80,35 @@ function ____exports.spawnGridWithVariant(self, gridEntityType, variant, gridInd
|
|
|
72
80
|
if gridEntity == nil then
|
|
73
81
|
return gridEntity
|
|
74
82
|
end
|
|
75
|
-
if gridEntityType == GridEntityType.
|
|
83
|
+
if gridEntityType == GridEntityType.PIT then
|
|
76
84
|
local pit = gridEntity:ToPit()
|
|
77
85
|
if pit ~= nil then
|
|
78
86
|
pit:UpdateCollision()
|
|
79
87
|
end
|
|
80
|
-
elseif gridEntityType == GridEntityType.
|
|
81
|
-
gridEntity.CollisionClass = GridCollisionClass.
|
|
88
|
+
elseif gridEntityType == GridEntityType.WALL then
|
|
89
|
+
gridEntity.CollisionClass = GridCollisionClass.WALL
|
|
82
90
|
end
|
|
83
91
|
return gridEntity
|
|
84
92
|
end
|
|
85
93
|
local BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS = __TS__New(Set, {
|
|
86
|
-
GridEntityType.
|
|
87
|
-
GridEntityType.
|
|
88
|
-
GridEntityType.
|
|
89
|
-
GridEntityType.
|
|
90
|
-
GridEntityType.
|
|
91
|
-
GridEntityType.
|
|
92
|
-
GridEntityType.
|
|
93
|
-
GridEntityType.
|
|
94
|
-
GridEntityType.
|
|
95
|
-
GridEntityType.
|
|
96
|
-
GridEntityType.
|
|
94
|
+
GridEntityType.ROCK,
|
|
95
|
+
GridEntityType.ROCK_TINTED,
|
|
96
|
+
GridEntityType.ROCK_BOMB,
|
|
97
|
+
GridEntityType.ROCK_ALT,
|
|
98
|
+
GridEntityType.SPIDER_WEB,
|
|
99
|
+
GridEntityType.TNT,
|
|
100
|
+
GridEntityType.POOP,
|
|
101
|
+
GridEntityType.ROCK_SUPER_SPECIAL,
|
|
102
|
+
GridEntityType.ROCK_SPIKED,
|
|
103
|
+
GridEntityType.ROCK_ALT_2,
|
|
104
|
+
GridEntityType.ROCK_GOLD
|
|
97
105
|
})
|
|
98
106
|
local BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS = __TS__New(
|
|
99
107
|
Set,
|
|
100
|
-
{(tostring(GridEntityType.
|
|
108
|
+
{(tostring(GridEntityType.STATUE) .. ".") .. tostring(StatueVariant.ANGEL)}
|
|
101
109
|
)
|
|
102
110
|
function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntityXMLVariant)
|
|
103
|
-
if gridEntityXMLType == EntityType.
|
|
111
|
+
if gridEntityXMLType == EntityType.TRIGGER_OUTPUT then
|
|
104
112
|
return nil
|
|
105
113
|
end
|
|
106
114
|
local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
|
|
@@ -109,7 +117,7 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
|
|
|
109
117
|
end
|
|
110
118
|
local gridEntityType = gridEntityArray[1]
|
|
111
119
|
local gridEntityVariant = gridEntityArray[2]
|
|
112
|
-
if gridEntityType == GridEntityType.
|
|
120
|
+
if gridEntityType == GridEntityType.SPIKES_ON_OFF or gridEntityType == GridEntityType.PRESSURE_PLATE or gridEntityType == GridEntityType.TELEPORTER then
|
|
113
121
|
gridEntityVariant = gridEntityXMLVariant
|
|
114
122
|
end
|
|
115
123
|
return {gridEntityType, gridEntityVariant}
|
|
@@ -153,6 +161,11 @@ function ____exports.getGridEntitiesMap(self, ...)
|
|
|
153
161
|
end
|
|
154
162
|
return gridEntityMap
|
|
155
163
|
end
|
|
164
|
+
function ____exports.getGridEntityID(self, gridEntity)
|
|
165
|
+
local gridEntityType = gridEntity:GetType()
|
|
166
|
+
local gridEntityVariant = gridEntity:GetVariant()
|
|
167
|
+
return (tostring(gridEntityType) .. ".") .. tostring(gridEntityVariant)
|
|
168
|
+
end
|
|
156
169
|
function ____exports.getSurroundingGridEntities(self, gridEntity)
|
|
157
170
|
local room = game:GetRoom()
|
|
158
171
|
local gridWidth = room:GetGridWidth()
|
|
@@ -187,10 +200,10 @@ function ____exports.isAllPressurePlatesPushed(self)
|
|
|
187
200
|
if not hasPressurePlates then
|
|
188
201
|
return true
|
|
189
202
|
end
|
|
190
|
-
local pressurePlates = ____exports.getGridEntities(nil, GridEntityType.
|
|
203
|
+
local pressurePlates = ____exports.getGridEntities(nil, GridEntityType.PRESSURE_PLATE)
|
|
191
204
|
return __TS__ArrayEvery(
|
|
192
205
|
pressurePlates,
|
|
193
|
-
function(____, pressurePlate) return pressurePlate.State ==
|
|
206
|
+
function(____, pressurePlate) return pressurePlate.State == PressurePlateState.PRESSURE_PLATE_PRESSED end
|
|
194
207
|
)
|
|
195
208
|
end
|
|
196
209
|
function ____exports.isGridEntityBreakableByExplosion(self, gridEntity)
|
|
@@ -246,16 +259,16 @@ function ____exports.spawnGiantPoop(self, topLeftGridIndex)
|
|
|
246
259
|
local topRightGridIndex = topLeftGridIndex + 1
|
|
247
260
|
local bottomLeftGridIndex = topLeftGridIndex + gridWidth
|
|
248
261
|
local bottomRightGridIndex = bottomLeftGridIndex + 1
|
|
249
|
-
____exports.spawnGridWithVariant(nil, GridEntityType.
|
|
250
|
-
____exports.spawnGridWithVariant(nil, GridEntityType.
|
|
251
|
-
____exports.spawnGridWithVariant(nil, GridEntityType.
|
|
252
|
-
____exports.spawnGridWithVariant(nil, GridEntityType.
|
|
262
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIGA_TOP_LEFT, topLeftGridIndex)
|
|
263
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIGA_TOP_RIGHT, topRightGridIndex)
|
|
264
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIGA_BOTTOM_LEFT, bottomLeftGridIndex)
|
|
265
|
+
____exports.spawnGridWithVariant(nil, GridEntityType.POOP, PoopGridEntityVariant.GIGA_BOTTOM_RIGHT, bottomRightGridIndex)
|
|
253
266
|
end
|
|
254
267
|
function ____exports.spawnGrid(self, gridEntityType, gridIndexOrPosition)
|
|
255
268
|
return ____exports.spawnGridWithVariant(nil, gridEntityType, 0, gridIndexOrPosition)
|
|
256
269
|
end
|
|
257
270
|
function ____exports.spawnVoidPortal(self, gridIndex)
|
|
258
|
-
local voidPortal = ____exports.spawnGridWithVariant(nil, GridEntityType.
|
|
271
|
+
local voidPortal = ____exports.spawnGridWithVariant(nil, GridEntityType.TRAPDOOR, TrapdoorVariant.VOID_PORTAL, gridIndex)
|
|
259
272
|
if voidPortal == nil then
|
|
260
273
|
return voidPortal
|
|
261
274
|
end
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { ButtonAction, Controller, Keyboard } from "isaac-typescript-definitions";
|
|
2
2
|
/** Helper function to get the enum name for the specified `Controller` value. */
|
|
3
3
|
export declare function controllerToString(controller: Controller): string;
|
|
4
4
|
export declare function getMoveActions(): Set<ButtonAction>;
|
|
@@ -10,12 +10,22 @@ export declare function isActionPressedOnAnyInput(buttonAction: ButtonAction): b
|
|
|
10
10
|
* then released).
|
|
11
11
|
*/
|
|
12
12
|
export declare function isActionTriggeredOnAnyInput(buttonAction: ButtonAction): boolean;
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to see if a particular keyboard key is being pressed down by the player.
|
|
15
|
+
*
|
|
16
|
+
* This function is variadic, meaning you can pass as many keyboard values as you want to check for.
|
|
17
|
+
* This function will return true if any of the values are pressed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isKeyboardPressed(...keys: Keyboard[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Helper function to check if one or more modifier keys are being pressed down on the keyboard.
|
|
22
|
+
*
|
|
23
|
+
* A modifier key is defined as shift, control, alt, or Windows.
|
|
24
|
+
*/
|
|
25
|
+
export declare function isModifierKeyPressed(): boolean;
|
|
14
26
|
export declare function isMoveAction(buttonAction: ButtonAction): boolean;
|
|
15
27
|
export declare function isMoveActionPressedOnAnyInput(): boolean;
|
|
16
28
|
export declare function isMoveActionTriggeredOnAnyInput(): boolean;
|
|
17
29
|
export declare function isShootAction(buttonAction: ButtonAction): boolean;
|
|
18
30
|
export declare function isShootActionPressedOnAnyInput(): boolean;
|
|
19
31
|
export declare function isShootActionTriggeredOnAnyInput(): boolean;
|
|
20
|
-
/** Helper function to get the enum name for the specified `Keyboard` value. */
|
|
21
|
-
export declare function keyboardToString(keyboard: Keyboard): string;
|
package/dist/functions/input.lua
CHANGED
|
@@ -1,81 +1,41 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__StringReplace = ____lualib.__TS__StringReplace
|
|
5
|
-
local __TS__ObjectEntries = ____lualib.__TS__ObjectEntries
|
|
6
4
|
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
7
|
-
local __TS__StringSlice = ____lualib.__TS__StringSlice
|
|
8
5
|
local ____exports = {}
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
|
|
8
|
+
local Controller = ____isaac_2Dtypescript_2Ddefinitions.Controller
|
|
9
|
+
local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
10
|
+
local Keyboard = ____isaac_2Dtypescript_2Ddefinitions.Keyboard
|
|
9
11
|
local ____constants = require("constants")
|
|
10
12
|
local MAX_NUM_INPUTS = ____constants.MAX_NUM_INPUTS
|
|
11
13
|
local ____math = require("functions.math")
|
|
12
|
-
local
|
|
14
|
+
local erange = ____math.erange
|
|
13
15
|
local ____set = require("functions.set")
|
|
14
16
|
local copySet = ____set.copySet
|
|
15
|
-
local
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
ControllerLiteral.BUTTON_X = 6
|
|
29
|
-
ControllerLiteral[ControllerLiteral.BUTTON_X] = "BUTTON_X"
|
|
30
|
-
ControllerLiteral.BUTTON_Y = 7
|
|
31
|
-
ControllerLiteral[ControllerLiteral.BUTTON_Y] = "BUTTON_Y"
|
|
32
|
-
ControllerLiteral.BUMPER_LEFT = 8
|
|
33
|
-
ControllerLiteral[ControllerLiteral.BUMPER_LEFT] = "BUMPER_LEFT"
|
|
34
|
-
ControllerLiteral.TRIGGER_LEFT = 9
|
|
35
|
-
ControllerLiteral[ControllerLiteral.TRIGGER_LEFT] = "TRIGGER_LEFT"
|
|
36
|
-
ControllerLiteral.STICK_LEFT = 10
|
|
37
|
-
ControllerLiteral[ControllerLiteral.STICK_LEFT] = "STICK_LEFT"
|
|
38
|
-
ControllerLiteral.BUMPER_RIGHT = 11
|
|
39
|
-
ControllerLiteral[ControllerLiteral.BUMPER_RIGHT] = "BUMPER_RIGHT"
|
|
40
|
-
ControllerLiteral.TRIGGER_RIGHT = 12
|
|
41
|
-
ControllerLiteral[ControllerLiteral.TRIGGER_RIGHT] = "TRIGGER_RIGHT"
|
|
42
|
-
ControllerLiteral.STICK_RIGHT = 13
|
|
43
|
-
ControllerLiteral[ControllerLiteral.STICK_RIGHT] = "STICK_RIGHT"
|
|
44
|
-
ControllerLiteral.BUTTON_BACK = 14
|
|
45
|
-
ControllerLiteral[ControllerLiteral.BUTTON_BACK] = "BUTTON_BACK"
|
|
46
|
-
ControllerLiteral.BUTTON_START = 15
|
|
47
|
-
ControllerLiteral[ControllerLiteral.BUTTON_START] = "BUTTON_START"
|
|
48
|
-
local MOVEMENT_ACTIONS = {ButtonAction.ACTION_LEFT, ButtonAction.ACTION_RIGHT, ButtonAction.ACTION_UP, ButtonAction.ACTION_DOWN}
|
|
17
|
+
local ____string = require("functions.string")
|
|
18
|
+
local trimPrefix = ____string.trimPrefix
|
|
19
|
+
local MODIFIER_KEYS = {
|
|
20
|
+
Keyboard.LEFT_SHIFT,
|
|
21
|
+
Keyboard.LEFT_CONTROL,
|
|
22
|
+
Keyboard.LEFT_ALT,
|
|
23
|
+
Keyboard.LEFT_SUPER,
|
|
24
|
+
Keyboard.RIGHT_SHIFT,
|
|
25
|
+
Keyboard.RIGHT_CONTROL,
|
|
26
|
+
Keyboard.RIGHT_ALT,
|
|
27
|
+
Keyboard.RIGHT_SUPER
|
|
28
|
+
}
|
|
29
|
+
local MOVEMENT_ACTIONS = {ButtonAction.LEFT, ButtonAction.RIGHT, ButtonAction.UP, ButtonAction.DOWN}
|
|
49
30
|
local MOVEMENT_ACTIONS_SET = __TS__New(Set, MOVEMENT_ACTIONS)
|
|
50
|
-
local SHOOTING_ACTIONS = {ButtonAction.
|
|
31
|
+
local SHOOTING_ACTIONS = {ButtonAction.SHOOT_LEFT, ButtonAction.SHOOT_RIGHT, ButtonAction.SHOOT_UP, ButtonAction.SHOOT_DOWN}
|
|
51
32
|
local SHOOTING_ACTIONS_SET = __TS__New(Set, SHOOTING_ACTIONS)
|
|
52
33
|
function ____exports.controllerToString(self, controller)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
do
|
|
57
|
-
if type(key) ~= "string" then
|
|
58
|
-
goto __continue3
|
|
59
|
-
end
|
|
60
|
-
local controllerCode = controllerLiteralCode
|
|
61
|
-
if controllerCode ~= controller then
|
|
62
|
-
goto __continue3
|
|
63
|
-
end
|
|
64
|
-
local controllerName = key
|
|
65
|
-
for ____, prefix in ipairs({
|
|
66
|
-
"DPAD_",
|
|
67
|
-
"BUTTON_",
|
|
68
|
-
"BUMPER_",
|
|
69
|
-
"TRIGGER_",
|
|
70
|
-
"STICK_"
|
|
71
|
-
}) do
|
|
72
|
-
controllerName = __TS__StringReplace(controllerName, prefix, "")
|
|
73
|
-
end
|
|
74
|
-
return controllerName
|
|
75
|
-
end
|
|
76
|
-
::__continue3::
|
|
34
|
+
local key = Controller[controller]
|
|
35
|
+
if key == nil then
|
|
36
|
+
return "unknown"
|
|
77
37
|
end
|
|
78
|
-
return "
|
|
38
|
+
return trimPrefix(nil, key, "BUTTON_")
|
|
79
39
|
end
|
|
80
40
|
function ____exports.getMoveActions(self)
|
|
81
41
|
return copySet(nil, MOVEMENT_ACTIONS_SET)
|
|
@@ -84,21 +44,31 @@ function ____exports.getShootActions(self)
|
|
|
84
44
|
return copySet(nil, SHOOTING_ACTIONS_SET)
|
|
85
45
|
end
|
|
86
46
|
function ____exports.isActionPressedOnAnyInput(self, buttonAction)
|
|
87
|
-
local validInputs =
|
|
47
|
+
local validInputs = erange(nil, MAX_NUM_INPUTS)
|
|
88
48
|
return __TS__ArraySome(
|
|
89
49
|
validInputs,
|
|
90
50
|
function(____, input) return Input.IsActionPressed(buttonAction, input) end
|
|
91
51
|
)
|
|
92
52
|
end
|
|
93
53
|
function ____exports.isActionTriggeredOnAnyInput(self, buttonAction)
|
|
94
|
-
local validInputs =
|
|
54
|
+
local validInputs = erange(nil, MAX_NUM_INPUTS)
|
|
95
55
|
return __TS__ArraySome(
|
|
96
56
|
validInputs,
|
|
97
57
|
function(____, input) return Input.IsActionTriggered(buttonAction, input) end
|
|
98
58
|
)
|
|
99
59
|
end
|
|
100
|
-
function ____exports.isKeyboardPressed(self,
|
|
101
|
-
|
|
60
|
+
function ____exports.isKeyboardPressed(self, ...)
|
|
61
|
+
local keys = {...}
|
|
62
|
+
return __TS__ArraySome(
|
|
63
|
+
keys,
|
|
64
|
+
function(____, key) return Input.IsButtonPressed(key, ControllerIndex.KEYBOARD) end
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
function ____exports.isModifierKeyPressed(self)
|
|
68
|
+
return ____exports.isKeyboardPressed(
|
|
69
|
+
nil,
|
|
70
|
+
table.unpack(MODIFIER_KEYS)
|
|
71
|
+
)
|
|
102
72
|
end
|
|
103
73
|
function ____exports.isMoveAction(self, buttonAction)
|
|
104
74
|
return MOVEMENT_ACTIONS_SET:has(buttonAction)
|
|
@@ -130,16 +100,4 @@ function ____exports.isShootActionTriggeredOnAnyInput(self)
|
|
|
130
100
|
function(____, shootAction) return ____exports.isActionTriggeredOnAnyInput(nil, shootAction) end
|
|
131
101
|
)
|
|
132
102
|
end
|
|
133
|
-
function ____exports.keyboardToString(self, keyboard)
|
|
134
|
-
for ____, ____value in ipairs(__TS__ObjectEntries(Keyboard)) do
|
|
135
|
-
local keyName = ____value[1]
|
|
136
|
-
local keyCode = ____value[2]
|
|
137
|
-
if keyCode == keyboard then
|
|
138
|
-
local withoutPrefix = __TS__StringSlice(keyName, #"KEY_")
|
|
139
|
-
local withoutUnderscores = string.gsub(withoutPrefix, "_", " ")
|
|
140
|
-
return withoutUnderscores
|
|
141
|
-
end
|
|
142
|
-
end
|
|
143
|
-
return "unknown"
|
|
144
|
-
end
|
|
145
103
|
return ____exports
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/// <reference types="typescript-to-lua/language-extensions" />
|
|
2
2
|
/**
|
|
3
3
|
* Converts a JSON string to a Lua table.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* manually removed their existing
|
|
4
|
+
*
|
|
5
|
+
* In most cases, this function will be used for reading data from a "save#.dat" file. If decoding
|
|
6
|
+
* fails, it will return a blank Lua table instead of throwing an error. (This allows execution to
|
|
7
|
+
* continue in cases where users have no current save data or have manually removed their existing
|
|
8
|
+
* save data.)
|
|
8
9
|
*/
|
|
9
10
|
export declare function jsonDecode(jsonString: string): LuaTable<AnyNotNil, unknown>;
|
|
10
11
|
/**
|
|
11
12
|
* Converts a Lua table to a JSON string.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* a user's
|
|
13
|
+
*
|
|
14
|
+
* In most cases, this function will be used for writing data to a "save#.dat" file. If encoding
|
|
15
|
+
* fails, it will throw an error to prevent writing a blank string or corrupted data to a user's
|
|
16
|
+
* "save#.dat" file.
|
|
15
17
|
*/
|
|
16
18
|
export declare function jsonEncode(table: unknown): string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
1
|
local ____exports = {}
|
|
3
2
|
local OBJECT_NAME
|
|
4
3
|
local ____SerializationBrand = require("enums.private.SerializationBrand")
|
|
@@ -42,7 +41,7 @@ function ____exports.copyKColor(self, kColor, serializationType)
|
|
|
42
41
|
end
|
|
43
42
|
local kColorTable = {}
|
|
44
43
|
copyValuesToTable(nil, kColor, KEYS, kColorTable)
|
|
45
|
-
kColorTable[SerializationBrand.
|
|
44
|
+
kColorTable[SerializationBrand.K_COLOR] = ""
|
|
46
45
|
return kColorTable
|
|
47
46
|
end
|
|
48
47
|
end
|
|
@@ -59,6 +58,18 @@ function ____exports.copyKColor(self, kColor, serializationType)
|
|
|
59
58
|
OBJECT_NAME,
|
|
60
59
|
table.unpack(KEYS)
|
|
61
60
|
))
|
|
61
|
+
if r == nil then
|
|
62
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: r")
|
|
63
|
+
end
|
|
64
|
+
if g == nil then
|
|
65
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: g")
|
|
66
|
+
end
|
|
67
|
+
if b == nil then
|
|
68
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: b")
|
|
69
|
+
end
|
|
70
|
+
if a == nil then
|
|
71
|
+
error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: a")
|
|
72
|
+
end
|
|
62
73
|
return KColor(r, g, b, a)
|
|
63
74
|
end
|
|
64
75
|
end
|
|
@@ -82,7 +93,7 @@ function ____exports.isSerializedKColor(self, object)
|
|
|
82
93
|
nil,
|
|
83
94
|
____table,
|
|
84
95
|
table.unpack(KEYS)
|
|
85
|
-
) and ____table[SerializationBrand.
|
|
96
|
+
) and ____table[SerializationBrand.K_COLOR] ~= nil
|
|
86
97
|
end
|
|
87
98
|
function ____exports.kColorEquals(self, kColor1, kColor2)
|
|
88
99
|
return isaacAPIClassEquals(nil, kColor1, kColor2, KEYS)
|