isaacscript-common 87.9.7 → 87.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/index.rollup.d.ts +11 -11
- 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.d.ts +11 -11
- package/dist/interfaces/PlayerHealth.d.ts.map +1 -1
- 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
- package/src/interfaces/PlayerHealth.ts +12 -11
|
@@ -1,200 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// cspell:ignore addcharges
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
exports.eternalHearts = eternalHearts;
|
|
48
|
-
exports.flies = flies;
|
|
49
|
-
exports.flight = flight;
|
|
50
|
-
exports.fool = fool;
|
|
51
|
-
exports.getChallenge = getChallenge;
|
|
52
|
-
exports.getCharge = getCharge;
|
|
53
|
-
exports.getPosition = getPosition;
|
|
54
|
-
exports.giant = giant;
|
|
55
|
-
exports.gigaBomb = gigaBomb;
|
|
56
|
-
exports.goldBomb = goldBomb;
|
|
57
|
-
exports.goldenBomb = goldenBomb;
|
|
58
|
-
exports.goldenHearts = goldenHearts;
|
|
59
|
-
exports.goldenKey = goldenKey;
|
|
60
|
-
exports.goldenPill = goldenPill;
|
|
61
|
-
exports.goldenTrinket = goldenTrinket;
|
|
62
|
-
exports.goldHearts = goldHearts;
|
|
63
|
-
exports.goldKey = goldKey;
|
|
64
|
-
exports.goldPill = goldPill;
|
|
65
|
-
exports.goldTrinket = goldTrinket;
|
|
66
|
-
exports.grid = grid;
|
|
67
|
-
exports.grid2 = grid2;
|
|
68
|
-
exports.gridCosts = gridCosts;
|
|
69
|
-
exports.gridEntities = gridEntities;
|
|
70
|
-
exports.hearts = hearts;
|
|
71
|
-
exports.hitboxes = hitboxes;
|
|
72
|
-
exports.horse = horse;
|
|
73
|
-
exports.hush = hush;
|
|
74
|
-
exports.iAmErrorRoom = iAmErrorRoom;
|
|
75
|
-
exports.key = key;
|
|
76
|
-
exports.keys = keys;
|
|
77
|
-
exports.labyrinth = labyrinth;
|
|
78
|
-
exports.left = left;
|
|
79
|
-
exports.library = library;
|
|
80
|
-
exports.list = list;
|
|
81
|
-
exports.listAll = listAll;
|
|
82
|
-
exports.listGrid = listGrid;
|
|
83
|
-
exports.listGridAll = listGridAll;
|
|
84
|
-
exports.lost = lost;
|
|
85
|
-
exports.lowHP = lowHP;
|
|
86
|
-
exports.luck = luck;
|
|
87
|
-
exports.mana = mana;
|
|
88
|
-
exports.map = map;
|
|
89
|
-
exports.maxHearts = maxHearts;
|
|
90
|
-
exports.maze = maze;
|
|
91
|
-
exports.megaSatan = megaSatan;
|
|
92
|
-
exports.miniboss = miniboss;
|
|
93
|
-
exports.music = music;
|
|
94
|
-
exports.noCurses = noCurses;
|
|
95
|
-
exports.oneHP = oneHP;
|
|
96
|
-
exports.pill = pill;
|
|
97
|
-
exports.pills = pills;
|
|
98
|
-
exports.planetarium = planetarium;
|
|
99
|
-
exports.playSound = playSound;
|
|
100
|
-
exports.pocket = pocket;
|
|
101
|
-
exports.poop = poop;
|
|
102
|
-
exports.poopMana = poopMana;
|
|
103
|
-
exports.position = position;
|
|
104
|
-
exports.redHearts = redHearts;
|
|
105
|
-
exports.reloadRoom = reloadRoom;
|
|
106
|
-
exports.right = right;
|
|
107
|
-
exports.room = room;
|
|
108
|
-
exports.rottenHearts = rottenHearts;
|
|
109
|
-
exports.runTests = runTests;
|
|
110
|
-
exports.s = s;
|
|
111
|
-
exports.sacrificeRoom = sacrificeRoom;
|
|
112
|
-
exports.secretRoom = secretRoom;
|
|
113
|
-
exports.secretShop = secretShop;
|
|
114
|
-
exports.seeds = seeds;
|
|
115
|
-
exports.seedStick = seedStick;
|
|
116
|
-
exports.setCharges = setCharges;
|
|
117
|
-
exports.setPosition = setPosition;
|
|
118
|
-
exports.shop = shop;
|
|
119
|
-
exports.smelt = smelt;
|
|
120
|
-
exports.soulCharges = soulCharges;
|
|
121
|
-
exports.soulHearts = soulHearts;
|
|
122
|
-
exports.sound = sound;
|
|
123
|
-
exports.sounds = sounds;
|
|
124
|
-
exports.spam = spam;
|
|
125
|
-
exports.spawnCollectible = spawnCollectible;
|
|
126
|
-
exports.spawnCollectibleAt = spawnCollectibleAt;
|
|
127
|
-
exports.spawnGoldenTrinket = spawnGoldenTrinket;
|
|
128
|
-
exports.spawnGoldenTrinketAt = spawnGoldenTrinketAt;
|
|
129
|
-
exports.spawnGoldTrinket = spawnGoldTrinket;
|
|
130
|
-
exports.spawnTrinket = spawnTrinket;
|
|
131
|
-
exports.spawnTrinketAt = spawnTrinketAt;
|
|
132
|
-
exports.speed = speed;
|
|
133
|
-
exports.spikes = spikes;
|
|
134
|
-
exports.startingRoom = startingRoom;
|
|
135
|
-
exports.startRoom = startRoom;
|
|
136
|
-
exports.superSecretRoom = superSecretRoom;
|
|
137
|
-
exports.tears = tears;
|
|
138
|
-
exports.tests = tests;
|
|
139
|
-
exports.trapdoor = trapdoor;
|
|
140
|
-
exports.treasureRoom = treasureRoom;
|
|
141
|
-
exports.trinket = trinket;
|
|
142
|
-
exports.ultraSecretRoom = ultraSecretRoom;
|
|
143
|
-
exports.unknown = unknown;
|
|
144
|
-
exports.unseed = unseed;
|
|
145
|
-
exports.up = up;
|
|
146
|
-
exports.warp = warp;
|
|
147
|
-
exports.xl = xl;
|
|
148
|
-
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
149
|
-
const cachedEnumValues_1 = require("../../../../cachedEnumValues");
|
|
150
|
-
const cachedClasses_1 = require("../../../../core/cachedClasses");
|
|
151
|
-
const constants_1 = require("../../../../core/constants");
|
|
152
|
-
const constantsFirstLast_1 = require("../../../../core/constantsFirstLast");
|
|
153
|
-
const HealthType_1 = require("../../../../enums/HealthType");
|
|
154
|
-
const cards_1 = require("../../../../functions/cards");
|
|
155
|
-
const characters_1 = require("../../../../functions/characters");
|
|
156
|
-
const charge_1 = require("../../../../functions/charge");
|
|
157
|
-
const collectibles_1 = require("../../../../functions/collectibles");
|
|
158
|
-
const console_1 = require("../../../../functions/console");
|
|
159
|
-
const deepCopyTests_1 = require("../../../../functions/deepCopyTests");
|
|
160
|
-
const entitiesSpecific_1 = require("../../../../functions/entitiesSpecific");
|
|
161
|
-
const enums_1 = require("../../../../functions/enums");
|
|
162
|
-
const flag_1 = require("../../../../functions/flag");
|
|
163
|
-
const gridEntities_1 = require("../../../../functions/gridEntities");
|
|
164
|
-
const levelGrid_1 = require("../../../../functions/levelGrid");
|
|
165
|
-
const logMisc_1 = require("../../../../functions/logMisc");
|
|
166
|
-
const mergeTests_1 = require("../../../../functions/mergeTests");
|
|
167
|
-
const pickupsSpecific_1 = require("../../../../functions/pickupsSpecific");
|
|
168
|
-
const pills_1 = require("../../../../functions/pills");
|
|
169
|
-
const playerCollectibles_1 = require("../../../../functions/playerCollectibles");
|
|
170
|
-
const playerIndex_1 = require("../../../../functions/playerIndex");
|
|
171
|
-
const players_1 = require("../../../../functions/players");
|
|
172
|
-
const roomData_1 = require("../../../../functions/roomData");
|
|
173
|
-
const roomGrid_1 = require("../../../../functions/roomGrid");
|
|
174
|
-
const roomTransition_1 = require("../../../../functions/roomTransition");
|
|
175
|
-
const rooms_1 = require("../../../../functions/rooms");
|
|
176
|
-
const run_1 = require("../../../../functions/run");
|
|
177
|
-
const spawnCollectible_1 = require("../../../../functions/spawnCollectible");
|
|
178
|
-
const stage_1 = require("../../../../functions/stage");
|
|
179
|
-
const string_1 = require("../../../../functions/string");
|
|
180
|
-
const trinkets_1 = require("../../../../functions/trinkets");
|
|
181
|
-
const types_1 = require("../../../../functions/types");
|
|
182
|
-
const utils_1 = require("../../../../functions/utils");
|
|
183
|
-
const cardNameToTypeMap_1 = require("../../../../maps/cardNameToTypeMap");
|
|
184
|
-
const characterNameToTypeMap_1 = require("../../../../maps/characterNameToTypeMap");
|
|
185
|
-
const collectibleNameToTypeMap_1 = require("../../../../maps/collectibleNameToTypeMap");
|
|
186
|
-
const pillNameToEffectMap_1 = require("../../../../maps/pillNameToEffectMap");
|
|
187
|
-
const roomNameToTypeMap_1 = require("../../../../maps/roomNameToTypeMap");
|
|
188
|
-
const trinketNameToTypeMap_1 = require("../../../../maps/trinketNameToTypeMap");
|
|
189
|
-
const roomTypeNames_1 = require("../../../../objects/roomTypeNames");
|
|
190
|
-
const subroutines_1 = require("./subroutines");
|
|
191
|
-
const v_1 = require("./v");
|
|
2
|
+
import { ActiveSlot, BossID, CacheFlag, Challenge, CollectibleType, Direction, DisplayFlag, GameStateFlag, GridEntityType, GridRoom, LevelStage, PillColor, PlayerType, PocketItemSlot, RoomType, SoundEffect, StageType, } from "isaac-typescript-definitions";
|
|
3
|
+
import { GRID_ENTITY_TYPE_VALUES } from "../../../../cachedEnumValues";
|
|
4
|
+
import { game, sfxManager } from "../../../../core/cachedClasses";
|
|
5
|
+
import { DOGMA_ROOM_GRID_INDEX, MAX_LEVEL_GRID_INDEX, MAX_NUM_FAMILIARS, } from "../../../../core/constants";
|
|
6
|
+
import { FIRST_CARD_TYPE, FIRST_HORSE_PILL_COLOR, FIRST_PILL_COLOR, LAST_VANILLA_CARD_TYPE, } from "../../../../core/constantsFirstLast";
|
|
7
|
+
import { HealthType } from "../../../../enums/HealthType";
|
|
8
|
+
import { getCardName, isValidCardType } from "../../../../functions/cards";
|
|
9
|
+
import { getCharacterName } from "../../../../functions/characters";
|
|
10
|
+
import { addCharge, getTotalCharge } from "../../../../functions/charge";
|
|
11
|
+
import { isValidCollectibleType } from "../../../../functions/collectibles";
|
|
12
|
+
import { printEnabled } from "../../../../functions/console";
|
|
13
|
+
import { runDeepCopyTests } from "../../../../functions/deepCopyTests";
|
|
14
|
+
import { getNPCs } from "../../../../functions/entitiesSpecific";
|
|
15
|
+
import { isEnumValue } from "../../../../functions/enums";
|
|
16
|
+
import { addFlag } from "../../../../functions/flag";
|
|
17
|
+
import { spawnGridEntity } from "../../../../functions/gridEntities";
|
|
18
|
+
import { getRoomGridIndexesForType } from "../../../../functions/levelGrid";
|
|
19
|
+
import { logMusic, logPlayerEffects, logRoom, logSeedEffects, logSounds, } from "../../../../functions/logMisc";
|
|
20
|
+
import { runMergeTests } from "../../../../functions/mergeTests";
|
|
21
|
+
import { spawnCard, spawnPill, spawnTrinket as spawnTrinketFunction, } from "../../../../functions/pickupsSpecific";
|
|
22
|
+
import { getHorsePillColor, getPillEffectName, isValidPillEffect, } from "../../../../functions/pills";
|
|
23
|
+
import { addCollectibleCostume, removeCollectibleCostume, useActiveItemTemp, } from "../../../../functions/playerCollectibles";
|
|
24
|
+
import { getPlayers } from "../../../../functions/playerIndex";
|
|
25
|
+
import { getPlayerName } from "../../../../functions/players";
|
|
26
|
+
import { getRoomData } from "../../../../functions/roomData";
|
|
27
|
+
import { gridCoordinatesToWorldPosition } from "../../../../functions/roomGrid";
|
|
28
|
+
import { reloadRoom as reloadRoomFunction } from "../../../../functions/roomTransition";
|
|
29
|
+
import { changeRoom } from "../../../../functions/rooms";
|
|
30
|
+
import { onSetSeed, restart, setUnseeded } from "../../../../functions/run";
|
|
31
|
+
import { spawnCollectible as spawnCollectibleFunc } from "../../../../functions/spawnCollectible";
|
|
32
|
+
import { onStage, setStage } from "../../../../functions/stage";
|
|
33
|
+
import { getMapPartialMatch } from "../../../../functions/string";
|
|
34
|
+
import { getGoldenTrinketType, isValidTrinketType, } from "../../../../functions/trinkets";
|
|
35
|
+
import { parseIntSafe } from "../../../../functions/types";
|
|
36
|
+
import { iRange } from "../../../../functions/utils";
|
|
37
|
+
import { CARD_NAME_TO_TYPE_MAP } from "../../../../maps/cardNameToTypeMap";
|
|
38
|
+
import { CHARACTER_NAME_TO_TYPE_MAP } from "../../../../maps/characterNameToTypeMap";
|
|
39
|
+
import { COLLECTIBLE_NAME_TO_TYPE_MAP } from "../../../../maps/collectibleNameToTypeMap";
|
|
40
|
+
import { PILL_NAME_TO_EFFECT_MAP } from "../../../../maps/pillNameToEffectMap";
|
|
41
|
+
import { ROOM_NAME_TO_TYPE_MAP } from "../../../../maps/roomNameToTypeMap";
|
|
42
|
+
import { TRINKET_NAME_TO_TYPE_MAP } from "../../../../maps/trinketNameToTypeMap";
|
|
43
|
+
import { ROOM_TYPE_NAMES } from "../../../../objects/roomTypeNames";
|
|
44
|
+
import { addHeart, devilAngel, listEntities, listGridEntities, movePlayer, spawnTrapdoorOrCrawlSpace, warpNextToRoomType, warpToRoomType, } from "./subroutines";
|
|
45
|
+
import { v } from "./v";
|
|
192
46
|
/**
|
|
193
47
|
* Adds a single charge to the player's specified active item. You must provide the active slot
|
|
194
48
|
* number. Provide a second number to give a custom amount of charges. (You can use negative numbers
|
|
195
49
|
* to remove charge.)
|
|
196
50
|
*/
|
|
197
|
-
function addCharges(params) {
|
|
51
|
+
export function addCharges(params) {
|
|
198
52
|
if (params === "") {
|
|
199
53
|
print("You must specify a slot number. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)");
|
|
200
54
|
return;
|
|
@@ -208,14 +62,14 @@ function addCharges(params) {
|
|
|
208
62
|
if (activeSlotString === undefined) {
|
|
209
63
|
return;
|
|
210
64
|
}
|
|
211
|
-
const activeSlot =
|
|
212
|
-
if (activeSlot === undefined || !
|
|
65
|
+
const activeSlot = parseIntSafe(activeSlotString);
|
|
66
|
+
if (activeSlot === undefined || !isEnumValue(activeSlot, ActiveSlot)) {
|
|
213
67
|
print(`Invalid slot number: ${activeSlot}`);
|
|
214
68
|
return;
|
|
215
69
|
}
|
|
216
70
|
let numCharges = 1;
|
|
217
71
|
if (numChargeString !== undefined) {
|
|
218
|
-
const numChargesAttempt =
|
|
72
|
+
const numChargesAttempt = parseIntSafe(numChargeString);
|
|
219
73
|
if (numChargesAttempt === undefined) {
|
|
220
74
|
print(`Invalid charge amount: ${numChargeString}`);
|
|
221
75
|
return;
|
|
@@ -223,31 +77,31 @@ function addCharges(params) {
|
|
|
223
77
|
numCharges = numChargesAttempt;
|
|
224
78
|
}
|
|
225
79
|
const player = Isaac.GetPlayer();
|
|
226
|
-
|
|
80
|
+
addCharge(player, activeSlot, numCharges);
|
|
227
81
|
}
|
|
228
82
|
/**
|
|
229
83
|
* Warps to the Angel Room for the floor. If the Devil Room has already been visited or initialized,
|
|
230
84
|
* this will uninitialize it and make an Angel Room instead.
|
|
231
85
|
*/
|
|
232
|
-
function angelRoom() {
|
|
233
|
-
|
|
86
|
+
export function angelRoom() {
|
|
87
|
+
devilAngel(false);
|
|
234
88
|
}
|
|
235
89
|
/** Activates the flags for the Ascent (i.e. Backwards Path). */
|
|
236
|
-
function ascent() {
|
|
237
|
-
|
|
238
|
-
|
|
90
|
+
export function ascent() {
|
|
91
|
+
game.SetStateFlag(GameStateFlag.BACKWARDS_PATH_INIT, true);
|
|
92
|
+
game.SetStateFlag(GameStateFlag.BACKWARDS_PATH, true);
|
|
239
93
|
print("Set Ascent flags.");
|
|
240
94
|
}
|
|
241
95
|
/** Warps to the first Clean Bedroom or Dirty Bedroom on the floor. */
|
|
242
|
-
function bedroom() {
|
|
243
|
-
const cleanBedroomGridIndexes =
|
|
96
|
+
export function bedroom() {
|
|
97
|
+
const cleanBedroomGridIndexes = getRoomGridIndexesForType(RoomType.CLEAN_BEDROOM);
|
|
244
98
|
if (cleanBedroomGridIndexes.length > 0) {
|
|
245
|
-
|
|
99
|
+
warpToRoomType(RoomType.CLEAN_BEDROOM);
|
|
246
100
|
return;
|
|
247
101
|
}
|
|
248
|
-
const dirtyBedroomGridIndexes =
|
|
102
|
+
const dirtyBedroomGridIndexes = getRoomGridIndexesForType(RoomType.DIRTY_BEDROOM);
|
|
249
103
|
if (dirtyBedroomGridIndexes.length > 0) {
|
|
250
|
-
|
|
104
|
+
warpToRoomType(RoomType.DIRTY_BEDROOM);
|
|
251
105
|
return;
|
|
252
106
|
}
|
|
253
107
|
print("There are no Clean Bedrooms or Dirty Bedrooms on this floor.");
|
|
@@ -256,26 +110,26 @@ function bedroom() {
|
|
|
256
110
|
* Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
|
|
257
111
|
* negative numbers to remove hearts.)
|
|
258
112
|
*/
|
|
259
|
-
function blackHearts(params) {
|
|
260
|
-
|
|
113
|
+
export function blackHearts(params) {
|
|
114
|
+
addHeart(params, HealthType.BLACK);
|
|
261
115
|
}
|
|
262
116
|
/** Warps to the Black Market for the floor. */
|
|
263
|
-
function blackMarket() {
|
|
264
|
-
|
|
117
|
+
export function blackMarket() {
|
|
118
|
+
changeRoom(GridRoom.BLACK_MARKET);
|
|
265
119
|
}
|
|
266
120
|
/** Toggles permanent Curse of the Blind. */
|
|
267
|
-
function blind() {
|
|
268
|
-
|
|
269
|
-
|
|
121
|
+
export function blind() {
|
|
122
|
+
v.persistent.blind = !v.persistent.blind;
|
|
123
|
+
printEnabled(v.persistent.blind, "permanent Curse of the Blind");
|
|
270
124
|
}
|
|
271
125
|
/**
|
|
272
126
|
* Gives a blood charge. This only affects Bethany. Provide a number to give a custom amount of
|
|
273
127
|
* charges. (You can use negative numbers to remove charges.)
|
|
274
128
|
*/
|
|
275
|
-
function bloodCharges(params) {
|
|
129
|
+
export function bloodCharges(params) {
|
|
276
130
|
let charges = 1;
|
|
277
131
|
if (params !== "") {
|
|
278
|
-
const num =
|
|
132
|
+
const num = parseIntSafe(params);
|
|
279
133
|
if (num === undefined) {
|
|
280
134
|
print(`Invalid charge amount: ${num}`);
|
|
281
135
|
return;
|
|
@@ -286,17 +140,17 @@ function bloodCharges(params) {
|
|
|
286
140
|
player.AddBloodCharge(charges);
|
|
287
141
|
}
|
|
288
142
|
/** Alias for the "blackMarket" command. */
|
|
289
|
-
function bm() {
|
|
143
|
+
export function bm() {
|
|
290
144
|
blackMarket();
|
|
291
145
|
}
|
|
292
146
|
/**
|
|
293
147
|
* Gives a bomb. Provide a number to give a custom amount of bombs. (You can use negative numbers to
|
|
294
148
|
* remove bombs.)
|
|
295
149
|
*/
|
|
296
|
-
function bomb(params) {
|
|
150
|
+
export function bomb(params) {
|
|
297
151
|
let numBombs = 1;
|
|
298
152
|
if (params !== "") {
|
|
299
|
-
const num =
|
|
153
|
+
const num = parseIntSafe(params);
|
|
300
154
|
if (num === undefined) {
|
|
301
155
|
print(`Invalid bomb amount: ${num}`);
|
|
302
156
|
return;
|
|
@@ -310,10 +164,10 @@ function bomb(params) {
|
|
|
310
164
|
* Gives 99 bombs. Provide a number to give a custom amount of bombs. (You can use negative numbers
|
|
311
165
|
* to remove bombs.)
|
|
312
166
|
*/
|
|
313
|
-
function bombs(params) {
|
|
167
|
+
export function bombs(params) {
|
|
314
168
|
let numBombs = 99;
|
|
315
169
|
if (params !== "") {
|
|
316
|
-
const num =
|
|
170
|
+
const num = parseIntSafe(params);
|
|
317
171
|
if (num === undefined) {
|
|
318
172
|
print(`Invalid bomb amount: ${num}`);
|
|
319
173
|
return;
|
|
@@ -327,43 +181,43 @@ function bombs(params) {
|
|
|
327
181
|
* Gives a bone heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
328
182
|
* numbers to remove hearts.)
|
|
329
183
|
*/
|
|
330
|
-
function boneHearts(params) {
|
|
331
|
-
|
|
184
|
+
export function boneHearts(params) {
|
|
185
|
+
addHeart(params, HealthType.BONE);
|
|
332
186
|
}
|
|
333
187
|
/** Alias for the "bossRoom" command. */
|
|
334
|
-
function boss() {
|
|
188
|
+
export function boss() {
|
|
335
189
|
bossRoom();
|
|
336
190
|
}
|
|
337
191
|
/** Warps to the room next to the first Boss Room on the floor. */
|
|
338
|
-
function bossNextRoom() {
|
|
339
|
-
|
|
192
|
+
export function bossNextRoom() {
|
|
193
|
+
warpNextToRoomType(RoomType.BOSS);
|
|
340
194
|
}
|
|
341
195
|
/** Warps to the first Boss Room on the floor (or the Delirium Boss Room if on The Void). */
|
|
342
|
-
function bossRoom() {
|
|
196
|
+
export function bossRoom() {
|
|
343
197
|
// Most of the logic here is copied from the "warpToRoomType" function.
|
|
344
|
-
const roomType =
|
|
345
|
-
const roomGridIndexes =
|
|
346
|
-
const roomGridIndex =
|
|
347
|
-
? roomGridIndexes.find((thisRoomGridIndex) =>
|
|
198
|
+
const roomType = RoomType.BOSS;
|
|
199
|
+
const roomGridIndexes = getRoomGridIndexesForType(roomType);
|
|
200
|
+
const roomGridIndex = onStage(LevelStage.VOID)
|
|
201
|
+
? roomGridIndexes.find((thisRoomGridIndex) => getRoomData(thisRoomGridIndex)?.Subtype === BossID.DELIRIUM)
|
|
348
202
|
: roomGridIndexes[0];
|
|
349
|
-
const roomTypeName =
|
|
203
|
+
const roomTypeName = ROOM_TYPE_NAMES[RoomType.BOSS];
|
|
350
204
|
if (roomGridIndex === undefined) {
|
|
351
205
|
print(`There are no ${roomTypeName}s on this floor.`);
|
|
352
206
|
return;
|
|
353
207
|
}
|
|
354
|
-
|
|
208
|
+
changeRoom(roomGridIndex);
|
|
355
209
|
print(`Warped to room type: ${roomTypeName} (${roomType})`);
|
|
356
210
|
}
|
|
357
211
|
/** Warps to the Boss Rush for the floor. */
|
|
358
|
-
function bossRush() {
|
|
359
|
-
|
|
212
|
+
export function bossRush() {
|
|
213
|
+
changeRoom(GridRoom.BOSS_RUSH);
|
|
360
214
|
}
|
|
361
215
|
/**
|
|
362
216
|
* Gives a broken heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
363
217
|
* numbers to remove hearts.)
|
|
364
218
|
*/
|
|
365
|
-
function brokenHearts(params) {
|
|
366
|
-
|
|
219
|
+
export function brokenHearts(params) {
|
|
220
|
+
addHeart(params, HealthType.BROKEN);
|
|
367
221
|
}
|
|
368
222
|
/**
|
|
369
223
|
* Gives the specified card. Accepts either the card type or the partial name of the card.
|
|
@@ -372,15 +226,15 @@ function brokenHearts(params) {
|
|
|
372
226
|
* - card 5 - Gives The Emperor.
|
|
373
227
|
* - card spa - Gives 2 of Spades.
|
|
374
228
|
*/
|
|
375
|
-
function card(params) {
|
|
229
|
+
export function card(params) {
|
|
376
230
|
if (params === "") {
|
|
377
231
|
print("You must specify a card name or number.");
|
|
378
232
|
return;
|
|
379
233
|
}
|
|
380
234
|
let cardType;
|
|
381
|
-
const num =
|
|
235
|
+
const num = parseIntSafe(params);
|
|
382
236
|
if (num === undefined) {
|
|
383
|
-
const match =
|
|
237
|
+
const match = getMapPartialMatch(params, CARD_NAME_TO_TYPE_MAP);
|
|
384
238
|
if (match === undefined) {
|
|
385
239
|
print(`Unknown card: ${params}`);
|
|
386
240
|
return;
|
|
@@ -388,41 +242,41 @@ function card(params) {
|
|
|
388
242
|
cardType = match[1];
|
|
389
243
|
}
|
|
390
244
|
else {
|
|
391
|
-
if (!
|
|
245
|
+
if (!isValidCardType(num)) {
|
|
392
246
|
print(`Invalid card type: ${num}`);
|
|
393
247
|
return;
|
|
394
248
|
}
|
|
395
249
|
cardType = num;
|
|
396
250
|
}
|
|
397
|
-
const cardName =
|
|
251
|
+
const cardName = getCardName(cardType);
|
|
398
252
|
Isaac.ExecuteCommand(`g k${cardType}`);
|
|
399
253
|
print(`Gave card: ${cardName} (${cardType})`);
|
|
400
254
|
}
|
|
401
255
|
/** Spawns every card on the ground, starting at the top-left-most tile. */
|
|
402
|
-
function cards() {
|
|
403
|
-
let cardType =
|
|
256
|
+
export function cards() {
|
|
257
|
+
let cardType = FIRST_CARD_TYPE;
|
|
404
258
|
for (let y = 0; y <= 6; y++) {
|
|
405
259
|
for (let x = 0; x <= 12; x++) {
|
|
406
|
-
if (cardType >
|
|
260
|
+
if (cardType > LAST_VANILLA_CARD_TYPE) {
|
|
407
261
|
return;
|
|
408
262
|
}
|
|
409
|
-
const worldPosition =
|
|
410
|
-
|
|
263
|
+
const worldPosition = gridCoordinatesToWorldPosition(x, y);
|
|
264
|
+
spawnCard(cardType, worldPosition);
|
|
411
265
|
cardType++; // eslint-disable-line complete/strict-enums
|
|
412
266
|
}
|
|
413
267
|
}
|
|
414
268
|
}
|
|
415
269
|
/** Alias for the "chaosCardTears" command. */
|
|
416
|
-
function cc() {
|
|
270
|
+
export function cc() {
|
|
417
271
|
chaosCardTears();
|
|
418
272
|
}
|
|
419
273
|
/**
|
|
420
274
|
* Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
|
|
421
275
|
* "debug 10".
|
|
422
276
|
*/
|
|
423
|
-
function chaosCardTears() {
|
|
424
|
-
|
|
425
|
-
|
|
277
|
+
export function chaosCardTears() {
|
|
278
|
+
v.persistent.chaosCardTears = !v.persistent.chaosCardTears;
|
|
279
|
+
printEnabled(v.persistent.chaosCardTears, "Chaos Card tears");
|
|
426
280
|
}
|
|
427
281
|
/**
|
|
428
282
|
* Restart as the specified character. Accepts either the character sub-type or the partial name of
|
|
@@ -432,15 +286,15 @@ function chaosCardTears() {
|
|
|
432
286
|
* - character 2 - Restarts as Cain.
|
|
433
287
|
* - character ta - Restarts as Tainted Azazel.
|
|
434
288
|
*/
|
|
435
|
-
function character(params) {
|
|
289
|
+
export function character(params) {
|
|
436
290
|
if (params === "") {
|
|
437
291
|
print("You must specify a character name or number.");
|
|
438
292
|
return;
|
|
439
293
|
}
|
|
440
294
|
let playerType;
|
|
441
|
-
const num =
|
|
295
|
+
const num = parseIntSafe(params);
|
|
442
296
|
if (num === undefined) {
|
|
443
|
-
const match =
|
|
297
|
+
const match = getMapPartialMatch(params, CHARACTER_NAME_TO_TYPE_MAP);
|
|
444
298
|
if (match === undefined) {
|
|
445
299
|
print(`Unknown character: ${params}`);
|
|
446
300
|
return;
|
|
@@ -448,32 +302,32 @@ function character(params) {
|
|
|
448
302
|
playerType = match[1];
|
|
449
303
|
}
|
|
450
304
|
else {
|
|
451
|
-
if (!
|
|
305
|
+
if (!isEnumValue(num, PlayerType) || num === PlayerType.POSSESSOR) {
|
|
452
306
|
print(`Invalid character number: ${num}`);
|
|
453
307
|
return;
|
|
454
308
|
}
|
|
455
309
|
playerType = num;
|
|
456
310
|
}
|
|
457
|
-
const characterName =
|
|
458
|
-
|
|
311
|
+
const characterName = getCharacterName(playerType);
|
|
312
|
+
restart(playerType);
|
|
459
313
|
print(`Restarting as character: ${characterName} (${playerType})`);
|
|
460
314
|
}
|
|
461
315
|
/** Alias for the "addCharges" command. */
|
|
462
|
-
function charge(params) {
|
|
316
|
+
export function charge(params) {
|
|
463
317
|
addCharges(params);
|
|
464
318
|
}
|
|
465
319
|
/** Warps to the first Clean Bedroom on the floor. */
|
|
466
|
-
function cleanBedroom() {
|
|
467
|
-
|
|
320
|
+
export function cleanBedroom() {
|
|
321
|
+
warpToRoomType(RoomType.CLEAN_BEDROOM);
|
|
468
322
|
}
|
|
469
323
|
/**
|
|
470
324
|
* Gives a coin. Provide a number to give a custom amount of coins. (You can use negative numbers to
|
|
471
325
|
* remove coins.)
|
|
472
326
|
*/
|
|
473
|
-
function coin(params) {
|
|
327
|
+
export function coin(params) {
|
|
474
328
|
let numCoins = 1;
|
|
475
329
|
if (params !== "") {
|
|
476
|
-
const num =
|
|
330
|
+
const num = parseIntSafe(params);
|
|
477
331
|
if (num === undefined) {
|
|
478
332
|
print(`Invalid coin amount: ${num}`);
|
|
479
333
|
return;
|
|
@@ -487,10 +341,10 @@ function coin(params) {
|
|
|
487
341
|
* Gives 999 coins. Provide a number to give a custom amount of coins. (You can use negative numbers
|
|
488
342
|
* to remove coins.)
|
|
489
343
|
*/
|
|
490
|
-
function coins(params) {
|
|
344
|
+
export function coins(params) {
|
|
491
345
|
let numCoins = 999;
|
|
492
346
|
if (params !== "") {
|
|
493
|
-
const num =
|
|
347
|
+
const num = parseIntSafe(params);
|
|
494
348
|
if (num === undefined) {
|
|
495
349
|
print(`Invalid coin amount: ${num}`);
|
|
496
350
|
return;
|
|
@@ -501,143 +355,143 @@ function coins(params) {
|
|
|
501
355
|
player.AddCoins(numCoins);
|
|
502
356
|
}
|
|
503
357
|
/** Alias for the "spawnCollectible" command. */
|
|
504
|
-
function collectible(params) {
|
|
358
|
+
export function collectible(params) {
|
|
505
359
|
spawnCollectible(params);
|
|
506
360
|
}
|
|
507
361
|
/** Creates a crawl space next to the player. */
|
|
508
|
-
function crawlSpace() {
|
|
509
|
-
|
|
362
|
+
export function crawlSpace() {
|
|
363
|
+
spawnTrapdoorOrCrawlSpace(false);
|
|
510
364
|
}
|
|
511
365
|
/** Toggles permanent Curse of the Cursed. */
|
|
512
|
-
function cursed() {
|
|
513
|
-
|
|
514
|
-
|
|
366
|
+
export function cursed() {
|
|
367
|
+
v.persistent.cursed = !v.persistent.cursed;
|
|
368
|
+
printEnabled(v.persistent.cursed, "permanent Curse of the Cursed");
|
|
515
369
|
}
|
|
516
370
|
/** Uses the D20. */
|
|
517
|
-
function d20() {
|
|
371
|
+
export function d20() {
|
|
518
372
|
const player = Isaac.GetPlayer();
|
|
519
|
-
|
|
373
|
+
useActiveItemTemp(player, CollectibleType.D20);
|
|
520
374
|
}
|
|
521
375
|
/** Uses the D6. */
|
|
522
|
-
function d6() {
|
|
376
|
+
export function d6() {
|
|
523
377
|
const player = Isaac.GetPlayer();
|
|
524
|
-
|
|
378
|
+
useActiveItemTemp(player, CollectibleType.D6);
|
|
525
379
|
}
|
|
526
380
|
/** Warps to the Mausoleum 2 Boss Room that has Dad's Note in it. */
|
|
527
|
-
function dadsNote() {
|
|
528
|
-
|
|
529
|
-
|
|
381
|
+
export function dadsNote() {
|
|
382
|
+
game.SetStateFlag(GameStateFlag.BACKWARDS_PATH_INIT, true);
|
|
383
|
+
setStage(LevelStage.DEPTHS_2, StageType.REPENTANCE);
|
|
530
384
|
bossRoom();
|
|
531
385
|
}
|
|
532
386
|
/**
|
|
533
387
|
* Toggles a set damage stat for the player. You can provide an optional argument to this command in
|
|
534
388
|
* order to set the damage to a specific amount. Default is 500.
|
|
535
389
|
*/
|
|
536
|
-
function damage(params) {
|
|
390
|
+
export function damage(params) {
|
|
537
391
|
if (params !== "") {
|
|
538
392
|
const num = tonumber(params); // Can be a float.
|
|
539
393
|
if (num === undefined) {
|
|
540
394
|
print(`Invalid damage amount: ${params}`);
|
|
541
395
|
return;
|
|
542
396
|
}
|
|
543
|
-
|
|
397
|
+
v.persistent.damageAmount = num;
|
|
544
398
|
}
|
|
545
|
-
|
|
399
|
+
v.persistent.damage = !v.persistent.damage;
|
|
546
400
|
const player = Isaac.GetPlayer();
|
|
547
|
-
player.AddCacheFlags(
|
|
401
|
+
player.AddCacheFlags(CacheFlag.DAMAGE);
|
|
548
402
|
player.EvaluateItems();
|
|
549
|
-
|
|
403
|
+
printEnabled(v.persistent.damage, "set damage");
|
|
550
404
|
}
|
|
551
405
|
/** Toggles permanent Curse of Darkness. */
|
|
552
|
-
function darkness() {
|
|
553
|
-
|
|
554
|
-
|
|
406
|
+
export function darkness() {
|
|
407
|
+
v.persistent.darkness = !v.persistent.darkness;
|
|
408
|
+
printEnabled(v.persistent.darkness, "permanent Curse of Darkness");
|
|
555
409
|
}
|
|
556
410
|
/** Alias for the "devil" command. */
|
|
557
|
-
function dd() {
|
|
411
|
+
export function dd() {
|
|
558
412
|
devilRoom();
|
|
559
413
|
}
|
|
560
414
|
/**
|
|
561
415
|
* Warps to the Devil Room for the floor. If the Angel Room has already been visited or initialized,
|
|
562
416
|
* this will uninitialize it and make an Devil Room instead.
|
|
563
417
|
*/
|
|
564
|
-
function devilRoom() {
|
|
565
|
-
|
|
418
|
+
export function devilRoom() {
|
|
419
|
+
devilAngel(true);
|
|
566
420
|
}
|
|
567
421
|
/** Warps to the first Dirty Bedroom on the floor. */
|
|
568
|
-
function dirtyBedroom() {
|
|
569
|
-
|
|
422
|
+
export function dirtyBedroom() {
|
|
423
|
+
warpToRoomType(RoomType.DIRTY_BEDROOM);
|
|
570
424
|
}
|
|
571
425
|
/** Toggles whether curses can appear. */
|
|
572
|
-
function disableCurses() {
|
|
573
|
-
|
|
574
|
-
|
|
426
|
+
export function disableCurses() {
|
|
427
|
+
v.persistent.disableCurses = !v.persistent.disableCurses;
|
|
428
|
+
printEnabled(!v.persistent.disableCurses, "curses");
|
|
575
429
|
}
|
|
576
430
|
/** Warps to the Dogma Boss Room. */
|
|
577
|
-
function dogma() {
|
|
578
|
-
|
|
579
|
-
|
|
431
|
+
export function dogma() {
|
|
432
|
+
setStage(LevelStage.HOME, StageType.WRATH_OF_THE_LAMB);
|
|
433
|
+
changeRoom(DOGMA_ROOM_GRID_INDEX);
|
|
580
434
|
}
|
|
581
435
|
/** Moves the player 0.5 units down. Provide a number to move a custom amount of units. */
|
|
582
|
-
function down(params) {
|
|
583
|
-
|
|
436
|
+
export function down(params) {
|
|
437
|
+
movePlayer(params, Direction.DOWN);
|
|
584
438
|
}
|
|
585
439
|
/** Warps to the Dungeon (i.e. the crawl space room) for the floor. */
|
|
586
|
-
function dungeon() {
|
|
587
|
-
|
|
440
|
+
export function dungeon() {
|
|
441
|
+
changeRoom(GridRoom.DUNGEON);
|
|
588
442
|
}
|
|
589
443
|
/** Logs the player's current temporary effects to the "log.txt" file. */
|
|
590
|
-
function effects() {
|
|
444
|
+
export function effects() {
|
|
591
445
|
const player = Isaac.GetPlayer();
|
|
592
|
-
|
|
446
|
+
logPlayerEffects(player);
|
|
593
447
|
print('Logged the player\'s effects to the "log.txt" file.');
|
|
594
448
|
}
|
|
595
449
|
/** Alias for the "iAmError" command. */
|
|
596
|
-
function errorRoom() {
|
|
450
|
+
export function errorRoom() {
|
|
597
451
|
iAmErrorRoom();
|
|
598
452
|
}
|
|
599
453
|
/**
|
|
600
454
|
* Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
601
455
|
* numbers to remove hearts.)
|
|
602
456
|
*/
|
|
603
|
-
function eternalHearts(params) {
|
|
604
|
-
|
|
457
|
+
export function eternalHearts(params) {
|
|
458
|
+
addHeart(params, HealthType.ETERNAL);
|
|
605
459
|
}
|
|
606
460
|
/** Grants the maximum amount of blue flies to the player. */
|
|
607
|
-
function flies() {
|
|
461
|
+
export function flies() {
|
|
608
462
|
const player = Isaac.GetPlayer();
|
|
609
|
-
player.AddBlueFlies(
|
|
463
|
+
player.AddBlueFlies(MAX_NUM_FAMILIARS, player.Position, undefined);
|
|
610
464
|
}
|
|
611
465
|
/** Toggles flight for the player. */
|
|
612
|
-
function flight(params) {
|
|
466
|
+
export function flight(params) {
|
|
613
467
|
const player = Isaac.GetPlayer();
|
|
614
|
-
|
|
468
|
+
v.persistent.flight = !v.persistent.flight;
|
|
615
469
|
// Optionally, allow the toggle to be overridden by a parameter.
|
|
616
470
|
if (params === "true") {
|
|
617
|
-
|
|
471
|
+
v.persistent.flight = true;
|
|
618
472
|
}
|
|
619
473
|
else if (params === "false") {
|
|
620
|
-
|
|
474
|
+
v.persistent.flight = false;
|
|
621
475
|
}
|
|
622
|
-
player.AddCacheFlags(
|
|
476
|
+
player.AddCacheFlags(CacheFlag.FLYING);
|
|
623
477
|
player.EvaluateItems();
|
|
624
|
-
const collectibleUsedToShowFlight =
|
|
625
|
-
if (
|
|
626
|
-
|
|
478
|
+
const collectibleUsedToShowFlight = CollectibleType.FATE;
|
|
479
|
+
if (v.persistent.flight) {
|
|
480
|
+
addCollectibleCostume(player, collectibleUsedToShowFlight);
|
|
627
481
|
}
|
|
628
482
|
else {
|
|
629
|
-
|
|
483
|
+
removeCollectibleCostume(player, collectibleUsedToShowFlight);
|
|
630
484
|
}
|
|
631
|
-
|
|
485
|
+
printEnabled(v.persistent.flight, "flight");
|
|
632
486
|
}
|
|
633
487
|
/** Alias for the "startingRoom" command. */
|
|
634
|
-
function fool() {
|
|
488
|
+
export function fool() {
|
|
635
489
|
startingRoom();
|
|
636
490
|
}
|
|
637
491
|
/** Displays the current challenge, if any. */
|
|
638
|
-
function getChallenge() {
|
|
492
|
+
export function getChallenge() {
|
|
639
493
|
const challenge = Isaac.GetChallenge();
|
|
640
|
-
const challengeName =
|
|
494
|
+
const challengeName = Challenge[challenge];
|
|
641
495
|
const challengeDescription =
|
|
642
496
|
// Handle modded challenges.
|
|
643
497
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
@@ -647,40 +501,40 @@ function getChallenge() {
|
|
|
647
501
|
print(`The current challenge is: ${challengeDescription}`);
|
|
648
502
|
}
|
|
649
503
|
/** Prints the charge for the specified slot. By default, will use `ActiveSlot.PRIMARY`. */
|
|
650
|
-
function getCharge(params) {
|
|
651
|
-
let activeSlot =
|
|
504
|
+
export function getCharge(params) {
|
|
505
|
+
let activeSlot = ActiveSlot.PRIMARY;
|
|
652
506
|
if (params !== "") {
|
|
653
|
-
const num =
|
|
654
|
-
if (num === undefined || !
|
|
507
|
+
const num = parseIntSafe(params);
|
|
508
|
+
if (num === undefined || !isEnumValue(num, ActiveSlot)) {
|
|
655
509
|
print(`Invalid slot number: ${params}`);
|
|
656
510
|
return;
|
|
657
511
|
}
|
|
658
512
|
activeSlot = num;
|
|
659
513
|
}
|
|
660
514
|
const player = Isaac.GetPlayer();
|
|
661
|
-
const totalCharge =
|
|
662
|
-
print(`Total charge for ActiveSlot.${
|
|
515
|
+
const totalCharge = getTotalCharge(player, activeSlot);
|
|
516
|
+
print(`Total charge for ActiveSlot.${ActiveSlot[activeSlot]} (${activeSlot}) is: ${totalCharge}`);
|
|
663
517
|
}
|
|
664
518
|
/** Prints the current position of all players. */
|
|
665
|
-
function getPosition() {
|
|
666
|
-
for (const player of
|
|
667
|
-
const playerName =
|
|
519
|
+
export function getPosition() {
|
|
520
|
+
for (const player of getPlayers()) {
|
|
521
|
+
const playerName = getPlayerName(player);
|
|
668
522
|
print(`Player position for ${playerName}: (${player.Position.X}, ${player.Position.Y})`);
|
|
669
523
|
}
|
|
670
524
|
}
|
|
671
525
|
/** Toggles permanent Curse of the Giant. */
|
|
672
|
-
function giant() {
|
|
673
|
-
|
|
674
|
-
|
|
526
|
+
export function giant() {
|
|
527
|
+
v.persistent.giant = !v.persistent.giant;
|
|
528
|
+
printEnabled(v.persistent.giant, "permanent Curse of the Giant");
|
|
675
529
|
}
|
|
676
530
|
/**
|
|
677
531
|
* Gives a Giga Bomb. Provide a number to give a custom amount of Giga Bombs. (You can use negative
|
|
678
532
|
* numbers to remove bombs.)
|
|
679
533
|
*/
|
|
680
|
-
function gigaBomb(params) {
|
|
534
|
+
export function gigaBomb(params) {
|
|
681
535
|
let numBombs = 1;
|
|
682
536
|
if (params !== "") {
|
|
683
|
-
const num =
|
|
537
|
+
const num = parseIntSafe(params);
|
|
684
538
|
if (num === undefined) {
|
|
685
539
|
print(`Invalid Giga Bomb amount: ${num}`);
|
|
686
540
|
return;
|
|
@@ -691,11 +545,11 @@ function gigaBomb(params) {
|
|
|
691
545
|
player.AddGigaBombs(numBombs);
|
|
692
546
|
}
|
|
693
547
|
/** Alias for the "goldenBomb" command. */
|
|
694
|
-
function goldBomb() {
|
|
548
|
+
export function goldBomb() {
|
|
695
549
|
goldenBomb();
|
|
696
550
|
}
|
|
697
551
|
/** Gives the player a golden bomb. */
|
|
698
|
-
function goldenBomb() {
|
|
552
|
+
export function goldenBomb() {
|
|
699
553
|
const player = Isaac.GetPlayer();
|
|
700
554
|
player.AddGoldenBomb();
|
|
701
555
|
}
|
|
@@ -703,66 +557,66 @@ function goldenBomb() {
|
|
|
703
557
|
* Gives a golden heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
704
558
|
* numbers to remove hearts.)
|
|
705
559
|
*/
|
|
706
|
-
function goldenHearts(params) {
|
|
707
|
-
|
|
560
|
+
export function goldenHearts(params) {
|
|
561
|
+
addHeart(params, HealthType.GOLDEN);
|
|
708
562
|
}
|
|
709
563
|
/** Gives the player a golden key. */
|
|
710
|
-
function goldenKey() {
|
|
564
|
+
export function goldenKey() {
|
|
711
565
|
const player = Isaac.GetPlayer();
|
|
712
566
|
player.AddGoldenKey();
|
|
713
567
|
}
|
|
714
568
|
/** Gives the player a golden pill. */
|
|
715
|
-
function goldenPill() {
|
|
569
|
+
export function goldenPill() {
|
|
716
570
|
const player = Isaac.GetPlayer();
|
|
717
|
-
player.AddPill(
|
|
571
|
+
player.AddPill(PillColor.GOLD);
|
|
718
572
|
}
|
|
719
573
|
/** Alias for the "spawnGoldenTrinket" command. */
|
|
720
|
-
function goldenTrinket(params) {
|
|
574
|
+
export function goldenTrinket(params) {
|
|
721
575
|
spawnGoldenTrinket(params);
|
|
722
576
|
}
|
|
723
577
|
/** Alias for the "goldenHearts" command. */
|
|
724
|
-
function goldHearts(params) {
|
|
578
|
+
export function goldHearts(params) {
|
|
725
579
|
goldenHearts(params);
|
|
726
580
|
}
|
|
727
581
|
/** Alias for the "goldenKey" command. */
|
|
728
|
-
function goldKey() {
|
|
582
|
+
export function goldKey() {
|
|
729
583
|
goldenKey();
|
|
730
584
|
}
|
|
731
585
|
/** Alias for the "goldenPill" command. */
|
|
732
|
-
function goldPill() {
|
|
586
|
+
export function goldPill() {
|
|
733
587
|
goldenPill();
|
|
734
588
|
}
|
|
735
589
|
/** Alias for the "spawnGoldenTrinket" command. */
|
|
736
|
-
function goldTrinket(params) {
|
|
590
|
+
export function goldTrinket(params) {
|
|
737
591
|
spawnGoldenTrinket(params);
|
|
738
592
|
}
|
|
739
593
|
/**
|
|
740
594
|
* Alias for the "debug 11" command. Useful for seeing the coordinates and grid index of each tile
|
|
741
595
|
* in the room.
|
|
742
596
|
*/
|
|
743
|
-
function grid() {
|
|
597
|
+
export function grid() {
|
|
744
598
|
Isaac.ExecuteCommand("debug 11");
|
|
745
599
|
}
|
|
746
600
|
/** Alias for the "gridCosts" command. */
|
|
747
|
-
function grid2() {
|
|
601
|
+
export function grid2() {
|
|
748
602
|
gridCosts();
|
|
749
603
|
}
|
|
750
604
|
/** Alias for the "debug 2" command. Useful for seeing the grid costs of each tile in the room. */
|
|
751
|
-
function gridCosts() {
|
|
605
|
+
export function gridCosts() {
|
|
752
606
|
Isaac.ExecuteCommand("debug 2");
|
|
753
607
|
}
|
|
754
608
|
/** Spawns every grid entity, starting at the top-left-most tile. */
|
|
755
|
-
function gridEntities() {
|
|
609
|
+
export function gridEntities() {
|
|
756
610
|
let gridEntityTypeIndex = -1;
|
|
757
611
|
for (let y = 0; y <= 6; y++) {
|
|
758
612
|
for (let x = 0; x <= 12; x++) {
|
|
759
613
|
gridEntityTypeIndex++;
|
|
760
|
-
const gridEntityType =
|
|
614
|
+
const gridEntityType = GRID_ENTITY_TYPE_VALUES[gridEntityTypeIndex];
|
|
761
615
|
if (gridEntityType === undefined) {
|
|
762
616
|
return;
|
|
763
617
|
}
|
|
764
|
-
const worldPosition =
|
|
765
|
-
|
|
618
|
+
const worldPosition = gridCoordinatesToWorldPosition(x, y);
|
|
619
|
+
spawnGridEntity(gridEntityType, worldPosition);
|
|
766
620
|
}
|
|
767
621
|
}
|
|
768
622
|
}
|
|
@@ -770,34 +624,34 @@ function gridEntities() {
|
|
|
770
624
|
* Gives a half red heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
771
625
|
* numbers to remove hearts.)
|
|
772
626
|
*/
|
|
773
|
-
function hearts(params) {
|
|
774
|
-
|
|
627
|
+
export function hearts(params) {
|
|
628
|
+
addHeart(params, HealthType.RED);
|
|
775
629
|
}
|
|
776
630
|
/** Alias for the "debug 6" command. */
|
|
777
|
-
function hitboxes() {
|
|
631
|
+
export function hitboxes() {
|
|
778
632
|
Isaac.ExecuteCommand("debug 6");
|
|
779
633
|
}
|
|
780
634
|
/** The same thing as the `pill` command, but gives a horse pill instead of a normal pill. */
|
|
781
|
-
function horse(params) {
|
|
635
|
+
export function horse(params) {
|
|
782
636
|
pill(params, true);
|
|
783
637
|
}
|
|
784
638
|
/** Warps to the Blue Womb Boss Room. */
|
|
785
|
-
function hush() {
|
|
786
|
-
|
|
639
|
+
export function hush() {
|
|
640
|
+
setStage(LevelStage.BLUE_WOMB, StageType.ORIGINAL);
|
|
787
641
|
bossRoom();
|
|
788
642
|
}
|
|
789
643
|
/** Warps to the I AM ERROR room for the floor. */
|
|
790
|
-
function iAmErrorRoom() {
|
|
791
|
-
|
|
644
|
+
export function iAmErrorRoom() {
|
|
645
|
+
changeRoom(GridRoom.ERROR);
|
|
792
646
|
}
|
|
793
647
|
/**
|
|
794
648
|
* Gives a key. Provide a number to give a custom amount of key. (You can use negative numbers to
|
|
795
649
|
* remove keys.)
|
|
796
650
|
*/
|
|
797
|
-
function key(params) {
|
|
651
|
+
export function key(params) {
|
|
798
652
|
let numKeys = 1;
|
|
799
653
|
if (params !== "") {
|
|
800
|
-
const num =
|
|
654
|
+
const num = parseIntSafe(params);
|
|
801
655
|
if (num === undefined) {
|
|
802
656
|
print(`Invalid key amount: ${num}`);
|
|
803
657
|
return;
|
|
@@ -811,10 +665,10 @@ function key(params) {
|
|
|
811
665
|
* Gives 99 keys. Provide a number to give a custom amount of coins. (You can use negative numbers
|
|
812
666
|
* to remove keys.)
|
|
813
667
|
*/
|
|
814
|
-
function keys(params) {
|
|
668
|
+
export function keys(params) {
|
|
815
669
|
let numKeys = 99;
|
|
816
670
|
if (params !== "") {
|
|
817
|
-
const num =
|
|
671
|
+
const num = parseIntSafe(params);
|
|
818
672
|
if (num === undefined) {
|
|
819
673
|
print(`Invalid key amount: ${num}`);
|
|
820
674
|
return;
|
|
@@ -825,17 +679,17 @@ function keys(params) {
|
|
|
825
679
|
player.AddKeys(numKeys);
|
|
826
680
|
}
|
|
827
681
|
/** Toggles permanent Curse of the Labyrinth. */
|
|
828
|
-
function labyrinth() {
|
|
829
|
-
|
|
830
|
-
|
|
682
|
+
export function labyrinth() {
|
|
683
|
+
v.persistent.labyrinth = !v.persistent.labyrinth;
|
|
684
|
+
printEnabled(v.persistent.labyrinth, "permanent Curse of the Labyrinth");
|
|
831
685
|
}
|
|
832
686
|
/** Moves the player 0.5 units left. Provide a number to move a custom amount of units. */
|
|
833
|
-
function left(params) {
|
|
834
|
-
|
|
687
|
+
export function left(params) {
|
|
688
|
+
movePlayer(params, Direction.LEFT);
|
|
835
689
|
}
|
|
836
690
|
/** Warps to the first Library on the floor. */
|
|
837
|
-
function library() {
|
|
838
|
-
|
|
691
|
+
export function library() {
|
|
692
|
+
warpToRoomType(RoomType.LIBRARY);
|
|
839
693
|
}
|
|
840
694
|
/**
|
|
841
695
|
* Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
|
|
@@ -844,15 +698,15 @@ function library() {
|
|
|
844
698
|
* By default, this command will exclude background effects. If that is not desired, use the
|
|
845
699
|
* "listAll" command instead.
|
|
846
700
|
*/
|
|
847
|
-
function list(params) {
|
|
848
|
-
|
|
701
|
+
export function list(params) {
|
|
702
|
+
listEntities(params, false);
|
|
849
703
|
}
|
|
850
704
|
/**
|
|
851
705
|
* Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
|
|
852
706
|
* `EntityType`.
|
|
853
707
|
*/
|
|
854
|
-
function listAll(params) {
|
|
855
|
-
|
|
708
|
+
export function listAll(params) {
|
|
709
|
+
listEntities(params, true);
|
|
856
710
|
}
|
|
857
711
|
/**
|
|
858
712
|
* Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
|
|
@@ -861,40 +715,40 @@ function listAll(params) {
|
|
|
861
715
|
* By default, this command will exclude walls. If that is not desired, use the "listGridAll"
|
|
862
716
|
* command instead.
|
|
863
717
|
*/
|
|
864
|
-
function listGrid(params) {
|
|
865
|
-
|
|
718
|
+
export function listGrid(params) {
|
|
719
|
+
listGridEntities(params, false);
|
|
866
720
|
}
|
|
867
721
|
/**
|
|
868
722
|
* Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
|
|
869
723
|
* specific `GridEntityType`.
|
|
870
724
|
*/
|
|
871
|
-
function listGridAll(params) {
|
|
872
|
-
|
|
725
|
+
export function listGridAll(params) {
|
|
726
|
+
listGridEntities(params, true);
|
|
873
727
|
}
|
|
874
728
|
/** Toggles permanent Curse of the Lost. */
|
|
875
|
-
function lost() {
|
|
876
|
-
|
|
877
|
-
|
|
729
|
+
export function lost() {
|
|
730
|
+
v.persistent.lost = !v.persistent.lost;
|
|
731
|
+
printEnabled(v.persistent.lost, "permanent Curse of the Lost");
|
|
878
732
|
}
|
|
879
733
|
/** Alias for the "1hp" command. */
|
|
880
|
-
function lowHP() {
|
|
734
|
+
export function lowHP() {
|
|
881
735
|
oneHP();
|
|
882
736
|
}
|
|
883
737
|
/** Alias for "debug 9". */
|
|
884
|
-
function luck() {
|
|
738
|
+
export function luck() {
|
|
885
739
|
Isaac.ExecuteCommand("debug 9");
|
|
886
740
|
}
|
|
887
741
|
/** Alias for the "poopMana" command. */
|
|
888
|
-
function mana(params) {
|
|
742
|
+
export function mana(params) {
|
|
889
743
|
poopMana(params);
|
|
890
744
|
}
|
|
891
745
|
/** Completely reveals the entire map, including the Ultra Secret Room. */
|
|
892
|
-
function map() {
|
|
893
|
-
const level =
|
|
894
|
-
const displayFlags =
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
for (const roomGridIndex of
|
|
746
|
+
export function map() {
|
|
747
|
+
const level = game.GetLevel();
|
|
748
|
+
const displayFlags = addFlag(DisplayFlag.VISIBLE, // 1 << 0
|
|
749
|
+
DisplayFlag.SHADOW, // 1 << 1
|
|
750
|
+
DisplayFlag.SHOW_ICON);
|
|
751
|
+
for (const roomGridIndex of iRange(MAX_LEVEL_GRID_INDEX)) {
|
|
898
752
|
const roomDesc = level.GetRoomByIdx(roomGridIndex);
|
|
899
753
|
roomDesc.DisplayFlags = displayFlags;
|
|
900
754
|
}
|
|
@@ -905,34 +759,34 @@ function map() {
|
|
|
905
759
|
* Gives a heart container. Provide a number to give a custom amount of heart containers. (You can
|
|
906
760
|
* use negative numbers to remove heart containers.)
|
|
907
761
|
*/
|
|
908
|
-
function maxHearts(params) {
|
|
909
|
-
|
|
762
|
+
export function maxHearts(params) {
|
|
763
|
+
addHeart(params, HealthType.MAX_HEARTS);
|
|
910
764
|
}
|
|
911
765
|
/** Toggles permanent Curse of the Maze. */
|
|
912
|
-
function maze() {
|
|
913
|
-
|
|
914
|
-
|
|
766
|
+
export function maze() {
|
|
767
|
+
v.persistent.maze = !v.persistent.maze;
|
|
768
|
+
printEnabled(v.persistent.maze, "permanent Curse of the Maze");
|
|
915
769
|
}
|
|
916
770
|
/** Warps to the Mega Satan room on the floor. (Every floor has a Mega Satan room.) */
|
|
917
|
-
function megaSatan() {
|
|
918
|
-
|
|
771
|
+
export function megaSatan() {
|
|
772
|
+
changeRoom(GridRoom.MEGA_SATAN);
|
|
919
773
|
}
|
|
920
774
|
/** Warps to the first Miniboss Room on the floor. */
|
|
921
|
-
function miniboss() {
|
|
922
|
-
|
|
775
|
+
export function miniboss() {
|
|
776
|
+
warpToRoomType(RoomType.MINI_BOSS);
|
|
923
777
|
}
|
|
924
778
|
/** Logs the currently playing music track to the "log.txt" file. */
|
|
925
|
-
function music() {
|
|
926
|
-
|
|
779
|
+
export function music() {
|
|
780
|
+
logMusic();
|
|
927
781
|
print('Logged the currently playing music track to the "log.txt" file.');
|
|
928
782
|
}
|
|
929
783
|
/** Alias for the "disableCurses" command. */
|
|
930
|
-
function noCurses() {
|
|
784
|
+
export function noCurses() {
|
|
931
785
|
disableCurses();
|
|
932
786
|
}
|
|
933
787
|
/** Sets every NPC in the room to 1 HP. */
|
|
934
|
-
function oneHP() {
|
|
935
|
-
for (const npc of
|
|
788
|
+
export function oneHP() {
|
|
789
|
+
for (const npc of getNPCs()) {
|
|
936
790
|
npc.HitPoints = 1;
|
|
937
791
|
}
|
|
938
792
|
print("Set every NPC to 1 HP.");
|
|
@@ -946,15 +800,15 @@ function oneHP() {
|
|
|
946
800
|
* - `pill 5` - Gives a "Full Health" pill.
|
|
947
801
|
* - `pill suns` - Gives a "Feels like I'm walking on sunshine" pill.
|
|
948
802
|
*/
|
|
949
|
-
function pill(params, isHorse = false) {
|
|
803
|
+
export function pill(params, isHorse = false) {
|
|
950
804
|
if (params === "") {
|
|
951
805
|
print("You must specify a pill name or number.");
|
|
952
806
|
return;
|
|
953
807
|
}
|
|
954
808
|
let pillEffect;
|
|
955
|
-
const num =
|
|
809
|
+
const num = parseIntSafe(params);
|
|
956
810
|
if (num === undefined) {
|
|
957
|
-
const match =
|
|
811
|
+
const match = getMapPartialMatch(params, PILL_NAME_TO_EFFECT_MAP);
|
|
958
812
|
if (match === undefined) {
|
|
959
813
|
print(`Unknown pill effect: ${params}`);
|
|
960
814
|
return;
|
|
@@ -962,19 +816,19 @@ function pill(params, isHorse = false) {
|
|
|
962
816
|
pillEffect = match[1];
|
|
963
817
|
}
|
|
964
818
|
else {
|
|
965
|
-
if (!
|
|
819
|
+
if (!isValidPillEffect(num)) {
|
|
966
820
|
print(`Invalid pill effect ID: ${num}`);
|
|
967
821
|
return;
|
|
968
822
|
}
|
|
969
823
|
pillEffect = num;
|
|
970
824
|
}
|
|
971
|
-
const pillEffectName =
|
|
825
|
+
const pillEffectName = getPillEffectName(pillEffect);
|
|
972
826
|
Isaac.ExecuteCommand(`g p${pillEffect}`);
|
|
973
827
|
if (isHorse) {
|
|
974
828
|
const player = Isaac.GetPlayer();
|
|
975
|
-
const pillColor = player.GetPill(
|
|
976
|
-
const horsePillColor =
|
|
977
|
-
player.SetPill(
|
|
829
|
+
const pillColor = player.GetPill(PocketItemSlot.SLOT_1);
|
|
830
|
+
const horsePillColor = getHorsePillColor(pillColor);
|
|
831
|
+
player.SetPill(PocketItemSlot.SLOT_1, horsePillColor);
|
|
978
832
|
}
|
|
979
833
|
if (isHorse) {
|
|
980
834
|
print(`Gave horse pill: ${pillEffectName} (${pillEffect})`);
|
|
@@ -984,73 +838,73 @@ function pill(params, isHorse = false) {
|
|
|
984
838
|
}
|
|
985
839
|
}
|
|
986
840
|
/** Spawns every pill on the ground, starting at the top-left-most tile. */
|
|
987
|
-
function pills() {
|
|
841
|
+
export function pills() {
|
|
988
842
|
let y;
|
|
989
843
|
let pillColor;
|
|
990
844
|
y = 1;
|
|
991
|
-
pillColor =
|
|
845
|
+
pillColor = FIRST_PILL_COLOR;
|
|
992
846
|
for (let x = 0; x <= 12; x++) {
|
|
993
|
-
if (pillColor >=
|
|
847
|
+
if (pillColor >= PillColor.GOLD) {
|
|
994
848
|
break;
|
|
995
849
|
}
|
|
996
|
-
const worldPosition =
|
|
997
|
-
|
|
850
|
+
const worldPosition = gridCoordinatesToWorldPosition(x, y);
|
|
851
|
+
spawnPill(pillColor, worldPosition);
|
|
998
852
|
pillColor++; // eslint-disable-line complete/strict-enums
|
|
999
853
|
}
|
|
1000
854
|
y = 2;
|
|
1001
|
-
pillColor =
|
|
855
|
+
pillColor = FIRST_HORSE_PILL_COLOR;
|
|
1002
856
|
for (let x = 0; x <= 12; x++) {
|
|
1003
|
-
if (pillColor >=
|
|
857
|
+
if (pillColor >= PillColor.HORSE_GOLD) {
|
|
1004
858
|
break;
|
|
1005
859
|
}
|
|
1006
|
-
const worldPosition =
|
|
1007
|
-
|
|
860
|
+
const worldPosition = gridCoordinatesToWorldPosition(x, y);
|
|
861
|
+
spawnPill(pillColor, worldPosition);
|
|
1008
862
|
pillColor++; // eslint-disable-line complete/strict-enums
|
|
1009
863
|
}
|
|
1010
864
|
y = 3;
|
|
1011
|
-
const worldPosition1 =
|
|
1012
|
-
|
|
1013
|
-
const worldPosition2 =
|
|
1014
|
-
|
|
865
|
+
const worldPosition1 = gridCoordinatesToWorldPosition(0, y);
|
|
866
|
+
spawnPill(PillColor.GOLD, worldPosition1);
|
|
867
|
+
const worldPosition2 = gridCoordinatesToWorldPosition(1, y);
|
|
868
|
+
spawnPill(PillColor.HORSE_GOLD, worldPosition2);
|
|
1015
869
|
}
|
|
1016
870
|
/** Warps to the first Planetarium on the floor. */
|
|
1017
|
-
function planetarium() {
|
|
1018
|
-
|
|
871
|
+
export function planetarium() {
|
|
872
|
+
warpToRoomType(RoomType.PLANETARIUM);
|
|
1019
873
|
}
|
|
1020
874
|
/** Alias for the "sound" command. */
|
|
1021
|
-
function playSound(params) {
|
|
875
|
+
export function playSound(params) {
|
|
1022
876
|
sound(params);
|
|
1023
877
|
}
|
|
1024
878
|
/** Sets the player's pocket item to the specified collectible type. */
|
|
1025
|
-
function pocket(params) {
|
|
879
|
+
export function pocket(params) {
|
|
1026
880
|
if (params === "") {
|
|
1027
881
|
print("You must supply a collectible type to put as the pocket item.");
|
|
1028
882
|
return;
|
|
1029
883
|
}
|
|
1030
|
-
const collectibleType =
|
|
884
|
+
const collectibleType = parseIntSafe(params);
|
|
1031
885
|
if (collectibleType === undefined
|
|
1032
|
-
|| !
|
|
886
|
+
|| !isValidCollectibleType(collectibleType)) {
|
|
1033
887
|
print(`Invalid collectible type: ${collectibleType}`);
|
|
1034
888
|
return;
|
|
1035
889
|
}
|
|
1036
890
|
const player = Isaac.GetPlayer();
|
|
1037
|
-
player.SetPocketActiveItem(collectibleType,
|
|
891
|
+
player.SetPocketActiveItem(collectibleType, ActiveSlot.POCKET);
|
|
1038
892
|
}
|
|
1039
893
|
/** Creates a poop grid entity next to the player. */
|
|
1040
|
-
function poop() {
|
|
1041
|
-
const roomClass =
|
|
894
|
+
export function poop() {
|
|
895
|
+
const roomClass = game.GetRoom();
|
|
1042
896
|
const player = Isaac.GetPlayer();
|
|
1043
897
|
const tilePosition = roomClass.FindFreeTilePosition(player.Position, 0);
|
|
1044
|
-
|
|
898
|
+
spawnGridEntity(GridEntityType.POOP, tilePosition);
|
|
1045
899
|
}
|
|
1046
900
|
/**
|
|
1047
901
|
* Gives a poop mana charge. This only affects Tainted Blue Baby. Provide a number to give a custom
|
|
1048
902
|
* amount of charges. (You can use negative numbers to remove charges.)
|
|
1049
903
|
*/
|
|
1050
|
-
function poopMana(params) {
|
|
904
|
+
export function poopMana(params) {
|
|
1051
905
|
let charges = 1;
|
|
1052
906
|
if (params !== "") {
|
|
1053
|
-
const num =
|
|
907
|
+
const num = parseIntSafe(params);
|
|
1054
908
|
if (num === undefined) {
|
|
1055
909
|
print(`Invalid mana amount: ${num}`);
|
|
1056
910
|
return;
|
|
@@ -1061,32 +915,32 @@ function poopMana(params) {
|
|
|
1061
915
|
player.AddPoopMana(charges);
|
|
1062
916
|
}
|
|
1063
917
|
/** Alias for the "getPosition" command. */
|
|
1064
|
-
function position() {
|
|
918
|
+
export function position() {
|
|
1065
919
|
getPosition();
|
|
1066
920
|
}
|
|
1067
921
|
/** Alias for the "hearts" command. */
|
|
1068
|
-
function redHearts(params) {
|
|
922
|
+
export function redHearts(params) {
|
|
1069
923
|
hearts(params);
|
|
1070
924
|
}
|
|
1071
925
|
/** Starts a room transition to the same room that you are already in. */
|
|
1072
|
-
function reloadRoom() {
|
|
1073
|
-
(
|
|
926
|
+
export function reloadRoom() {
|
|
927
|
+
reloadRoomFunction();
|
|
1074
928
|
}
|
|
1075
929
|
/** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
|
|
1076
|
-
function right(params) {
|
|
1077
|
-
|
|
930
|
+
export function right(params) {
|
|
931
|
+
movePlayer(params, Direction.RIGHT);
|
|
1078
932
|
}
|
|
1079
933
|
/** Logs information about the room to the "log.txt" file. */
|
|
1080
|
-
function room() {
|
|
1081
|
-
|
|
934
|
+
export function room() {
|
|
935
|
+
logRoom();
|
|
1082
936
|
print('Logged room information to the "log.txt" file.');
|
|
1083
937
|
}
|
|
1084
938
|
/**
|
|
1085
939
|
* Gives a rotten heart. Provide a number to give a custom amount of hearts. (You can use negative
|
|
1086
940
|
* numbers to remove hearts.)
|
|
1087
941
|
*/
|
|
1088
|
-
function rottenHearts(params) {
|
|
1089
|
-
|
|
942
|
+
export function rottenHearts(params) {
|
|
943
|
+
addHeart(params, HealthType.ROTTEN);
|
|
1090
944
|
}
|
|
1091
945
|
/**
|
|
1092
946
|
* Run the suite of tests that prove that the "deepCopy" helper function and the "merge" function
|
|
@@ -1095,9 +949,9 @@ function rottenHearts(params) {
|
|
|
1095
949
|
*
|
|
1096
950
|
* In general, running the tests is only useful if you are troubleshooting the save data manager.
|
|
1097
951
|
*/
|
|
1098
|
-
function runTests() {
|
|
1099
|
-
|
|
1100
|
-
|
|
952
|
+
export function runTests() {
|
|
953
|
+
runDeepCopyTests();
|
|
954
|
+
runMergeTests();
|
|
1101
955
|
}
|
|
1102
956
|
/**
|
|
1103
957
|
* Alias for the "stage" command.
|
|
@@ -1106,7 +960,7 @@ function runTests() {
|
|
|
1106
960
|
* - s 3 - Warps to Caves 1.
|
|
1107
961
|
* - s 1c - Warps to Downpour 1.
|
|
1108
962
|
*/
|
|
1109
|
-
function s(params) {
|
|
963
|
+
export function s(params) {
|
|
1110
964
|
if (params === "") {
|
|
1111
965
|
print("You must specify a stage number.");
|
|
1112
966
|
return;
|
|
@@ -1127,33 +981,33 @@ function s(params) {
|
|
|
1127
981
|
stageString = params;
|
|
1128
982
|
stageTypeLetter = "";
|
|
1129
983
|
}
|
|
1130
|
-
const stage =
|
|
1131
|
-
if (stage === undefined || !
|
|
984
|
+
const stage = parseIntSafe(stageString);
|
|
985
|
+
if (stage === undefined || !isEnumValue(stage, StageType)) {
|
|
1132
986
|
print(`Invalid stage number: ${stage}`);
|
|
1133
987
|
return;
|
|
1134
988
|
}
|
|
1135
989
|
Isaac.ExecuteCommand(`stage ${stage}${stageTypeLetter}`);
|
|
1136
990
|
}
|
|
1137
991
|
/** Warps to the first Sacrifice Room on the floor. */
|
|
1138
|
-
function sacrificeRoom() {
|
|
1139
|
-
|
|
992
|
+
export function sacrificeRoom() {
|
|
993
|
+
warpToRoomType(RoomType.SACRIFICE);
|
|
1140
994
|
}
|
|
1141
995
|
/** Warps to the first Secret Room on the floor. */
|
|
1142
|
-
function secretRoom() {
|
|
1143
|
-
|
|
996
|
+
export function secretRoom() {
|
|
997
|
+
warpToRoomType(RoomType.SECRET);
|
|
1144
998
|
}
|
|
1145
999
|
/** Warps to the Secret Shop that you would normally get to with a Member Card. */
|
|
1146
|
-
function secretShop() {
|
|
1147
|
-
|
|
1000
|
+
export function secretShop() {
|
|
1001
|
+
changeRoom(GridRoom.SECRET_SHOP);
|
|
1148
1002
|
}
|
|
1149
1003
|
/** Logs all of the current run's seed effects to the "log.txt" file. */
|
|
1150
|
-
function seeds() {
|
|
1151
|
-
|
|
1004
|
+
export function seeds() {
|
|
1005
|
+
logSeedEffects();
|
|
1152
1006
|
print('Logged the seed effects to the "log.txt" file.');
|
|
1153
1007
|
}
|
|
1154
1008
|
/** Changes to a seeded run, using the seed of the current run. */
|
|
1155
|
-
function seedStick() {
|
|
1156
|
-
const seedsClass =
|
|
1009
|
+
export function seedStick() {
|
|
1010
|
+
const seedsClass = game.GetSeeds();
|
|
1157
1011
|
const startSeedString = seedsClass.GetStartSeedString();
|
|
1158
1012
|
Isaac.ExecuteCommand(`seed ${startSeedString}`);
|
|
1159
1013
|
print(`Sticking to seed: ${startSeedString}`);
|
|
@@ -1162,7 +1016,7 @@ function seedStick() {
|
|
|
1162
1016
|
* Sets a charge to the player's specified active item. You must provide the active slot number and
|
|
1163
1017
|
* the number of charges to set.
|
|
1164
1018
|
*/
|
|
1165
|
-
function setCharges(params) {
|
|
1019
|
+
export function setCharges(params) {
|
|
1166
1020
|
if (params === "") {
|
|
1167
1021
|
print("You must specify a slot number and a charge amount. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)");
|
|
1168
1022
|
return;
|
|
@@ -1180,12 +1034,12 @@ function setCharges(params) {
|
|
|
1180
1034
|
if (activeSlotString === undefined || chargeString === undefined) {
|
|
1181
1035
|
return;
|
|
1182
1036
|
}
|
|
1183
|
-
const activeSlot =
|
|
1184
|
-
if (activeSlot === undefined || !
|
|
1037
|
+
const activeSlot = parseIntSafe(activeSlotString);
|
|
1038
|
+
if (activeSlot === undefined || !isEnumValue(activeSlot, ActiveSlot)) {
|
|
1185
1039
|
print(`Invalid slot number: ${activeSlotString}`);
|
|
1186
1040
|
return;
|
|
1187
1041
|
}
|
|
1188
|
-
const chargeNum =
|
|
1042
|
+
const chargeNum = parseIntSafe(chargeString);
|
|
1189
1043
|
if (chargeNum === undefined) {
|
|
1190
1044
|
print(`Invalid charge amount: ${chargeString}`);
|
|
1191
1045
|
return;
|
|
@@ -1203,7 +1057,7 @@ function setCharges(params) {
|
|
|
1203
1057
|
* For example:
|
|
1204
1058
|
* - setPosition 100 50
|
|
1205
1059
|
*/
|
|
1206
|
-
function setPosition(params) {
|
|
1060
|
+
export function setPosition(params) {
|
|
1207
1061
|
if (params === "") {
|
|
1208
1062
|
print('You must specify a position. (e.g. "setPosition 100 50")');
|
|
1209
1063
|
return;
|
|
@@ -1217,12 +1071,12 @@ function setPosition(params) {
|
|
|
1217
1071
|
if (xString === undefined || yString === undefined) {
|
|
1218
1072
|
return;
|
|
1219
1073
|
}
|
|
1220
|
-
const x =
|
|
1074
|
+
const x = parseIntSafe(xString);
|
|
1221
1075
|
if (x === undefined) {
|
|
1222
1076
|
print(`Invalid x value: ${xString}`);
|
|
1223
1077
|
return;
|
|
1224
1078
|
}
|
|
1225
|
-
const y =
|
|
1079
|
+
const y = parseIntSafe(yString);
|
|
1226
1080
|
if (y === undefined) {
|
|
1227
1081
|
print(`Invalid y value: ${yString}`);
|
|
1228
1082
|
return;
|
|
@@ -1232,22 +1086,22 @@ function setPosition(params) {
|
|
|
1232
1086
|
player.Position = newPosition;
|
|
1233
1087
|
}
|
|
1234
1088
|
/** Warps to the first shop on the floor. */
|
|
1235
|
-
function shop() {
|
|
1236
|
-
|
|
1089
|
+
export function shop() {
|
|
1090
|
+
warpToRoomType(RoomType.SHOP);
|
|
1237
1091
|
}
|
|
1238
1092
|
/** Uses the Smelter to smelt the current player's trinket. */
|
|
1239
|
-
function smelt() {
|
|
1093
|
+
export function smelt() {
|
|
1240
1094
|
const player = Isaac.GetPlayer();
|
|
1241
|
-
|
|
1095
|
+
useActiveItemTemp(player, CollectibleType.SMELTER);
|
|
1242
1096
|
}
|
|
1243
1097
|
/**
|
|
1244
1098
|
* Gives a soul charge. This only affects Tainted Bethany. Provide a number to give a custom amount
|
|
1245
1099
|
* of charges. (You can use negative numbers to remove charges.)
|
|
1246
1100
|
*/
|
|
1247
|
-
function soulCharges(params) {
|
|
1101
|
+
export function soulCharges(params) {
|
|
1248
1102
|
let charges = 1;
|
|
1249
1103
|
if (params !== "") {
|
|
1250
|
-
const num =
|
|
1104
|
+
const num = parseIntSafe(params);
|
|
1251
1105
|
if (num === undefined) {
|
|
1252
1106
|
print(`Invalid charges amount: ${num}`);
|
|
1253
1107
|
return;
|
|
@@ -1261,8 +1115,8 @@ function soulCharges(params) {
|
|
|
1261
1115
|
* Gives a half soul heart. Provide a number to give a custom amount of hearts. (You can use
|
|
1262
1116
|
* negative numbers to remove hearts.)
|
|
1263
1117
|
*/
|
|
1264
|
-
function soulHearts(params) {
|
|
1265
|
-
|
|
1118
|
+
export function soulHearts(params) {
|
|
1119
|
+
addHeart(params, HealthType.SOUL);
|
|
1266
1120
|
}
|
|
1267
1121
|
/**
|
|
1268
1122
|
* Play the supplied sound effect.
|
|
@@ -1270,26 +1124,26 @@ function soulHearts(params) {
|
|
|
1270
1124
|
* For example:
|
|
1271
1125
|
* - sound 1 - Plays the 1-Up sound effect.
|
|
1272
1126
|
*/
|
|
1273
|
-
function sound(params) {
|
|
1274
|
-
const soundEffect =
|
|
1275
|
-
if (soundEffect === undefined || !
|
|
1127
|
+
export function sound(params) {
|
|
1128
|
+
const soundEffect = parseIntSafe(params);
|
|
1129
|
+
if (soundEffect === undefined || !isEnumValue(soundEffect, SoundEffect)) {
|
|
1276
1130
|
print(`Invalid sound effect ID: ${soundEffect}.`);
|
|
1277
1131
|
return;
|
|
1278
1132
|
}
|
|
1279
|
-
|
|
1133
|
+
sfxManager.Play(soundEffect);
|
|
1280
1134
|
}
|
|
1281
1135
|
/** Logs all of the currently playing sound effects to the "log.txt" file. */
|
|
1282
|
-
function sounds() {
|
|
1283
|
-
|
|
1136
|
+
export function sounds() {
|
|
1137
|
+
logSounds();
|
|
1284
1138
|
print('Logged the currently playing sound effects to the "log.txt" file.');
|
|
1285
1139
|
}
|
|
1286
1140
|
/**
|
|
1287
1141
|
* Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
|
|
1288
1142
|
* "debug 10".
|
|
1289
1143
|
*/
|
|
1290
|
-
function spam() {
|
|
1291
|
-
|
|
1292
|
-
|
|
1144
|
+
export function spam() {
|
|
1145
|
+
v.persistent.spamBloodRights = !v.persistent.spamBloodRights;
|
|
1146
|
+
printEnabled(v.persistent.spamBloodRights, "spamming Blood Rights");
|
|
1293
1147
|
}
|
|
1294
1148
|
/**
|
|
1295
1149
|
* Spawns a collectible in the center of the room. You must specify the collectible name or the
|
|
@@ -1304,15 +1158,15 @@ function spam() {
|
|
|
1304
1158
|
* spawnCollectible 3
|
|
1305
1159
|
* ```
|
|
1306
1160
|
*/
|
|
1307
|
-
function spawnCollectible(params) {
|
|
1161
|
+
export function spawnCollectible(params) {
|
|
1308
1162
|
if (params === "") {
|
|
1309
1163
|
print("You must specify the collectible name or the number corresponding to the collectible type.");
|
|
1310
1164
|
return;
|
|
1311
1165
|
}
|
|
1312
|
-
const num =
|
|
1166
|
+
const num = parseIntSafe(params);
|
|
1313
1167
|
let collectibleType;
|
|
1314
1168
|
if (num === undefined) {
|
|
1315
|
-
const match =
|
|
1169
|
+
const match = getMapPartialMatch(params, COLLECTIBLE_NAME_TO_TYPE_MAP);
|
|
1316
1170
|
if (match === undefined) {
|
|
1317
1171
|
print(`Unknown collectible: ${params}`);
|
|
1318
1172
|
return;
|
|
@@ -1320,14 +1174,14 @@ function spawnCollectible(params) {
|
|
|
1320
1174
|
collectibleType = match[1];
|
|
1321
1175
|
}
|
|
1322
1176
|
else {
|
|
1323
|
-
if (!
|
|
1177
|
+
if (!isValidCollectibleType(num)) {
|
|
1324
1178
|
print(`Invalid collectible type: ${num}`);
|
|
1325
1179
|
}
|
|
1326
1180
|
collectibleType = num;
|
|
1327
1181
|
}
|
|
1328
|
-
const roomClass =
|
|
1182
|
+
const roomClass = game.GetRoom();
|
|
1329
1183
|
const centerPos = roomClass.GetCenterPos();
|
|
1330
|
-
(
|
|
1184
|
+
spawnCollectibleFunc(collectibleType, centerPos, undefined);
|
|
1331
1185
|
}
|
|
1332
1186
|
/**
|
|
1333
1187
|
* Spawns a collectible at a specific grid tile location. You must specify the number corresponding
|
|
@@ -1342,7 +1196,7 @@ function spawnCollectible(params) {
|
|
|
1342
1196
|
* (You can use the "grid" command to toggle displaying the numerical grid indexes corresponding to
|
|
1343
1197
|
* a grid tile.)
|
|
1344
1198
|
*/
|
|
1345
|
-
function spawnCollectibleAt(params) {
|
|
1199
|
+
export function spawnCollectibleAt(params) {
|
|
1346
1200
|
if (params === "") {
|
|
1347
1201
|
print("You must specify the number corresponding to the collectible type and the number corresponding to the grid tile location.");
|
|
1348
1202
|
return;
|
|
@@ -1356,35 +1210,35 @@ function spawnCollectibleAt(params) {
|
|
|
1356
1210
|
if (collectibleTypeString === undefined || gridIndexString === undefined) {
|
|
1357
1211
|
return;
|
|
1358
1212
|
}
|
|
1359
|
-
const collectibleType =
|
|
1213
|
+
const collectibleType = parseIntSafe(collectibleTypeString);
|
|
1360
1214
|
if (collectibleType === undefined
|
|
1361
|
-
|| !
|
|
1215
|
+
|| !isValidCollectibleType(collectibleType)) {
|
|
1362
1216
|
print(`Invalid collectible type: ${args[0]}`);
|
|
1363
1217
|
return;
|
|
1364
1218
|
}
|
|
1365
|
-
const gridIndex =
|
|
1219
|
+
const gridIndex = parseIntSafe(gridIndexString);
|
|
1366
1220
|
if (gridIndex === undefined || gridIndex < 0) {
|
|
1367
1221
|
print(`Failed to parse the grid index of: ${args[1]}`);
|
|
1368
1222
|
return;
|
|
1369
1223
|
}
|
|
1370
|
-
(
|
|
1224
|
+
spawnCollectibleFunc(collectibleType, gridIndex, undefined);
|
|
1371
1225
|
}
|
|
1372
1226
|
/**
|
|
1373
1227
|
* The same thing as the `spawnTrinket` command but spawns a golden version of the specified
|
|
1374
1228
|
* trinket.
|
|
1375
1229
|
*/
|
|
1376
|
-
function spawnGoldenTrinket(params) {
|
|
1230
|
+
export function spawnGoldenTrinket(params) {
|
|
1377
1231
|
spawnTrinket(params, true);
|
|
1378
1232
|
}
|
|
1379
1233
|
/**
|
|
1380
1234
|
* The same thing as the `spawnTrinketAt` command but spawns a golden version of the specified
|
|
1381
1235
|
* trinket.
|
|
1382
1236
|
*/
|
|
1383
|
-
function spawnGoldenTrinketAt(params) {
|
|
1237
|
+
export function spawnGoldenTrinketAt(params) {
|
|
1384
1238
|
spawnTrinketAt(params, true);
|
|
1385
1239
|
}
|
|
1386
1240
|
/** Alias for the `spawnGoldenTrinket` command. */
|
|
1387
|
-
function spawnGoldTrinket(params) {
|
|
1241
|
+
export function spawnGoldTrinket(params) {
|
|
1388
1242
|
spawnGoldenTrinket(params);
|
|
1389
1243
|
}
|
|
1390
1244
|
/**
|
|
@@ -1402,15 +1256,15 @@ function spawnGoldTrinket(params) {
|
|
|
1402
1256
|
*
|
|
1403
1257
|
* Also see the `spawnGoldenTrinket` command.
|
|
1404
1258
|
*/
|
|
1405
|
-
function spawnTrinket(params, golden = false) {
|
|
1259
|
+
export function spawnTrinket(params, golden = false) {
|
|
1406
1260
|
if (params === "") {
|
|
1407
1261
|
print("You must specify the name or number corresponding to the trinket type.");
|
|
1408
1262
|
return;
|
|
1409
1263
|
}
|
|
1410
|
-
const num =
|
|
1264
|
+
const num = parseIntSafe(params);
|
|
1411
1265
|
let trinketType;
|
|
1412
1266
|
if (num === undefined) {
|
|
1413
|
-
const match =
|
|
1267
|
+
const match = getMapPartialMatch(params, TRINKET_NAME_TO_TYPE_MAP);
|
|
1414
1268
|
if (match === undefined) {
|
|
1415
1269
|
print(`Unknown trinket: ${params}`);
|
|
1416
1270
|
return;
|
|
@@ -1418,17 +1272,17 @@ function spawnTrinket(params, golden = false) {
|
|
|
1418
1272
|
trinketType = match[1];
|
|
1419
1273
|
}
|
|
1420
1274
|
else {
|
|
1421
|
-
if (!
|
|
1275
|
+
if (!isValidTrinketType(num)) {
|
|
1422
1276
|
print(`Invalid trinket type: ${num}`);
|
|
1423
1277
|
return;
|
|
1424
1278
|
}
|
|
1425
1279
|
trinketType = num;
|
|
1426
1280
|
}
|
|
1427
|
-
const roomClass =
|
|
1281
|
+
const roomClass = game.GetRoom();
|
|
1428
1282
|
const centerPos = roomClass.GetCenterPos();
|
|
1429
|
-
const goldenTrinketType =
|
|
1283
|
+
const goldenTrinketType = getGoldenTrinketType(trinketType);
|
|
1430
1284
|
const trinketTypeToSpawn = golden ? goldenTrinketType : trinketType;
|
|
1431
|
-
(
|
|
1285
|
+
spawnTrinketFunction(trinketTypeToSpawn, centerPos);
|
|
1432
1286
|
}
|
|
1433
1287
|
/**
|
|
1434
1288
|
* Spawns a trinket at a specific grid tile location. You must specify the number corresponding to
|
|
@@ -1443,7 +1297,7 @@ function spawnTrinket(params, golden = false) {
|
|
|
1443
1297
|
* (You can use the "grid" command to toggle displaying the numerical grid indexes corresponding to
|
|
1444
1298
|
* a grid tile.)
|
|
1445
1299
|
*/
|
|
1446
|
-
function spawnTrinketAt(params, golden = false) {
|
|
1300
|
+
export function spawnTrinketAt(params, golden = false) {
|
|
1447
1301
|
if (params === "") {
|
|
1448
1302
|
print("You must specify the number corresponding to the trinket type and the number corresponding to the grid tile location.");
|
|
1449
1303
|
return;
|
|
@@ -1457,26 +1311,26 @@ function spawnTrinketAt(params, golden = false) {
|
|
|
1457
1311
|
if (trinketTypeString === undefined || gridIndexString === undefined) {
|
|
1458
1312
|
return;
|
|
1459
1313
|
}
|
|
1460
|
-
const trinketType =
|
|
1461
|
-
if (trinketType === undefined || !
|
|
1314
|
+
const trinketType = parseIntSafe(trinketTypeString);
|
|
1315
|
+
if (trinketType === undefined || !isValidTrinketType(trinketType)) {
|
|
1462
1316
|
print(`Invalid trinket type: ${trinketTypeString}`);
|
|
1463
1317
|
return;
|
|
1464
1318
|
}
|
|
1465
|
-
const gridIndex =
|
|
1319
|
+
const gridIndex = parseIntSafe(gridIndexString);
|
|
1466
1320
|
if (gridIndex === undefined || gridIndex < 0) {
|
|
1467
1321
|
print(`Failed to parse the grid index of: ${args[1]}`);
|
|
1468
1322
|
return;
|
|
1469
1323
|
}
|
|
1470
|
-
const goldenTrinketType =
|
|
1324
|
+
const goldenTrinketType = getGoldenTrinketType(trinketType);
|
|
1471
1325
|
const trinketTypeToSpawn = golden ? goldenTrinketType : trinketType;
|
|
1472
|
-
(
|
|
1326
|
+
spawnTrinketFunction(trinketTypeToSpawn, gridIndex);
|
|
1473
1327
|
}
|
|
1474
1328
|
/**
|
|
1475
1329
|
* Toggles a set movement speed and flight for the player. You can provide an optional argument to
|
|
1476
1330
|
* this command in order to set the speed to a specific amount. Default is 2.0 (which is the maximum
|
|
1477
1331
|
* that the stat can be set to).
|
|
1478
1332
|
*/
|
|
1479
|
-
function speed(params) {
|
|
1333
|
+
export function speed(params) {
|
|
1480
1334
|
const player = Isaac.GetPlayer();
|
|
1481
1335
|
if (params !== "") {
|
|
1482
1336
|
const num = tonumber(params); // Can be a float.
|
|
@@ -1484,93 +1338,93 @@ function speed(params) {
|
|
|
1484
1338
|
print(`Invalid speed amount: ${params}`);
|
|
1485
1339
|
return;
|
|
1486
1340
|
}
|
|
1487
|
-
|
|
1341
|
+
v.persistent.damageAmount = num;
|
|
1488
1342
|
}
|
|
1489
|
-
|
|
1490
|
-
player.AddCacheFlags(
|
|
1343
|
+
v.persistent.speed = !v.persistent.speed;
|
|
1344
|
+
player.AddCacheFlags(CacheFlag.SPEED);
|
|
1491
1345
|
player.EvaluateItems();
|
|
1492
|
-
const value = tostring(
|
|
1346
|
+
const value = tostring(v.persistent.speed);
|
|
1493
1347
|
flight(value);
|
|
1494
|
-
|
|
1348
|
+
printEnabled(v.persistent.speed, "set speed");
|
|
1495
1349
|
}
|
|
1496
1350
|
/** Creates a spikes grid entity next to the player. */
|
|
1497
|
-
function spikes() {
|
|
1498
|
-
const roomClass =
|
|
1351
|
+
export function spikes() {
|
|
1352
|
+
const roomClass = game.GetRoom();
|
|
1499
1353
|
const player = Isaac.GetPlayer();
|
|
1500
1354
|
const tilePosition = roomClass.FindFreeTilePosition(player.Position, 0);
|
|
1501
|
-
|
|
1355
|
+
spawnGridEntity(GridEntityType.SPIKES, tilePosition);
|
|
1502
1356
|
}
|
|
1503
1357
|
/** Warps to the starting room of the floor. */
|
|
1504
|
-
function startingRoom() {
|
|
1505
|
-
const level =
|
|
1358
|
+
export function startingRoom() {
|
|
1359
|
+
const level = game.GetLevel();
|
|
1506
1360
|
const startingRoomIndex = level.GetStartingRoomIndex();
|
|
1507
|
-
|
|
1361
|
+
changeRoom(startingRoomIndex);
|
|
1508
1362
|
}
|
|
1509
1363
|
/** Alias for the "startingRoom" command. */
|
|
1510
|
-
function startRoom() {
|
|
1364
|
+
export function startRoom() {
|
|
1511
1365
|
startingRoom();
|
|
1512
1366
|
}
|
|
1513
1367
|
/** Warps to the first Super Secret Room on the floor. */
|
|
1514
|
-
function superSecretRoom() {
|
|
1515
|
-
|
|
1368
|
+
export function superSecretRoom() {
|
|
1369
|
+
warpToRoomType(RoomType.SUPER_SECRET);
|
|
1516
1370
|
}
|
|
1517
1371
|
/**
|
|
1518
1372
|
* Toggles a set tear delay (e.g. fire rate) for the player. You can provide an optional argument to
|
|
1519
1373
|
* this command in order to set the tear delay to a specific amount. Default is 1 (which is
|
|
1520
1374
|
* equivalent to the Soy Milk tear rate).
|
|
1521
1375
|
*/
|
|
1522
|
-
function tears(params) {
|
|
1376
|
+
export function tears(params) {
|
|
1523
1377
|
if (params !== "") {
|
|
1524
1378
|
const num = tonumber(params); // Can be a float.
|
|
1525
1379
|
if (num === undefined) {
|
|
1526
1380
|
print(`Invalid tear delay amount: ${params}`);
|
|
1527
1381
|
return;
|
|
1528
1382
|
}
|
|
1529
|
-
|
|
1383
|
+
v.persistent.tearsAmount = num;
|
|
1530
1384
|
}
|
|
1531
|
-
|
|
1385
|
+
v.persistent.tears = !v.persistent.tears;
|
|
1532
1386
|
const player = Isaac.GetPlayer();
|
|
1533
|
-
player.AddCacheFlags(
|
|
1387
|
+
player.AddCacheFlags(CacheFlag.FIRE_DELAY);
|
|
1534
1388
|
player.EvaluateItems();
|
|
1535
|
-
|
|
1389
|
+
printEnabled(v.persistent.damage, "set tear delay");
|
|
1536
1390
|
}
|
|
1537
1391
|
/** Alias for the "runTests" command. */
|
|
1538
|
-
function tests() {
|
|
1392
|
+
export function tests() {
|
|
1539
1393
|
runTests();
|
|
1540
1394
|
}
|
|
1541
1395
|
/** Creates a trapdoor next to the player. */
|
|
1542
|
-
function trapdoor() {
|
|
1543
|
-
|
|
1396
|
+
export function trapdoor() {
|
|
1397
|
+
spawnTrapdoorOrCrawlSpace(true);
|
|
1544
1398
|
}
|
|
1545
1399
|
/** Warps to the first Treasure Room on the floor. */
|
|
1546
|
-
function treasureRoom() {
|
|
1547
|
-
|
|
1400
|
+
export function treasureRoom() {
|
|
1401
|
+
warpToRoomType(RoomType.TREASURE);
|
|
1548
1402
|
}
|
|
1549
1403
|
/** Alias for the "spawnTrinket" command. */
|
|
1550
|
-
function trinket(params) {
|
|
1404
|
+
export function trinket(params) {
|
|
1551
1405
|
spawnTrinket(params);
|
|
1552
1406
|
}
|
|
1553
1407
|
/** Warps to the first Ultra Secret Room on the floor. */
|
|
1554
|
-
function ultraSecretRoom() {
|
|
1555
|
-
|
|
1408
|
+
export function ultraSecretRoom() {
|
|
1409
|
+
warpToRoomType(RoomType.ULTRA_SECRET);
|
|
1556
1410
|
}
|
|
1557
1411
|
/** Toggles permanent Curse of the Unknown. */
|
|
1558
|
-
function unknown() {
|
|
1559
|
-
|
|
1560
|
-
|
|
1412
|
+
export function unknown() {
|
|
1413
|
+
v.persistent.unknown = !v.persistent.unknown;
|
|
1414
|
+
printEnabled(v.persistent.unknown, "permanent Curse of the Unknown");
|
|
1561
1415
|
}
|
|
1562
1416
|
/** If currently on a set seed, changes to an unseeded state and restarts the game. */
|
|
1563
|
-
function unseed() {
|
|
1564
|
-
if (!
|
|
1417
|
+
export function unseed() {
|
|
1418
|
+
if (!onSetSeed()) {
|
|
1565
1419
|
print("You are not on a set seed, so you cannot unseed the run.");
|
|
1566
1420
|
return;
|
|
1567
1421
|
}
|
|
1568
|
-
|
|
1569
|
-
|
|
1422
|
+
setUnseeded();
|
|
1423
|
+
restart();
|
|
1570
1424
|
}
|
|
1571
1425
|
/** Moves the player 0.5 units up. Provide a number to move a custom amount of units. */
|
|
1572
|
-
function up(params) {
|
|
1573
|
-
|
|
1426
|
+
export function up(params) {
|
|
1427
|
+
movePlayer(params, Direction.UP);
|
|
1574
1428
|
}
|
|
1575
1429
|
/**
|
|
1576
1430
|
* Warps to the specified room type. Accepts either the room type number or the partial name of the
|
|
@@ -1580,15 +1434,15 @@ function up(params) {
|
|
|
1580
1434
|
* - warp 5 - Warps to the first Boss Room on the floor, if any.
|
|
1581
1435
|
* - warp tr - Warps to the first Treasure Room on the floor, if any.
|
|
1582
1436
|
*/
|
|
1583
|
-
function warp(params) {
|
|
1437
|
+
export function warp(params) {
|
|
1584
1438
|
if (params === "") {
|
|
1585
1439
|
print("You must specify a room type name or number.");
|
|
1586
1440
|
return;
|
|
1587
1441
|
}
|
|
1588
1442
|
let roomType;
|
|
1589
|
-
const num =
|
|
1443
|
+
const num = parseIntSafe(params);
|
|
1590
1444
|
if (num === undefined) {
|
|
1591
|
-
const match =
|
|
1445
|
+
const match = getMapPartialMatch(params, ROOM_NAME_TO_TYPE_MAP);
|
|
1592
1446
|
if (match === undefined) {
|
|
1593
1447
|
print(`Unknown room type: ${params}`);
|
|
1594
1448
|
return;
|
|
@@ -1596,15 +1450,15 @@ function warp(params) {
|
|
|
1596
1450
|
roomType = match[1];
|
|
1597
1451
|
}
|
|
1598
1452
|
else {
|
|
1599
|
-
if (!
|
|
1453
|
+
if (!isEnumValue(num, RoomType)) {
|
|
1600
1454
|
print(`Invalid room type: ${num}`);
|
|
1601
1455
|
return;
|
|
1602
1456
|
}
|
|
1603
1457
|
roomType = num;
|
|
1604
1458
|
}
|
|
1605
|
-
|
|
1459
|
+
warpToRoomType(roomType);
|
|
1606
1460
|
}
|
|
1607
1461
|
/** Alias for the "labyrinth" command. */
|
|
1608
|
-
function xl() {
|
|
1462
|
+
export function xl() {
|
|
1609
1463
|
labyrinth();
|
|
1610
1464
|
}
|