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,92 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.getSurroundingGridEntities = getSurroundingGridEntities;
|
|
19
|
-
exports.getSurroundingGridIndexes = getSurroundingGridIndexes;
|
|
20
|
-
exports.getTopLeftWall = getTopLeftWall;
|
|
21
|
-
exports.getTopLeftWallGridIndex = getTopLeftWallGridIndex;
|
|
22
|
-
exports.isGridEntityBreakableByExplosion = isGridEntityBreakableByExplosion;
|
|
23
|
-
exports.isGridEntityBroken = isGridEntityBroken;
|
|
24
|
-
exports.isGridEntityXMLType = isGridEntityXMLType;
|
|
25
|
-
exports.isGridIndexAdjacentToDoor = isGridIndexAdjacentToDoor;
|
|
26
|
-
exports.isPoopGridEntityXMLType = isPoopGridEntityXMLType;
|
|
27
|
-
exports.isPostBossVoidPortal = isPostBossVoidPortal;
|
|
28
|
-
exports.removeAllGridEntitiesExcept = removeAllGridEntitiesExcept;
|
|
29
|
-
exports.removeAllMatchingGridEntities = removeAllMatchingGridEntities;
|
|
30
|
-
exports.removeEntitiesSpawnedFromGridEntity = removeEntitiesSpawnedFromGridEntity;
|
|
31
|
-
exports.removeGridEntities = removeGridEntities;
|
|
32
|
-
exports.removeGridEntity = removeGridEntity;
|
|
33
|
-
exports.setGridEntityInvisible = setGridEntityInvisible;
|
|
34
|
-
exports.setGridEntityType = setGridEntityType;
|
|
35
|
-
exports.spawnGiantPoop = spawnGiantPoop;
|
|
36
|
-
exports.spawnGridEntity = spawnGridEntity;
|
|
37
|
-
exports.spawnGridEntityWithVariant = spawnGridEntityWithVariant;
|
|
38
|
-
exports.spawnVoidPortal = spawnVoidPortal;
|
|
39
|
-
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
40
|
-
const cachedEnumValues_1 = require("../cachedEnumValues");
|
|
41
|
-
const cachedClasses_1 = require("../core/cachedClasses");
|
|
42
|
-
const constants_1 = require("../core/constants");
|
|
43
|
-
const gridEntityTypeToBrokenStateMap_1 = require("../maps/gridEntityTypeToBrokenStateMap");
|
|
44
|
-
const gridEntityXMLMap_1 = require("../maps/gridEntityXMLMap");
|
|
45
|
-
const roomShapeToTopLeftWallGridIndexMap_1 = require("../maps/roomShapeToTopLeftWallGridIndexMap");
|
|
46
|
-
const gridEntityTypeToANM2Name_1 = require("../objects/gridEntityTypeToANM2Name");
|
|
47
|
-
const poopGridEntityXMLTypesSet_1 = require("../sets/poopGridEntityXMLTypesSet");
|
|
48
|
-
const ReadonlySet_1 = require("../types/ReadonlySet");
|
|
49
|
-
const entities_1 = require("./entities");
|
|
50
|
-
const entitiesSpecific_1 = require("./entitiesSpecific");
|
|
51
|
-
const math_1 = require("./math");
|
|
52
|
-
const rooms_1 = require("./rooms");
|
|
53
|
-
const types_1 = require("./types");
|
|
54
|
-
const utils_1 = require("./utils");
|
|
55
|
-
const vector_1 = require("./vector");
|
|
1
|
+
import { BackdropType, EffectVariant, GridCollisionClass, GridEntityType, PoopGridEntityVariant, StatueVariant, TrapdoorVariant, } from "isaac-typescript-definitions";
|
|
2
|
+
import { GRID_ENTITY_XML_TYPE_VALUES } from "../cachedEnumValues";
|
|
3
|
+
import { game } from "../core/cachedClasses";
|
|
4
|
+
import { DISTANCE_OF_GRID_TILE, VectorOne } from "../core/constants";
|
|
5
|
+
import { GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP } from "../maps/gridEntityTypeToBrokenStateMap";
|
|
6
|
+
import { GRID_ENTITY_XML_MAP } from "../maps/gridEntityXMLMap";
|
|
7
|
+
import { DEFAULT_TOP_LEFT_WALL_GRID_INDEX, ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP, } from "../maps/roomShapeToTopLeftWallGridIndexMap";
|
|
8
|
+
import { GRID_ENTITY_TYPE_TO_ANM2_NAME } from "../objects/gridEntityTypeToANM2Name";
|
|
9
|
+
import { POOP_GRID_ENTITY_XML_TYPES_SET } from "../sets/poopGridEntityXMLTypesSet";
|
|
10
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
11
|
+
import { removeEntities } from "./entities";
|
|
12
|
+
import { getEffects } from "./entitiesSpecific";
|
|
13
|
+
import { isCircleIntersectingRectangle } from "./math";
|
|
14
|
+
import { roomUpdateSafe } from "./rooms";
|
|
15
|
+
import { isInteger, parseIntSafe } from "./types";
|
|
16
|
+
import { assertDefined, eRange, iRange } from "./utils";
|
|
17
|
+
import { isVector, vectorEquals } from "./vector";
|
|
56
18
|
/**
|
|
57
19
|
* For some specific grid entities, the variant defined in the XML is what is used by the actual
|
|
58
20
|
* game (which is not the case for e.g. poops).
|
|
59
21
|
*/
|
|
60
|
-
const GRID_ENTITY_TYPES_THAT_KEEP_GRID_ENTITY_XML_VARIANT = new
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
22
|
+
const GRID_ENTITY_TYPES_THAT_KEEP_GRID_ENTITY_XML_VARIANT = new ReadonlySet([
|
|
23
|
+
GridEntityType.SPIKES_ON_OFF, // 9
|
|
24
|
+
GridEntityType.PRESSURE_PLATE, // 20
|
|
25
|
+
GridEntityType.TELEPORTER, // 23
|
|
64
26
|
]);
|
|
65
|
-
const BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS = new
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
27
|
+
const BREAKABLE_GRID_ENTITY_TYPES_BY_EXPLOSIONS = new ReadonlySet([
|
|
28
|
+
GridEntityType.ROCK, // 2
|
|
29
|
+
GridEntityType.ROCK_TINTED, // 4
|
|
30
|
+
GridEntityType.ROCK_BOMB, // 5
|
|
31
|
+
GridEntityType.ROCK_ALT, // 6
|
|
32
|
+
GridEntityType.SPIDER_WEB, // 10
|
|
33
|
+
GridEntityType.TNT, // 12
|
|
72
34
|
// GridEntityType.FIREPLACE (13) does not count since it is turned into a non-grid entity upon
|
|
73
35
|
// spawning.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
36
|
+
GridEntityType.POOP, // 14
|
|
37
|
+
GridEntityType.ROCK_SUPER_SPECIAL, // 22
|
|
38
|
+
GridEntityType.ROCK_SPIKED, // 25
|
|
39
|
+
GridEntityType.ROCK_ALT_2, // 26
|
|
40
|
+
GridEntityType.ROCK_GOLD, // 27
|
|
79
41
|
]);
|
|
80
|
-
const BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS = new
|
|
81
|
-
const GRID_ENTITY_XML_TYPES_SET = new
|
|
42
|
+
const BREAKABLE_GRID_ENTITY_TYPES_VARIANTS_BY_EXPLOSIONS = new ReadonlySet([`${GridEntityType.STATUE}.${StatueVariant.ANGEL}`]);
|
|
43
|
+
const GRID_ENTITY_XML_TYPES_SET = new ReadonlySet(GRID_ENTITY_XML_TYPE_VALUES);
|
|
82
44
|
/**
|
|
83
45
|
* Helper function to convert the grid entity type found in a room XML file to the corresponding
|
|
84
46
|
* grid entity type and variant normally used by the game. For example, `GridEntityXMLType.ROCK` is
|
|
85
47
|
* 1000 (in a room XML file), but `GridEntityType.ROCK` is equal to 2 (in-game).
|
|
86
48
|
*/
|
|
87
|
-
function convertXMLGridEntityType(gridEntityXMLType, gridEntityXMLVariant) {
|
|
88
|
-
const gridEntityArray =
|
|
89
|
-
|
|
49
|
+
export function convertXMLGridEntityType(gridEntityXMLType, gridEntityXMLVariant) {
|
|
50
|
+
const gridEntityArray = GRID_ENTITY_XML_MAP.get(gridEntityXMLType);
|
|
51
|
+
assertDefined(gridEntityArray, `Failed to find an entry in the grid entity map for XML entity type: ${gridEntityXMLType}`);
|
|
90
52
|
const gridEntityType = gridEntityArray[0];
|
|
91
53
|
const variant = GRID_ENTITY_TYPES_THAT_KEEP_GRID_ENTITY_XML_VARIANT.has(gridEntityType)
|
|
92
54
|
? gridEntityXMLVariant
|
|
@@ -100,8 +62,8 @@ function convertXMLGridEntityType(gridEntityXMLType, gridEntityXMLVariant) {
|
|
|
100
62
|
* @param gridEntityType The grid entity type to match.
|
|
101
63
|
* @param variant Optional. Default is -1, which matches every variant.
|
|
102
64
|
*/
|
|
103
|
-
function doesGridEntityExist(gridEntityType, variant = -1) {
|
|
104
|
-
const room =
|
|
65
|
+
export function doesGridEntityExist(gridEntityType, variant = -1) {
|
|
66
|
+
const room = game.GetRoom();
|
|
105
67
|
const gridIndexes = getAllGridIndexes();
|
|
106
68
|
return gridIndexes.some((gridIndex) => {
|
|
107
69
|
const gridEntity = room.GetGridEntity(gridIndex);
|
|
@@ -119,10 +81,10 @@ function doesGridEntityExist(gridEntityType, variant = -1) {
|
|
|
119
81
|
*
|
|
120
82
|
* Under the hood, this uses the `Room.GetGridSize` method.
|
|
121
83
|
*/
|
|
122
|
-
function getAllGridIndexes() {
|
|
123
|
-
const room =
|
|
84
|
+
export function getAllGridIndexes() {
|
|
85
|
+
const room = game.GetRoom();
|
|
124
86
|
const gridSize = room.GetGridSize();
|
|
125
|
-
return
|
|
87
|
+
return eRange(gridSize);
|
|
126
88
|
}
|
|
127
89
|
/**
|
|
128
90
|
* Gets the entities that have a hitbox that overlaps with any part of the square that the grid
|
|
@@ -134,28 +96,28 @@ function getAllGridIndexes() {
|
|
|
134
96
|
* Note that this function will not work properly in the `POST_NEW_ROOM` callback since entities do
|
|
135
97
|
* not have collision yet in that callback.
|
|
136
98
|
*/
|
|
137
|
-
function getCollidingEntitiesWithGridEntity(gridEntity) {
|
|
99
|
+
export function getCollidingEntitiesWithGridEntity(gridEntity) {
|
|
138
100
|
const { topLeft, bottomRight } = getGridEntityCollisionPoints(gridEntity);
|
|
139
|
-
const closeEntities = Isaac.FindInRadius(gridEntity.Position,
|
|
101
|
+
const closeEntities = Isaac.FindInRadius(gridEntity.Position, DISTANCE_OF_GRID_TILE * 2);
|
|
140
102
|
return closeEntities.filter((entity) => entity.CollidesWithGrid()
|
|
141
|
-
&&
|
|
103
|
+
&& isCircleIntersectingRectangle(entity.Position,
|
|
142
104
|
// We arbitrarily add 0.1 to account for entities that are already pushed back by the time
|
|
143
105
|
// the `POST_UPDATE` callback fires.
|
|
144
106
|
entity.Size + 0.1, topLeft, bottomRight));
|
|
145
107
|
}
|
|
146
108
|
/** Helper function to get the grid entity type and variant from a `GridEntityID`. */
|
|
147
|
-
function getConstituentsFromGridEntityID(gridEntityID) {
|
|
109
|
+
export function getConstituentsFromGridEntityID(gridEntityID) {
|
|
148
110
|
const parts = gridEntityID.split(".");
|
|
149
111
|
if (parts.length !== 2) {
|
|
150
112
|
error(`Failed to get the constituents from a grid entity ID: ${gridEntityID}`);
|
|
151
113
|
}
|
|
152
114
|
const [gridEntityTypeString, variantString] = parts;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const gridEntityType =
|
|
156
|
-
|
|
157
|
-
const variant =
|
|
158
|
-
|
|
115
|
+
assertDefined(gridEntityTypeString, `Failed to get the first constituent from a grid entity ID: ${gridEntityID}`);
|
|
116
|
+
assertDefined(variantString, `Failed to get the second constituent from a grid entity ID: ${gridEntityID}`);
|
|
117
|
+
const gridEntityType = parseIntSafe(gridEntityTypeString);
|
|
118
|
+
assertDefined(gridEntityType, `Failed to convert the grid entity type to a number: ${gridEntityTypeString}`);
|
|
119
|
+
const variant = parseIntSafe(variantString);
|
|
120
|
+
assertDefined(variant, `Failed to convert the grid entity variant to an integer: ${variantString}`);
|
|
159
121
|
return [gridEntityType, variant];
|
|
160
122
|
}
|
|
161
123
|
/**
|
|
@@ -184,12 +146,12 @@ function getConstituentsFromGridEntityID(gridEntityID) {
|
|
|
184
146
|
*
|
|
185
147
|
* @allowEmptyVariadic
|
|
186
148
|
*/
|
|
187
|
-
function getGridEntities(...gridEntityTypes) {
|
|
149
|
+
export function getGridEntities(...gridEntityTypes) {
|
|
188
150
|
const gridEntities = getAllGridEntities();
|
|
189
151
|
if (gridEntityTypes.length === 0) {
|
|
190
152
|
return gridEntities;
|
|
191
153
|
}
|
|
192
|
-
const gridEntityTypesSet = new
|
|
154
|
+
const gridEntityTypesSet = new ReadonlySet(gridEntityTypes);
|
|
193
155
|
return gridEntities.filter((gridEntity) => {
|
|
194
156
|
const gridEntityType = gridEntity.GetType();
|
|
195
157
|
return gridEntityTypesSet.has(gridEntityType);
|
|
@@ -201,30 +163,30 @@ function getGridEntities(...gridEntityTypes) {
|
|
|
201
163
|
* This function is variadic, meaning that you can specify as many grid entity types as you want to
|
|
202
164
|
* exclude.
|
|
203
165
|
*/
|
|
204
|
-
function getGridEntitiesExcept(...gridEntityTypes) {
|
|
166
|
+
export function getGridEntitiesExcept(...gridEntityTypes) {
|
|
205
167
|
const gridEntities = getAllGridEntities();
|
|
206
168
|
if (gridEntityTypes.length === 0) {
|
|
207
169
|
return gridEntities;
|
|
208
170
|
}
|
|
209
|
-
const gridEntityTypesSet = new
|
|
171
|
+
const gridEntityTypesSet = new ReadonlySet(gridEntityTypes);
|
|
210
172
|
return gridEntities.filter((gridEntity) => {
|
|
211
173
|
const gridEntityType = gridEntity.GetType();
|
|
212
174
|
return !gridEntityTypesSet.has(gridEntityType);
|
|
213
175
|
});
|
|
214
176
|
}
|
|
215
177
|
/** Helper function to get all grid entities in a given radius around a given point. */
|
|
216
|
-
function getGridEntitiesInRadius(targetPosition, radius) {
|
|
178
|
+
export function getGridEntitiesInRadius(targetPosition, radius) {
|
|
217
179
|
radius = Math.abs(radius);
|
|
218
|
-
const topLeftOffset =
|
|
180
|
+
const topLeftOffset = VectorOne.mul(-radius);
|
|
219
181
|
const mostTopLeftPosition = targetPosition.add(topLeftOffset);
|
|
220
|
-
const room =
|
|
182
|
+
const room = game.GetRoom();
|
|
221
183
|
const diameter = radius * 2;
|
|
222
|
-
const iterations = Math.ceil(diameter /
|
|
184
|
+
const iterations = Math.ceil(diameter / DISTANCE_OF_GRID_TILE);
|
|
223
185
|
const separation = diameter / iterations;
|
|
224
186
|
const gridEntities = [];
|
|
225
187
|
const registeredGridIndexes = new Set();
|
|
226
|
-
for (const x of
|
|
227
|
-
for (const y of
|
|
188
|
+
for (const x of iRange(iterations)) {
|
|
189
|
+
for (const y of iRange(iterations)) {
|
|
228
190
|
const position = mostTopLeftPosition.add(Vector(x * separation, y * separation));
|
|
229
191
|
const gridIndex = room.GetGridIndex(position);
|
|
230
192
|
const gridEntity = room.GetGridEntityFromPos(position);
|
|
@@ -233,7 +195,7 @@ function getGridEntitiesInRadius(targetPosition, radius) {
|
|
|
233
195
|
}
|
|
234
196
|
registeredGridIndexes.add(gridIndex);
|
|
235
197
|
const { topLeft, bottomRight } = getGridEntityCollisionPoints(gridEntity);
|
|
236
|
-
if (
|
|
198
|
+
if (isCircleIntersectingRectangle(targetPosition, radius, topLeft, bottomRight)) {
|
|
237
199
|
gridEntities.push(gridEntity);
|
|
238
200
|
}
|
|
239
201
|
}
|
|
@@ -249,7 +211,7 @@ function getGridEntitiesInRadius(targetPosition, radius) {
|
|
|
249
211
|
*
|
|
250
212
|
* @allowEmptyVariadic
|
|
251
213
|
*/
|
|
252
|
-
function getGridEntitiesMap(...gridEntityTypes) {
|
|
214
|
+
export function getGridEntitiesMap(...gridEntityTypes) {
|
|
253
215
|
const gridEntities = getGridEntities(...gridEntityTypes);
|
|
254
216
|
const gridEntityMap = new Map();
|
|
255
217
|
for (const gridEntity of gridEntities) {
|
|
@@ -259,21 +221,21 @@ function getGridEntitiesMap(...gridEntityTypes) {
|
|
|
259
221
|
return gridEntityMap;
|
|
260
222
|
}
|
|
261
223
|
/** Helper function to get the ANM2 path for a grid entity type. */
|
|
262
|
-
function getGridEntityANM2Path(gridEntityType) {
|
|
224
|
+
export function getGridEntityANM2Path(gridEntityType) {
|
|
263
225
|
const gridEntityANM2Name = getGridEntityANM2Name(gridEntityType);
|
|
264
226
|
return `gfx/grid/${gridEntityANM2Name}`;
|
|
265
227
|
}
|
|
266
228
|
/** Helper function to get the top left and bottom right corners of a given grid entity. */
|
|
267
|
-
function getGridEntityCollisionPoints(gridEntity) {
|
|
268
|
-
const topLeft = Vector(gridEntity.Position.X -
|
|
269
|
-
const bottomRight = Vector(gridEntity.Position.X +
|
|
229
|
+
export function getGridEntityCollisionPoints(gridEntity) {
|
|
230
|
+
const topLeft = Vector(gridEntity.Position.X - DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y - DISTANCE_OF_GRID_TILE / 2);
|
|
231
|
+
const bottomRight = Vector(gridEntity.Position.X + DISTANCE_OF_GRID_TILE / 2, gridEntity.Position.Y + DISTANCE_OF_GRID_TILE / 2);
|
|
270
232
|
return {
|
|
271
233
|
topLeft,
|
|
272
234
|
bottomRight,
|
|
273
235
|
};
|
|
274
236
|
}
|
|
275
237
|
/** Helper function to get a string containing the grid entity's type and variant. */
|
|
276
|
-
function getGridEntityID(gridEntity) {
|
|
238
|
+
export function getGridEntityID(gridEntity) {
|
|
277
239
|
const gridEntityType = gridEntity.GetType();
|
|
278
240
|
const variant = gridEntity.GetVariant();
|
|
279
241
|
return `${gridEntityType}.${variant}`;
|
|
@@ -282,7 +244,7 @@ function getGridEntityID(gridEntity) {
|
|
|
282
244
|
* Helper function to get a formatted string in the format returned by the `getGridEntityID`
|
|
283
245
|
* function.
|
|
284
246
|
*/
|
|
285
|
-
function getGridEntityIDFromConstituents(gridEntityType, variant) {
|
|
247
|
+
export function getGridEntityIDFromConstituents(gridEntityType, variant) {
|
|
286
248
|
return `${gridEntityType}.${variant}`;
|
|
287
249
|
}
|
|
288
250
|
/**
|
|
@@ -291,7 +253,7 @@ function getGridEntityIDFromConstituents(gridEntityType, variant) {
|
|
|
291
253
|
*
|
|
292
254
|
* If you want to match every variant, use the `getGridEntities` function instead.
|
|
293
255
|
*/
|
|
294
|
-
function getMatchingGridEntities(gridEntityType, variant) {
|
|
256
|
+
export function getMatchingGridEntities(gridEntityType, variant) {
|
|
295
257
|
const gridEntities = getGridEntities(gridEntityType);
|
|
296
258
|
return gridEntities.filter((gridEntity) => gridEntity.GetVariant() === variant);
|
|
297
259
|
}
|
|
@@ -301,7 +263,7 @@ function getMatchingGridEntities(gridEntityType, variant) {
|
|
|
301
263
|
*
|
|
302
264
|
* All of the rock PNGs are in the "gfx/grid" directory.
|
|
303
265
|
*/
|
|
304
|
-
function getRockPNGPath() {
|
|
266
|
+
export function getRockPNGPath() {
|
|
305
267
|
const rockPNGName = getRockPNGName();
|
|
306
268
|
return `gfx/grid/${rockPNGName}`;
|
|
307
269
|
}
|
|
@@ -311,8 +273,8 @@ function getRockPNGPath() {
|
|
|
311
273
|
* For example, if a rock was surrounded by rocks on all sides, this would return an array of 8
|
|
312
274
|
* rocks (e.g. top-left + top + top-right + left + right + bottom-left + bottom + right).
|
|
313
275
|
*/
|
|
314
|
-
function getSurroundingGridEntities(gridEntity) {
|
|
315
|
-
const room =
|
|
276
|
+
export function getSurroundingGridEntities(gridEntity) {
|
|
277
|
+
const room = game.GetRoom();
|
|
316
278
|
const gridIndex = gridEntity.GetGridIndex();
|
|
317
279
|
const surroundingGridIndexes = getSurroundingGridIndexes(gridIndex);
|
|
318
280
|
const surroundingGridEntities = [];
|
|
@@ -331,8 +293,8 @@ function getSurroundingGridEntities(gridEntity) {
|
|
|
331
293
|
* bottom-left + bottom + right), even if the computed values would be negative or otherwise
|
|
332
294
|
* invalid.
|
|
333
295
|
*/
|
|
334
|
-
function getSurroundingGridIndexes(gridIndex) {
|
|
335
|
-
const room =
|
|
296
|
+
export function getSurroundingGridIndexes(gridIndex) {
|
|
297
|
+
const room = game.GetRoom();
|
|
336
298
|
const gridWidth = room.GetGridWidth();
|
|
337
299
|
return [
|
|
338
300
|
gridIndex - gridWidth - 1, // Top-left
|
|
@@ -350,8 +312,8 @@ function getSurroundingGridIndexes(gridIndex) {
|
|
|
350
312
|
*
|
|
351
313
|
* This function can be useful in certain situations to determine if the room is currently loaded.
|
|
352
314
|
*/
|
|
353
|
-
function getTopLeftWall() {
|
|
354
|
-
const room =
|
|
315
|
+
export function getTopLeftWall() {
|
|
316
|
+
const room = game.GetRoom();
|
|
355
317
|
const topLeftWallGridIndex = getTopLeftWallGridIndex();
|
|
356
318
|
return room.GetGridEntity(topLeftWallGridIndex);
|
|
357
319
|
}
|
|
@@ -361,11 +323,11 @@ function getTopLeftWall() {
|
|
|
361
323
|
*
|
|
362
324
|
* This function can be useful in certain situations to determine if the room is currently loaded.
|
|
363
325
|
*/
|
|
364
|
-
function getTopLeftWallGridIndex() {
|
|
365
|
-
const room =
|
|
326
|
+
export function getTopLeftWallGridIndex() {
|
|
327
|
+
const room = game.GetRoom();
|
|
366
328
|
const roomShape = room.GetRoomShape();
|
|
367
|
-
const topLeftWallGridIndex =
|
|
368
|
-
return topLeftWallGridIndex ??
|
|
329
|
+
const topLeftWallGridIndex = ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP.get(roomShape);
|
|
330
|
+
return topLeftWallGridIndex ?? DEFAULT_TOP_LEFT_WALL_GRID_INDEX;
|
|
369
331
|
}
|
|
370
332
|
/**
|
|
371
333
|
* Helper function to detect if a particular grid entity would "break" if it was touched by an
|
|
@@ -373,7 +335,7 @@ function getTopLeftWallGridIndex() {
|
|
|
373
335
|
*
|
|
374
336
|
* For example, rocks and pots are breakable by explosions, but blocks are not.
|
|
375
337
|
*/
|
|
376
|
-
function isGridEntityBreakableByExplosion(gridEntity) {
|
|
338
|
+
export function isGridEntityBreakableByExplosion(gridEntity) {
|
|
377
339
|
const gridEntityType = gridEntity.GetType();
|
|
378
340
|
const variant = gridEntity.GetVariant();
|
|
379
341
|
const gridEntityTypeVariant = `${gridEntityType}.${variant}`;
|
|
@@ -387,24 +349,24 @@ function isGridEntityBreakableByExplosion(gridEntity) {
|
|
|
387
349
|
* Note that in the case of `GridEntityType.LOCK` (11), the state will turn to being broken before
|
|
388
350
|
* the actual collision for the entity is removed.
|
|
389
351
|
*/
|
|
390
|
-
function isGridEntityBroken(gridEntity) {
|
|
352
|
+
export function isGridEntityBroken(gridEntity) {
|
|
391
353
|
const gridEntityType = gridEntity.GetType();
|
|
392
|
-
const brokenState =
|
|
354
|
+
const brokenState = GRID_ENTITY_TYPE_TO_BROKEN_STATE_MAP.get(gridEntityType);
|
|
393
355
|
return gridEntity.State === brokenState;
|
|
394
356
|
}
|
|
395
357
|
/**
|
|
396
358
|
* Helper function to see if an arbitrary number is a valid `GridEntityXMLType`. This is useful in
|
|
397
359
|
* the `PRE_ROOM_ENTITY_SPAWN` callback for narrowing the type of the first argument.
|
|
398
360
|
*/
|
|
399
|
-
function isGridEntityXMLType(num) {
|
|
361
|
+
export function isGridEntityXMLType(num) {
|
|
400
362
|
return GRID_ENTITY_XML_TYPES_SET.has(num); // eslint-disable-line complete/strict-enums
|
|
401
363
|
}
|
|
402
364
|
/**
|
|
403
365
|
* Helper function to check if the provided grid index has a door on it or if the surrounding 8 grid
|
|
404
366
|
* indexes have a door on it.
|
|
405
367
|
*/
|
|
406
|
-
function isGridIndexAdjacentToDoor(gridIndex) {
|
|
407
|
-
const room =
|
|
368
|
+
export function isGridIndexAdjacentToDoor(gridIndex) {
|
|
369
|
+
const room = game.GetRoom();
|
|
408
370
|
const surroundingGridIndexes = getSurroundingGridIndexes(gridIndex);
|
|
409
371
|
const gridIndexes = [gridIndex, ...surroundingGridIndexes];
|
|
410
372
|
for (const gridIndexToInspect of gridIndexes) {
|
|
@@ -419,8 +381,8 @@ function isGridIndexAdjacentToDoor(gridIndex) {
|
|
|
419
381
|
return false;
|
|
420
382
|
}
|
|
421
383
|
/** Helper function to see if a `GridEntityXMLType` is some kind of poop. */
|
|
422
|
-
function isPoopGridEntityXMLType(gridEntityXMLType) {
|
|
423
|
-
return
|
|
384
|
+
export function isPoopGridEntityXMLType(gridEntityXMLType) {
|
|
385
|
+
return POOP_GRID_ENTITY_XML_TYPES_SET.has(gridEntityXMLType);
|
|
424
386
|
}
|
|
425
387
|
/**
|
|
426
388
|
* Helper function to detect whether a given Void Portal is one that randomly spawns after a boss is
|
|
@@ -430,11 +392,11 @@ function isPoopGridEntityXMLType(gridEntityXMLType) {
|
|
|
430
392
|
* - The `VarData` of Void Portals that are spawned after bosses will be equal to 1.
|
|
431
393
|
* - The `VarData` of the Void Portal in the room after Hush is equal to 0.
|
|
432
394
|
*/
|
|
433
|
-
function isPostBossVoidPortal(gridEntity) {
|
|
395
|
+
export function isPostBossVoidPortal(gridEntity) {
|
|
434
396
|
const saveState = gridEntity.GetSaveState();
|
|
435
|
-
return (saveState.Type ===
|
|
397
|
+
return (saveState.Type === GridEntityType.TRAPDOOR
|
|
436
398
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
437
|
-
&& saveState.Variant ===
|
|
399
|
+
&& saveState.Variant === TrapdoorVariant.VOID_PORTAL
|
|
438
400
|
&& saveState.VarData === 1);
|
|
439
401
|
}
|
|
440
402
|
/**
|
|
@@ -455,8 +417,8 @@ function isPostBossVoidPortal(gridEntity) {
|
|
|
455
417
|
*
|
|
456
418
|
* @returns The grid entities that were removed.
|
|
457
419
|
*/
|
|
458
|
-
function removeAllGridEntitiesExcept(...gridEntityTypes) {
|
|
459
|
-
const gridEntityTypeExceptions = new
|
|
420
|
+
export function removeAllGridEntitiesExcept(...gridEntityTypes) {
|
|
421
|
+
const gridEntityTypeExceptions = new ReadonlySet(gridEntityTypes);
|
|
460
422
|
const gridEntities = getGridEntities();
|
|
461
423
|
const removedGridEntities = [];
|
|
462
424
|
for (const gridEntity of gridEntities) {
|
|
@@ -467,7 +429,7 @@ function removeAllGridEntitiesExcept(...gridEntityTypes) {
|
|
|
467
429
|
}
|
|
468
430
|
}
|
|
469
431
|
if (removedGridEntities.length > 0) {
|
|
470
|
-
|
|
432
|
+
roomUpdateSafe();
|
|
471
433
|
}
|
|
472
434
|
return removedGridEntities;
|
|
473
435
|
}
|
|
@@ -490,7 +452,7 @@ function removeAllGridEntitiesExcept(...gridEntityTypes) {
|
|
|
490
452
|
*
|
|
491
453
|
* @returns An array of the grid entities removed.
|
|
492
454
|
*/
|
|
493
|
-
function removeAllMatchingGridEntities(...gridEntityType) {
|
|
455
|
+
export function removeAllMatchingGridEntities(...gridEntityType) {
|
|
494
456
|
const gridEntities = getGridEntities(...gridEntityType);
|
|
495
457
|
if (gridEntities.length === 0) {
|
|
496
458
|
return [];
|
|
@@ -498,7 +460,7 @@ function removeAllMatchingGridEntities(...gridEntityType) {
|
|
|
498
460
|
for (const gridEntity of gridEntities) {
|
|
499
461
|
removeGridEntity(gridEntity, false);
|
|
500
462
|
}
|
|
501
|
-
|
|
463
|
+
roomUpdateSafe();
|
|
502
464
|
return gridEntities;
|
|
503
465
|
}
|
|
504
466
|
/**
|
|
@@ -508,10 +470,10 @@ function removeAllMatchingGridEntities(...gridEntityType) {
|
|
|
508
470
|
*
|
|
509
471
|
* You must specify an array of entities to look through.
|
|
510
472
|
*/
|
|
511
|
-
function removeEntitiesSpawnedFromGridEntity(entities, gridEntity) {
|
|
473
|
+
export function removeEntitiesSpawnedFromGridEntity(entities, gridEntity) {
|
|
512
474
|
const entitiesFromGridEntity = entities.filter((entity) => entity.FrameCount === 0
|
|
513
|
-
&&
|
|
514
|
-
|
|
475
|
+
&& vectorEquals(entity.Position, gridEntity.Position));
|
|
476
|
+
removeEntities(entitiesFromGridEntity);
|
|
515
477
|
}
|
|
516
478
|
/**
|
|
517
479
|
* Helper function to remove all of the grid entities in the supplied array.
|
|
@@ -525,7 +487,7 @@ function removeEntitiesSpawnedFromGridEntity(entities, gridEntity) {
|
|
|
525
487
|
* @param cap Optional. If specified, will only remove the given amount of entities.
|
|
526
488
|
* @returns An array of the entities that were removed.
|
|
527
489
|
*/
|
|
528
|
-
function removeGridEntities(gridEntities, updateRoom, cap) {
|
|
490
|
+
export function removeGridEntities(gridEntities, updateRoom, cap) {
|
|
529
491
|
if (gridEntities.length === 0) {
|
|
530
492
|
return [];
|
|
531
493
|
}
|
|
@@ -538,7 +500,7 @@ function removeGridEntities(gridEntities, updateRoom, cap) {
|
|
|
538
500
|
}
|
|
539
501
|
}
|
|
540
502
|
if (updateRoom) {
|
|
541
|
-
|
|
503
|
+
roomUpdateSafe();
|
|
542
504
|
}
|
|
543
505
|
return gridEntitiesRemoved;
|
|
544
506
|
}
|
|
@@ -556,9 +518,9 @@ function removeGridEntities(gridEntities, updateRoom, cap) {
|
|
|
556
518
|
* this is expensive, since it involves a call to `Isaac.GetRoomEntities`, so set
|
|
557
519
|
* this to false if you need to run this function multiple times.
|
|
558
520
|
*/
|
|
559
|
-
function removeGridEntity(gridEntityOrGridIndex, updateRoom) {
|
|
560
|
-
const room =
|
|
561
|
-
const gridEntity =
|
|
521
|
+
export function removeGridEntity(gridEntityOrGridIndex, updateRoom) {
|
|
522
|
+
const room = game.GetRoom();
|
|
523
|
+
const gridEntity = isInteger(gridEntityOrGridIndex)
|
|
562
524
|
? room.GetGridEntity(gridEntityOrGridIndex)
|
|
563
525
|
: gridEntityOrGridIndex;
|
|
564
526
|
if (gridEntity === undefined) {
|
|
@@ -568,24 +530,24 @@ function removeGridEntity(gridEntityOrGridIndex, updateRoom) {
|
|
|
568
530
|
const gridEntityType = gridEntity.GetType();
|
|
569
531
|
const variant = gridEntity.GetVariant();
|
|
570
532
|
const position = gridEntity.Position;
|
|
571
|
-
const gridIndex =
|
|
533
|
+
const gridIndex = isInteger(gridEntityOrGridIndex)
|
|
572
534
|
? gridEntityOrGridIndex
|
|
573
535
|
: gridEntityOrGridIndex.GetGridIndex();
|
|
574
536
|
room.RemoveGridEntity(gridIndex, 0, false);
|
|
575
537
|
if (updateRoom) {
|
|
576
|
-
|
|
538
|
+
roomUpdateSafe();
|
|
577
539
|
}
|
|
578
540
|
// In the special case of removing a Devil Statue or Angel Statue, we also need to delete the
|
|
579
541
|
// corresponding effect.
|
|
580
|
-
if (gridEntityType ===
|
|
542
|
+
if (gridEntityType === GridEntityType.STATUE) {
|
|
581
543
|
const effectVariant =
|
|
582
544
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
583
|
-
variant ===
|
|
584
|
-
?
|
|
585
|
-
:
|
|
586
|
-
const effects =
|
|
587
|
-
const effectsOnTile = effects.filter((effect) =>
|
|
588
|
-
|
|
545
|
+
variant === StatueVariant.DEVIL
|
|
546
|
+
? EffectVariant.DEVIL
|
|
547
|
+
: EffectVariant.ANGEL;
|
|
548
|
+
const effects = getEffects(effectVariant);
|
|
549
|
+
const effectsOnTile = effects.filter((effect) => vectorEquals(effect.Position, position));
|
|
550
|
+
removeEntities(effectsOnTile);
|
|
589
551
|
}
|
|
590
552
|
}
|
|
591
553
|
/**
|
|
@@ -595,7 +557,7 @@ function removeGridEntity(gridEntityOrGridIndex, updateRoom) {
|
|
|
595
557
|
* longer become visible. (This is because the information about the sprite is lost when it is
|
|
596
558
|
* reset.)
|
|
597
559
|
*/
|
|
598
|
-
function setGridEntityInvisible(gridEntity) {
|
|
560
|
+
export function setGridEntityInvisible(gridEntity) {
|
|
599
561
|
const sprite = gridEntity.GetSprite();
|
|
600
562
|
sprite.Reset();
|
|
601
563
|
}
|
|
@@ -606,7 +568,7 @@ function setGridEntityInvisible(gridEntity) {
|
|
|
606
568
|
*
|
|
607
569
|
* Setting the new type to `GridEntityType.NULL` (0) will have no effect.
|
|
608
570
|
*/
|
|
609
|
-
function setGridEntityType(gridEntity, gridEntityType) {
|
|
571
|
+
export function setGridEntityType(gridEntity, gridEntityType) {
|
|
610
572
|
gridEntity.SetType(gridEntityType);
|
|
611
573
|
const sprite = gridEntity.GetSprite();
|
|
612
574
|
const anm2Path = getGridEntityANM2Path(gridEntityType);
|
|
@@ -614,7 +576,7 @@ function setGridEntityType(gridEntity, gridEntityType) {
|
|
|
614
576
|
return;
|
|
615
577
|
}
|
|
616
578
|
sprite.Load(anm2Path, false);
|
|
617
|
-
if (gridEntityType ===
|
|
579
|
+
if (gridEntityType === GridEntityType.ROCK) {
|
|
618
580
|
const pngPath = getRockPNGPath();
|
|
619
581
|
sprite.ReplaceSpritesheet(0, pngPath);
|
|
620
582
|
}
|
|
@@ -628,8 +590,8 @@ function setGridEntityType(gridEntity, gridEntityType) {
|
|
|
628
590
|
*
|
|
629
591
|
* @returns Whether spawning the four quadrants was successful.
|
|
630
592
|
*/
|
|
631
|
-
function spawnGiantPoop(topLeftGridIndex) {
|
|
632
|
-
const room =
|
|
593
|
+
export function spawnGiantPoop(topLeftGridIndex) {
|
|
594
|
+
const room = game.GetRoom();
|
|
633
595
|
const gridWidth = room.GetGridWidth();
|
|
634
596
|
const topRightGridIndex = topLeftGridIndex + 1;
|
|
635
597
|
const bottomLeftGridIndex = topLeftGridIndex + gridWidth;
|
|
@@ -646,26 +608,26 @@ function spawnGiantPoop(topLeftGridIndex) {
|
|
|
646
608
|
return false;
|
|
647
609
|
}
|
|
648
610
|
}
|
|
649
|
-
const topLeft = spawnGridEntityWithVariant(
|
|
650
|
-
const topRight = spawnGridEntityWithVariant(
|
|
651
|
-
const bottomLeft = spawnGridEntityWithVariant(
|
|
652
|
-
const bottomRight = spawnGridEntityWithVariant(
|
|
611
|
+
const topLeft = spawnGridEntityWithVariant(GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_LEFT, topLeftGridIndex);
|
|
612
|
+
const topRight = spawnGridEntityWithVariant(GridEntityType.POOP, PoopGridEntityVariant.GIANT_TOP_RIGHT, topRightGridIndex);
|
|
613
|
+
const bottomLeft = spawnGridEntityWithVariant(GridEntityType.POOP, PoopGridEntityVariant.GIANT_BOTTOM_LEFT, bottomLeftGridIndex);
|
|
614
|
+
const bottomRight = spawnGridEntityWithVariant(GridEntityType.POOP, PoopGridEntityVariant.GIANT_BOTTOM_RIGHT, bottomRightGridIndex);
|
|
653
615
|
return (topLeft !== undefined
|
|
654
|
-
&& topLeft.GetType() ===
|
|
616
|
+
&& topLeft.GetType() === GridEntityType.POOP
|
|
655
617
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
656
|
-
&& topLeft.GetVariant() ===
|
|
618
|
+
&& topLeft.GetVariant() === PoopGridEntityVariant.GIANT_TOP_LEFT
|
|
657
619
|
&& topRight !== undefined
|
|
658
|
-
&& topRight.GetType() ===
|
|
620
|
+
&& topRight.GetType() === GridEntityType.POOP
|
|
659
621
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
660
|
-
&& topRight.GetVariant() ===
|
|
622
|
+
&& topRight.GetVariant() === PoopGridEntityVariant.GIANT_TOP_RIGHT
|
|
661
623
|
&& bottomLeft !== undefined
|
|
662
|
-
&& bottomLeft.GetType() ===
|
|
624
|
+
&& bottomLeft.GetType() === GridEntityType.POOP
|
|
663
625
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
664
|
-
&& bottomLeft.GetVariant() ===
|
|
626
|
+
&& bottomLeft.GetVariant() === PoopGridEntityVariant.GIANT_BOTTOM_LEFT
|
|
665
627
|
&& bottomRight !== undefined
|
|
666
|
-
&& bottomRight.GetType() ===
|
|
628
|
+
&& bottomRight.GetType() === GridEntityType.POOP
|
|
667
629
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
|
|
668
|
-
&& bottomRight.GetVariant() ===
|
|
630
|
+
&& bottomRight.GetVariant() === PoopGridEntityVariant.GIANT_BOTTOM_RIGHT);
|
|
669
631
|
}
|
|
670
632
|
/**
|
|
671
633
|
* Helper function to spawn a grid entity with a specific type.
|
|
@@ -687,7 +649,7 @@ function spawnGiantPoop(topLeftGridIndex) {
|
|
|
687
649
|
* function will do nothing, since spawning a grid entity on top of
|
|
688
650
|
* another grid entity will not replace it.
|
|
689
651
|
*/
|
|
690
|
-
function spawnGridEntity(gridEntityType, gridIndexOrPosition, shouldRemoveExistingGridEntity = true) {
|
|
652
|
+
export function spawnGridEntity(gridEntityType, gridIndexOrPosition, shouldRemoveExistingGridEntity = true) {
|
|
691
653
|
return spawnGridEntityWithVariant(gridEntityType, 0, gridIndexOrPosition, shouldRemoveExistingGridEntity);
|
|
692
654
|
}
|
|
693
655
|
/**
|
|
@@ -708,15 +670,15 @@ function spawnGridEntity(gridEntityType, gridIndexOrPosition, shouldRemoveExisti
|
|
|
708
670
|
* function will do nothing, since spawning a grid entity on top of
|
|
709
671
|
* another grid entity will not replace it.
|
|
710
672
|
*/
|
|
711
|
-
function spawnGridEntityWithVariant(gridEntityType, variant, gridIndexOrPosition, shouldRemoveExistingGridEntity = true) {
|
|
712
|
-
const room =
|
|
673
|
+
export function spawnGridEntityWithVariant(gridEntityType, variant, gridIndexOrPosition, shouldRemoveExistingGridEntity = true) {
|
|
674
|
+
const room = game.GetRoom();
|
|
713
675
|
// We do an explicit check to prevent run-time errors in Lua environments.
|
|
714
676
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
715
677
|
if (gridIndexOrPosition === undefined) {
|
|
716
678
|
const gridEntityID = getGridEntityIDFromConstituents(gridEntityType, variant);
|
|
717
679
|
error(`Failed to spawn grid entity ${gridEntityID} since an undefined position was passed to the "spawnGridEntityWithVariant" function.`);
|
|
718
680
|
}
|
|
719
|
-
const existingGridEntity =
|
|
681
|
+
const existingGridEntity = isVector(gridIndexOrPosition)
|
|
720
682
|
? room.GetGridEntityFromPos(gridIndexOrPosition)
|
|
721
683
|
: room.GetGridEntity(gridIndexOrPosition);
|
|
722
684
|
if (existingGridEntity !== undefined) {
|
|
@@ -727,14 +689,14 @@ function spawnGridEntityWithVariant(gridEntityType, variant, gridIndexOrPosition
|
|
|
727
689
|
return undefined;
|
|
728
690
|
}
|
|
729
691
|
}
|
|
730
|
-
const position =
|
|
692
|
+
const position = isVector(gridIndexOrPosition)
|
|
731
693
|
? gridIndexOrPosition
|
|
732
694
|
: room.GetGridPosition(gridIndexOrPosition);
|
|
733
695
|
const gridEntity = Isaac.GridSpawn(gridEntityType, variant, position);
|
|
734
696
|
if (gridEntity === undefined) {
|
|
735
697
|
return gridEntity;
|
|
736
698
|
}
|
|
737
|
-
if (gridEntityType ===
|
|
699
|
+
if (gridEntityType === GridEntityType.PIT) {
|
|
738
700
|
// For some reason, spawned pits start with a collision class of `NONE`, so we have to manually
|
|
739
701
|
// set it.
|
|
740
702
|
const pit = gridEntity.ToPit();
|
|
@@ -742,10 +704,10 @@ function spawnGridEntityWithVariant(gridEntityType, variant, gridIndexOrPosition
|
|
|
742
704
|
pit.UpdateCollision();
|
|
743
705
|
}
|
|
744
706
|
}
|
|
745
|
-
else if (gridEntityType ===
|
|
707
|
+
else if (gridEntityType === GridEntityType.WALL) {
|
|
746
708
|
// For some reason, spawned walls start with a collision class of `NONE`, so we have to manually
|
|
747
709
|
// set it.
|
|
748
|
-
gridEntity.CollisionClass =
|
|
710
|
+
gridEntity.CollisionClass = GridCollisionClass.WALL;
|
|
749
711
|
}
|
|
750
712
|
return gridEntity;
|
|
751
713
|
}
|
|
@@ -753,8 +715,8 @@ function spawnGridEntityWithVariant(gridEntityType, variant, gridIndexOrPosition
|
|
|
753
715
|
* Helper function to spawn a Void Portal. This is more complicated than simply spawning a trapdoor
|
|
754
716
|
* with the appropriate variant, as the game does not give it the correct sprite automatically.
|
|
755
717
|
*/
|
|
756
|
-
function spawnVoidPortal(gridIndex) {
|
|
757
|
-
const voidPortal = spawnGridEntityWithVariant(
|
|
718
|
+
export function spawnVoidPortal(gridIndex) {
|
|
719
|
+
const voidPortal = spawnGridEntityWithVariant(GridEntityType.TRAPDOOR, TrapdoorVariant.VOID_PORTAL, gridIndex);
|
|
758
720
|
if (voidPortal === undefined) {
|
|
759
721
|
return voidPortal;
|
|
760
722
|
}
|
|
@@ -766,7 +728,7 @@ function spawnVoidPortal(gridIndex) {
|
|
|
766
728
|
return voidPortal;
|
|
767
729
|
}
|
|
768
730
|
function getAllGridEntities() {
|
|
769
|
-
const room =
|
|
731
|
+
const room = game.GetRoom();
|
|
770
732
|
const gridEntities = [];
|
|
771
733
|
for (const gridIndex of getAllGridIndexes()) {
|
|
772
734
|
const gridEntity = room.GetGridEntity(gridIndex);
|
|
@@ -779,11 +741,11 @@ function getAllGridEntities() {
|
|
|
779
741
|
function getGridEntityANM2Name(gridEntityType) {
|
|
780
742
|
switch (gridEntityType) {
|
|
781
743
|
// 1
|
|
782
|
-
case
|
|
744
|
+
case GridEntityType.DECORATION: {
|
|
783
745
|
return getGridEntityANM2NameDecoration();
|
|
784
746
|
}
|
|
785
747
|
default: {
|
|
786
|
-
return
|
|
748
|
+
return GRID_ENTITY_TYPE_TO_ANM2_NAME[gridEntityType];
|
|
787
749
|
}
|
|
788
750
|
}
|
|
789
751
|
}
|
|
@@ -792,91 +754,91 @@ function getGridEntityANM2Name(gridEntityType) {
|
|
|
792
754
|
* backdrop. The values are taken from the "backdrops.xml" file.
|
|
793
755
|
*/
|
|
794
756
|
function getGridEntityANM2NameDecoration() {
|
|
795
|
-
const room =
|
|
757
|
+
const room = game.GetRoom();
|
|
796
758
|
const backdropType = room.GetBackdropType();
|
|
797
759
|
switch (backdropType) {
|
|
798
760
|
// 1, 2, 3, 36, 49, 52
|
|
799
|
-
case
|
|
800
|
-
case
|
|
801
|
-
case
|
|
802
|
-
case
|
|
803
|
-
case
|
|
804
|
-
case
|
|
761
|
+
case BackdropType.BASEMENT:
|
|
762
|
+
case BackdropType.CELLAR:
|
|
763
|
+
case BackdropType.BURNING_BASEMENT:
|
|
764
|
+
case BackdropType.DOWNPOUR_ENTRANCE:
|
|
765
|
+
case BackdropType.ISAACS_BEDROOM:
|
|
766
|
+
case BackdropType.CLOSET: {
|
|
805
767
|
return "Props_01_Basement.anm2";
|
|
806
768
|
}
|
|
807
769
|
// 4, 5, 6, 37
|
|
808
|
-
case
|
|
809
|
-
case
|
|
810
|
-
case
|
|
811
|
-
case
|
|
770
|
+
case BackdropType.CAVES:
|
|
771
|
+
case BackdropType.CATACOMBS:
|
|
772
|
+
case BackdropType.FLOODED_CAVES:
|
|
773
|
+
case BackdropType.MINES_ENTRANCE: {
|
|
812
774
|
return "Props_03_Caves.anm2";
|
|
813
775
|
}
|
|
814
776
|
// 7, 8, 9, 30, 33, 38, 39, 40, 41, 42, 53, 60
|
|
815
|
-
case
|
|
816
|
-
case
|
|
817
|
-
case
|
|
818
|
-
case
|
|
819
|
-
case
|
|
820
|
-
case
|
|
821
|
-
case
|
|
822
|
-
case
|
|
823
|
-
case
|
|
824
|
-
case
|
|
825
|
-
case
|
|
826
|
-
case
|
|
777
|
+
case BackdropType.DEPTHS:
|
|
778
|
+
case BackdropType.NECROPOLIS:
|
|
779
|
+
case BackdropType.DANK_DEPTHS:
|
|
780
|
+
case BackdropType.SACRIFICE:
|
|
781
|
+
case BackdropType.MAUSOLEUM:
|
|
782
|
+
case BackdropType.MAUSOLEUM_ENTRANCE:
|
|
783
|
+
case BackdropType.CORPSE_ENTRANCE:
|
|
784
|
+
case BackdropType.MAUSOLEUM_2:
|
|
785
|
+
case BackdropType.MAUSOLEUM_3:
|
|
786
|
+
case BackdropType.MAUSOLEUM_4:
|
|
787
|
+
case BackdropType.CLOSET_B:
|
|
788
|
+
case BackdropType.DARK_CLOSET: {
|
|
827
789
|
return "Props_05_Depths.anm2";
|
|
828
790
|
}
|
|
829
791
|
// 10, 12
|
|
830
|
-
case
|
|
831
|
-
case
|
|
792
|
+
case BackdropType.WOMB:
|
|
793
|
+
case BackdropType.SCARRED_WOMB: {
|
|
832
794
|
return "Props_07_The Womb.anm2";
|
|
833
795
|
}
|
|
834
796
|
// 11
|
|
835
|
-
case
|
|
797
|
+
case BackdropType.UTERO: {
|
|
836
798
|
return "Props_07_Utero.anm2";
|
|
837
799
|
}
|
|
838
800
|
// 13, 27
|
|
839
|
-
case
|
|
840
|
-
case
|
|
801
|
+
case BackdropType.BLUE_WOMB:
|
|
802
|
+
case BackdropType.BLUE_WOMB_PASS: {
|
|
841
803
|
return "Props_07_The Womb_blue.anm2";
|
|
842
804
|
}
|
|
843
805
|
// 14, 47
|
|
844
|
-
case
|
|
845
|
-
case
|
|
806
|
+
case BackdropType.SHEOL:
|
|
807
|
+
case BackdropType.GEHENNA: {
|
|
846
808
|
return "Props_09_Sheol.anm2";
|
|
847
809
|
}
|
|
848
810
|
// 15
|
|
849
|
-
case
|
|
811
|
+
case BackdropType.CATHEDRAL: {
|
|
850
812
|
return "Props_10_Cathedral.anm2";
|
|
851
813
|
}
|
|
852
814
|
// 17
|
|
853
|
-
case
|
|
815
|
+
case BackdropType.CHEST: {
|
|
854
816
|
return "Props_11_The Chest.anm2";
|
|
855
817
|
}
|
|
856
818
|
// 28
|
|
857
|
-
case
|
|
819
|
+
case BackdropType.GREED_SHOP: {
|
|
858
820
|
return "Props_12_Greed.anm2";
|
|
859
821
|
}
|
|
860
822
|
// 31
|
|
861
|
-
case
|
|
823
|
+
case BackdropType.DOWNPOUR: {
|
|
862
824
|
return "props_01x_downpour.anm2";
|
|
863
825
|
}
|
|
864
826
|
// 32, 46, 58, 59
|
|
865
|
-
case
|
|
866
|
-
case
|
|
867
|
-
case
|
|
868
|
-
case
|
|
827
|
+
case BackdropType.MINES:
|
|
828
|
+
case BackdropType.ASHPIT:
|
|
829
|
+
case BackdropType.MINES_SHAFT:
|
|
830
|
+
case BackdropType.ASHPIT_SHAFT: {
|
|
869
831
|
return "props_03x_mines.anm2";
|
|
870
832
|
}
|
|
871
833
|
// 34, 43, 44, 48
|
|
872
|
-
case
|
|
873
|
-
case
|
|
874
|
-
case
|
|
875
|
-
case
|
|
834
|
+
case BackdropType.CORPSE:
|
|
835
|
+
case BackdropType.CORPSE_2:
|
|
836
|
+
case BackdropType.CORPSE_3:
|
|
837
|
+
case BackdropType.MORTIS: {
|
|
876
838
|
return "props_07_the corpse.anm2";
|
|
877
839
|
}
|
|
878
840
|
// 45
|
|
879
|
-
case
|
|
841
|
+
case BackdropType.DROSS: {
|
|
880
842
|
return "props_02x_dross.anm2";
|
|
881
843
|
}
|
|
882
844
|
default: {
|
|
@@ -885,117 +847,117 @@ function getGridEntityANM2NameDecoration() {
|
|
|
885
847
|
}
|
|
886
848
|
}
|
|
887
849
|
function getRockPNGName() {
|
|
888
|
-
const room =
|
|
850
|
+
const room = game.GetRoom();
|
|
889
851
|
const backdropType = room.GetBackdropType();
|
|
890
852
|
switch (backdropType) {
|
|
891
853
|
// 1, 17
|
|
892
|
-
case
|
|
893
|
-
case
|
|
854
|
+
case BackdropType.BASEMENT:
|
|
855
|
+
case BackdropType.CHEST: {
|
|
894
856
|
return "rocks_basement.png";
|
|
895
857
|
}
|
|
896
858
|
// 2
|
|
897
|
-
case
|
|
859
|
+
case BackdropType.CELLAR: {
|
|
898
860
|
return "rocks_cellar.png";
|
|
899
861
|
}
|
|
900
862
|
// 3
|
|
901
|
-
case
|
|
863
|
+
case BackdropType.BURNING_BASEMENT: {
|
|
902
864
|
return "rocks_burningbasement.png"; // cspell:ignore burningbasement
|
|
903
865
|
}
|
|
904
866
|
// 4
|
|
905
|
-
case
|
|
867
|
+
case BackdropType.CAVES: {
|
|
906
868
|
return "rocks_caves.png";
|
|
907
869
|
}
|
|
908
870
|
// 5
|
|
909
|
-
case
|
|
871
|
+
case BackdropType.CATACOMBS: {
|
|
910
872
|
return "rocks_catacombs.png";
|
|
911
873
|
}
|
|
912
874
|
// 6
|
|
913
|
-
case
|
|
875
|
+
case BackdropType.FLOODED_CAVES: {
|
|
914
876
|
return "rocks_drownedcaves.png"; // cspell:ignore drownedcaves
|
|
915
877
|
}
|
|
916
878
|
// 7, 8, 9, 30, 60
|
|
917
|
-
case
|
|
918
|
-
case
|
|
919
|
-
case
|
|
920
|
-
case
|
|
921
|
-
case
|
|
879
|
+
case BackdropType.DEPTHS:
|
|
880
|
+
case BackdropType.NECROPOLIS:
|
|
881
|
+
case BackdropType.DANK_DEPTHS:
|
|
882
|
+
case BackdropType.SACRIFICE:
|
|
883
|
+
case BackdropType.DARK_CLOSET: {
|
|
922
884
|
return "rocks_depths.png";
|
|
923
885
|
}
|
|
924
886
|
// 10
|
|
925
|
-
case
|
|
887
|
+
case BackdropType.WOMB: {
|
|
926
888
|
return "rocks_womb.png";
|
|
927
889
|
}
|
|
928
890
|
// 11
|
|
929
|
-
case
|
|
891
|
+
case BackdropType.UTERO: {
|
|
930
892
|
return "rocks_utero.png";
|
|
931
893
|
}
|
|
932
894
|
// 12
|
|
933
|
-
case
|
|
895
|
+
case BackdropType.SCARRED_WOMB: {
|
|
934
896
|
return "rocks_scarredwomb.png"; // cspell:ignore scarredwomb
|
|
935
897
|
}
|
|
936
898
|
// 13, 27
|
|
937
|
-
case
|
|
938
|
-
case
|
|
899
|
+
case BackdropType.BLUE_WOMB:
|
|
900
|
+
case BackdropType.BLUE_WOMB_PASS: {
|
|
939
901
|
return "rocks_bluewomb.png"; // cspell:ignore bluewomb
|
|
940
902
|
}
|
|
941
903
|
// 14, 16
|
|
942
|
-
case
|
|
943
|
-
case
|
|
904
|
+
case BackdropType.SHEOL:
|
|
905
|
+
case BackdropType.DARK_ROOM: {
|
|
944
906
|
return "rocks_sheol.png";
|
|
945
907
|
}
|
|
946
908
|
// 15, 35
|
|
947
|
-
case
|
|
948
|
-
case
|
|
909
|
+
case BackdropType.CATHEDRAL:
|
|
910
|
+
case BackdropType.PLANETARIUM: {
|
|
949
911
|
return "rocks_cathedral.png";
|
|
950
912
|
}
|
|
951
913
|
// 23, 32, 37, 58
|
|
952
|
-
case
|
|
953
|
-
case
|
|
954
|
-
case
|
|
955
|
-
case
|
|
914
|
+
case BackdropType.SECRET:
|
|
915
|
+
case BackdropType.MINES:
|
|
916
|
+
case BackdropType.MINES_ENTRANCE:
|
|
917
|
+
case BackdropType.MINES_SHAFT: {
|
|
956
918
|
return "rocks_secretroom.png"; // cspell:ignore secretroom
|
|
957
919
|
}
|
|
958
920
|
// 31, 36
|
|
959
|
-
case
|
|
960
|
-
case
|
|
921
|
+
case BackdropType.DOWNPOUR:
|
|
922
|
+
case BackdropType.DOWNPOUR_ENTRANCE: {
|
|
961
923
|
return "rocks_downpour.png";
|
|
962
924
|
}
|
|
963
925
|
// 33, 38, 40, 41, 42
|
|
964
|
-
case
|
|
965
|
-
case
|
|
966
|
-
case
|
|
967
|
-
case
|
|
968
|
-
case
|
|
926
|
+
case BackdropType.MAUSOLEUM:
|
|
927
|
+
case BackdropType.MAUSOLEUM_ENTRANCE:
|
|
928
|
+
case BackdropType.MAUSOLEUM_2:
|
|
929
|
+
case BackdropType.MAUSOLEUM_3:
|
|
930
|
+
case BackdropType.MAUSOLEUM_4: {
|
|
969
931
|
return "rocks_mausoleum.png";
|
|
970
932
|
}
|
|
971
933
|
// 34, 48
|
|
972
|
-
case
|
|
973
|
-
case
|
|
934
|
+
case BackdropType.CORPSE:
|
|
935
|
+
case BackdropType.MORTIS: {
|
|
974
936
|
return "rocks_corpse.png";
|
|
975
937
|
}
|
|
976
938
|
// 39
|
|
977
|
-
case
|
|
939
|
+
case BackdropType.CORPSE_ENTRANCE: {
|
|
978
940
|
return "rocks_corpseentrance.png"; // cspell:ignore corpseentrance
|
|
979
941
|
}
|
|
980
942
|
// 43
|
|
981
|
-
case
|
|
943
|
+
case BackdropType.CORPSE_2: {
|
|
982
944
|
return "rocks_corpse2.png";
|
|
983
945
|
}
|
|
984
946
|
// 44
|
|
985
|
-
case
|
|
947
|
+
case BackdropType.CORPSE_3: {
|
|
986
948
|
return "rocks_corpse3.png";
|
|
987
949
|
}
|
|
988
950
|
// 45
|
|
989
|
-
case
|
|
951
|
+
case BackdropType.DROSS: {
|
|
990
952
|
return "rocks_dross.png";
|
|
991
953
|
}
|
|
992
954
|
// 46, 59
|
|
993
|
-
case
|
|
994
|
-
case
|
|
955
|
+
case BackdropType.ASHPIT:
|
|
956
|
+
case BackdropType.ASHPIT_SHAFT: {
|
|
995
957
|
return "rocks_ashpit.png";
|
|
996
958
|
}
|
|
997
959
|
// 47
|
|
998
|
-
case
|
|
960
|
+
case BackdropType.GEHENNA: {
|
|
999
961
|
return "rocks_gehenna.png";
|
|
1000
962
|
}
|
|
1001
963
|
default: {
|