isaacscript-common 87.9.7 → 87.9.8
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/cachedEnumValues.js +29 -32
- package/dist/callbackClasses.js +142 -289
- package/dist/callbacks.js +147 -183
- package/dist/classes/DefaultMap.js +4 -8
- package/dist/classes/ModFeature.js +21 -25
- package/dist/classes/ModUpgraded.js +43 -47
- package/dist/classes/callbacks/EntityTakeDmgFilter.js +6 -10
- package/dist/classes/callbacks/EntityTakeDmgPlayer.js +7 -11
- package/dist/classes/callbacks/InputActionFilter.js +4 -8
- package/dist/classes/callbacks/InputActionPlayer.js +4 -8
- package/dist/classes/callbacks/PostAmbushFinished.js +10 -14
- package/dist/classes/callbacks/PostAmbushStarted.js +10 -14
- package/dist/classes/callbacks/PostBombExploded.js +8 -12
- package/dist/classes/callbacks/PostBombInitFilter.js +6 -10
- package/dist/classes/callbacks/PostBombInitLate.js +6 -10
- package/dist/classes/callbacks/PostBombRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostBombUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostBoneSwing.js +7 -11
- package/dist/classes/callbacks/PostCollectibleEmpty.js +6 -10
- package/dist/classes/callbacks/PostCursedTeleport.js +30 -34
- package/dist/classes/callbacks/PostCustomRevive.js +4 -8
- package/dist/classes/callbacks/PostDiceRoomActivated.js +9 -13
- package/dist/classes/callbacks/PostDoorRender.js +8 -12
- package/dist/classes/callbacks/PostDoorUpdate.js +8 -12
- package/dist/classes/callbacks/PostEffectInitFilter.js +6 -10
- package/dist/classes/callbacks/PostEffectInitLate.js +6 -10
- package/dist/classes/callbacks/PostEffectRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostEffectStateChanged.js +8 -12
- package/dist/classes/callbacks/PostEffectUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostEntityKillFilter.js +6 -10
- package/dist/classes/callbacks/PostEntityRemoveFilter.js +6 -10
- package/dist/classes/callbacks/PostEsauJr.js +4 -8
- package/dist/classes/callbacks/PostFamiliarInitFilter.js +6 -10
- package/dist/classes/callbacks/PostFamiliarInitLate.js +6 -10
- package/dist/classes/callbacks/PostFamiliarRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostFamiliarStateChanged.js +8 -12
- package/dist/classes/callbacks/PostFamiliarUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostFirstEsauJr.js +4 -8
- package/dist/classes/callbacks/PostFirstFlip.js +4 -8
- package/dist/classes/callbacks/PostFlip.js +4 -8
- package/dist/classes/callbacks/PostGameEndFilter.js +6 -10
- package/dist/classes/callbacks/PostGameStartedReordered.js +6 -10
- package/dist/classes/callbacks/PostGameStartedReorderedLast.js +6 -10
- package/dist/classes/callbacks/PostGreedModeWave.js +7 -11
- package/dist/classes/callbacks/PostGridEntityBroken.js +6 -10
- package/dist/classes/callbacks/PostGridEntityCollision.js +4 -8
- package/dist/classes/callbacks/PostGridEntityCustomBroken.js +6 -10
- package/dist/classes/callbacks/PostGridEntityCustomCollision.js +4 -8
- package/dist/classes/callbacks/PostGridEntityCustomInit.js +6 -10
- package/dist/classes/callbacks/PostGridEntityCustomRemove.js +4 -8
- package/dist/classes/callbacks/PostGridEntityCustomRender.js +6 -10
- package/dist/classes/callbacks/PostGridEntityCustomStateChanged.js +6 -10
- package/dist/classes/callbacks/PostGridEntityCustomUpdate.js +6 -10
- package/dist/classes/callbacks/PostGridEntityInit.js +6 -10
- package/dist/classes/callbacks/PostGridEntityRemove.js +4 -8
- package/dist/classes/callbacks/PostGridEntityRender.js +6 -10
- package/dist/classes/callbacks/PostGridEntityStateChanged.js +6 -10
- package/dist/classes/callbacks/PostGridEntityUpdate.js +6 -10
- package/dist/classes/callbacks/PostHolyMantleRemoved.js +15 -19
- package/dist/classes/callbacks/PostItemDischarge.js +23 -27
- package/dist/classes/callbacks/PostItemPickup.js +6 -10
- package/dist/classes/callbacks/PostKeyboardChanged.js +9 -13
- package/dist/classes/callbacks/PostKnifeInitFilter.js +6 -10
- package/dist/classes/callbacks/PostKnifeInitLate.js +6 -10
- package/dist/classes/callbacks/PostKnifeRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostKnifeUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostLaserInitFilter.js +6 -10
- package/dist/classes/callbacks/PostLaserInitLate.js +6 -10
- package/dist/classes/callbacks/PostLaserRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostLaserUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostNPCDeathFilter.js +6 -10
- package/dist/classes/callbacks/PostNPCInitFilter.js +6 -10
- package/dist/classes/callbacks/PostNPCInitLate.js +6 -10
- package/dist/classes/callbacks/PostNPCRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostNPCStateChanged.js +8 -12
- package/dist/classes/callbacks/PostNPCUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostNewLevelReordered.js +6 -10
- package/dist/classes/callbacks/PostNewRoomEarly.js +17 -21
- package/dist/classes/callbacks/PostNewRoomReordered.js +6 -10
- package/dist/classes/callbacks/PostPEffectUpdateReordered.js +6 -10
- package/dist/classes/callbacks/PostPickupChanged.js +6 -10
- package/dist/classes/callbacks/PostPickupCollect.js +8 -12
- package/dist/classes/callbacks/PostPickupInitFilter.js +6 -10
- package/dist/classes/callbacks/PostPickupInitFirst.js +10 -14
- package/dist/classes/callbacks/PostPickupInitLate.js +6 -10
- package/dist/classes/callbacks/PostPickupRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostPickupSelectionFilter.js +4 -8
- package/dist/classes/callbacks/PostPickupStateChanged.js +8 -12
- package/dist/classes/callbacks/PostPickupUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostPitRender.js +8 -12
- package/dist/classes/callbacks/PostPitUpdate.js +8 -12
- package/dist/classes/callbacks/PostPlayerChangeHealth.js +14 -18
- package/dist/classes/callbacks/PostPlayerChangeStat.js +26 -30
- package/dist/classes/callbacks/PostPlayerChangeType.js +11 -15
- package/dist/classes/callbacks/PostPlayerCollectibleAdded.js +6 -10
- package/dist/classes/callbacks/PostPlayerCollectibleRemoved.js +6 -10
- package/dist/classes/callbacks/PostPlayerFatalDamage.js +24 -28
- package/dist/classes/callbacks/PostPlayerInitFirst.js +12 -16
- package/dist/classes/callbacks/PostPlayerInitLate.js +9 -13
- package/dist/classes/callbacks/PostPlayerRenderReordered.js +6 -10
- package/dist/classes/callbacks/PostPlayerUpdateReordered.js +6 -10
- package/dist/classes/callbacks/PostPoopRender.js +8 -12
- package/dist/classes/callbacks/PostPoopUpdate.js +8 -12
- package/dist/classes/callbacks/PostPressurePlateRender.js +8 -12
- package/dist/classes/callbacks/PostPressurePlateUpdate.js +8 -12
- package/dist/classes/callbacks/PostProjectileInitFilter.js +6 -10
- package/dist/classes/callbacks/PostProjectileInitLate.js +6 -10
- package/dist/classes/callbacks/PostProjectileKill.js +8 -12
- package/dist/classes/callbacks/PostProjectileRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostProjectileUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostPurchase.js +21 -25
- package/dist/classes/callbacks/PostRockRender.js +8 -12
- package/dist/classes/callbacks/PostRockUpdate.js +8 -12
- package/dist/classes/callbacks/PostRoomClearChanged.js +9 -13
- package/dist/classes/callbacks/PostSacrifice.js +12 -16
- package/dist/classes/callbacks/PostSlotAnimationChanged.js +6 -10
- package/dist/classes/callbacks/PostSlotCollision.js +8 -12
- package/dist/classes/callbacks/PostSlotDestroyed.js +6 -10
- package/dist/classes/callbacks/PostSlotInit.js +6 -10
- package/dist/classes/callbacks/PostSlotRender.js +6 -10
- package/dist/classes/callbacks/PostSlotUpdate.js +6 -10
- package/dist/classes/callbacks/PostSpikesRender.js +8 -12
- package/dist/classes/callbacks/PostSpikesUpdate.js +8 -12
- package/dist/classes/callbacks/PostTNTRender.js +8 -12
- package/dist/classes/callbacks/PostTNTUpdate.js +8 -12
- package/dist/classes/callbacks/PostTearInitFilter.js +6 -10
- package/dist/classes/callbacks/PostTearInitLate.js +6 -10
- package/dist/classes/callbacks/PostTearInitVeryLate.js +6 -10
- package/dist/classes/callbacks/PostTearKill.js +8 -12
- package/dist/classes/callbacks/PostTearRenderFilter.js +6 -10
- package/dist/classes/callbacks/PostTearUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PostTransformation.js +10 -14
- package/dist/classes/callbacks/PostTrinketBreak.js +16 -20
- package/dist/classes/callbacks/PostUsePillFilter.js +18 -22
- package/dist/classes/callbacks/PreBerserkDeath.js +14 -18
- package/dist/classes/callbacks/PreBombCollisionFilter.js +6 -10
- package/dist/classes/callbacks/PreCustomRevive.js +6 -10
- package/dist/classes/callbacks/PreEntitySpawnFilter.js +4 -8
- package/dist/classes/callbacks/PreFamiliarCollisionFilter.js +6 -10
- package/dist/classes/callbacks/PreGetPedestal.js +8 -12
- package/dist/classes/callbacks/PreItemPickup.js +6 -10
- package/dist/classes/callbacks/PreKnifeCollisionFilter.js +6 -10
- package/dist/classes/callbacks/PreNPCCollisionFilter.js +6 -10
- package/dist/classes/callbacks/PreNPCUpdateFilter.js +6 -10
- package/dist/classes/callbacks/PreNewLevel.js +10 -14
- package/dist/classes/callbacks/PreProjectileCollisionFilter.js +6 -10
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.js +4 -8
- package/dist/classes/callbacks/PreTearCollisionFilter.js +6 -10
- package/dist/classes/features/callbackLogic/CustomGridEntities.js +46 -50
- package/dist/classes/features/callbackLogic/CustomRevive.js +28 -32
- package/dist/classes/features/callbackLogic/EsauJrDetection.js +11 -15
- package/dist/classes/features/callbackLogic/FlipDetection.js +11 -15
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +26 -30
- package/dist/classes/features/callbackLogic/GridEntityCollisionDetection.js +10 -14
- package/dist/classes/features/callbackLogic/GridEntityRenderDetection.js +6 -10
- package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.js +12 -16
- package/dist/classes/features/callbackLogic/ItemPickupDetection.js +17 -21
- package/dist/classes/features/callbackLogic/PickupChangeDetection.js +6 -10
- package/dist/classes/features/callbackLogic/PlayerCollectibleDetection.js +39 -43
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.js +18 -22
- package/dist/classes/features/callbackLogic/SlotDestroyedDetection.js +17 -21
- package/dist/classes/features/callbackLogic/SlotRenderDetection.js +8 -12
- package/dist/classes/features/callbackLogic/SlotUpdateDetection.js +9 -13
- package/dist/classes/features/other/CharacterHealthConversion.js +13 -17
- package/dist/classes/features/other/CharacterStats.js +9 -13
- package/dist/classes/features/other/CollectibleItemPoolType.js +17 -21
- package/dist/classes/features/other/CustomHotkeys.js +15 -19
- package/dist/classes/features/other/CustomItemPools.js +20 -24
- package/dist/classes/features/other/CustomPickups.js +15 -19
- package/dist/classes/features/other/CustomStages.js +116 -153
- package/dist/classes/features/other/CustomTrapdoors.js +119 -123
- package/dist/classes/features/other/DebugDisplay.js +77 -81
- package/dist/classes/features/other/DeployJSONRoom.js +65 -69
- package/dist/classes/features/other/DisableAllSound.js +14 -18
- package/dist/classes/features/other/DisableInputs.js +24 -28
- package/dist/classes/features/other/EdenStartingStatsHealth.js +36 -40
- package/dist/classes/features/other/ExtraConsoleCommands.js +65 -102
- package/dist/classes/features/other/FadeInRemover.js +9 -13
- package/dist/classes/features/other/FastReset.js +18 -22
- package/dist/classes/features/other/FlyingDetection.js +10 -14
- package/dist/classes/features/other/ForgottenSwitch.js +8 -12
- package/dist/classes/features/other/ItemPoolDetection.js +35 -39
- package/dist/classes/features/other/ModdedElementDetection.js +43 -47
- package/dist/classes/features/other/ModdedElementSets.js +135 -139
- package/dist/classes/features/other/NoSirenSteal.js +7 -11
- package/dist/classes/features/other/Pause.js +48 -52
- package/dist/classes/features/other/PersistentEntities.js +16 -20
- package/dist/classes/features/other/PickupIndexCreation.js +31 -35
- package/dist/classes/features/other/PlayerCollectibleTracking.js +18 -22
- package/dist/classes/features/other/PonyDetection.js +22 -26
- package/dist/classes/features/other/PressInput.js +10 -14
- package/dist/classes/features/other/PreventChildEntities.js +6 -10
- package/dist/classes/features/other/PreventGridEntityRespawn.js +34 -38
- package/dist/classes/features/other/RerunDetection.js +11 -15
- package/dist/classes/features/other/RoomClearFrame.js +11 -15
- package/dist/classes/features/other/RoomHistory.js +30 -34
- package/dist/classes/features/other/RunInNFrames.js +24 -28
- package/dist/classes/features/other/RunNextRoom.js +8 -12
- package/dist/classes/features/other/RunNextRun.js +8 -12
- package/dist/classes/features/other/SaveDataManager.js +61 -65
- package/dist/classes/features/other/SpawnRockAltRewards.js +115 -119
- package/dist/classes/features/other/StageHistory.js +76 -80
- package/dist/classes/features/other/StartAmbush.js +12 -16
- package/dist/classes/features/other/TaintedLazarusPlayers.js +10 -14
- package/dist/classes/features/other/UnlockAchievementsDetection.js +10 -14
- package/dist/classes/features/other/customStages/backdrop.js +68 -71
- package/dist/classes/features/other/customStages/constants.js +7 -10
- package/dist/classes/features/other/customStages/gridEntities.js +23 -30
- package/dist/classes/features/other/customStages/shadows.js +27 -30
- package/dist/classes/features/other/customStages/streakText.js +55 -60
- package/dist/classes/features/other/customStages/utils.js +13 -17
- package/dist/classes/features/other/customStages/v.js +4 -7
- package/dist/classes/features/other/customStages/versusScreen.js +46 -50
- package/dist/classes/features/other/debugDisplay/DebugDisplayBomb.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayDoor.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayEffect.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayFamiliar.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayKnife.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayLaser.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayNPC.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayPickup.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayPit.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayPlayer.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayPoop.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayPressurePlate.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayProjectile.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayRock.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplaySlot.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplaySpikes.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayTNT.js +8 -12
- package/dist/classes/features/other/debugDisplay/DebugDisplayTear.js +8 -12
- package/dist/classes/features/other/debugDisplay/utils.js +6 -10
- package/dist/classes/features/other/extraConsoleCommands/commands.js +411 -557
- package/dist/classes/features/other/extraConsoleCommands/subroutines.js +47 -57
- package/dist/classes/features/other/extraConsoleCommands/v.js +1 -4
- package/dist/classes/features/other/saveDataManager/constants.js +1 -4
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +17 -21
- package/dist/classes/features/other/saveDataManager/loadFromDisk.js +19 -22
- package/dist/classes/features/other/saveDataManager/restoreDefaults.js +20 -25
- package/dist/classes/features/other/saveDataManager/saveToDisk.js +13 -16
- package/dist/classes/private/CustomCallback.js +4 -8
- package/dist/classes/private/Feature.js +1 -5
- package/dist/core/cachedClasses.js +12 -15
- package/dist/core/constants.js +126 -130
- package/dist/core/constantsFirstLast.js +22 -25
- package/dist/core/constantsVanilla.js +25 -28
- package/dist/core/upgradeMod.js +7 -10
- package/dist/decorators.js +6 -10
- package/dist/enums/AmbushType.js +2 -5
- package/dist/enums/CornerType.js +2 -5
- package/dist/enums/HealthType.js +2 -5
- package/dist/enums/ISCFeature.js +2 -5
- package/dist/enums/LadderSubTypeCustom.js +2 -5
- package/dist/enums/ModCallbackCustom.js +2 -5
- package/dist/enums/MysteriousPaperEffect.js +2 -5
- package/dist/enums/PlayerStat.js +2 -5
- package/dist/enums/PocketItemType.js +2 -5
- package/dist/enums/RockAltType.js +2 -5
- package/dist/enums/SaveDataKey.js +2 -5
- package/dist/enums/SerializationType.js +2 -5
- package/dist/enums/SlotDestructionType.js +2 -5
- package/dist/enums/private/GridEntityTypeCustom.js +1 -4
- package/dist/enums/private/SerializationBrand.js +2 -5
- package/dist/enums/private/StageTravelState.js +2 -5
- package/dist/enums/private/TrapdoorAnimation.js +2 -5
- package/dist/enums/private/UIStreakAnimation.js +2 -5
- package/dist/features.js +138 -141
- package/dist/functions/ambush.js +9 -12
- package/dist/functions/array.js +45 -76
- package/dist/functions/arrayLua.js +7 -16
- package/dist/functions/benchmark.js +4 -7
- package/dist/functions/bitSet128.js +19 -26
- package/dist/functions/bitwise.js +14 -23
- package/dist/functions/bombs.js +1 -4
- package/dist/functions/bosses.js +68 -85
- package/dist/functions/cards.js +44 -62
- package/dist/functions/challenges.js +28 -39
- package/dist/functions/characters.js +68 -87
- package/dist/functions/charge.js +41 -52
- package/dist/functions/chargeBar.js +2 -6
- package/dist/functions/collectibleTag.js +9 -13
- package/dist/functions/collectibles.js +133 -172
- package/dist/functions/color.js +29 -38
- package/dist/functions/console.js +4 -8
- package/dist/functions/curses.js +6 -10
- package/dist/functions/debugFunctions.js +7 -14
- package/dist/functions/decorators.js +13 -19
- package/dist/functions/deepCopy.js +96 -99
- package/dist/functions/deepCopyTests.js +56 -59
- package/dist/functions/dimensions.js +10 -14
- package/dist/functions/direction.js +22 -30
- package/dist/functions/doors.js +104 -154
- package/dist/functions/easing.js +30 -62
- package/dist/functions/effects.js +6 -10
- package/dist/functions/emptyRoom.js +30 -34
- package/dist/functions/entities.js +88 -115
- package/dist/functions/entitiesSpecific.js +83 -125
- package/dist/functions/entityTypes.js +3 -6
- package/dist/functions/enums.js +27 -41
- package/dist/functions/external.js +4 -8
- package/dist/functions/familiars.js +17 -25
- package/dist/functions/flag.js +10 -19
- package/dist/functions/frames.js +31 -51
- package/dist/functions/globals.js +26 -66
- package/dist/functions/gridEntities.js +231 -269
- package/dist/functions/gridEntitiesSpecific.js +86 -126
- package/dist/functions/gridIndex.js +8 -11
- package/dist/functions/hash.js +1 -4
- package/dist/functions/hex.js +7 -11
- package/dist/functions/input.js +65 -88
- package/dist/functions/isaacAPIClass.js +28 -53
- package/dist/functions/itemPool.js +39 -48
- package/dist/functions/jsonHelpers.js +5 -42
- package/dist/functions/jsonRoom.js +39 -46
- package/dist/functions/kColor.js +30 -39
- package/dist/functions/language.js +3 -6
- package/dist/functions/level.js +20 -26
- package/dist/functions/levelGrid.js +81 -108
- package/dist/functions/log.js +6 -12
- package/dist/functions/logEntities.js +49 -59
- package/dist/functions/logMisc.js +183 -214
- package/dist/functions/map.js +10 -20
- package/dist/functions/math.js +16 -31
- package/dist/functions/merge.js +48 -51
- package/dist/functions/mergeTests.js +34 -37
- package/dist/functions/minimap.js +34 -46
- package/dist/functions/modFeatures.js +1 -4
- package/dist/functions/newArray.js +5 -8
- package/dist/functions/nextStage.js +63 -67
- package/dist/functions/npcDataStructures.js +9 -20
- package/dist/functions/npcs.js +37 -45
- package/dist/functions/pickupVariants.js +26 -39
- package/dist/functions/pickups.js +43 -59
- package/dist/functions/pickupsSpecific.js +76 -118
- package/dist/functions/pills.js +52 -72
- package/dist/functions/playerCenter.js +13 -16
- package/dist/functions/playerCollectibles.js +59 -79
- package/dist/functions/playerDataStructures.js +18 -29
- package/dist/functions/playerEffects.js +12 -19
- package/dist/functions/playerHealth.js +91 -113
- package/dist/functions/playerIndex.js +22 -33
- package/dist/functions/playerTrinkets.js +31 -43
- package/dist/functions/players.js +87 -126
- package/dist/functions/pocketItems.js +33 -43
- package/dist/functions/positionVelocity.js +23 -32
- package/dist/functions/pressurePlate.js +7 -10
- package/dist/functions/projectiles.js +11 -15
- package/dist/functions/random.js +8 -13
- package/dist/functions/readOnly.js +3 -8
- package/dist/functions/render.js +7 -12
- package/dist/functions/revive.js +38 -45
- package/dist/functions/rng.js +31 -44
- package/dist/functions/rockAlt.js +18 -22
- package/dist/functions/roomData.js +24 -40
- package/dist/functions/roomGrid.js +17 -25
- package/dist/functions/roomShape.js +39 -55
- package/dist/functions/roomShapeWalls.js +67 -71
- package/dist/functions/roomTransition.js +13 -17
- package/dist/functions/rooms.js +181 -244
- package/dist/functions/run.js +29 -39
- package/dist/functions/seeds.js +6 -10
- package/dist/functions/serialization.js +27 -34
- package/dist/functions/set.js +24 -40
- package/dist/functions/slots.js +18 -22
- package/dist/functions/sort.js +9 -15
- package/dist/functions/sound.js +12 -16
- package/dist/functions/spawnCollectible.js +21 -26
- package/dist/functions/sprites.js +16 -24
- package/dist/functions/stage.js +122 -164
- package/dist/functions/stats.js +37 -43
- package/dist/functions/storyBosses.js +36 -40
- package/dist/functions/string.js +19 -33
- package/dist/functions/table.js +21 -31
- package/dist/functions/tears.js +6 -14
- package/dist/functions/transformations.js +35 -42
- package/dist/functions/trinketGive.js +29 -36
- package/dist/functions/trinkets.js +45 -60
- package/dist/functions/tstlClass.js +11 -20
- package/dist/functions/types.js +22 -46
- package/dist/functions/ui.js +25 -40
- package/dist/functions/utils.js +22 -36
- package/dist/functions/vector.js +33 -46
- package/dist/functions/versusScreen.js +12 -18
- package/dist/functions/weighted.js +8 -12
- package/dist/index.js +150 -166
- package/dist/indexLua.js +151 -167
- package/dist/interfaces/ChargeBarSprites.js +1 -2
- package/dist/interfaces/Corner.js +1 -2
- package/dist/interfaces/CustomStageTSConfig.js +1 -2
- package/dist/interfaces/GridEntityCustomData.js +1 -2
- package/dist/interfaces/JSONRoomsFile.js +1 -2
- package/dist/interfaces/PlayerHealth.js +1 -2
- package/dist/interfaces/PlayerStats.js +2 -4
- package/dist/interfaces/PocketItemDescription.js +1 -2
- package/dist/interfaces/RoomDescription.js +1 -2
- package/dist/interfaces/SaveData.js +1 -2
- package/dist/interfaces/StageHistoryEntry.js +1 -2
- package/dist/interfaces/TSTLClassMetatable.js +1 -2
- package/dist/interfaces/TrinketSituation.js +1 -2
- package/dist/interfaces/private/AddCallbackParametersCustom.js +2 -4
- package/dist/interfaces/private/CustomStage.js +1 -2
- package/dist/interfaces/private/CustomTrapdoorDescription.js +1 -2
- package/dist/interfaces/private/ModUpgradedInterface.js +1 -2
- package/dist/isaacscript-common.lua +1 -1
- package/dist/maps/PHDPillConversionsMap.js +19 -22
- package/dist/maps/cardNameToTypeMap.js +205 -208
- package/dist/maps/characterNameToTypeMap.js +85 -88
- package/dist/maps/collectibleNameToTypeMap.js +5 -8
- package/dist/maps/defaultPlayerStatMap.js +10 -13
- package/dist/maps/entityTypeVariantToBossIDMap.js +3 -6
- package/dist/maps/falsePHDPillConversionsMap.js +33 -36
- package/dist/maps/gridEntityTypeToBrokenStateMap.js +15 -18
- package/dist/maps/gridEntityXMLMap.js +52 -55
- package/dist/maps/itemPoolTypeToItemPoolName.js +33 -36
- package/dist/maps/keyboardToStringMap.js +66 -69
- package/dist/maps/pillNameToEffectMap.js +83 -86
- package/dist/maps/roomNameToTypeMap.js +38 -41
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.js +9 -12
- package/dist/maps/transformationNameToPlayerFormMap.js +30 -33
- package/dist/maps/trinketNameToTypeMap.js +5 -8
- package/dist/objects/LRoomShapeToRectangles.js +22 -25
- package/dist/objects/backdropTypeToRockAltType.js +65 -68
- package/dist/objects/batteryNames.js +8 -11
- package/dist/objects/bombNames.js +11 -14
- package/dist/objects/bossIDToEntityTypeVariant.js +116 -119
- package/dist/objects/bossNamePNGFileNames.js +104 -107
- package/dist/objects/bossNames.js +105 -108
- package/dist/objects/bossPortraitPNGFileNames.js +104 -107
- package/dist/objects/cardDescriptions.js +101 -104
- package/dist/objects/cardNames.js +101 -104
- package/dist/objects/challengeBosses.js +49 -52
- package/dist/objects/challengeCharacters.js +49 -52
- package/dist/objects/challengeCollectibleTypes.js +160 -163
- package/dist/objects/challengeNames.js +49 -52
- package/dist/objects/challengeTrinketType.js +48 -51
- package/dist/objects/characterDamageMultipliers.js +44 -47
- package/dist/objects/characterNames.js +44 -47
- package/dist/objects/characterSpritePNGFileNames.js +44 -47
- package/dist/objects/characterStartingCollectibleTypes.js +49 -52
- package/dist/objects/characterStartingTrinketTypes.js +44 -47
- package/dist/objects/chestNames.js +15 -18
- package/dist/objects/coinNames.js +11 -14
- package/dist/objects/coinSubTypeToValue.js +11 -14
- package/dist/objects/collectibleDescriptions.js +725 -728
- package/dist/objects/collectibleNames.js +725 -728
- package/dist/objects/colors.js +1 -4
- package/dist/objects/directionNames.js +7 -10
- package/dist/objects/directionToDegrees.js +7 -10
- package/dist/objects/directionToMoveAction.js +7 -10
- package/dist/objects/directionToShootAction.js +7 -10
- package/dist/objects/directionToVector.js +9 -12
- package/dist/objects/doorSlotFlagToDoorSlot.js +11 -14
- package/dist/objects/doorSlotToDirection.js +11 -14
- package/dist/objects/doorSlotToDoorSlotFlag.js +11 -14
- package/dist/objects/gridEntityTypeToANM2Name.js +30 -33
- package/dist/objects/heartNames.js +16 -19
- package/dist/objects/isaacAPIClassTypeToBrand.js +8 -11
- package/dist/objects/isaacAPIClassTypeToFunctions.js +37 -40
- package/dist/objects/itemPoolTypeToCollectibleTypesSet.js +9 -45
- package/dist/objects/kColors.js +1 -4
- package/dist/objects/keyNames.js +8 -11
- package/dist/objects/languageNames.js +9 -12
- package/dist/objects/oppositeDoorSlots.js +11 -14
- package/dist/objects/pillEffectClasses.js +53 -56
- package/dist/objects/pillEffectNames.js +53 -56
- package/dist/objects/pillEffectTypeToPillEffects.js +11 -14
- package/dist/objects/pillEffectTypes.js +53 -56
- package/dist/objects/playerNamePNGFileNames.js +44 -47
- package/dist/objects/playerPortraitPNGFileNames.js +44 -47
- package/dist/objects/roomShapeBounds.js +23 -26
- package/dist/objects/roomShapeCorners.js +128 -131
- package/dist/objects/roomShapeLayoutSizes.js +23 -26
- package/dist/objects/roomShapeToBottomRightPosition.js +17 -20
- package/dist/objects/roomShapeToDoorSlotCoordinates.js +78 -81
- package/dist/objects/roomShapeToDoorSlots.js +48 -51
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.js +82 -85
- package/dist/objects/roomShapeToGridWidth.js +14 -17
- package/dist/objects/roomShapeToTopLeftPosition.js +18 -21
- package/dist/objects/roomShapeVolumes.js +21 -24
- package/dist/objects/roomTypeNames.js +32 -35
- package/dist/objects/roomTypeSpecialGotoPrefixes.js +32 -35
- package/dist/objects/sackNames.js +6 -9
- package/dist/objects/slotNames.js +21 -24
- package/dist/objects/stageIDNames.js +33 -36
- package/dist/objects/stageToMusic.js +69 -72
- package/dist/objects/stageToStageID.js +90 -93
- package/dist/objects/stageTypeSuffixes.js +8 -11
- package/dist/objects/transformationNames.js +16 -19
- package/dist/objects/trinketDescriptions.js +192 -195
- package/dist/objects/trinketNames.js +192 -195
- package/dist/objects/versusScreenBackgroundColors.js +39 -42
- package/dist/objects/versusScreenDirtSpotColors.js +39 -42
- package/dist/patchErrorFunctions.js +4 -7
- package/dist/serialization.js +6 -9
- package/dist/sets/LRoomShapesSet.js +7 -10
- package/dist/sets/bigRoomShapesSet.js +10 -13
- package/dist/sets/bossSets.js +261 -264
- package/dist/sets/charactersThatStartWithAnActiveItemSet.js +14 -17
- package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.js +5 -8
- package/dist/sets/charactersWithFreeDevilDealsSet.js +3 -6
- package/dist/sets/charactersWithNoRedHeartsSet.js +11 -14
- package/dist/sets/charactersWithNoSoulHeartsSet.js +8 -11
- package/dist/sets/consoleCommandsSet.js +2 -5
- package/dist/sets/entitiesWithArmorSet.js +44 -47
- package/dist/sets/familiarsThatShootPlayerTearsSet.js +11 -14
- package/dist/sets/itemConfigCardTypesForCards.js +7 -10
- package/dist/sets/lostStyleCharactersSet.js +8 -11
- package/dist/sets/mineShaftRoomSubTypesSet.js +8 -11
- package/dist/sets/narrowRoomShapesSet.js +7 -10
- package/dist/sets/poopGridEntityXMLTypesSet.js +12 -15
- package/dist/sets/redHeartSubTypesSet.js +6 -9
- package/dist/sets/repentanceBossIDsSet.js +26 -29
- package/dist/sets/sinEntityTypesSet.js +10 -13
- package/dist/sets/singleUseActiveCollectibleTypesSet.js +11 -14
- package/dist/shaderCrashFix.js +4 -7
- package/dist/shouldFire.js +28 -58
- package/dist/types/AddSubtract.js +1 -2
- package/dist/types/AllButFirst.js +1 -2
- package/dist/types/AllButLast.js +1 -2
- package/dist/types/AnyClass.js +1 -2
- package/dist/types/AnyEntity.js +1 -2
- package/dist/types/AnyFunction.js +1 -2
- package/dist/types/AnyGridEntity.js +1 -2
- package/dist/types/CompositionTypeSatisfiesEnum.js +1 -2
- package/dist/types/ConversionHeartSubType.js +1 -2
- package/dist/types/Decrement.js +1 -2
- package/dist/types/ERange.js +1 -2
- package/dist/types/EntityID.js +1 -2
- package/dist/types/FunctionTuple.js +1 -2
- package/dist/types/GridEntityID.js +1 -2
- package/dist/types/HasFunction.js +1 -2
- package/dist/types/IRange.js +1 -2
- package/dist/types/Immutable.js +1 -2
- package/dist/types/Increment.js +1 -2
- package/dist/types/LowercaseKeys.js +1 -2
- package/dist/types/NaturalNumbersLessThan.js +1 -2
- package/dist/types/NaturalNumbersLessThanOrEqualTo.js +1 -2
- package/dist/types/ObjectValues.js +1 -2
- package/dist/types/PickingUpItem.js +15 -22
- package/dist/types/PickupIndex.js +1 -2
- package/dist/types/PlayerIndex.js +1 -2
- package/dist/types/PossibleStatType.js +1 -2
- package/dist/types/PublicInterface.js +1 -2
- package/dist/types/ReadonlyMap.js +1 -4
- package/dist/types/ReadonlyRecord.js +1 -2
- package/dist/types/ReadonlySet.js +1 -4
- package/dist/types/StartsWithLowercase.js +1 -2
- package/dist/types/StartsWithUppercase.js +1 -2
- package/dist/types/TSTLClass.js +1 -2
- package/dist/types/Tuple.js +1 -2
- package/dist/types/TupleKeys.js +1 -2
- package/dist/types/TupleToIntersection.js +1 -2
- package/dist/types/TupleToUnion.js +1 -2
- package/dist/types/TupleWithLengthBetween.js +1 -2
- package/dist/types/TupleWithMaxLength.js +1 -2
- package/dist/types/UnionToIntersection.js +1 -2
- package/dist/types/UppercaseKeys.js +1 -2
- package/dist/types/WeightedArray.js +1 -2
- package/dist/types/WidenLiteral.js +1 -2
- package/dist/types/Writable.js +1 -2
- package/dist/types/private/CallbackTuple.js +1 -2
- package/dist/types/private/ModUpgradedWithFeatures.js +1 -2
- package/package.json +3 -3
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const familiars_1 = require("./familiars");
|
|
8
|
-
const math_1 = require("./math");
|
|
9
|
-
const playerIndex_1 = require("./playerIndex");
|
|
1
|
+
import { Direction } from "isaac-typescript-definitions";
|
|
2
|
+
import { game } from "../core/cachedClasses";
|
|
3
|
+
import { NEW_FLOOR_STARTING_POSITION_GREED_MODE, NEW_FLOOR_STARTING_POSITION_NORMAL_MODE, } from "../core/constants";
|
|
4
|
+
import { getPlayerFamiliars } from "./familiars";
|
|
5
|
+
import { getCircleDiscretizedPoints } from "./math";
|
|
6
|
+
import { getAllPlayers } from "./playerIndex";
|
|
10
7
|
/**
|
|
11
8
|
* Helper function to move all of the players to where they would normally go when arriving at a new
|
|
12
9
|
* floor. (In normal mode, this is the center of the room. In Greed Mode, this is below the top
|
|
@@ -18,12 +15,12 @@ const playerIndex_1 = require("./playerIndex");
|
|
|
18
15
|
*
|
|
19
16
|
* @param radius Optional. The radius of the circle. Default is 10.
|
|
20
17
|
*/
|
|
21
|
-
function movePlayersToCenter(radius = 10) {
|
|
22
|
-
const isGreedMode =
|
|
18
|
+
export function movePlayersToCenter(radius = 10) {
|
|
19
|
+
const isGreedMode = game.IsGreedMode();
|
|
23
20
|
const startingPosition = isGreedMode
|
|
24
|
-
?
|
|
25
|
-
:
|
|
26
|
-
const players =
|
|
21
|
+
? NEW_FLOOR_STARTING_POSITION_GREED_MODE
|
|
22
|
+
: NEW_FLOOR_STARTING_POSITION_NORMAL_MODE;
|
|
23
|
+
const players = getAllPlayers();
|
|
27
24
|
const firstPlayer = players[0];
|
|
28
25
|
if (firstPlayer === undefined) {
|
|
29
26
|
return;
|
|
@@ -35,7 +32,7 @@ function movePlayersToCenter(radius = 10) {
|
|
|
35
32
|
}
|
|
36
33
|
// If there is more than one player, spread them out in a circle around the center of the room.
|
|
37
34
|
// (This is what happens in vanilla.)
|
|
38
|
-
const circlePoints =
|
|
35
|
+
const circlePoints = getCircleDiscretizedPoints(startingPosition, radius, players.length, 1, 1, Direction.LEFT);
|
|
39
36
|
for (const [i, player] of players.entries()) {
|
|
40
37
|
const circlePosition = circlePoints[i];
|
|
41
38
|
if (circlePosition !== undefined) {
|
|
@@ -45,7 +42,7 @@ function movePlayersToCenter(radius = 10) {
|
|
|
45
42
|
}
|
|
46
43
|
function movePlayerAndTheirFamiliars(player, position) {
|
|
47
44
|
player.Position = position;
|
|
48
|
-
const familiars =
|
|
45
|
+
const familiars = getPlayerFamiliars(player);
|
|
49
46
|
for (const familiar of familiars) {
|
|
50
47
|
familiar.Position = position;
|
|
51
48
|
}
|
|
@@ -1,44 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.getPlayersWithCollectible = getPlayersWithCollectible;
|
|
10
|
-
exports.getTotalPlayerCollectibles = getTotalPlayerCollectibles;
|
|
11
|
-
exports.hasCollectible = hasCollectible;
|
|
12
|
-
exports.hasCollectibleInActiveSlot = hasCollectibleInActiveSlot;
|
|
13
|
-
exports.hasOpenActiveItemSlot = hasOpenActiveItemSlot;
|
|
14
|
-
exports.isActiveSlotEmpty = isActiveSlotEmpty;
|
|
15
|
-
exports.removeAllActiveItems = removeAllActiveItems;
|
|
16
|
-
exports.removeCollectible = removeCollectible;
|
|
17
|
-
exports.removeCollectibleCostume = removeCollectibleCostume;
|
|
18
|
-
exports.removeCollectibleFromAllPlayers = removeCollectibleFromAllPlayers;
|
|
19
|
-
exports.setActiveItem = setActiveItem;
|
|
20
|
-
exports.useActiveItemTemp = useActiveItemTemp;
|
|
21
|
-
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
22
|
-
const cachedEnumValues_1 = require("../cachedEnumValues");
|
|
23
|
-
const cachedClasses_1 = require("../core/cachedClasses");
|
|
24
|
-
const ReadonlySet_1 = require("../types/ReadonlySet");
|
|
25
|
-
const array_1 = require("./array");
|
|
26
|
-
const collectibles_1 = require("./collectibles");
|
|
27
|
-
const playerIndex_1 = require("./playerIndex");
|
|
28
|
-
const players_1 = require("./players");
|
|
1
|
+
import { ActiveSlot, CollectibleType, PlayerType, } from "isaac-typescript-definitions";
|
|
2
|
+
import { ACTIVE_SLOT_VALUES } from "../cachedEnumValues";
|
|
3
|
+
import { game, itemConfig } from "../core/cachedClasses";
|
|
4
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
5
|
+
import { sumArray } from "./array";
|
|
6
|
+
import { getCollectibleMaxCharges } from "./collectibles";
|
|
7
|
+
import { getAllPlayers, getPlayers } from "./playerIndex";
|
|
8
|
+
import { isCharacter } from "./players";
|
|
29
9
|
/**
|
|
30
10
|
* Helper function to add one or more collectibles to a player.
|
|
31
11
|
*
|
|
32
12
|
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
33
13
|
* add.
|
|
34
14
|
*/
|
|
35
|
-
function addCollectible(player, ...collectibleTypes) {
|
|
15
|
+
export function addCollectible(player, ...collectibleTypes) {
|
|
36
16
|
for (const collectibleType of collectibleTypes) {
|
|
37
17
|
player.AddCollectible(collectibleType);
|
|
38
18
|
}
|
|
39
19
|
}
|
|
40
|
-
function addCollectibleCostume(player, collectibleType) {
|
|
41
|
-
const itemConfigItem =
|
|
20
|
+
export function addCollectibleCostume(player, collectibleType) {
|
|
21
|
+
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
42
22
|
if (itemConfigItem === undefined) {
|
|
43
23
|
return;
|
|
44
24
|
}
|
|
@@ -52,16 +32,16 @@ function addCollectibleCostume(player, collectibleType) {
|
|
|
52
32
|
* ignores effects granted by items like Zodiac, 3 Dollar Bill and Lemegeton.
|
|
53
33
|
* Default is false.
|
|
54
34
|
*/
|
|
55
|
-
function anyPlayerHasCollectible(collectibleType, ignoreModifiers) {
|
|
56
|
-
const players =
|
|
35
|
+
export function anyPlayerHasCollectible(collectibleType, ignoreModifiers) {
|
|
36
|
+
const players = getAllPlayers();
|
|
57
37
|
return players.some((player) => player.HasCollectible(collectibleType, ignoreModifiers));
|
|
58
38
|
}
|
|
59
39
|
/**
|
|
60
40
|
* Helper function to find the active slots that the player has the corresponding collectible type
|
|
61
41
|
* in. Returns an empty array if the player does not have the collectible in any active slot.
|
|
62
42
|
*/
|
|
63
|
-
function getActiveItemSlots(player, collectibleType) {
|
|
64
|
-
return
|
|
43
|
+
export function getActiveItemSlots(player, collectibleType) {
|
|
44
|
+
return ACTIVE_SLOT_VALUES.filter((activeSlot) => {
|
|
65
45
|
const activeItem = player.GetActiveItem(activeSlot);
|
|
66
46
|
return activeItem === collectibleType;
|
|
67
47
|
});
|
|
@@ -71,8 +51,8 @@ function getActiveItemSlots(player, collectibleType) {
|
|
|
71
51
|
* players currently have. (For example, if Jacob has one Steam Sale and Esau has one Steam Sale,
|
|
72
52
|
* the prices for items in the shop would be the same as if Isaac had two Steam Sales.)
|
|
73
53
|
*/
|
|
74
|
-
function getAdjustedPrice(basePrice) {
|
|
75
|
-
const numSteamSales = getTotalPlayerCollectibles(
|
|
54
|
+
export function getAdjustedPrice(basePrice) {
|
|
55
|
+
const numSteamSales = getTotalPlayerCollectibles(CollectibleType.STEAM_SALE);
|
|
76
56
|
return Math.ceil(basePrice / (numSteamSales + 1));
|
|
77
57
|
}
|
|
78
58
|
/**
|
|
@@ -83,7 +63,7 @@ function getAdjustedPrice(basePrice) {
|
|
|
83
63
|
*
|
|
84
64
|
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
85
65
|
*/
|
|
86
|
-
function getPlayerCollectibleCount(player, ...collectibleTypes) {
|
|
66
|
+
export function getPlayerCollectibleCount(player, ...collectibleTypes) {
|
|
87
67
|
let numCollectibles = 0;
|
|
88
68
|
for (const collectibleType of collectibleTypes) {
|
|
89
69
|
// We specify "true" as the second argument to filter out things like Lilith's Incubus.
|
|
@@ -97,8 +77,8 @@ function getPlayerCollectibleCount(player, ...collectibleTypes) {
|
|
|
97
77
|
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
98
78
|
* check for. It only returns the players that have all of the collectibles.
|
|
99
79
|
*/
|
|
100
|
-
function getPlayersWithCollectible(...collectibleTypes) {
|
|
101
|
-
const players =
|
|
80
|
+
export function getPlayersWithCollectible(...collectibleTypes) {
|
|
81
|
+
const players = getPlayers();
|
|
102
82
|
return players.filter((player) => collectibleTypes.every((collectibleType) => player.HasCollectible(collectibleType)));
|
|
103
83
|
}
|
|
104
84
|
/**
|
|
@@ -107,12 +87,12 @@ function getPlayersWithCollectible(...collectibleTypes) {
|
|
|
107
87
|
*
|
|
108
88
|
* Note that this will filter out non-real collectibles like Lilith's Incubus.
|
|
109
89
|
*/
|
|
110
|
-
function getTotalPlayerCollectibles(collectibleType) {
|
|
111
|
-
const players =
|
|
90
|
+
export function getTotalPlayerCollectibles(collectibleType) {
|
|
91
|
+
const players = getPlayers();
|
|
112
92
|
const numCollectiblesArray = players.map((player) =>
|
|
113
93
|
// We specify "true" as the second argument to filter out things like Lilith's Incubus.
|
|
114
94
|
player.GetCollectibleNum(collectibleType, true));
|
|
115
|
-
return
|
|
95
|
+
return sumArray(numCollectiblesArray);
|
|
116
96
|
}
|
|
117
97
|
/**
|
|
118
98
|
* Helper function to check to see if a player has one or more collectibles.
|
|
@@ -122,7 +102,7 @@ function getTotalPlayerCollectibles(collectibleType) {
|
|
|
122
102
|
*
|
|
123
103
|
* This function always passes `false` to the `ignoreModifiers` argument.
|
|
124
104
|
*/
|
|
125
|
-
function hasCollectible(player, ...collectibleTypes) {
|
|
105
|
+
export function hasCollectible(player, ...collectibleTypes) {
|
|
126
106
|
return collectibleTypes.some((collectibleType) => player.HasCollectible(collectibleType));
|
|
127
107
|
}
|
|
128
108
|
/**
|
|
@@ -133,8 +113,8 @@ function hasCollectible(player, ...collectibleTypes) {
|
|
|
133
113
|
* for. This function will return true if the collectible type is located in any of the active slots
|
|
134
114
|
* provided.
|
|
135
115
|
*/
|
|
136
|
-
function hasCollectibleInActiveSlot(player, collectibleType, ...activeSlots) {
|
|
137
|
-
const matchingActiveSlotsSet = new
|
|
116
|
+
export function hasCollectibleInActiveSlot(player, collectibleType, ...activeSlots) {
|
|
117
|
+
const matchingActiveSlotsSet = new ReadonlySet(activeSlots);
|
|
138
118
|
const activeItemSlots = getActiveItemSlots(player, collectibleType);
|
|
139
119
|
return activeItemSlots.some((activeSlot) => matchingActiveSlotsSet.has(activeSlot));
|
|
140
120
|
}
|
|
@@ -145,18 +125,18 @@ function hasCollectibleInActiveSlot(player, collectibleType, ...activeSlots) {
|
|
|
145
125
|
* If the player is the Tainted Soul, this always returns false, since that character cannot pick up
|
|
146
126
|
* items. (Only Tainted Forgotten can pick up items.)
|
|
147
127
|
*/
|
|
148
|
-
function hasOpenActiveItemSlot(player) {
|
|
149
|
-
if (
|
|
128
|
+
export function hasOpenActiveItemSlot(player) {
|
|
129
|
+
if (isCharacter(player, PlayerType.SOUL_B)) {
|
|
150
130
|
return false;
|
|
151
131
|
}
|
|
152
|
-
const activeItemPrimary = player.GetActiveItem(
|
|
153
|
-
const activeItemSecondary = player.GetActiveItem(
|
|
154
|
-
const hasSchoolbag = player.HasCollectible(
|
|
132
|
+
const activeItemPrimary = player.GetActiveItem(ActiveSlot.PRIMARY);
|
|
133
|
+
const activeItemSecondary = player.GetActiveItem(ActiveSlot.SECONDARY);
|
|
134
|
+
const hasSchoolbag = player.HasCollectible(CollectibleType.SCHOOLBAG);
|
|
155
135
|
if (hasSchoolbag) {
|
|
156
|
-
return (activeItemPrimary ===
|
|
157
|
-
|| activeItemSecondary ===
|
|
136
|
+
return (activeItemPrimary === CollectibleType.NULL
|
|
137
|
+
|| activeItemSecondary === CollectibleType.NULL);
|
|
158
138
|
}
|
|
159
|
-
return activeItemPrimary ===
|
|
139
|
+
return activeItemPrimary === CollectibleType.NULL;
|
|
160
140
|
}
|
|
161
141
|
/**
|
|
162
142
|
* Helper function to check if the active slot of a particular player is empty.
|
|
@@ -164,18 +144,18 @@ function hasOpenActiveItemSlot(player) {
|
|
|
164
144
|
* @param player The player to check.
|
|
165
145
|
* @param activeSlot Optional. The active slot to check. Default is `ActiveSlot.PRIMARY`.
|
|
166
146
|
*/
|
|
167
|
-
function isActiveSlotEmpty(player, activeSlot =
|
|
147
|
+
export function isActiveSlotEmpty(player, activeSlot = ActiveSlot.PRIMARY) {
|
|
168
148
|
const activeCollectibleType = player.GetActiveItem(activeSlot);
|
|
169
|
-
return activeCollectibleType ===
|
|
149
|
+
return activeCollectibleType === CollectibleType.NULL;
|
|
170
150
|
}
|
|
171
151
|
/**
|
|
172
152
|
* Helper function to remove all of the active items from a player. This includes the Schoolbag item
|
|
173
153
|
* and any pocket actives.
|
|
174
154
|
*/
|
|
175
|
-
function removeAllActiveItems(player) {
|
|
176
|
-
for (const activeSlot of
|
|
155
|
+
export function removeAllActiveItems(player) {
|
|
156
|
+
for (const activeSlot of ACTIVE_SLOT_VALUES) {
|
|
177
157
|
const collectibleType = player.GetActiveItem(activeSlot);
|
|
178
|
-
if (collectibleType ===
|
|
158
|
+
if (collectibleType === CollectibleType.NULL) {
|
|
179
159
|
continue;
|
|
180
160
|
}
|
|
181
161
|
let stillHasCollectible;
|
|
@@ -191,7 +171,7 @@ function removeAllActiveItems(player) {
|
|
|
191
171
|
* This function is variadic, meaning that you can supply as many collectible types as you want to
|
|
192
172
|
* remove.
|
|
193
173
|
*/
|
|
194
|
-
function removeCollectible(player, ...collectibleTypes) {
|
|
174
|
+
export function removeCollectible(player, ...collectibleTypes) {
|
|
195
175
|
for (const collectibleType of collectibleTypes) {
|
|
196
176
|
player.RemoveCollectible(collectibleType);
|
|
197
177
|
}
|
|
@@ -200,8 +180,8 @@ function removeCollectible(player, ...collectibleTypes) {
|
|
|
200
180
|
* Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
201
181
|
* having to request the collectible from the item config.
|
|
202
182
|
*/
|
|
203
|
-
function removeCollectibleCostume(player, collectibleType) {
|
|
204
|
-
const itemConfigItem =
|
|
183
|
+
export function removeCollectibleCostume(player, collectibleType) {
|
|
184
|
+
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
205
185
|
if (itemConfigItem === undefined) {
|
|
206
186
|
return;
|
|
207
187
|
}
|
|
@@ -214,8 +194,8 @@ function removeCollectibleCostume(player, collectibleType) {
|
|
|
214
194
|
* This function is variadic, meaning that you can specify as many collectibles as you want to
|
|
215
195
|
* remove.
|
|
216
196
|
*/
|
|
217
|
-
function removeCollectibleFromAllPlayers(...collectibleTypes) {
|
|
218
|
-
for (const player of
|
|
197
|
+
export function removeCollectibleFromAllPlayers(...collectibleTypes) {
|
|
198
|
+
for (const player of getAllPlayers()) {
|
|
219
199
|
for (const collectibleType of collectibleTypes) {
|
|
220
200
|
while (player.HasCollectible(collectibleType, true)) {
|
|
221
201
|
player.RemoveCollectible(collectibleType);
|
|
@@ -239,20 +219,20 @@ function removeCollectibleFromAllPlayers(...collectibleTypes) {
|
|
|
239
219
|
* with maximum charges.
|
|
240
220
|
* @param keepInPools Optional. Whether to remove the item from pools. Default is false.
|
|
241
221
|
*/
|
|
242
|
-
function setActiveItem(player, collectibleType, activeSlot =
|
|
243
|
-
const itemPool =
|
|
244
|
-
const primaryCollectibleType = player.GetActiveItem(
|
|
245
|
-
const primaryCharge = player.GetActiveCharge(
|
|
246
|
-
const secondaryCollectibleType = player.GetActiveItem(
|
|
247
|
-
charge ??=
|
|
222
|
+
export function setActiveItem(player, collectibleType, activeSlot = ActiveSlot.PRIMARY, charge, keepInPools = false) {
|
|
223
|
+
const itemPool = game.GetItemPool();
|
|
224
|
+
const primaryCollectibleType = player.GetActiveItem(ActiveSlot.PRIMARY);
|
|
225
|
+
const primaryCharge = player.GetActiveCharge(ActiveSlot.PRIMARY);
|
|
226
|
+
const secondaryCollectibleType = player.GetActiveItem(ActiveSlot.SECONDARY);
|
|
227
|
+
charge ??= getCollectibleMaxCharges(collectibleType);
|
|
248
228
|
if (!keepInPools) {
|
|
249
229
|
itemPool.RemoveCollectible(collectibleType);
|
|
250
230
|
}
|
|
251
231
|
switch (activeSlot) {
|
|
252
|
-
case
|
|
232
|
+
case ActiveSlot.PRIMARY: {
|
|
253
233
|
// If there is a Schoolbag item, removing the primary item will shift the Schoolbag item to
|
|
254
234
|
// the primary slot.
|
|
255
|
-
if (primaryCollectibleType !==
|
|
235
|
+
if (primaryCollectibleType !== CollectibleType.NULL) {
|
|
256
236
|
player.RemoveCollectible(primaryCollectibleType);
|
|
257
237
|
}
|
|
258
238
|
// If there was a Schoolbag item, adding a new primary item will shift it back into the
|
|
@@ -260,27 +240,27 @@ function setActiveItem(player, collectibleType, activeSlot = isaac_typescript_de
|
|
|
260
240
|
player.AddCollectible(collectibleType, charge, false);
|
|
261
241
|
break;
|
|
262
242
|
}
|
|
263
|
-
case
|
|
264
|
-
if (primaryCollectibleType !==
|
|
243
|
+
case ActiveSlot.SECONDARY: {
|
|
244
|
+
if (primaryCollectibleType !== CollectibleType.NULL) {
|
|
265
245
|
player.RemoveCollectible(primaryCollectibleType);
|
|
266
246
|
}
|
|
267
|
-
if (secondaryCollectibleType !==
|
|
247
|
+
if (secondaryCollectibleType !== CollectibleType.NULL) {
|
|
268
248
|
player.RemoveCollectible(secondaryCollectibleType);
|
|
269
249
|
}
|
|
270
250
|
// Add the new item, which will go to the primary slot.
|
|
271
251
|
player.AddCollectible(secondaryCollectibleType, charge, false);
|
|
272
252
|
// Add back the original primary item, if any.
|
|
273
|
-
if (primaryCollectibleType !==
|
|
253
|
+
if (primaryCollectibleType !== CollectibleType.NULL) {
|
|
274
254
|
player.AddCollectible(primaryCollectibleType, primaryCharge, false);
|
|
275
255
|
}
|
|
276
256
|
break;
|
|
277
257
|
}
|
|
278
|
-
case
|
|
258
|
+
case ActiveSlot.POCKET: {
|
|
279
259
|
player.SetPocketActiveItem(collectibleType, activeSlot, keepInPools);
|
|
280
260
|
player.SetActiveCharge(charge, activeSlot);
|
|
281
261
|
break;
|
|
282
262
|
}
|
|
283
|
-
case
|
|
263
|
+
case ActiveSlot.POCKET_SINGLE_USE: {
|
|
284
264
|
player.SetPocketActiveItem(collectibleType, activeSlot, keepInPools);
|
|
285
265
|
break;
|
|
286
266
|
}
|
|
@@ -290,6 +270,6 @@ function setActiveItem(player, collectibleType, activeSlot = isaac_typescript_de
|
|
|
290
270
|
* Helper function to use an active item without showing an animation, keeping the item, or adding
|
|
291
271
|
* any costumes.
|
|
292
272
|
*/
|
|
293
|
-
function useActiveItemTemp(player, collectibleType) {
|
|
273
|
+
export function useActiveItemTemp(player, collectibleType) {
|
|
294
274
|
player.UseActiveItem(collectibleType, false, false, true, false, -1);
|
|
295
275
|
}
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultMapGetPlayer = defaultMapGetPlayer;
|
|
4
|
-
exports.defaultMapSetPlayer = defaultMapSetPlayer;
|
|
5
|
-
exports.mapDeletePlayer = mapDeletePlayer;
|
|
6
|
-
exports.mapGetPlayer = mapGetPlayer;
|
|
7
|
-
exports.mapHasPlayer = mapHasPlayer;
|
|
8
|
-
exports.mapSetPlayer = mapSetPlayer;
|
|
9
|
-
exports.setAddPlayer = setAddPlayer;
|
|
10
|
-
exports.setDeletePlayer = setDeletePlayer;
|
|
11
|
-
exports.setHasPlayer = setHasPlayer;
|
|
12
|
-
const playerIndex_1 = require("./playerIndex");
|
|
1
|
+
import { getPlayerIndex } from "./playerIndex";
|
|
13
2
|
/**
|
|
14
3
|
* Helper function to make using default maps with an index of `PlayerIndex` easier. Use this
|
|
15
4
|
* instead of the `DefaultMap.getAndSetDefault` method if you have a default map of this type.
|
|
@@ -30,8 +19,8 @@ const playerIndex_1 = require("./playerIndex");
|
|
|
30
19
|
*
|
|
31
20
|
* @allowEmptyVariadic
|
|
32
21
|
*/
|
|
33
|
-
function defaultMapGetPlayer(map, player, ...extraArgs) {
|
|
34
|
-
const playerIndex =
|
|
22
|
+
export function defaultMapGetPlayer(map, player, ...extraArgs) {
|
|
23
|
+
const playerIndex = getPlayerIndex(player);
|
|
35
24
|
return map.getAndSetDefault(playerIndex, ...extraArgs);
|
|
36
25
|
}
|
|
37
26
|
/**
|
|
@@ -41,7 +30,7 @@ function defaultMapGetPlayer(map, player, ...extraArgs) {
|
|
|
41
30
|
* Since `Map` and `DefaultMap` set values in the same way, this function is simply an alias for the
|
|
42
31
|
* `mapSetPlayer` helper function.
|
|
43
32
|
*/
|
|
44
|
-
function defaultMapSetPlayer(
|
|
33
|
+
export function defaultMapSetPlayer(
|
|
45
34
|
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
46
35
|
map, player, value) {
|
|
47
36
|
mapSetPlayer(map, player, value);
|
|
@@ -50,10 +39,10 @@ map, player, value) {
|
|
|
50
39
|
* Helper function to make using maps with an type of `PlayerIndex` easier. Use this instead of the
|
|
51
40
|
* `Map.delete` method if you have a set of this type.
|
|
52
41
|
*/
|
|
53
|
-
function mapDeletePlayer(
|
|
42
|
+
export function mapDeletePlayer(
|
|
54
43
|
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
55
44
|
map, player) {
|
|
56
|
-
const playerIndex =
|
|
45
|
+
const playerIndex = getPlayerIndex(player);
|
|
57
46
|
return map.delete(playerIndex);
|
|
58
47
|
}
|
|
59
48
|
/**
|
|
@@ -76,16 +65,16 @@ map, player) {
|
|
|
76
65
|
* }
|
|
77
66
|
* ```
|
|
78
67
|
*/
|
|
79
|
-
function mapGetPlayer(map, player) {
|
|
80
|
-
const playerIndex =
|
|
68
|
+
export function mapGetPlayer(map, player) {
|
|
69
|
+
const playerIndex = getPlayerIndex(player);
|
|
81
70
|
return map.get(playerIndex);
|
|
82
71
|
}
|
|
83
72
|
/**
|
|
84
73
|
* Helper function to make using maps with an index of `PlayerIndex` easier. Use this instead of the
|
|
85
74
|
* `Map.has` method if you have a map of this type.
|
|
86
75
|
*/
|
|
87
|
-
function mapHasPlayer(map, player) {
|
|
88
|
-
const playerIndex =
|
|
76
|
+
export function mapHasPlayer(map, player) {
|
|
77
|
+
const playerIndex = getPlayerIndex(player);
|
|
89
78
|
return map.has(playerIndex);
|
|
90
79
|
}
|
|
91
80
|
/**
|
|
@@ -108,37 +97,37 @@ function mapHasPlayer(map, player) {
|
|
|
108
97
|
* }
|
|
109
98
|
* ```
|
|
110
99
|
*/
|
|
111
|
-
function mapSetPlayer(
|
|
100
|
+
export function mapSetPlayer(
|
|
112
101
|
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
113
102
|
map, player, value) {
|
|
114
|
-
const playerIndex =
|
|
103
|
+
const playerIndex = getPlayerIndex(player);
|
|
115
104
|
map.set(playerIndex, value);
|
|
116
105
|
}
|
|
117
106
|
/**
|
|
118
107
|
* Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the
|
|
119
108
|
* `Set.add` method if you have a set of this type.
|
|
120
109
|
*/
|
|
121
|
-
function setAddPlayer(
|
|
110
|
+
export function setAddPlayer(
|
|
122
111
|
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
123
112
|
set, player) {
|
|
124
|
-
const playerIndex =
|
|
113
|
+
const playerIndex = getPlayerIndex(player);
|
|
125
114
|
set.add(playerIndex);
|
|
126
115
|
}
|
|
127
116
|
/**
|
|
128
117
|
* Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the
|
|
129
118
|
* `Set.delete` method if you have a set of this type.
|
|
130
119
|
*/
|
|
131
|
-
function setDeletePlayer(
|
|
120
|
+
export function setDeletePlayer(
|
|
132
121
|
// eslint-disable-next-line complete/prefer-readonly-parameter-types
|
|
133
122
|
set, player) {
|
|
134
|
-
const playerIndex =
|
|
123
|
+
const playerIndex = getPlayerIndex(player);
|
|
135
124
|
return set.delete(playerIndex);
|
|
136
125
|
}
|
|
137
126
|
/**
|
|
138
127
|
* Helper function to make using sets with an type of `PlayerIndex` easier. Use this instead of the
|
|
139
128
|
* `Set.has` method if you have a set of this type.
|
|
140
129
|
*/
|
|
141
|
-
function setHasPlayer(set, player) {
|
|
142
|
-
const playerIndex =
|
|
130
|
+
export function setHasPlayer(set, player) {
|
|
131
|
+
const playerIndex = getPlayerIndex(player);
|
|
143
132
|
return set.has(playerIndex);
|
|
144
133
|
}
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.anyPlayerHasNullEffect = anyPlayerHasNullEffect;
|
|
5
|
-
exports.anyPlayerHasTrinketEffect = anyPlayerHasTrinketEffect;
|
|
6
|
-
exports.getEffectsList = getEffectsList;
|
|
7
|
-
exports.shouldWhoreOfBabylonBeActive = shouldWhoreOfBabylonBeActive;
|
|
8
|
-
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
9
|
-
const playerIndex_1 = require("./playerIndex");
|
|
10
|
-
const players_1 = require("./players");
|
|
1
|
+
import { PlayerType } from "isaac-typescript-definitions";
|
|
2
|
+
import { getAllPlayers } from "./playerIndex";
|
|
3
|
+
import { isCharacter } from "./players";
|
|
11
4
|
/** Helper function to check to see if any player has a temporary collectible effect. */
|
|
12
|
-
function anyPlayerHasCollectibleEffect(collectibleType) {
|
|
13
|
-
const players =
|
|
5
|
+
export function anyPlayerHasCollectibleEffect(collectibleType) {
|
|
6
|
+
const players = getAllPlayers();
|
|
14
7
|
return players.some((player) => {
|
|
15
8
|
const effects = player.GetEffects();
|
|
16
9
|
return effects.HasCollectibleEffect(collectibleType);
|
|
17
10
|
});
|
|
18
11
|
}
|
|
19
12
|
/** Helper function to check to see if any player has a temporary null effect. */
|
|
20
|
-
function anyPlayerHasNullEffect(nullItemID) {
|
|
21
|
-
const players =
|
|
13
|
+
export function anyPlayerHasNullEffect(nullItemID) {
|
|
14
|
+
const players = getAllPlayers();
|
|
22
15
|
return players.some((player) => {
|
|
23
16
|
const effects = player.GetEffects();
|
|
24
17
|
return effects.HasNullEffect(nullItemID);
|
|
25
18
|
});
|
|
26
19
|
}
|
|
27
20
|
/** Helper function to check to see if any player has a temporary trinket effect. */
|
|
28
|
-
function anyPlayerHasTrinketEffect(trinketType) {
|
|
29
|
-
const players =
|
|
21
|
+
export function anyPlayerHasTrinketEffect(trinketType) {
|
|
22
|
+
const players = getAllPlayers();
|
|
30
23
|
return players.some((player) => {
|
|
31
24
|
const effects = player.GetEffects();
|
|
32
25
|
return effects.HasTrinketEffect(trinketType);
|
|
@@ -36,7 +29,7 @@ function anyPlayerHasTrinketEffect(trinketType) {
|
|
|
36
29
|
* Helper function to get an array of temporary effects for a player. This is helpful so that you
|
|
37
30
|
* don't have to manually create an array from an `EffectsList` object.
|
|
38
31
|
*/
|
|
39
|
-
function getEffectsList(player) {
|
|
32
|
+
export function getEffectsList(player) {
|
|
40
33
|
const effects = player.GetEffects();
|
|
41
34
|
const effectsList = effects.GetEffectsList();
|
|
42
35
|
const effectArray = [];
|
|
@@ -55,8 +48,8 @@ function getEffectsList(player) {
|
|
|
55
48
|
* - For most characters, Whore of Babylon activates when the red hearts are at 1/2 or less.
|
|
56
49
|
* - For Eve, Whore of Babylon activates when the red hearts are at 1 or less.
|
|
57
50
|
*/
|
|
58
|
-
function shouldWhoreOfBabylonBeActive(player) {
|
|
51
|
+
export function shouldWhoreOfBabylonBeActive(player) {
|
|
59
52
|
const redHearts = player.GetHearts();
|
|
60
|
-
const threshold =
|
|
53
|
+
const threshold = isCharacter(player, PlayerType.EVE) ? 2 : 1;
|
|
61
54
|
return redHearts <= threshold;
|
|
62
55
|
}
|