isaacscript-common 84.0.1 → 84.1.1
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/arrays/cachedEnumValues.js +33 -0
- package/dist/callbackClasses.js +289 -0
- package/dist/callbacks.js +181 -0
- package/dist/classes/DefaultMap.js +171 -0
- package/dist/classes/ModFeature.js +244 -0
- package/dist/classes/ModUpgraded.js +324 -0
- package/dist/classes/callbacks/EntityTakeDmgFilter.js +19 -0
- package/dist/classes/callbacks/EntityTakeDmgPlayer.js +29 -0
- package/dist/classes/callbacks/InputActionFilter.js +24 -0
- package/dist/classes/callbacks/InputActionPlayer.js +37 -0
- package/dist/classes/callbacks/PostAmbushFinished.js +40 -0
- package/dist/classes/callbacks/PostAmbushStarted.js +40 -0
- package/dist/classes/callbacks/PostBombExploded.js +24 -0
- package/dist/classes/callbacks/PostBombInitFilter.js +21 -0
- package/dist/classes/callbacks/PostBombInitLate.js +31 -0
- package/dist/classes/callbacks/PostBombRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostBombUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostBoneSwing.js +53 -0
- package/dist/classes/callbacks/PostCollectibleEmpty.js +50 -0
- package/dist/classes/callbacks/PostCursedTeleport.js +119 -0
- package/dist/classes/callbacks/PostCustomRevive.js +17 -0
- package/dist/classes/callbacks/PostDiceRoomActivated.js +50 -0
- package/dist/classes/callbacks/PostDoorRender.js +24 -0
- package/dist/classes/callbacks/PostDoorUpdate.js +24 -0
- package/dist/classes/callbacks/PostEffectInitFilter.js +21 -0
- package/dist/classes/callbacks/PostEffectInitLate.js +31 -0
- package/dist/classes/callbacks/PostEffectRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostEffectStateChanged.js +34 -0
- package/dist/classes/callbacks/PostEffectUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostEntityKillFilter.js +21 -0
- package/dist/classes/callbacks/PostEsauJr.js +12 -0
- package/dist/classes/callbacks/PostFamiliarInitFilter.js +21 -0
- package/dist/classes/callbacks/PostFamiliarInitLate.js +31 -0
- package/dist/classes/callbacks/PostFamiliarRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostFamiliarStateChanged.js +34 -0
- package/dist/classes/callbacks/PostFamiliarUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostFirstEsauJr.js +12 -0
- package/dist/classes/callbacks/PostFirstFlip.js +12 -0
- package/dist/classes/callbacks/PostFlip.js +12 -0
- package/dist/classes/callbacks/PostGameEndFilter.js +21 -0
- package/dist/classes/callbacks/PostGameStartedReordered.js +14 -0
- package/dist/classes/callbacks/PostGameStartedReorderedLast.js +14 -0
- package/dist/classes/callbacks/PostGreedModeWave.js +35 -0
- package/dist/classes/callbacks/PostGridEntityBroken.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCollision.js +28 -0
- package/dist/classes/callbacks/PostGridEntityCustomBroken.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomCollision.js +24 -0
- package/dist/classes/callbacks/PostGridEntityCustomInit.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomRemove.js +18 -0
- package/dist/classes/callbacks/PostGridEntityCustomRender.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomStateChanged.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomUpdate.js +14 -0
- package/dist/classes/callbacks/PostGridEntityInit.js +14 -0
- package/dist/classes/callbacks/PostGridEntityRemove.js +19 -0
- package/dist/classes/callbacks/PostGridEntityRender.js +14 -0
- package/dist/classes/callbacks/PostGridEntityStateChanged.js +14 -0
- package/dist/classes/callbacks/PostGridEntityUpdate.js +14 -0
- package/dist/classes/callbacks/PostHolyMantleRemoved.js +43 -0
- package/dist/classes/callbacks/PostItemDischarge.js +122 -0
- package/dist/classes/callbacks/PostItemPickup.js +14 -0
- package/dist/classes/callbacks/PostKeyboardChanged.js +46 -0
- package/dist/classes/callbacks/PostKnifeInitFilter.js +21 -0
- package/dist/classes/callbacks/PostKnifeInitLate.js +31 -0
- package/dist/classes/callbacks/PostKnifeRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostKnifeUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserInitFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserInitLate.js +31 -0
- package/dist/classes/callbacks/PostLaserRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCDeathFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCInitFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCInitLate.js +31 -0
- package/dist/classes/callbacks/PostNPCRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCStateChanged.js +34 -0
- package/dist/classes/callbacks/PostNPCUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostNewLevelReordered.js +14 -0
- package/dist/classes/callbacks/PostNewRoomEarly.js +74 -0
- package/dist/classes/callbacks/PostNewRoomReordered.js +14 -0
- package/dist/classes/callbacks/PostPEffectUpdateReordered.js +14 -0
- package/dist/classes/callbacks/PostPickupChanged.js +14 -0
- package/dist/classes/callbacks/PostPickupCollect.js +38 -0
- package/dist/classes/callbacks/PostPickupInitFilter.js +21 -0
- package/dist/classes/callbacks/PostPickupInitFirst.js +33 -0
- package/dist/classes/callbacks/PostPickupInitLate.js +31 -0
- package/dist/classes/callbacks/PostPickupRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostPickupSelectionFilter.js +29 -0
- package/dist/classes/callbacks/PostPickupStateChanged.js +34 -0
- package/dist/classes/callbacks/PostPickupUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostPitRender.js +24 -0
- package/dist/classes/callbacks/PostPitUpdate.js +24 -0
- package/dist/classes/callbacks/PostPlayerChangeHealth.js +47 -0
- package/dist/classes/callbacks/PostPlayerChangeStat.js +79 -0
- package/dist/classes/callbacks/PostPlayerChangeType.js +36 -0
- package/dist/classes/callbacks/PostPlayerCollectibleAdded.js +14 -0
- package/dist/classes/callbacks/PostPlayerCollectibleRemoved.js +14 -0
- package/dist/classes/callbacks/PostPlayerFatalDamage.js +83 -0
- package/dist/classes/callbacks/PostPlayerInitFirst.js +41 -0
- package/dist/classes/callbacks/PostPlayerInitLate.js +33 -0
- package/dist/classes/callbacks/PostPlayerRenderReordered.js +14 -0
- package/dist/classes/callbacks/PostPlayerUpdateReordered.js +14 -0
- package/dist/classes/callbacks/PostPoopRender.js +24 -0
- package/dist/classes/callbacks/PostPoopUpdate.js +24 -0
- package/dist/classes/callbacks/PostPressurePlateRender.js +24 -0
- package/dist/classes/callbacks/PostPressurePlateUpdate.js +24 -0
- package/dist/classes/callbacks/PostProjectileInitFilter.js +21 -0
- package/dist/classes/callbacks/PostProjectileInitLate.js +31 -0
- package/dist/classes/callbacks/PostProjectileKill.js +52 -0
- package/dist/classes/callbacks/PostProjectileRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostProjectileUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostPurchase.js +90 -0
- package/dist/classes/callbacks/PostRockRender.js +24 -0
- package/dist/classes/callbacks/PostRockUpdate.js +24 -0
- package/dist/classes/callbacks/PostRoomClearChanged.js +46 -0
- package/dist/classes/callbacks/PostSacrifice.js +36 -0
- package/dist/classes/callbacks/PostSlotAnimationChanged.js +14 -0
- package/dist/classes/callbacks/PostSlotCollision.js +25 -0
- package/dist/classes/callbacks/PostSlotDestroyed.js +14 -0
- package/dist/classes/callbacks/PostSlotInit.js +14 -0
- package/dist/classes/callbacks/PostSlotRender.js +14 -0
- package/dist/classes/callbacks/PostSlotUpdate.js +14 -0
- package/dist/classes/callbacks/PostSpikesRender.js +24 -0
- package/dist/classes/callbacks/PostSpikesUpdate.js +24 -0
- package/dist/classes/callbacks/PostTNTRender.js +24 -0
- package/dist/classes/callbacks/PostTNTUpdate.js +24 -0
- package/dist/classes/callbacks/PostTearInitFilter.js +21 -0
- package/dist/classes/callbacks/PostTearInitLate.js +31 -0
- package/dist/classes/callbacks/PostTearInitVeryLate.js +35 -0
- package/dist/classes/callbacks/PostTearKill.js +52 -0
- package/dist/classes/callbacks/PostTearRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostTearUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostTransformation.js +47 -0
- package/dist/classes/callbacks/PostTrinketBreak.js +70 -0
- package/dist/classes/callbacks/PostUsePillFilter.js +76 -0
- package/dist/classes/callbacks/PreBerserkDeath.js +41 -0
- package/dist/classes/callbacks/PreBombCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreCustomRevive.js +14 -0
- package/dist/classes/callbacks/PreEntitySpawnFilter.js +24 -0
- package/dist/classes/callbacks/PreFamiliarCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreGetPedestal.js +46 -0
- package/dist/classes/callbacks/PreItemPickup.js +14 -0
- package/dist/classes/callbacks/PreKnifeCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreNPCCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreNPCUpdateFilter.js +19 -0
- package/dist/classes/callbacks/PreNewLevel.js +51 -0
- package/dist/classes/callbacks/PreProjectileCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.js +26 -0
- package/dist/classes/callbacks/PreTearCollisionFilter.js +19 -0
- package/dist/classes/features/callbackLogic/CustomGridEntities.js +359 -0
- package/dist/classes/features/callbackLogic/CustomRevive.js +170 -0
- package/dist/classes/features/callbackLogic/EsauJrDetection.js +70 -0
- package/dist/classes/features/callbackLogic/FlipDetection.js +61 -0
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +220 -0
- package/dist/classes/features/callbackLogic/GridEntityCollisionDetection.js +62 -0
- package/dist/classes/features/callbackLogic/GridEntityRenderDetection.js +35 -0
- package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.js +147 -0
- package/dist/classes/features/callbackLogic/ItemPickupDetection.js +68 -0
- package/dist/classes/features/callbackLogic/PickupChangeDetection.js +43 -0
- package/dist/classes/features/callbackLogic/PlayerCollectibleDetection.js +193 -0
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.js +109 -0
- package/dist/classes/features/callbackLogic/SlotDestroyedDetection.js +95 -0
- package/dist/classes/features/callbackLogic/SlotRenderDetection.js +48 -0
- package/dist/classes/features/callbackLogic/SlotUpdateDetection.js +52 -0
- package/dist/classes/features/other/CharacterHealthConversion.js +112 -0
- package/dist/classes/features/other/CharacterStats.js +68 -0
- package/dist/classes/features/other/CollectibleItemPoolType.js +75 -0
- package/dist/classes/features/other/CustomHotkeys.js +144 -0
- package/dist/classes/features/other/CustomItemPools.js +128 -0
- package/dist/classes/features/other/CustomPickups.js +118 -0
- package/dist/classes/features/other/CustomStages.js +471 -0
- package/dist/classes/features/other/CustomTrapdoors.js +596 -0
- package/dist/classes/features/other/DebugDisplay.js +699 -0
- package/dist/classes/features/other/DeployJSONRoom.js +301 -0
- package/dist/classes/features/other/DisableAllSound.js +90 -0
- package/dist/classes/features/other/DisableInputs.js +249 -0
- package/dist/classes/features/other/EdenStartingStatsHealth.js +197 -0
- package/dist/classes/features/other/ExtraConsoleCommands.js +292 -0
- package/dist/classes/features/other/FadeInRemover.js +67 -0
- package/dist/classes/features/other/FastReset.js +88 -0
- package/dist/classes/features/other/FlyingDetection.js +64 -0
- package/dist/classes/features/other/ForgottenSwitch.js +43 -0
- package/dist/classes/features/other/ItemPoolDetection.js +187 -0
- package/dist/classes/features/other/ModdedElementDetection.js +399 -0
- package/dist/classes/features/other/ModdedElementSets.js +1251 -0
- package/dist/classes/features/other/NoSirenSteal.js +88 -0
- package/dist/classes/features/other/Pause.js +197 -0
- package/dist/classes/features/other/PersistentEntities.js +168 -0
- package/dist/classes/features/other/PickupIndexCreation.js +229 -0
- package/dist/classes/features/other/PlayerCollectibleTracking.js +102 -0
- package/dist/classes/features/other/PonyDetection.js +86 -0
- package/dist/classes/features/other/PressInput.js +71 -0
- package/dist/classes/features/other/PreventChildEntities.js +60 -0
- package/dist/classes/features/other/PreventGridEntityRespawn.js +159 -0
- package/dist/classes/features/other/RerunDetection.js +69 -0
- package/dist/classes/features/other/RoomClearFrame.js +94 -0
- package/dist/classes/features/other/RoomHistory.js +196 -0
- package/dist/classes/features/other/RunInNFrames.js +323 -0
- package/dist/classes/features/other/RunNextRoom.js +53 -0
- package/dist/classes/features/other/RunNextRun.js +60 -0
- package/dist/classes/features/other/SaveDataManager.js +383 -0
- package/dist/classes/features/other/SpawnRockAltRewards.js +469 -0
- package/dist/classes/features/other/StageHistory.js +244 -0
- package/dist/classes/features/other/StartAmbush.js +62 -0
- package/dist/classes/features/other/TaintedLazarusPlayers.js +115 -0
- package/dist/classes/features/other/UnlockAchievementsDetection.js +60 -0
- package/dist/classes/features/other/customStages/backdrop.js +195 -0
- package/dist/classes/features/other/customStages/constants.js +19 -0
- package/dist/classes/features/other/customStages/gridEntities.js +177 -0
- package/dist/classes/features/other/customStages/shadows.js +67 -0
- package/dist/classes/features/other/customStages/streakText.js +222 -0
- package/dist/classes/features/other/customStages/utils.js +65 -0
- package/dist/classes/features/other/customStages/v.js +27 -0
- package/dist/classes/features/other/customStages/versusScreen.js +227 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayBomb.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayDoor.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayEffect.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayFamiliar.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayKnife.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayLaser.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayNPC.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPickup.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPit.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPlayer.js +25 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPoop.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPressurePlate.js +25 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayProjectile.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayRock.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplaySlot.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplaySpikes.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayTNT.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayTear.js +23 -0
- package/dist/classes/features/other/debugDisplay/utils.js +13 -0
- package/dist/classes/features/other/extraConsoleCommands/commands.js +1598 -0
- package/dist/classes/features/other/extraConsoleCommands/subroutines.js +135 -0
- package/dist/classes/features/other/extraConsoleCommands/v.js +30 -0
- package/dist/classes/features/other/saveDataManager/constants.js +4 -0
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +106 -0
- package/dist/classes/features/other/saveDataManager/loadFromDisk.js +69 -0
- package/dist/classes/features/other/saveDataManager/restoreDefaults.js +69 -0
- package/dist/classes/features/other/saveDataManager/saveToDisk.js +46 -0
- package/dist/classes/private/CustomCallback.js +59 -0
- package/dist/classes/private/Feature.js +39 -0
- package/dist/core/cachedClasses.js +61 -0
- package/dist/core/constants.js +289 -0
- package/dist/core/constantsFirstLast.js +98 -0
- package/dist/core/constantsVanilla.js +131 -0
- package/dist/core/upgradeMod.js +71 -0
- package/dist/customStageMetadata.json +1 -0
- package/dist/data/itempools.json +16625 -0
- package/dist/decorators.js +21 -0
- package/dist/enums/AmbushType.js +9 -0
- package/dist/enums/CornerType.js +11 -0
- package/dist/enums/HealthType.js +20 -0
- package/dist/enums/ISCFeature.js +65 -0
- package/dist/enums/LadderSubTypeCustom.js +20 -0
- package/dist/enums/ModCallbackCustom.js +2477 -0
- package/dist/enums/MysteriousPaperEffect.js +16 -0
- package/dist/enums/PlayerStat.js +37 -0
- package/dist/enums/PocketItemType.js +13 -0
- package/dist/enums/RockAltType.js +23 -0
- package/dist/enums/SaveDataKey.js +14 -0
- package/dist/enums/SerializationType.js +10 -0
- package/dist/enums/SlotDestructionType.js +22 -0
- package/dist/enums/private/GridEntityTypeCustom.js +10 -0
- package/dist/enums/private/SerializationBrand.js +42 -0
- package/dist/enums/private/StageTravelState.js +13 -0
- package/dist/enums/private/TrapdoorAnimation.js +9 -0
- package/dist/enums/private/UIStreakAnimation.js +10 -0
- package/dist/features.js +150 -0
- package/dist/functions/ambush.js +26 -0
- package/dist/functions/array.js +586 -0
- package/dist/functions/arrayLua.js +81 -0
- package/dist/functions/benchmark.js +36 -0
- package/dist/functions/bitSet128.js +64 -0
- package/dist/functions/bitwise.js +82 -0
- package/dist/functions/bombs.js +14 -0
- package/dist/functions/bosses.js +238 -0
- package/dist/functions/cards.js +164 -0
- package/dist/functions/challenges.js +117 -0
- package/dist/functions/characters.js +182 -0
- package/dist/functions/charge.js +251 -0
- package/dist/functions/chargeBar.js +54 -0
- package/dist/functions/collectibleTag.js +24 -0
- package/dist/functions/collectibles.js +581 -0
- package/dist/functions/color.js +88 -0
- package/dist/functions/console.js +18 -0
- package/dist/functions/curses.js +37 -0
- package/dist/functions/debugFunctions.js +108 -0
- package/dist/functions/decorators.js +113 -0
- package/dist/functions/deepCopy.js +406 -0
- package/dist/functions/deepCopyTests.js +361 -0
- package/dist/functions/dimensions.js +30 -0
- package/dist/functions/direction.js +78 -0
- package/dist/functions/doors.js +524 -0
- package/dist/functions/easing.js +327 -0
- package/dist/functions/effects.js +14 -0
- package/dist/functions/emptyRoom.js +79 -0
- package/dist/functions/entities.js +529 -0
- package/dist/functions/entitiesSpecific.js +582 -0
- package/dist/functions/entityTypes.js +9 -0
- package/dist/functions/enums.js +244 -0
- package/dist/functions/external.js +59 -0
- package/dist/functions/familiars.js +136 -0
- package/dist/functions/flag.js +146 -0
- package/dist/functions/frames.js +166 -0
- package/dist/functions/globals.js +291 -0
- package/dist/functions/gridEntities.js +990 -0
- package/dist/functions/gridEntitiesSpecific.js +456 -0
- package/dist/functions/gridIndex.js +35 -0
- package/dist/functions/hash.js +75 -0
- package/dist/functions/hex.js +57 -0
- package/dist/functions/input.js +185 -0
- package/dist/functions/isaacAPIClass.js +157 -0
- package/dist/functions/itemPool.js +118 -0
- package/dist/functions/jsonHelpers.js +73 -0
- package/dist/functions/jsonRoom.js +184 -0
- package/dist/functions/kColor.js +89 -0
- package/dist/functions/language.js +16 -0
- package/dist/functions/level.js +66 -0
- package/dist/functions/levelGrid.js +497 -0
- package/dist/functions/log.js +86 -0
- package/dist/functions/logEntities.js +308 -0
- package/dist/functions/logMisc.js +510 -0
- package/dist/functions/map.js +121 -0
- package/dist/functions/math.js +149 -0
- package/dist/functions/merge.js +159 -0
- package/dist/functions/mergeTests.js +313 -0
- package/dist/functions/minimap.js +204 -0
- package/dist/functions/modFeatures.js +39 -0
- package/dist/functions/newArray.js +30 -0
- package/dist/functions/nextStage.js +169 -0
- package/dist/functions/npcDataStructures.js +146 -0
- package/dist/functions/npcs.js +132 -0
- package/dist/functions/pickupVariants.js +63 -0
- package/dist/functions/pickups.js +168 -0
- package/dist/functions/pickupsSpecific.js +376 -0
- package/dist/functions/pills.js +200 -0
- package/dist/functions/playerCenter.js +53 -0
- package/dist/functions/playerCollectibles.js +300 -0
- package/dist/functions/playerDataStructures.js +145 -0
- package/dist/functions/playerEffects.js +63 -0
- package/dist/functions/playerHealth.js +604 -0
- package/dist/functions/playerIndex.js +186 -0
- package/dist/functions/playerTrinkets.js +149 -0
- package/dist/functions/players.js +471 -0
- package/dist/functions/pocketItems.js +165 -0
- package/dist/functions/positionVelocity.js +158 -0
- package/dist/functions/pressurePlate.js +26 -0
- package/dist/functions/projectiles.js +57 -0
- package/dist/functions/random.js +90 -0
- package/dist/functions/readOnly.js +33 -0
- package/dist/functions/render.js +36 -0
- package/dist/functions/revive.js +151 -0
- package/dist/functions/rng.js +140 -0
- package/dist/functions/rockAlt.js +50 -0
- package/dist/functions/roomData.js +155 -0
- package/dist/functions/roomGrid.js +97 -0
- package/dist/functions/roomShape.js +143 -0
- package/dist/functions/roomShapeWalls.js +187 -0
- package/dist/functions/roomTransition.js +43 -0
- package/dist/functions/rooms.js +782 -0
- package/dist/functions/run.js +121 -0
- package/dist/functions/seeds.js +22 -0
- package/dist/functions/serialization.js +98 -0
- package/dist/functions/set.js +215 -0
- package/dist/functions/slots.js +41 -0
- package/dist/functions/sort.js +158 -0
- package/dist/functions/sound.js +45 -0
- package/dist/functions/spawnCollectible.js +112 -0
- package/dist/functions/sprites.js +130 -0
- package/dist/functions/stage.js +540 -0
- package/dist/functions/stats.js +104 -0
- package/dist/functions/storyBosses.js +63 -0
- package/dist/functions/string.js +194 -0
- package/dist/functions/table.js +162 -0
- package/dist/functions/tears.js +128 -0
- package/dist/functions/transformations.js +89 -0
- package/dist/functions/trinketGive.js +145 -0
- package/dist/functions/trinkets.js +213 -0
- package/dist/functions/tstlClass.js +97 -0
- package/dist/functions/types.js +225 -0
- package/dist/functions/ui.js +148 -0
- package/dist/functions/utils.d.ts +2 -0
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.js +195 -0
- package/dist/functions/utils.lua +4 -1
- package/dist/functions/vector.js +150 -0
- package/dist/functions/versusScreen.js +58 -0
- package/dist/functions/weighted.js +57 -0
- package/dist/index.js +219 -0
- package/dist/index.rollup.d.ts +2 -0
- package/dist/indexLua.js +220 -0
- package/dist/interfaces/ChargeBarSprites.js +2 -0
- package/dist/interfaces/Corner.js +2 -0
- package/dist/interfaces/CustomStageTSConfig.js +2 -0
- package/dist/interfaces/GridEntityCustomData.js +2 -0
- package/dist/interfaces/JSONRoomsFile.js +2 -0
- package/dist/interfaces/PlayerHealth.js +2 -0
- package/dist/interfaces/PlayerStats.js +4 -0
- package/dist/interfaces/PocketItemDescription.js +2 -0
- package/dist/interfaces/RoomDescription.js +2 -0
- package/dist/interfaces/SaveData.js +98 -0
- package/dist/interfaces/StageHistoryEntry.js +2 -0
- package/dist/interfaces/TSTLClassMetatable.js +2 -0
- package/dist/interfaces/TrinketSituation.js +2 -0
- package/dist/interfaces/private/AddCallbackParametersCustom.js +4 -0
- package/dist/interfaces/private/CustomStage.js +2 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.js +2 -0
- package/dist/interfaces/private/ModUpgradedInterface.js +2 -0
- package/dist/isaacscript-common.lua +5 -2
- package/dist/maps/PHDPillConversionsMap.js +23 -0
- package/dist/maps/cardNameToTypeMap.js +211 -0
- package/dist/maps/characterNameToTypeMap.js +91 -0
- package/dist/maps/collectibleNameToTypeMap.js +19 -0
- package/dist/maps/defaultPlayerStatMap.js +17 -0
- package/dist/maps/entityTypeVariantToBossIDMap.js +11 -0
- package/dist/maps/falsePHDPillConversionsMap.js +37 -0
- package/dist/maps/gridEntityTypeToBrokenStateMap.js +32 -0
- package/dist/maps/gridEntityXMLMap.js +133 -0
- package/dist/maps/itemPoolTypeToItemPoolName.js +38 -0
- package/dist/maps/keyboardToStringMap.js +71 -0
- package/dist/maps/pillNameToEffectMap.js +91 -0
- package/dist/maps/roomNameToTypeMap.js +43 -0
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.js +17 -0
- package/dist/maps/transformationNameToPlayerFormMap.js +35 -0
- package/dist/maps/trinketNameToTypeMap.js +19 -0
- package/dist/objects/LRoomShapeToRectangles.js +43 -0
- package/dist/objects/backdropTypeToRockAltType.js +68 -0
- package/dist/objects/batteryNames.js +13 -0
- package/dist/objects/bombNames.js +17 -0
- package/dist/objects/bossIDToEntityTypeVariant.js +228 -0
- package/dist/objects/bossNamePNGFileNames.js +120 -0
- package/dist/objects/bossNames.js +119 -0
- package/dist/objects/bossPortraitPNGFileNames.js +123 -0
- package/dist/objects/cardDescriptions.js +106 -0
- package/dist/objects/cardNames.js +106 -0
- package/dist/objects/challengeBosses.js +60 -0
- package/dist/objects/challengeCharacters.js +58 -0
- package/dist/objects/challengeCollectibleTypes.js +255 -0
- package/dist/objects/challengeNames.js +54 -0
- package/dist/objects/challengeTrinketType.js +58 -0
- package/dist/objects/characterDamageMultipliers.js +49 -0
- package/dist/objects/characterNames.js +48 -0
- package/dist/objects/characterSpritePNGFileNames.js +50 -0
- package/dist/objects/characterStartingCollectibleTypes.js +105 -0
- package/dist/objects/characterStartingTrinketTypes.js +90 -0
- package/dist/objects/chestNames.js +20 -0
- package/dist/objects/coinNames.js +16 -0
- package/dist/objects/coinSubTypeToValue.js +15 -0
- package/dist/objects/collectibleDescriptions.js +742 -0
- package/dist/objects/collectibleNames.js +745 -0
- package/dist/objects/colors.js +26 -0
- package/dist/objects/directionNames.js +11 -0
- package/dist/objects/directionToDegrees.js +11 -0
- package/dist/objects/directionToMoveAction.js +11 -0
- package/dist/objects/directionToShootAction.js +11 -0
- package/dist/objects/directionToVector.js +13 -0
- package/dist/objects/doorSlotFlagToDoorSlot.js +15 -0
- package/dist/objects/doorSlotToDirection.js +15 -0
- package/dist/objects/doorSlotToDoorSlotFlag.js +15 -0
- package/dist/objects/gridEntityTypeToANM2Name.js +37 -0
- package/dist/objects/heartNames.js +21 -0
- package/dist/objects/isaacAPIClassTypeToBrand.js +12 -0
- package/dist/objects/isaacAPIClassTypeToFunctions.js +46 -0
- package/dist/objects/itemPoolTypeToCollectibleTypesSet.js +57 -0
- package/dist/objects/kColors.js +27 -0
- package/dist/objects/keyNames.js +13 -0
- package/dist/objects/languageNames.js +13 -0
- package/dist/objects/oppositeDoorSlots.js +15 -0
- package/dist/objects/pillEffectClasses.js +57 -0
- package/dist/objects/pillEffectNames.js +57 -0
- package/dist/objects/pillEffectTypeToPillEffects.js +23 -0
- package/dist/objects/pillEffectTypes.js +57 -0
- package/dist/objects/playerNamePNGFileNames.js +57 -0
- package/dist/objects/playerPortraitPNGFileNames.js +54 -0
- package/dist/objects/roomShapeBounds.js +48 -0
- package/dist/objects/roomShapeCorners.js +330 -0
- package/dist/objects/roomShapeLayoutSizes.js +41 -0
- package/dist/objects/roomShapeToBottomRightPosition.js +25 -0
- package/dist/objects/roomShapeToDoorSlotCoordinates.js +111 -0
- package/dist/objects/roomShapeToDoorSlots.js +72 -0
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.js +118 -0
- package/dist/objects/roomShapeToGridWidth.js +20 -0
- package/dist/objects/roomShapeToTopLeftPosition.js +26 -0
- package/dist/objects/roomShapeVolumes.js +32 -0
- package/dist/objects/roomTypeNames.js +35 -0
- package/dist/objects/roomTypeSpecialGotoPrefixes.js +35 -0
- package/dist/objects/sackNames.js +11 -0
- package/dist/objects/slotNames.js +26 -0
- package/dist/objects/stageIDNames.js +43 -0
- package/dist/objects/stageToMusic.js +91 -0
- package/dist/objects/stageToStageID.js +117 -0
- package/dist/objects/stageTypeSuffixes.js +14 -0
- package/dist/objects/transformationNames.js +20 -0
- package/dist/objects/trinketDescriptions.js +199 -0
- package/dist/objects/trinketNames.js +202 -0
- package/dist/objects/versusScreenBackgroundColors.js +46 -0
- package/dist/objects/versusScreenDirtSpotColors.js +46 -0
- package/dist/patchErrorFunctions.js +65 -0
- package/dist/serialization.js +21 -0
- package/dist/sets/LRoomShapesSet.js +11 -0
- package/dist/sets/bigRoomShapesSet.js +14 -0
- package/dist/sets/bossSets.js +465 -0
- package/dist/sets/charactersThatStartWithAnActiveItemSet.js +18 -0
- package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.js +9 -0
- package/dist/sets/charactersWithFreeDevilDealsSet.js +6 -0
- package/dist/sets/charactersWithNoRedHeartsSet.js +19 -0
- package/dist/sets/charactersWithNoSoulHeartsSet.js +16 -0
- package/dist/sets/consoleCommandsSet.js +64 -0
- package/dist/sets/entitiesWithArmorSet.js +59 -0
- package/dist/sets/familiarsThatShootPlayerTearsSet.js +15 -0
- package/dist/sets/itemConfigCardTypesForCards.js +14 -0
- package/dist/sets/lostStyleCharactersSet.js +16 -0
- package/dist/sets/mineShaftRoomSubTypesSet.js +12 -0
- package/dist/sets/narrowRoomShapesSet.js +11 -0
- package/dist/sets/poopGridEntityXMLTypesSet.js +16 -0
- package/dist/sets/redHeartSubTypesSet.js +10 -0
- package/dist/sets/repentanceBossIDsSet.js +30 -0
- package/dist/sets/sinEntityTypesSet.js +14 -0
- package/dist/sets/singleUseActiveCollectibleTypesSet.js +15 -0
- package/dist/shaderCrashFix.js +24 -0
- package/dist/shouldFire.js +226 -0
- package/dist/types/AddSubtract.js +2 -0
- package/dist/types/AllButFirst.js +2 -0
- package/dist/types/AllButLast.js +2 -0
- package/dist/types/AnyClass.js +2 -0
- package/dist/types/AnyEntity.js +2 -0
- package/dist/types/AnyFunction.js +2 -0
- package/dist/types/AnyGridEntity.js +2 -0
- package/dist/types/CompositionTypeSatisfiesEnum.js +11 -0
- package/dist/types/ConversionHeartSubType.js +2 -0
- package/dist/types/Decrement.js +2 -0
- package/dist/types/ERange.js +2 -0
- package/dist/types/EntityID.js +2 -0
- package/dist/types/FunctionTuple.js +2 -0
- package/dist/types/GridEntityID.js +2 -0
- package/dist/types/HasFunction.js +2 -0
- package/dist/types/IRange.js +2 -0
- package/dist/types/Immutable.js +2 -0
- package/dist/types/Increment.js +2 -0
- package/dist/types/LowercaseKeys.js +2 -0
- package/dist/types/NaturalNumbersLessThan.js +2 -0
- package/dist/types/NaturalNumbersLessThanOrEqualTo.js +2 -0
- package/dist/types/PickingUpItem.js +44 -0
- package/dist/types/PickupIndex.js +2 -0
- package/dist/types/PlayerIndex.js +2 -0
- package/dist/types/PossibleStatType.js +2 -0
- package/dist/types/PublicInterface.js +2 -0
- package/dist/types/ReadonlyMap.js +6 -0
- package/dist/types/ReadonlyRecord.js +2 -0
- package/dist/types/ReadonlySet.js +6 -0
- package/dist/types/StartsWithLowercase.js +2 -0
- package/dist/types/StartsWithUppercase.js +2 -0
- package/dist/types/TSTLClass.js +2 -0
- package/dist/types/Tuple.js +2 -0
- package/dist/types/TupleKeys.js +2 -0
- package/dist/types/TupleToIntersection.js +2 -0
- package/dist/types/TupleToUnion.js +2 -0
- package/dist/types/TupleWithLengthBetween.js +22 -0
- package/dist/types/TupleWithMaxLength.js +27 -0
- package/dist/types/UnionToIntersection.js +2 -0
- package/dist/types/UppercaseKeys.js +2 -0
- package/dist/types/WeightedArray.js +2 -0
- package/dist/types/WidenLiteral.js +2 -0
- package/dist/types/Writable.js +2 -0
- package/dist/types/private/CallbackTuple.js +2 -0
- package/dist/types/private/ModUpgradedWithFeatures.js +2 -0
- package/package.json +1 -1
- package/src/functions/utils.ts +4 -1
- package/src/lib/jsonLua.js +701 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serializeBitSet128 = exports.isSerializedBitSet128 = exports.isBitSet128 = exports.deserializeBitSet128 = exports.copyBitSet128 = void 0;
|
|
4
|
+
const SerializationBrand_1 = require("../enums/private/SerializationBrand");
|
|
5
|
+
const isaacAPIClass_1 = require("./isaacAPIClass");
|
|
6
|
+
const table_1 = require("./table");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const OBJECT_NAME = "BitSet128";
|
|
10
|
+
const KEYS = ["l", "h"];
|
|
11
|
+
/** Helper function to copy a `BitSet128` Isaac API class. */
|
|
12
|
+
function copyBitSet128(bitSet128) {
|
|
13
|
+
if (!isBitSet128(bitSet128)) {
|
|
14
|
+
error(`Failed to copy a ${OBJECT_NAME} object since the provided object was not a userdata ${OBJECT_NAME} class.`);
|
|
15
|
+
}
|
|
16
|
+
const lowBits = bitSet128.l;
|
|
17
|
+
const highBits = bitSet128.h;
|
|
18
|
+
return BitSet128(lowBits, highBits);
|
|
19
|
+
}
|
|
20
|
+
exports.copyBitSet128 = copyBitSet128;
|
|
21
|
+
/**
|
|
22
|
+
* Helper function to convert a `SerializedBitSet128` object to a normal `BitSet128` object. (This
|
|
23
|
+
* is used by the save data manager when reading data from the "save#.dat" file.)
|
|
24
|
+
*/
|
|
25
|
+
function deserializeBitSet128(bitSet128) {
|
|
26
|
+
if (!(0, types_1.isTable)(bitSet128)) {
|
|
27
|
+
error(`Failed to deserialize a ${OBJECT_NAME} object since the provided object was not a Lua table.`);
|
|
28
|
+
}
|
|
29
|
+
const [l, h] = (0, table_1.getNumbersFromTable)(bitSet128, OBJECT_NAME, ...KEYS);
|
|
30
|
+
(0, utils_1.assertDefined)(l, `Failed to deserialize a ${OBJECT_NAME} object since the provided object did not have a value for: l`);
|
|
31
|
+
(0, utils_1.assertDefined)(h, `Failed to deserialize a ${OBJECT_NAME} object since the provided object did not have a value for: h`);
|
|
32
|
+
return BitSet128(l, h);
|
|
33
|
+
}
|
|
34
|
+
exports.deserializeBitSet128 = deserializeBitSet128;
|
|
35
|
+
/** Helper function to check if something is an instantiated `BitSet128` object. */
|
|
36
|
+
function isBitSet128(object) {
|
|
37
|
+
return (0, isaacAPIClass_1.isIsaacAPIClassOfType)(object, OBJECT_NAME);
|
|
38
|
+
}
|
|
39
|
+
exports.isBitSet128 = isBitSet128;
|
|
40
|
+
/**
|
|
41
|
+
* Used to determine is the given table is a serialized `BitSet128` object created by the `deepCopy`
|
|
42
|
+
* function.
|
|
43
|
+
*/
|
|
44
|
+
function isSerializedBitSet128(object) {
|
|
45
|
+
if (!(0, types_1.isTable)(object)) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
return ((0, table_1.tableHasKeys)(object, ...KEYS) && object.has(SerializationBrand_1.SerializationBrand.BIT_SET_128));
|
|
49
|
+
}
|
|
50
|
+
exports.isSerializedBitSet128 = isSerializedBitSet128;
|
|
51
|
+
/**
|
|
52
|
+
* Helper function to convert a `BitSet128` object to a `SerializedBitSet128` object. (This is used
|
|
53
|
+
* by the save data manager when writing data from the "save#.dat" file.)
|
|
54
|
+
*/
|
|
55
|
+
function serializeBitSet128(bitSet128) {
|
|
56
|
+
if (!isBitSet128(bitSet128)) {
|
|
57
|
+
error(`Failed to serialize a ${OBJECT_NAME} object since the provided object was not a userdata ${OBJECT_NAME} class.`);
|
|
58
|
+
}
|
|
59
|
+
const bitSet128Table = new LuaMap();
|
|
60
|
+
(0, table_1.copyUserdataValuesToTable)(bitSet128, KEYS, bitSet128Table);
|
|
61
|
+
bitSet128Table.set(SerializationBrand_1.SerializationBrand.BIT_SET_128, "");
|
|
62
|
+
return bitSet128Table;
|
|
63
|
+
}
|
|
64
|
+
exports.serializeBitSet128 = serializeBitSet128;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setToBitFlags = exports.getNumBitsOfN = exports.getKBitOfN = exports.countSetBits = exports.convertDecimalToBinary = exports.convertBinaryToDecimal = exports.arrayToBitFlags = void 0;
|
|
4
|
+
const flag_1 = require("./flag");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
7
|
+
function arrayToBitFlags(array) {
|
|
8
|
+
let flags = 0;
|
|
9
|
+
for (const flag of array) {
|
|
10
|
+
flags = (0, flag_1.addFlag)(flags, flag);
|
|
11
|
+
}
|
|
12
|
+
return flags;
|
|
13
|
+
}
|
|
14
|
+
exports.arrayToBitFlags = arrayToBitFlags;
|
|
15
|
+
/** Helper function to convert an array of bits to the resulting decimal number. */
|
|
16
|
+
function convertBinaryToDecimal(bits) {
|
|
17
|
+
const bitsString = bits.join("");
|
|
18
|
+
return Number.parseInt(bitsString, 2);
|
|
19
|
+
}
|
|
20
|
+
exports.convertBinaryToDecimal = convertBinaryToDecimal;
|
|
21
|
+
/**
|
|
22
|
+
* Helper function to convert a number to an array of bits.
|
|
23
|
+
*
|
|
24
|
+
* @param num The number to convert.
|
|
25
|
+
* @param minLength Optional. Equal to the minimum amount of bits that should be returned. If the
|
|
26
|
+
* converted number of bits is below this number, 0's will be padded to the left
|
|
27
|
+
* side until the minimum length is met. Default is undefined (which will not cause
|
|
28
|
+
* any padding).
|
|
29
|
+
*/
|
|
30
|
+
function convertDecimalToBinary(num, minLength) {
|
|
31
|
+
const bits = [];
|
|
32
|
+
const bitsString = num.toString(2);
|
|
33
|
+
for (const bitString of bitsString) {
|
|
34
|
+
const bit = tonumber(bitString);
|
|
35
|
+
(0, utils_1.assertDefined)(bit, `Failed to convert the following number to binary: ${num}`);
|
|
36
|
+
bits.push(bit);
|
|
37
|
+
}
|
|
38
|
+
if (minLength !== undefined) {
|
|
39
|
+
while (bits.length < minLength) {
|
|
40
|
+
bits.unshift(0);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return bits;
|
|
44
|
+
}
|
|
45
|
+
exports.convertDecimalToBinary = convertDecimalToBinary;
|
|
46
|
+
/**
|
|
47
|
+
* Helper function to count the number of bits that are set to 1 in a binary representation of a
|
|
48
|
+
* number.
|
|
49
|
+
*/
|
|
50
|
+
function countSetBits(num) {
|
|
51
|
+
let count = 0;
|
|
52
|
+
while (num > 0) {
|
|
53
|
+
num &= num - 1;
|
|
54
|
+
count++;
|
|
55
|
+
}
|
|
56
|
+
return count;
|
|
57
|
+
}
|
|
58
|
+
exports.countSetBits = countSetBits;
|
|
59
|
+
/** Helper function to get the value of a specific but in a binary representation of a number. */
|
|
60
|
+
function getKBitOfN(k, n) {
|
|
61
|
+
return (n >>> k) & 1;
|
|
62
|
+
}
|
|
63
|
+
exports.getKBitOfN = getKBitOfN;
|
|
64
|
+
/** Helper function to get the number of bits in a binary representation of a number. */
|
|
65
|
+
function getNumBitsOfN(n) {
|
|
66
|
+
let numBits = 0;
|
|
67
|
+
while (n > 0) {
|
|
68
|
+
numBits++;
|
|
69
|
+
n >>>= 1;
|
|
70
|
+
}
|
|
71
|
+
return numBits;
|
|
72
|
+
}
|
|
73
|
+
exports.getNumBitsOfN = getNumBitsOfN;
|
|
74
|
+
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
75
|
+
function setToBitFlags(set) {
|
|
76
|
+
let flags = 0;
|
|
77
|
+
for (const flag of set) {
|
|
78
|
+
flags = (0, flag_1.addFlag)(flags, flag);
|
|
79
|
+
}
|
|
80
|
+
return flags;
|
|
81
|
+
}
|
|
82
|
+
exports.setToBitFlags = setToBitFlags;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBombRadiusFromDamage = void 0;
|
|
4
|
+
/** Helper function to find out how large a bomb explosion is based on the damage inflicted. */
|
|
5
|
+
function getBombRadiusFromDamage(damage) {
|
|
6
|
+
if (damage > 175) {
|
|
7
|
+
return 105;
|
|
8
|
+
}
|
|
9
|
+
if (damage <= 140) {
|
|
10
|
+
return 75;
|
|
11
|
+
}
|
|
12
|
+
return 90;
|
|
13
|
+
}
|
|
14
|
+
exports.getBombRadiusFromDamage = getBombRadiusFromDamage;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spawnBossWithSeed = exports.spawnBoss = exports.isSin = exports.isRepentanceBoss = exports.getEntityTypeVariantFromBossID = exports.getBosses = exports.getBossStageIDs = exports.getBossName = exports.getBossIDsForStageID = exports.getBossIDsForStage = exports.getBossIDFromEntityTypeVariant = exports.getBossID = exports.getAllNonStoryBosses = exports.getAllBosses = exports.getAliveBosses = void 0;
|
|
4
|
+
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
5
|
+
const cachedClasses_1 = require("../core/cachedClasses");
|
|
6
|
+
const constants_1 = require("../core/constants");
|
|
7
|
+
const entityTypeVariantToBossIDMap_1 = require("../maps/entityTypeVariantToBossIDMap");
|
|
8
|
+
const bossIDToEntityTypeVariant_1 = require("../objects/bossIDToEntityTypeVariant");
|
|
9
|
+
const bossNames_1 = require("../objects/bossNames");
|
|
10
|
+
const bossSets_1 = require("../sets/bossSets");
|
|
11
|
+
const repentanceBossIDsSet_1 = require("../sets/repentanceBossIDsSet");
|
|
12
|
+
const sinEntityTypesSet_1 = require("../sets/sinEntityTypesSet");
|
|
13
|
+
const ReadonlySet_1 = require("../types/ReadonlySet");
|
|
14
|
+
const entities_1 = require("./entities");
|
|
15
|
+
const entitiesSpecific_1 = require("./entitiesSpecific");
|
|
16
|
+
const npcs_1 = require("./npcs");
|
|
17
|
+
const rng_1 = require("./rng");
|
|
18
|
+
const rooms_1 = require("./rooms");
|
|
19
|
+
const utils_1 = require("./utils");
|
|
20
|
+
const BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS = new ReadonlySet_1.ReadonlySet([
|
|
21
|
+
isaac_typescript_definitions_1.EntityType.LARRY_JR,
|
|
22
|
+
isaac_typescript_definitions_1.EntityType.CHUB,
|
|
23
|
+
isaac_typescript_definitions_1.EntityType.LOKI,
|
|
24
|
+
isaac_typescript_definitions_1.EntityType.GURGLING,
|
|
25
|
+
isaac_typescript_definitions_1.EntityType.TURDLET, // 918
|
|
26
|
+
]);
|
|
27
|
+
const DEFAULT_BOSS_MULTI_SEGMENTS = 4;
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to get all of the non-dead bosses in the room.
|
|
30
|
+
*
|
|
31
|
+
* This function will not include bosses on an internal blacklist, such as Death's scythes or Big
|
|
32
|
+
* Horn holes.
|
|
33
|
+
*
|
|
34
|
+
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
35
|
+
* is -1, which matches every type.
|
|
36
|
+
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
37
|
+
* is -1, which matches every variant.
|
|
38
|
+
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
39
|
+
* is -1, which matches every sub-type.
|
|
40
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
41
|
+
*/
|
|
42
|
+
function getAliveBosses(entityType = -1, variant = -1, subType = -1, ignoreFriendly = false) {
|
|
43
|
+
const aliveNPCs = (0, npcs_1.getAliveNPCs)(entityType, variant, subType, ignoreFriendly);
|
|
44
|
+
return aliveNPCs.filter((aliveNPC) => aliveNPC.IsBoss());
|
|
45
|
+
}
|
|
46
|
+
exports.getAliveBosses = getAliveBosses;
|
|
47
|
+
/**
|
|
48
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
49
|
+
* enum.
|
|
50
|
+
*
|
|
51
|
+
* This includes:
|
|
52
|
+
* - Ultra Greed
|
|
53
|
+
* - Ultra Greedier
|
|
54
|
+
*
|
|
55
|
+
* This does not include:
|
|
56
|
+
* - mini-bosses (e.g. Ultra Pride, Krampus)
|
|
57
|
+
* - bosses that do not appear in Boss Rooms (e.g. Uriel, Gabriel)
|
|
58
|
+
* - the second phase of multi-phase bosses (e.g. Mega Satan 2)
|
|
59
|
+
* - sub-bosses of The Beast fight (e.g. Ultra Famine, Ultra Pestilence, Ultra War, Ultra Death)
|
|
60
|
+
* - bosses that do not have any Boss Rooms defined due to being unfinished (e.g. Raglich)
|
|
61
|
+
*
|
|
62
|
+
* Also see the `getAllNonStoryBosses` function.
|
|
63
|
+
*/
|
|
64
|
+
function getAllBosses() {
|
|
65
|
+
return bossSets_1.ALL_BOSSES;
|
|
66
|
+
}
|
|
67
|
+
exports.getAllBosses = getAllBosses;
|
|
68
|
+
/**
|
|
69
|
+
* Helper function to get an array with every boss in the game. This is derived from the `BossID`
|
|
70
|
+
* enum. This is the same thing as the `getAllBosses` helper function, but with story bosses
|
|
71
|
+
* filtered out.
|
|
72
|
+
*/
|
|
73
|
+
function getAllNonStoryBosses() {
|
|
74
|
+
return bossSets_1.NON_STORY_BOSSES;
|
|
75
|
+
}
|
|
76
|
+
exports.getAllNonStoryBosses = getAllNonStoryBosses;
|
|
77
|
+
/**
|
|
78
|
+
* Helper function to get the boss ID corresponding to the current room. Returns undefined if the
|
|
79
|
+
* current room is not a Boss Room.
|
|
80
|
+
*
|
|
81
|
+
* Use this instead of the vanilla `Room.GetBossID` method since it has a saner return type and it
|
|
82
|
+
* correctly handles Dogma, The Beast, and Ultra Greedier.
|
|
83
|
+
*/
|
|
84
|
+
function getBossID() {
|
|
85
|
+
if ((0, rooms_1.inDogmaRoom)()) {
|
|
86
|
+
return isaac_typescript_definitions_1.BossID.DOGMA;
|
|
87
|
+
}
|
|
88
|
+
if ((0, rooms_1.inBeastRoom)()) {
|
|
89
|
+
return isaac_typescript_definitions_1.BossID.BEAST;
|
|
90
|
+
}
|
|
91
|
+
const room = cachedClasses_1.game.GetRoom();
|
|
92
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
93
|
+
const bossID = room.GetBossID();
|
|
94
|
+
if (bossID === 0) {
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
// The Ultra Greed room holds both Ultra Greed and Ultra Greedier.
|
|
98
|
+
if (bossID === isaac_typescript_definitions_1.BossID.ULTRA_GREED &&
|
|
99
|
+
(0, entities_1.doesEntityExist)(isaac_typescript_definitions_1.EntityType.ULTRA_GREED, isaac_typescript_definitions_1.UltraGreedVariant.ULTRA_GREEDIER)) {
|
|
100
|
+
return isaac_typescript_definitions_1.BossID.ULTRA_GREEDIER;
|
|
101
|
+
}
|
|
102
|
+
return bossID;
|
|
103
|
+
}
|
|
104
|
+
exports.getBossID = getBossID;
|
|
105
|
+
function getBossIDFromEntityTypeVariant(entityType, variant) {
|
|
106
|
+
const entityTypeVariant = `${entityType}.${variant}`;
|
|
107
|
+
return entityTypeVariantToBossIDMap_1.ENTITY_TYPE_VARIANT_TO_BOSS_ID_MAP.get(entityTypeVariant);
|
|
108
|
+
}
|
|
109
|
+
exports.getBossIDFromEntityTypeVariant = getBossIDFromEntityTypeVariant;
|
|
110
|
+
/**
|
|
111
|
+
* Helper function to get the set of vanilla bosses for a particular stage across all of the stage
|
|
112
|
+
* types. For example, specifying `LevelStage.BASEMENT_2` will return a set with all of the bosses
|
|
113
|
+
* for Basement, Cellar, Burning Basement, Downpour, and Dross.
|
|
114
|
+
*
|
|
115
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStageID` functions.
|
|
116
|
+
*/
|
|
117
|
+
function getBossIDsForStage(stage) {
|
|
118
|
+
return bossSets_1.STAGE_TO_COMBINED_BOSS_SET_MAP.get(stage);
|
|
119
|
+
}
|
|
120
|
+
exports.getBossIDsForStage = getBossIDsForStage;
|
|
121
|
+
/**
|
|
122
|
+
* Helper function to get the set of vanilla bosses that can randomly appear on a particular stage
|
|
123
|
+
* ID.
|
|
124
|
+
*
|
|
125
|
+
* Also see the `getAllBossesSet` and `getBossIDsForStage` functions.
|
|
126
|
+
*/
|
|
127
|
+
function getBossIDsForStageID(stageID) {
|
|
128
|
+
return bossSets_1.STAGE_ID_TO_BOSS_IDS.get(stageID);
|
|
129
|
+
}
|
|
130
|
+
exports.getBossIDsForStageID = getBossIDsForStageID;
|
|
131
|
+
/**
|
|
132
|
+
* Helper function to get the proper English name for a boss. For example, the name for
|
|
133
|
+
* `BossID.WRETCHED` (36) is "The Wretched".
|
|
134
|
+
*/
|
|
135
|
+
function getBossName(bossID) {
|
|
136
|
+
// Handle modded boss IDs.
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
138
|
+
return bossNames_1.BOSS_NAMES[bossID] ?? bossNames_1.DEFAULT_BOSS_NAME;
|
|
139
|
+
}
|
|
140
|
+
exports.getBossName = getBossName;
|
|
141
|
+
/** Helper function to get the set of stage IDs that a particular boss naturally appears in. */
|
|
142
|
+
function getBossStageIDs(bossID) {
|
|
143
|
+
return bossSets_1.BOSS_ID_TO_STAGE_IDS[bossID];
|
|
144
|
+
}
|
|
145
|
+
exports.getBossStageIDs = getBossStageIDs;
|
|
146
|
+
/**
|
|
147
|
+
* Helper function to get all of the bosses in the room.
|
|
148
|
+
*
|
|
149
|
+
* @param entityType Optional. If specified, will only get the bosses that match the type. Default
|
|
150
|
+
* is -1, which matches every type.
|
|
151
|
+
* @param variant Optional. If specified, will only get the bosses that match the variant. Default
|
|
152
|
+
* is -1, which matches every variant.
|
|
153
|
+
* @param subType Optional. If specified, will only get the bosses that match the sub-type. Default
|
|
154
|
+
* is -1, which matches every sub-type.
|
|
155
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
156
|
+
*/
|
|
157
|
+
function getBosses(entityType, variant, subType, ignoreFriendly = false) {
|
|
158
|
+
const npcs = (0, entitiesSpecific_1.getNPCs)(entityType, variant, subType, ignoreFriendly);
|
|
159
|
+
return npcs.filter((npc) => npc.IsBoss());
|
|
160
|
+
}
|
|
161
|
+
exports.getBosses = getBosses;
|
|
162
|
+
function getEntityTypeVariantFromBossID(bossID) {
|
|
163
|
+
return bossIDToEntityTypeVariant_1.BOSS_ID_TO_ENTITY_TYPE_VARIANT[bossID];
|
|
164
|
+
}
|
|
165
|
+
exports.getEntityTypeVariantFromBossID = getEntityTypeVariantFromBossID;
|
|
166
|
+
/**
|
|
167
|
+
* Helper function to check if a boss is only found on a Repentance floor such as Dross, Mines, and
|
|
168
|
+
* so on.
|
|
169
|
+
*
|
|
170
|
+
* For example, The Pile is a boss that was added in Repentance, but since it can appear in
|
|
171
|
+
* Necropolis, it is not considered a Repentance boss for the purposes of this function.
|
|
172
|
+
*/
|
|
173
|
+
function isRepentanceBoss(bossID) {
|
|
174
|
+
return repentanceBossIDsSet_1.REPENTANCE_ONLY_BOSS_IDS_SET.has(bossID);
|
|
175
|
+
}
|
|
176
|
+
exports.isRepentanceBoss = isRepentanceBoss;
|
|
177
|
+
/** Helper function to check if the provided NPC is a Sin miniboss, such as Sloth or Lust. */
|
|
178
|
+
function isSin(npc) {
|
|
179
|
+
return sinEntityTypesSet_1.SIN_ENTITY_TYPES_SET.has(npc.Type);
|
|
180
|
+
}
|
|
181
|
+
exports.isSin = isSin;
|
|
182
|
+
function getNumBossSegments(entityType, variant, numSegments) {
|
|
183
|
+
if (numSegments !== undefined) {
|
|
184
|
+
return numSegments;
|
|
185
|
+
}
|
|
186
|
+
switch (entityType) {
|
|
187
|
+
// 28
|
|
188
|
+
case isaac_typescript_definitions_1.EntityType.CHUB: {
|
|
189
|
+
// Chub is always composed of 3 segments.
|
|
190
|
+
return 3;
|
|
191
|
+
}
|
|
192
|
+
// 69
|
|
193
|
+
case isaac_typescript_definitions_1.EntityType.LOKI: {
|
|
194
|
+
return variant === isaac_typescript_definitions_1.LokiVariant.LOKII ? 2 : 1;
|
|
195
|
+
}
|
|
196
|
+
// 237
|
|
197
|
+
case isaac_typescript_definitions_1.EntityType.GURGLING: {
|
|
198
|
+
// Gurglings & Turdlings are always encountered in groups of 2.
|
|
199
|
+
return 2;
|
|
200
|
+
}
|
|
201
|
+
default: {
|
|
202
|
+
return DEFAULT_BOSS_MULTI_SEGMENTS;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Helper function to spawn a boss.
|
|
208
|
+
*
|
|
209
|
+
* Use this function instead of `spawnNPC` since it handles automatically spawning multiple segments
|
|
210
|
+
* for multi-segment bosses.
|
|
211
|
+
*
|
|
212
|
+
* By default, this will spawn Chub (and his variants) with 3 segments, Lokii with 2 copies,
|
|
213
|
+
* Gurglings/Turdlings with 2 copies, and other multi-segment bosses with 4 segments. You can
|
|
214
|
+
* customize this via the "numSegments" argument.
|
|
215
|
+
*/
|
|
216
|
+
function spawnBoss(entityType, variant, subType, positionOrGridIndex, velocity = constants_1.VectorZero, spawner = undefined, seedOrRNG = undefined, numSegments) {
|
|
217
|
+
const seed = (0, rng_1.isRNG)(seedOrRNG) ? seedOrRNG.Next() : seedOrRNG;
|
|
218
|
+
const npc = (0, entitiesSpecific_1.spawnNPC)(entityType, variant, subType, positionOrGridIndex, velocity, spawner, seed);
|
|
219
|
+
if (BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS.has(entityType)) {
|
|
220
|
+
const numBossSegments = getNumBossSegments(entityType, variant, numSegments);
|
|
221
|
+
const remainingSegmentsToSpawn = numBossSegments - 1;
|
|
222
|
+
(0, utils_1.repeat)(remainingSegmentsToSpawn, () => {
|
|
223
|
+
(0, entitiesSpecific_1.spawnNPC)(entityType, variant, subType, positionOrGridIndex, velocity, spawner, seed);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return npc;
|
|
227
|
+
}
|
|
228
|
+
exports.spawnBoss = spawnBoss;
|
|
229
|
+
/**
|
|
230
|
+
* Helper function to spawn a boss with a specific seed.
|
|
231
|
+
*
|
|
232
|
+
* For more information, see the documentation for the `spawnBoss` function.
|
|
233
|
+
*/
|
|
234
|
+
function spawnBossWithSeed(entityType, variant, subType, positionOrGridIndex, seedOrRNG, velocity = constants_1.VectorZero, spawner = undefined, numSegments) {
|
|
235
|
+
const seed = (0, rng_1.isRNG)(seedOrRNG) ? seedOrRNG.Next() : seedOrRNG;
|
|
236
|
+
return spawnBoss(entityType, variant, subType, positionOrGridIndex, velocity, spawner, seed, numSegments);
|
|
237
|
+
}
|
|
238
|
+
exports.spawnBossWithSeed = spawnBossWithSeed;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCardTemp = exports.isVanillaCardType = exports.isValidCardType = exports.isTarotCard = exports.isSuitCard = exports.isSpecialCard = exports.isRune = exports.isReverseTarotCard = exports.isPocketItemObject = exports.isModdedCardType = exports.isCardType = exports.isCard = exports.hasCard = exports.getItemConfigCardType = exports.getCardName = exports.getCardDescription = void 0;
|
|
4
|
+
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
5
|
+
const cachedEnumValues_1 = require("../arrays/cachedEnumValues");
|
|
6
|
+
const cachedClasses_1 = require("../core/cachedClasses");
|
|
7
|
+
const constantsFirstLast_1 = require("../core/constantsFirstLast");
|
|
8
|
+
const cardDescriptions_1 = require("../objects/cardDescriptions");
|
|
9
|
+
const cardNames_1 = require("../objects/cardNames");
|
|
10
|
+
const itemConfigCardTypesForCards_1 = require("../sets/itemConfigCardTypesForCards");
|
|
11
|
+
const flag_1 = require("./flag");
|
|
12
|
+
const types_1 = require("./types");
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to get a card description from a `CardType` value. Returns "Unknown" if the
|
|
15
|
+
* provided card type is not valid.
|
|
16
|
+
*
|
|
17
|
+
* This function works for both vanilla and modded trinkets.
|
|
18
|
+
*
|
|
19
|
+
* For example, `getCardDescription(CardType.FOOL)` would return "Where journey begins".
|
|
20
|
+
*/
|
|
21
|
+
function getCardDescription(cardType) {
|
|
22
|
+
// "ItemConfigCard.Description" is bugged with vanilla cards on patch v1.7.6, so we use a
|
|
23
|
+
// hard-coded map as a workaround.
|
|
24
|
+
const cardDescription = cardDescriptions_1.CARD_DESCRIPTIONS[cardType];
|
|
25
|
+
// Handle modded cards.
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
27
|
+
if (cardDescription !== undefined) {
|
|
28
|
+
return cardDescription;
|
|
29
|
+
}
|
|
30
|
+
const itemConfigCard = cachedClasses_1.itemConfig.GetCard(cardType);
|
|
31
|
+
if (itemConfigCard !== undefined) {
|
|
32
|
+
return itemConfigCard.Description;
|
|
33
|
+
}
|
|
34
|
+
return cardDescriptions_1.DEFAULT_CARD_DESCRIPTION;
|
|
35
|
+
}
|
|
36
|
+
exports.getCardDescription = getCardDescription;
|
|
37
|
+
/**
|
|
38
|
+
* Helper function to get the name of a card. Returns "Unknown" if the provided card type is not
|
|
39
|
+
* valid.
|
|
40
|
+
*
|
|
41
|
+
* This function works for both vanilla and modded trinkets.
|
|
42
|
+
*
|
|
43
|
+
* For example, `getCardName(Card.FOOL)` would return "0 - The Fool".
|
|
44
|
+
*/
|
|
45
|
+
function getCardName(cardType) {
|
|
46
|
+
// "ItemConfigCard.Name" is bugged with vanilla cards on patch v1.7.6, so we use a hard-coded map
|
|
47
|
+
// as a workaround.
|
|
48
|
+
const cardName = cardNames_1.CARD_NAMES[cardType];
|
|
49
|
+
// Handle modded cards.
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
51
|
+
if (cardName !== undefined) {
|
|
52
|
+
return cardName;
|
|
53
|
+
}
|
|
54
|
+
const itemConfigCard = cachedClasses_1.itemConfig.GetCard(cardType);
|
|
55
|
+
if (itemConfigCard !== undefined) {
|
|
56
|
+
return itemConfigCard.Name;
|
|
57
|
+
}
|
|
58
|
+
return cardNames_1.DEFAULT_CARD_NAME;
|
|
59
|
+
}
|
|
60
|
+
exports.getCardName = getCardName;
|
|
61
|
+
/**
|
|
62
|
+
* Helper function to get the item config card type of a particular card, rune, or object. For
|
|
63
|
+
* example, the item config card type of `CardType.FOOL` is equal to `ItemConfigCardType.TAROT`.
|
|
64
|
+
*
|
|
65
|
+
* Returns undefined if the provided card type was not valid.
|
|
66
|
+
*/
|
|
67
|
+
function getItemConfigCardType(cardType) {
|
|
68
|
+
const itemConfigCard = cachedClasses_1.itemConfig.GetCard(cardType);
|
|
69
|
+
if (itemConfigCard === undefined) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return itemConfigCard.CardType;
|
|
73
|
+
}
|
|
74
|
+
exports.getItemConfigCardType = getItemConfigCardType;
|
|
75
|
+
/**
|
|
76
|
+
* Helper function to check if a player is holding a specific card in one of their pocket item
|
|
77
|
+
* slots.
|
|
78
|
+
*
|
|
79
|
+
* This function is variadic, meaning that you can pass as many cards as you want to check for. The
|
|
80
|
+
* function will return true if the player has any of the cards.
|
|
81
|
+
*/
|
|
82
|
+
function hasCard(player, ...cardTypes) {
|
|
83
|
+
const cardTypesSet = new Set(cardTypes);
|
|
84
|
+
return cachedEnumValues_1.POCKET_ITEM_SLOT_VALUES.some((pocketItemSlot) => {
|
|
85
|
+
const cardType = player.GetCard(pocketItemSlot);
|
|
86
|
+
return cardTypesSet.has(cardType);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
exports.hasCard = hasCard;
|
|
90
|
+
/**
|
|
91
|
+
* Returns true for card types that have the following item config card type:
|
|
92
|
+
*
|
|
93
|
+
* - `ItemConfigCardType.TAROT` (0)
|
|
94
|
+
* - `ItemConfigCardType.SUIT` (1)
|
|
95
|
+
* - `ItemConfigCardType.SPECIAL` (3)
|
|
96
|
+
* - `ItemConfigCardType.TAROT_REVERSE` (5)
|
|
97
|
+
*/
|
|
98
|
+
function isCard(cardType) {
|
|
99
|
+
const itemConfigCardType = getItemConfigCardType(cardType);
|
|
100
|
+
if (itemConfigCardType === undefined) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
return itemConfigCardTypesForCards_1.ITEM_CONFIG_CARD_TYPES_FOR_CARDS.has(itemConfigCardType);
|
|
104
|
+
}
|
|
105
|
+
exports.isCard = isCard;
|
|
106
|
+
/** Returns whether the given card type matches the specified item config card type. */
|
|
107
|
+
function isCardType(cardType, itemConfigCardType) {
|
|
108
|
+
return itemConfigCardType === getItemConfigCardType(cardType);
|
|
109
|
+
}
|
|
110
|
+
exports.isCardType = isCardType;
|
|
111
|
+
/** Returns true for any card type added by a mod. */
|
|
112
|
+
function isModdedCardType(cardType) {
|
|
113
|
+
return !isVanillaCardType(cardType);
|
|
114
|
+
}
|
|
115
|
+
exports.isModdedCardType = isModdedCardType;
|
|
116
|
+
/** Returns true for card types that have `ItemConfigCardType.SPECIAL_OBJECT`. */
|
|
117
|
+
function isPocketItemObject(cardType) {
|
|
118
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.SPECIAL_OBJECT);
|
|
119
|
+
}
|
|
120
|
+
exports.isPocketItemObject = isPocketItemObject;
|
|
121
|
+
/** Returns true for card types that have `ItemConfigCardType.TAROT_REVERSE`. */
|
|
122
|
+
function isReverseTarotCard(cardType) {
|
|
123
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.TAROT_REVERSE);
|
|
124
|
+
}
|
|
125
|
+
exports.isReverseTarotCard = isReverseTarotCard;
|
|
126
|
+
/** Returns true for card types that have `ItemConfigCardType.RUNE`. */
|
|
127
|
+
function isRune(cardType) {
|
|
128
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.RUNE);
|
|
129
|
+
}
|
|
130
|
+
exports.isRune = isRune;
|
|
131
|
+
/** Returns true for card types that have `ItemConfigCardType.SPECIAL`. */
|
|
132
|
+
function isSpecialCard(cardType) {
|
|
133
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.SPECIAL);
|
|
134
|
+
}
|
|
135
|
+
exports.isSpecialCard = isSpecialCard;
|
|
136
|
+
/** Returns true for card types that have `ItemConfigCardType.SUIT`. */
|
|
137
|
+
function isSuitCard(cardType) {
|
|
138
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.SUIT);
|
|
139
|
+
}
|
|
140
|
+
exports.isSuitCard = isSuitCard;
|
|
141
|
+
/** Returns true for card types that have `ItemConfigCardType.TAROT`. */
|
|
142
|
+
function isTarotCard(cardType) {
|
|
143
|
+
return isCardType(cardType, isaac_typescript_definitions_1.ItemConfigCardType.TAROT);
|
|
144
|
+
}
|
|
145
|
+
exports.isTarotCard = isTarotCard;
|
|
146
|
+
function isValidCardType(cardType) {
|
|
147
|
+
const potentialCardType = (0, types_1.asCardType)(cardType);
|
|
148
|
+
const itemConfigCard = cachedClasses_1.itemConfig.GetCard(potentialCardType);
|
|
149
|
+
return itemConfigCard !== undefined;
|
|
150
|
+
}
|
|
151
|
+
exports.isValidCardType = isValidCardType;
|
|
152
|
+
function isVanillaCardType(cardType) {
|
|
153
|
+
return cardType <= constantsFirstLast_1.LAST_VANILLA_CARD_TYPE;
|
|
154
|
+
}
|
|
155
|
+
exports.isVanillaCardType = isVanillaCardType;
|
|
156
|
+
/**
|
|
157
|
+
* Helper function to use a card without showing an animation and without the announcer voice
|
|
158
|
+
* playing.
|
|
159
|
+
*/
|
|
160
|
+
function useCardTemp(player, cardType) {
|
|
161
|
+
const useFlags = (0, flag_1.addFlag)(isaac_typescript_definitions_1.UseFlag.NO_ANIMATION, isaac_typescript_definitions_1.UseFlag.NO_ANNOUNCER_VOICE);
|
|
162
|
+
player.UseCard(cardType, useFlags);
|
|
163
|
+
}
|
|
164
|
+
exports.useCardTemp = useCardTemp;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setChallenge = exports.onChallenge = exports.onAnyChallenge = exports.getChallengeTrinketType = exports.getChallengeName = exports.getChallengeCollectibleTypes = exports.getChallengeCharacter = exports.getChallengeBoss = exports.clearChallenge = void 0;
|
|
4
|
+
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
5
|
+
const challengeBosses_1 = require("../objects/challengeBosses");
|
|
6
|
+
const challengeCharacters_1 = require("../objects/challengeCharacters");
|
|
7
|
+
const challengeCollectibleTypes_1 = require("../objects/challengeCollectibleTypes");
|
|
8
|
+
const challengeNames_1 = require("../objects/challengeNames");
|
|
9
|
+
const challengeTrinketType_1 = require("../objects/challengeTrinketType");
|
|
10
|
+
const log_1 = require("./log");
|
|
11
|
+
/**
|
|
12
|
+
* Helper function to clear the current challenge, which will restart the run on a new random
|
|
13
|
+
* non-challenge seed with the current character.
|
|
14
|
+
*
|
|
15
|
+
* If the player is not in a challenge already, this function will do nothing.
|
|
16
|
+
*
|
|
17
|
+
* Under the hood, this function executes the `challenge 0` console command.
|
|
18
|
+
*/
|
|
19
|
+
function clearChallenge() {
|
|
20
|
+
if (onAnyChallenge()) {
|
|
21
|
+
const command = `challenge ${isaac_typescript_definitions_1.Challenge.NULL}`;
|
|
22
|
+
(0, log_1.log)(`Restarting the run to clear the current challenge with a console command of: ${command}`);
|
|
23
|
+
Isaac.ExecuteCommand(command);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.clearChallenge = clearChallenge;
|
|
27
|
+
/**
|
|
28
|
+
* Get the final boss of a challenge. This will only work for vanilla challenges.
|
|
29
|
+
*
|
|
30
|
+
* For modded challenges, `BossID.MOM` (6) will be returned.
|
|
31
|
+
*
|
|
32
|
+
* Note that for `Challenge.BACKASSWARDS` (31), this function will return `BossID.MEGA_SATAN` (55),
|
|
33
|
+
* but this is not actually the final boss. (There is no final boss for this challenge.)
|
|
34
|
+
*/
|
|
35
|
+
function getChallengeBoss(challenge) {
|
|
36
|
+
const challengeBossID = challengeBosses_1.CHALLENGE_BOSSES[challenge];
|
|
37
|
+
// Handle modded challenges.
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
39
|
+
return challengeBossID ?? challengeBosses_1.DEFAULT_CHALLENGE_BOSS_ID;
|
|
40
|
+
}
|
|
41
|
+
exports.getChallengeBoss = getChallengeBoss;
|
|
42
|
+
/**
|
|
43
|
+
* Get the starting character of a challenge. This will only work for vanilla challenges.
|
|
44
|
+
*
|
|
45
|
+
* For modded challenges, `PlayerType.ISAAC` (0) will be returned.
|
|
46
|
+
*/
|
|
47
|
+
function getChallengeCharacter(challenge) {
|
|
48
|
+
const challengeCharacter = challengeCharacters_1.CHALLENGE_CHARACTERS[challenge];
|
|
49
|
+
// Handle modded challenges.
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
51
|
+
return challengeCharacter ?? challengeCharacters_1.DEFAULT_CHALLENGE_CHARACTER;
|
|
52
|
+
}
|
|
53
|
+
exports.getChallengeCharacter = getChallengeCharacter;
|
|
54
|
+
/**
|
|
55
|
+
* Get the extra starting collectibles for a challenge. This will only work for vanilla challenges.
|
|
56
|
+
*
|
|
57
|
+
* For modded challenges, an empty array will be returned.
|
|
58
|
+
*/
|
|
59
|
+
function getChallengeCollectibleTypes(challenge) {
|
|
60
|
+
return challengeCollectibleTypes_1.CHALLENGE_COLLECTIBLE_TYPES[challenge];
|
|
61
|
+
}
|
|
62
|
+
exports.getChallengeCollectibleTypes = getChallengeCollectibleTypes;
|
|
63
|
+
/**
|
|
64
|
+
* Get the proper name for a `Challenge` enum. This will only work for vanilla challenges.
|
|
65
|
+
*
|
|
66
|
+
* For modded challenges, "Unknown" will be returned.
|
|
67
|
+
*/
|
|
68
|
+
function getChallengeName(challenge) {
|
|
69
|
+
const challengeName = challengeNames_1.CHALLENGE_NAMES[challenge];
|
|
70
|
+
// Handle modded challenges.
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
72
|
+
return challengeName ?? challengeNames_1.DEFAULT_CHALLENGE_NAME;
|
|
73
|
+
}
|
|
74
|
+
exports.getChallengeName = getChallengeName;
|
|
75
|
+
/**
|
|
76
|
+
* Get the extra starting trinket for a challenge. This will only work for vanilla challenges.
|
|
77
|
+
*
|
|
78
|
+
* If a challenge does not grant a starting trinket, `undefined` will be returned.
|
|
79
|
+
*
|
|
80
|
+
* For modded challenges, `undefined` will be returned.
|
|
81
|
+
*/
|
|
82
|
+
function getChallengeTrinketType(challenge) {
|
|
83
|
+
return challengeTrinketType_1.CHALLENGE_TRINKET_TYPE[challenge];
|
|
84
|
+
}
|
|
85
|
+
exports.getChallengeTrinketType = getChallengeTrinketType;
|
|
86
|
+
/** Helper function to see if the player is playing any challenge. */
|
|
87
|
+
function onAnyChallenge() {
|
|
88
|
+
const challenge = Isaac.GetChallenge();
|
|
89
|
+
return challenge !== isaac_typescript_definitions_1.Challenge.NULL;
|
|
90
|
+
}
|
|
91
|
+
exports.onAnyChallenge = onAnyChallenge;
|
|
92
|
+
/**
|
|
93
|
+
* Helper function to check to see if the player is playing a particular challenge.
|
|
94
|
+
*
|
|
95
|
+
* This function is variadic, meaning that you can specify as many challenges as you want to check
|
|
96
|
+
* for.
|
|
97
|
+
*/
|
|
98
|
+
function onChallenge(...challenges) {
|
|
99
|
+
const challenge = Isaac.GetChallenge();
|
|
100
|
+
return challenges.includes(challenge);
|
|
101
|
+
}
|
|
102
|
+
exports.onChallenge = onChallenge;
|
|
103
|
+
/**
|
|
104
|
+
* Helper function to restart the run on a particular challenge.
|
|
105
|
+
*
|
|
106
|
+
* If the player is already in the particular challenge, this function will do nothing.
|
|
107
|
+
*
|
|
108
|
+
* Under the hood, this function executes the `challenge 0` console command.
|
|
109
|
+
*/
|
|
110
|
+
function setChallenge(challenge) {
|
|
111
|
+
if (!onChallenge(challenge)) {
|
|
112
|
+
const command = `challenge ${challenge}`;
|
|
113
|
+
(0, log_1.log)(`Restarting the run to set a challenge with a console command of: ${command}`);
|
|
114
|
+
Isaac.ExecuteCommand(command);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.setChallenge = setChallenge;
|