isaacscript-common 84.0.0 → 84.1.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/arrays/cachedEnumValues.js +33 -0
- package/dist/callbackClasses.js +289 -0
- package/dist/callbacks.js +181 -0
- package/dist/classes/DefaultMap.js +171 -0
- package/dist/classes/ModFeature.js +244 -0
- package/dist/classes/ModUpgraded.js +324 -0
- package/dist/classes/callbacks/EntityTakeDmgFilter.js +19 -0
- package/dist/classes/callbacks/EntityTakeDmgPlayer.js +29 -0
- package/dist/classes/callbacks/InputActionFilter.js +24 -0
- package/dist/classes/callbacks/InputActionPlayer.js +37 -0
- package/dist/classes/callbacks/PostAmbushFinished.js +40 -0
- package/dist/classes/callbacks/PostAmbushStarted.js +40 -0
- package/dist/classes/callbacks/PostBombExploded.js +24 -0
- package/dist/classes/callbacks/PostBombInitFilter.js +21 -0
- package/dist/classes/callbacks/PostBombInitLate.js +31 -0
- package/dist/classes/callbacks/PostBombRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostBombUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostBoneSwing.js +53 -0
- package/dist/classes/callbacks/PostCollectibleEmpty.js +50 -0
- package/dist/classes/callbacks/PostCursedTeleport.js +119 -0
- package/dist/classes/callbacks/PostCustomRevive.js +17 -0
- package/dist/classes/callbacks/PostDiceRoomActivated.js +50 -0
- package/dist/classes/callbacks/PostDoorRender.js +24 -0
- package/dist/classes/callbacks/PostDoorUpdate.js +24 -0
- package/dist/classes/callbacks/PostEffectInitFilter.js +21 -0
- package/dist/classes/callbacks/PostEffectInitLate.js +31 -0
- package/dist/classes/callbacks/PostEffectRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostEffectStateChanged.js +34 -0
- package/dist/classes/callbacks/PostEffectUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostEntityKillFilter.js +21 -0
- package/dist/classes/callbacks/PostEsauJr.js +12 -0
- package/dist/classes/callbacks/PostFamiliarInitFilter.js +21 -0
- package/dist/classes/callbacks/PostFamiliarInitLate.js +31 -0
- package/dist/classes/callbacks/PostFamiliarRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostFamiliarStateChanged.js +34 -0
- package/dist/classes/callbacks/PostFamiliarUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostFirstEsauJr.js +12 -0
- package/dist/classes/callbacks/PostFirstFlip.js +12 -0
- package/dist/classes/callbacks/PostFlip.js +12 -0
- package/dist/classes/callbacks/PostGameEndFilter.js +21 -0
- package/dist/classes/callbacks/PostGameStartedReordered.js +14 -0
- package/dist/classes/callbacks/PostGameStartedReorderedLast.js +14 -0
- package/dist/classes/callbacks/PostGreedModeWave.js +35 -0
- package/dist/classes/callbacks/PostGridEntityBroken.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCollision.js +28 -0
- package/dist/classes/callbacks/PostGridEntityCustomBroken.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomCollision.js +24 -0
- package/dist/classes/callbacks/PostGridEntityCustomInit.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomRemove.js +18 -0
- package/dist/classes/callbacks/PostGridEntityCustomRender.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomStateChanged.js +14 -0
- package/dist/classes/callbacks/PostGridEntityCustomUpdate.js +14 -0
- package/dist/classes/callbacks/PostGridEntityInit.js +14 -0
- package/dist/classes/callbacks/PostGridEntityRemove.js +19 -0
- package/dist/classes/callbacks/PostGridEntityRender.js +14 -0
- package/dist/classes/callbacks/PostGridEntityStateChanged.js +14 -0
- package/dist/classes/callbacks/PostGridEntityUpdate.js +14 -0
- package/dist/classes/callbacks/PostHolyMantleRemoved.js +43 -0
- package/dist/classes/callbacks/PostItemDischarge.js +122 -0
- package/dist/classes/callbacks/PostItemPickup.js +14 -0
- package/dist/classes/callbacks/PostKeyboardChanged.js +46 -0
- package/dist/classes/callbacks/PostKnifeInitFilter.js +21 -0
- package/dist/classes/callbacks/PostKnifeInitLate.js +31 -0
- package/dist/classes/callbacks/PostKnifeRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostKnifeUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserInitFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserInitLate.js +31 -0
- package/dist/classes/callbacks/PostLaserRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostLaserUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCDeathFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCInitFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCInitLate.js +31 -0
- package/dist/classes/callbacks/PostNPCRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostNPCStateChanged.js +34 -0
- package/dist/classes/callbacks/PostNPCUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostNewLevelReordered.js +14 -0
- package/dist/classes/callbacks/PostNewRoomEarly.js +74 -0
- package/dist/classes/callbacks/PostNewRoomReordered.js +14 -0
- package/dist/classes/callbacks/PostPEffectUpdateReordered.js +14 -0
- package/dist/classes/callbacks/PostPickupChanged.js +14 -0
- package/dist/classes/callbacks/PostPickupCollect.js +38 -0
- package/dist/classes/callbacks/PostPickupInitFilter.js +21 -0
- package/dist/classes/callbacks/PostPickupInitFirst.js +33 -0
- package/dist/classes/callbacks/PostPickupInitLate.js +31 -0
- package/dist/classes/callbacks/PostPickupRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostPickupSelectionFilter.js +29 -0
- package/dist/classes/callbacks/PostPickupStateChanged.js +34 -0
- package/dist/classes/callbacks/PostPickupUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostPitRender.js +24 -0
- package/dist/classes/callbacks/PostPitUpdate.js +24 -0
- package/dist/classes/callbacks/PostPlayerChangeHealth.js +47 -0
- package/dist/classes/callbacks/PostPlayerChangeStat.js +79 -0
- package/dist/classes/callbacks/PostPlayerChangeType.js +36 -0
- package/dist/classes/callbacks/PostPlayerCollectibleAdded.js +14 -0
- package/dist/classes/callbacks/PostPlayerCollectibleRemoved.js +14 -0
- package/dist/classes/callbacks/PostPlayerFatalDamage.js +83 -0
- package/dist/classes/callbacks/PostPlayerInitFirst.js +41 -0
- package/dist/classes/callbacks/PostPlayerInitLate.js +33 -0
- package/dist/classes/callbacks/PostPlayerRenderReordered.js +14 -0
- package/dist/classes/callbacks/PostPlayerUpdateReordered.js +14 -0
- package/dist/classes/callbacks/PostPoopRender.js +24 -0
- package/dist/classes/callbacks/PostPoopUpdate.js +24 -0
- package/dist/classes/callbacks/PostPressurePlateRender.js +24 -0
- package/dist/classes/callbacks/PostPressurePlateUpdate.js +24 -0
- package/dist/classes/callbacks/PostProjectileInitFilter.js +21 -0
- package/dist/classes/callbacks/PostProjectileInitLate.js +31 -0
- package/dist/classes/callbacks/PostProjectileKill.js +52 -0
- package/dist/classes/callbacks/PostProjectileRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostProjectileUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostPurchase.js +90 -0
- package/dist/classes/callbacks/PostRockRender.js +24 -0
- package/dist/classes/callbacks/PostRockUpdate.js +24 -0
- package/dist/classes/callbacks/PostRoomClearChanged.js +46 -0
- package/dist/classes/callbacks/PostSacrifice.js +36 -0
- package/dist/classes/callbacks/PostSlotAnimationChanged.js +14 -0
- package/dist/classes/callbacks/PostSlotCollision.js +25 -0
- package/dist/classes/callbacks/PostSlotDestroyed.js +14 -0
- package/dist/classes/callbacks/PostSlotInit.js +14 -0
- package/dist/classes/callbacks/PostSlotRender.js +14 -0
- package/dist/classes/callbacks/PostSlotUpdate.js +14 -0
- package/dist/classes/callbacks/PostSpikesRender.js +24 -0
- package/dist/classes/callbacks/PostSpikesUpdate.js +24 -0
- package/dist/classes/callbacks/PostTNTRender.js +24 -0
- package/dist/classes/callbacks/PostTNTUpdate.js +24 -0
- package/dist/classes/callbacks/PostTearInitFilter.js +21 -0
- package/dist/classes/callbacks/PostTearInitLate.js +31 -0
- package/dist/classes/callbacks/PostTearInitVeryLate.js +35 -0
- package/dist/classes/callbacks/PostTearKill.js +52 -0
- package/dist/classes/callbacks/PostTearRenderFilter.js +21 -0
- package/dist/classes/callbacks/PostTearUpdateFilter.js +21 -0
- package/dist/classes/callbacks/PostTransformation.js +47 -0
- package/dist/classes/callbacks/PostTrinketBreak.js +70 -0
- package/dist/classes/callbacks/PostUsePillFilter.js +76 -0
- package/dist/classes/callbacks/PreBerserkDeath.js +41 -0
- package/dist/classes/callbacks/PreBombCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreCustomRevive.js +14 -0
- package/dist/classes/callbacks/PreEntitySpawnFilter.js +24 -0
- package/dist/classes/callbacks/PreFamiliarCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreGetPedestal.js +46 -0
- package/dist/classes/callbacks/PreItemPickup.js +14 -0
- package/dist/classes/callbacks/PreKnifeCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreNPCCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreNPCUpdateFilter.js +19 -0
- package/dist/classes/callbacks/PreNewLevel.js +51 -0
- package/dist/classes/callbacks/PreProjectileCollisionFilter.js +19 -0
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.js +26 -0
- package/dist/classes/callbacks/PreTearCollisionFilter.js +19 -0
- package/dist/classes/features/callbackLogic/CustomGridEntities.js +359 -0
- package/dist/classes/features/callbackLogic/CustomRevive.js +170 -0
- package/dist/classes/features/callbackLogic/EsauJrDetection.js +70 -0
- package/dist/classes/features/callbackLogic/FlipDetection.js +61 -0
- package/dist/classes/features/callbackLogic/GameReorderedCallbacks.js +220 -0
- package/dist/classes/features/callbackLogic/GridEntityCollisionDetection.js +62 -0
- package/dist/classes/features/callbackLogic/GridEntityRenderDetection.js +35 -0
- package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.js +147 -0
- package/dist/classes/features/callbackLogic/ItemPickupDetection.js +68 -0
- package/dist/classes/features/callbackLogic/PickupChangeDetection.js +43 -0
- package/dist/classes/features/callbackLogic/PlayerCollectibleDetection.js +193 -0
- package/dist/classes/features/callbackLogic/PlayerReorderedCallbacks.js +109 -0
- package/dist/classes/features/callbackLogic/SlotDestroyedDetection.js +95 -0
- package/dist/classes/features/callbackLogic/SlotRenderDetection.js +48 -0
- package/dist/classes/features/callbackLogic/SlotUpdateDetection.js +52 -0
- package/dist/classes/features/other/CharacterHealthConversion.js +112 -0
- package/dist/classes/features/other/CharacterStats.js +68 -0
- package/dist/classes/features/other/CollectibleItemPoolType.js +75 -0
- package/dist/classes/features/other/CustomHotkeys.js +144 -0
- package/dist/classes/features/other/CustomItemPools.js +128 -0
- package/dist/classes/features/other/CustomPickups.js +118 -0
- package/dist/classes/features/other/CustomStages.js +471 -0
- package/dist/classes/features/other/CustomTrapdoors.js +596 -0
- package/dist/classes/features/other/DebugDisplay.js +699 -0
- package/dist/classes/features/other/DeployJSONRoom.js +301 -0
- package/dist/classes/features/other/DisableAllSound.js +90 -0
- package/dist/classes/features/other/DisableInputs.js +249 -0
- package/dist/classes/features/other/EdenStartingStatsHealth.js +197 -0
- package/dist/classes/features/other/ExtraConsoleCommands.js +292 -0
- package/dist/classes/features/other/FadeInRemover.js +67 -0
- package/dist/classes/features/other/FastReset.js +88 -0
- package/dist/classes/features/other/FlyingDetection.js +64 -0
- package/dist/classes/features/other/ForgottenSwitch.js +43 -0
- package/dist/classes/features/other/ItemPoolDetection.js +187 -0
- package/dist/classes/features/other/ModdedElementDetection.js +399 -0
- package/dist/classes/features/other/ModdedElementSets.js +1251 -0
- package/dist/classes/features/other/NoSirenSteal.js +88 -0
- package/dist/classes/features/other/Pause.js +197 -0
- package/dist/classes/features/other/PersistentEntities.js +168 -0
- package/dist/classes/features/other/PickupIndexCreation.js +229 -0
- package/dist/classes/features/other/PlayerCollectibleTracking.js +102 -0
- package/dist/classes/features/other/PonyDetection.js +86 -0
- package/dist/classes/features/other/PressInput.js +71 -0
- package/dist/classes/features/other/PreventChildEntities.js +60 -0
- package/dist/classes/features/other/PreventGridEntityRespawn.js +159 -0
- package/dist/classes/features/other/RerunDetection.js +69 -0
- package/dist/classes/features/other/RoomClearFrame.js +94 -0
- package/dist/classes/features/other/RoomHistory.js +196 -0
- package/dist/classes/features/other/RunInNFrames.js +323 -0
- package/dist/classes/features/other/RunNextRoom.js +53 -0
- package/dist/classes/features/other/RunNextRun.js +60 -0
- package/dist/classes/features/other/SaveDataManager.js +383 -0
- package/dist/classes/features/other/SpawnRockAltRewards.js +469 -0
- package/dist/classes/features/other/StageHistory.js +244 -0
- package/dist/classes/features/other/StartAmbush.js +62 -0
- package/dist/classes/features/other/TaintedLazarusPlayers.js +115 -0
- package/dist/classes/features/other/UnlockAchievementsDetection.js +60 -0
- package/dist/classes/features/other/customStages/backdrop.js +195 -0
- package/dist/classes/features/other/customStages/constants.js +19 -0
- package/dist/classes/features/other/customStages/gridEntities.js +177 -0
- package/dist/classes/features/other/customStages/shadows.js +67 -0
- package/dist/classes/features/other/customStages/streakText.js +222 -0
- package/dist/classes/features/other/customStages/utils.js +65 -0
- package/dist/classes/features/other/customStages/v.js +27 -0
- package/dist/classes/features/other/customStages/versusScreen.js +227 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayBomb.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayDoor.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayEffect.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayFamiliar.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayKnife.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayLaser.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayNPC.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPickup.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPit.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPlayer.js +25 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPoop.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayPressurePlate.js +25 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayProjectile.js +23 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayRock.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplaySlot.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplaySpikes.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayTNT.js +22 -0
- package/dist/classes/features/other/debugDisplay/DebugDisplayTear.js +23 -0
- package/dist/classes/features/other/debugDisplay/utils.js +13 -0
- package/dist/classes/features/other/extraConsoleCommands/commands.js +1598 -0
- package/dist/classes/features/other/extraConsoleCommands/subroutines.js +135 -0
- package/dist/classes/features/other/extraConsoleCommands/v.js +30 -0
- package/dist/classes/features/other/saveDataManager/constants.js +4 -0
- package/dist/classes/features/other/saveDataManager/glowingHourGlass.js +106 -0
- package/dist/classes/features/other/saveDataManager/loadFromDisk.js +69 -0
- package/dist/classes/features/other/saveDataManager/restoreDefaults.js +69 -0
- package/dist/classes/features/other/saveDataManager/saveToDisk.js +46 -0
- package/dist/classes/private/CustomCallback.js +59 -0
- package/dist/classes/private/Feature.js +39 -0
- package/dist/core/cachedClasses.js +61 -0
- package/dist/core/constants.js +289 -0
- package/dist/core/constantsFirstLast.js +98 -0
- package/dist/core/constantsVanilla.js +131 -0
- package/dist/core/upgradeMod.js +71 -0
- package/dist/customStageMetadata.json +1 -0
- package/dist/data/itempools.json +16625 -0
- package/dist/decorators.js +21 -0
- package/dist/enums/AmbushType.js +9 -0
- package/dist/enums/CornerType.js +11 -0
- package/dist/enums/HealthType.js +20 -0
- package/dist/enums/ISCFeature.js +65 -0
- package/dist/enums/LadderSubTypeCustom.js +20 -0
- package/dist/enums/ModCallbackCustom.js +2477 -0
- package/dist/enums/MysteriousPaperEffect.js +16 -0
- package/dist/enums/PlayerStat.js +37 -0
- package/dist/enums/PocketItemType.js +13 -0
- package/dist/enums/RockAltType.js +23 -0
- package/dist/enums/SaveDataKey.js +14 -0
- package/dist/enums/SerializationType.js +10 -0
- package/dist/enums/SlotDestructionType.js +22 -0
- package/dist/enums/private/GridEntityTypeCustom.js +10 -0
- package/dist/enums/private/SerializationBrand.js +42 -0
- package/dist/enums/private/StageTravelState.js +13 -0
- package/dist/enums/private/TrapdoorAnimation.js +9 -0
- package/dist/enums/private/UIStreakAnimation.js +10 -0
- package/dist/features.js +150 -0
- package/dist/functions/ambush.js +26 -0
- package/dist/functions/array.js +586 -0
- package/dist/functions/arrayLua.js +81 -0
- package/dist/functions/benchmark.js +36 -0
- package/dist/functions/bitSet128.js +64 -0
- package/dist/functions/bitwise.js +82 -0
- package/dist/functions/bombs.js +14 -0
- package/dist/functions/bosses.js +238 -0
- package/dist/functions/cards.js +164 -0
- package/dist/functions/challenges.js +117 -0
- package/dist/functions/characters.js +182 -0
- package/dist/functions/charge.js +251 -0
- package/dist/functions/chargeBar.js +54 -0
- package/dist/functions/collectibleTag.js +24 -0
- package/dist/functions/collectibles.js +581 -0
- package/dist/functions/color.js +88 -0
- package/dist/functions/console.js +18 -0
- package/dist/functions/curses.js +37 -0
- package/dist/functions/debugFunctions.js +108 -0
- package/dist/functions/decorators.js +113 -0
- package/dist/functions/deepCopy.js +406 -0
- package/dist/functions/deepCopyTests.js +361 -0
- package/dist/functions/dimensions.js +30 -0
- package/dist/functions/direction.js +78 -0
- package/dist/functions/doors.js +524 -0
- package/dist/functions/easing.js +327 -0
- package/dist/functions/effects.js +14 -0
- package/dist/functions/emptyRoom.js +79 -0
- package/dist/functions/entities.js +529 -0
- package/dist/functions/entitiesSpecific.js +582 -0
- package/dist/functions/entityTypes.js +9 -0
- package/dist/functions/enums.js +244 -0
- package/dist/functions/external.js +59 -0
- package/dist/functions/familiars.js +136 -0
- package/dist/functions/flag.js +146 -0
- package/dist/functions/frames.js +166 -0
- package/dist/functions/globals.js +291 -0
- package/dist/functions/gridEntities.js +990 -0
- package/dist/functions/gridEntitiesSpecific.js +456 -0
- package/dist/functions/gridIndex.js +35 -0
- package/dist/functions/hash.js +75 -0
- package/dist/functions/hex.js +57 -0
- package/dist/functions/input.js +185 -0
- package/dist/functions/isaacAPIClass.js +157 -0
- package/dist/functions/itemPool.js +118 -0
- package/dist/functions/jsonHelpers.js +73 -0
- package/dist/functions/jsonRoom.js +184 -0
- package/dist/functions/kColor.js +89 -0
- package/dist/functions/language.js +16 -0
- package/dist/functions/level.js +66 -0
- package/dist/functions/levelGrid.js +497 -0
- package/dist/functions/log.js +86 -0
- package/dist/functions/logEntities.js +308 -0
- package/dist/functions/logMisc.js +510 -0
- package/dist/functions/map.js +121 -0
- package/dist/functions/math.js +149 -0
- package/dist/functions/merge.js +159 -0
- package/dist/functions/mergeTests.js +313 -0
- package/dist/functions/minimap.js +204 -0
- package/dist/functions/modFeatures.js +39 -0
- package/dist/functions/newArray.js +30 -0
- package/dist/functions/nextStage.js +169 -0
- package/dist/functions/npcDataStructures.js +146 -0
- package/dist/functions/npcs.js +132 -0
- package/dist/functions/pickupVariants.js +63 -0
- package/dist/functions/pickups.js +168 -0
- package/dist/functions/pickupsSpecific.js +376 -0
- package/dist/functions/pills.js +200 -0
- package/dist/functions/playerCenter.js +53 -0
- package/dist/functions/playerCollectibles.js +300 -0
- package/dist/functions/playerDataStructures.js +145 -0
- package/dist/functions/playerEffects.js +63 -0
- package/dist/functions/playerHealth.js +604 -0
- package/dist/functions/playerIndex.js +186 -0
- package/dist/functions/playerTrinkets.js +149 -0
- package/dist/functions/players.js +471 -0
- package/dist/functions/pocketItems.js +165 -0
- package/dist/functions/positionVelocity.js +158 -0
- package/dist/functions/pressurePlate.js +26 -0
- package/dist/functions/projectiles.js +57 -0
- package/dist/functions/random.js +90 -0
- package/dist/functions/readOnly.js +33 -0
- package/dist/functions/render.js +36 -0
- package/dist/functions/revive.js +151 -0
- package/dist/functions/rng.js +140 -0
- package/dist/functions/rockAlt.js +50 -0
- package/dist/functions/roomData.js +155 -0
- package/dist/functions/roomGrid.js +97 -0
- package/dist/functions/roomShape.js +143 -0
- package/dist/functions/roomShapeWalls.js +187 -0
- package/dist/functions/roomTransition.js +43 -0
- package/dist/functions/rooms.js +782 -0
- package/dist/functions/run.js +121 -0
- package/dist/functions/seeds.js +22 -0
- package/dist/functions/serialization.js +98 -0
- package/dist/functions/set.js +215 -0
- package/dist/functions/slots.js +41 -0
- package/dist/functions/sort.js +158 -0
- package/dist/functions/sound.js +45 -0
- package/dist/functions/spawnCollectible.js +112 -0
- package/dist/functions/sprites.js +130 -0
- package/dist/functions/stage.js +540 -0
- package/dist/functions/stats.js +104 -0
- package/dist/functions/storyBosses.js +63 -0
- package/dist/functions/string.js +194 -0
- package/dist/functions/table.js +162 -0
- package/dist/functions/tears.js +128 -0
- package/dist/functions/transformations.js +89 -0
- package/dist/functions/trinketGive.js +145 -0
- package/dist/functions/trinkets.js +213 -0
- package/dist/functions/tstlClass.js +97 -0
- package/dist/functions/types.js +225 -0
- package/dist/functions/ui.js +148 -0
- package/dist/functions/utils.d.ts +4 -1
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.js +195 -0
- package/dist/functions/utils.lua +6 -2
- package/dist/functions/vector.js +150 -0
- package/dist/functions/versusScreen.js +58 -0
- package/dist/functions/weighted.js +57 -0
- package/dist/index.js +219 -0
- package/dist/index.rollup.d.ts +4 -1
- package/dist/indexLua.js +220 -0
- package/dist/interfaces/ChargeBarSprites.js +2 -0
- package/dist/interfaces/Corner.js +2 -0
- package/dist/interfaces/CustomStageTSConfig.js +2 -0
- package/dist/interfaces/GridEntityCustomData.js +2 -0
- package/dist/interfaces/JSONRoomsFile.js +2 -0
- package/dist/interfaces/PlayerHealth.js +2 -0
- package/dist/interfaces/PlayerStats.js +4 -0
- package/dist/interfaces/PocketItemDescription.js +2 -0
- package/dist/interfaces/RoomDescription.js +2 -0
- package/dist/interfaces/SaveData.js +98 -0
- package/dist/interfaces/StageHistoryEntry.js +2 -0
- package/dist/interfaces/TSTLClassMetatable.js +2 -0
- package/dist/interfaces/TrinketSituation.js +2 -0
- package/dist/interfaces/private/AddCallbackParametersCustom.js +4 -0
- package/dist/interfaces/private/CustomStage.js +2 -0
- package/dist/interfaces/private/CustomTrapdoorDescription.js +2 -0
- package/dist/interfaces/private/ModUpgradedInterface.js +2 -0
- package/dist/isaacscript-common.lua +7 -3
- package/dist/maps/PHDPillConversionsMap.js +23 -0
- package/dist/maps/cardNameToTypeMap.js +211 -0
- package/dist/maps/characterNameToTypeMap.js +91 -0
- package/dist/maps/collectibleNameToTypeMap.js +19 -0
- package/dist/maps/defaultPlayerStatMap.js +17 -0
- package/dist/maps/entityTypeVariantToBossIDMap.js +11 -0
- package/dist/maps/falsePHDPillConversionsMap.js +37 -0
- package/dist/maps/gridEntityTypeToBrokenStateMap.js +32 -0
- package/dist/maps/gridEntityXMLMap.js +133 -0
- package/dist/maps/itemPoolTypeToItemPoolName.js +38 -0
- package/dist/maps/keyboardToStringMap.js +71 -0
- package/dist/maps/pillNameToEffectMap.js +91 -0
- package/dist/maps/roomNameToTypeMap.js +43 -0
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.js +17 -0
- package/dist/maps/transformationNameToPlayerFormMap.js +35 -0
- package/dist/maps/trinketNameToTypeMap.js +19 -0
- package/dist/objects/LRoomShapeToRectangles.js +43 -0
- package/dist/objects/backdropTypeToRockAltType.js +68 -0
- package/dist/objects/batteryNames.js +13 -0
- package/dist/objects/bombNames.js +17 -0
- package/dist/objects/bossIDToEntityTypeVariant.js +228 -0
- package/dist/objects/bossNamePNGFileNames.js +120 -0
- package/dist/objects/bossNames.js +119 -0
- package/dist/objects/bossPortraitPNGFileNames.js +123 -0
- package/dist/objects/cardDescriptions.js +106 -0
- package/dist/objects/cardNames.js +106 -0
- package/dist/objects/challengeBosses.js +60 -0
- package/dist/objects/challengeCharacters.js +58 -0
- package/dist/objects/challengeCollectibleTypes.js +255 -0
- package/dist/objects/challengeNames.js +54 -0
- package/dist/objects/challengeTrinketType.js +58 -0
- package/dist/objects/characterDamageMultipliers.js +49 -0
- package/dist/objects/characterNames.js +48 -0
- package/dist/objects/characterSpritePNGFileNames.js +50 -0
- package/dist/objects/characterStartingCollectibleTypes.js +105 -0
- package/dist/objects/characterStartingTrinketTypes.js +90 -0
- package/dist/objects/chestNames.js +20 -0
- package/dist/objects/coinNames.js +16 -0
- package/dist/objects/coinSubTypeToValue.js +15 -0
- package/dist/objects/collectibleDescriptions.js +742 -0
- package/dist/objects/collectibleNames.js +745 -0
- package/dist/objects/colors.js +26 -0
- package/dist/objects/directionNames.js +11 -0
- package/dist/objects/directionToDegrees.js +11 -0
- package/dist/objects/directionToMoveAction.js +11 -0
- package/dist/objects/directionToShootAction.js +11 -0
- package/dist/objects/directionToVector.js +13 -0
- package/dist/objects/doorSlotFlagToDoorSlot.js +15 -0
- package/dist/objects/doorSlotToDirection.js +15 -0
- package/dist/objects/doorSlotToDoorSlotFlag.js +15 -0
- package/dist/objects/gridEntityTypeToANM2Name.js +37 -0
- package/dist/objects/heartNames.js +21 -0
- package/dist/objects/isaacAPIClassTypeToBrand.js +12 -0
- package/dist/objects/isaacAPIClassTypeToFunctions.js +46 -0
- package/dist/objects/itemPoolTypeToCollectibleTypesSet.js +57 -0
- package/dist/objects/kColors.js +27 -0
- package/dist/objects/keyNames.js +13 -0
- package/dist/objects/languageNames.js +13 -0
- package/dist/objects/oppositeDoorSlots.js +15 -0
- package/dist/objects/pillEffectClasses.js +57 -0
- package/dist/objects/pillEffectNames.js +57 -0
- package/dist/objects/pillEffectTypeToPillEffects.js +23 -0
- package/dist/objects/pillEffectTypes.js +57 -0
- package/dist/objects/playerNamePNGFileNames.js +57 -0
- package/dist/objects/playerPortraitPNGFileNames.js +54 -0
- package/dist/objects/roomShapeBounds.js +48 -0
- package/dist/objects/roomShapeCorners.js +330 -0
- package/dist/objects/roomShapeLayoutSizes.js +41 -0
- package/dist/objects/roomShapeToBottomRightPosition.js +25 -0
- package/dist/objects/roomShapeToDoorSlotCoordinates.js +111 -0
- package/dist/objects/roomShapeToDoorSlots.js +72 -0
- package/dist/objects/roomShapeToDoorSlotsToGridIndexDelta.js +118 -0
- package/dist/objects/roomShapeToGridWidth.js +20 -0
- package/dist/objects/roomShapeToTopLeftPosition.js +26 -0
- package/dist/objects/roomShapeVolumes.js +32 -0
- package/dist/objects/roomTypeNames.js +35 -0
- package/dist/objects/roomTypeSpecialGotoPrefixes.js +35 -0
- package/dist/objects/sackNames.js +11 -0
- package/dist/objects/slotNames.js +26 -0
- package/dist/objects/stageIDNames.js +43 -0
- package/dist/objects/stageToMusic.js +91 -0
- package/dist/objects/stageToStageID.js +117 -0
- package/dist/objects/stageTypeSuffixes.js +14 -0
- package/dist/objects/transformationNames.js +20 -0
- package/dist/objects/trinketDescriptions.js +199 -0
- package/dist/objects/trinketNames.js +202 -0
- package/dist/objects/versusScreenBackgroundColors.js +46 -0
- package/dist/objects/versusScreenDirtSpotColors.js +46 -0
- package/dist/patchErrorFunctions.js +65 -0
- package/dist/serialization.js +21 -0
- package/dist/sets/LRoomShapesSet.js +11 -0
- package/dist/sets/bigRoomShapesSet.js +14 -0
- package/dist/sets/bossSets.js +465 -0
- package/dist/sets/charactersThatStartWithAnActiveItemSet.js +18 -0
- package/dist/sets/charactersWithBlackHeartFromEternalHeartSet.js +9 -0
- package/dist/sets/charactersWithFreeDevilDealsSet.js +6 -0
- package/dist/sets/charactersWithNoRedHeartsSet.js +19 -0
- package/dist/sets/charactersWithNoSoulHeartsSet.js +16 -0
- package/dist/sets/consoleCommandsSet.js +64 -0
- package/dist/sets/entitiesWithArmorSet.js +59 -0
- package/dist/sets/familiarsThatShootPlayerTearsSet.js +15 -0
- package/dist/sets/itemConfigCardTypesForCards.js +14 -0
- package/dist/sets/lostStyleCharactersSet.js +16 -0
- package/dist/sets/mineShaftRoomSubTypesSet.js +12 -0
- package/dist/sets/narrowRoomShapesSet.js +11 -0
- package/dist/sets/poopGridEntityXMLTypesSet.js +16 -0
- package/dist/sets/redHeartSubTypesSet.js +10 -0
- package/dist/sets/repentanceBossIDsSet.js +30 -0
- package/dist/sets/sinEntityTypesSet.js +14 -0
- package/dist/sets/singleUseActiveCollectibleTypesSet.js +15 -0
- package/dist/shaderCrashFix.js +24 -0
- package/dist/shouldFire.js +226 -0
- package/dist/types/AddSubtract.js +2 -0
- package/dist/types/AllButFirst.js +2 -0
- package/dist/types/AllButLast.js +2 -0
- package/dist/types/AnyClass.js +2 -0
- package/dist/types/AnyEntity.js +2 -0
- package/dist/types/AnyFunction.js +2 -0
- package/dist/types/AnyGridEntity.js +2 -0
- package/dist/types/CompositionTypeSatisfiesEnum.js +11 -0
- package/dist/types/ConversionHeartSubType.js +2 -0
- package/dist/types/Decrement.js +2 -0
- package/dist/types/ERange.js +2 -0
- package/dist/types/EntityID.js +2 -0
- package/dist/types/FunctionTuple.js +2 -0
- package/dist/types/GridEntityID.js +2 -0
- package/dist/types/HasFunction.js +2 -0
- package/dist/types/IRange.js +2 -0
- package/dist/types/Immutable.js +2 -0
- package/dist/types/Increment.js +2 -0
- package/dist/types/LowercaseKeys.js +2 -0
- package/dist/types/NaturalNumbersLessThan.js +2 -0
- package/dist/types/NaturalNumbersLessThanOrEqualTo.js +2 -0
- package/dist/types/PickingUpItem.js +44 -0
- package/dist/types/PickupIndex.js +2 -0
- package/dist/types/PlayerIndex.js +2 -0
- package/dist/types/PossibleStatType.js +2 -0
- package/dist/types/PublicInterface.js +2 -0
- package/dist/types/ReadonlyMap.js +6 -0
- package/dist/types/ReadonlyRecord.js +2 -0
- package/dist/types/ReadonlySet.js +6 -0
- package/dist/types/StartsWithLowercase.js +2 -0
- package/dist/types/StartsWithUppercase.js +2 -0
- package/dist/types/TSTLClass.js +2 -0
- package/dist/types/Tuple.js +2 -0
- package/dist/types/TupleKeys.js +2 -0
- package/dist/types/TupleToIntersection.js +2 -0
- package/dist/types/TupleToUnion.js +2 -0
- package/dist/types/TupleWithLengthBetween.js +22 -0
- package/dist/types/TupleWithMaxLength.js +27 -0
- package/dist/types/UnionToIntersection.js +2 -0
- package/dist/types/UppercaseKeys.js +2 -0
- package/dist/types/WeightedArray.js +2 -0
- package/dist/types/WidenLiteral.js +2 -0
- package/dist/types/Writable.js +2 -0
- package/dist/types/private/CallbackTuple.js +2 -0
- package/dist/types/private/ModUpgradedWithFeatures.js +2 -0
- package/package.json +1 -1
- package/src/functions/utils.ts +6 -2
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.spawnTrapdoorWithVariant = exports.spawnTrapdoor = exports.spawnTeleporterWithVariant = exports.spawnTeleporter = exports.spawnTNTWithVariant = exports.spawnTNT = exports.spawnSpikesWithVariant = exports.spawnSpikes = exports.spawnRockWithVariant = exports.spawnRock = exports.spawnPressurePlateWithVariant = exports.spawnPressurePlate = exports.spawnPoopWithVariant = exports.spawnPoop = exports.spawnPitWithVariant = exports.spawnPit = exports.spawnDoorWithVariant = exports.spawnDoor = exports.spawnCrawlSpaceWithVariant = exports.spawnCrawlSpace = exports.removeAllTrapdoors = exports.removeAllTeleporters = exports.removeAllTNT = exports.removeAllSpikes = exports.removeAllRocks = exports.removeAllPressurePlates = exports.removeAllPoops = exports.removeAllPits = exports.removeAllCrawlSpaces = exports.getTrapdoors = exports.getTeleporters = exports.getTNT = exports.getSpikes = exports.getRocks = exports.getPressurePlates = exports.getPoops = exports.getPits = exports.getCrawlSpaces = void 0;
|
|
4
|
+
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
5
|
+
const gridEntities_1 = require("./gridEntities");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to get all of the grid entities of type `GridEntityType.CRAWL_SPACE` (18) in the
|
|
9
|
+
* room.
|
|
10
|
+
*
|
|
11
|
+
* @param crawlSpaceVariant Optional. If specified, will only get the crawl spaces that match the
|
|
12
|
+
* variant. Default is -1, which matches every variant.
|
|
13
|
+
*/
|
|
14
|
+
function getCrawlSpaces(crawlSpaceVariant = -1) {
|
|
15
|
+
if (crawlSpaceVariant === -1) {
|
|
16
|
+
return (0, gridEntities_1.getGridEntities)(isaac_typescript_definitions_1.GridEntityType.CRAWL_SPACE);
|
|
17
|
+
}
|
|
18
|
+
return (0, gridEntities_1.getMatchingGridEntities)(isaac_typescript_definitions_1.GridEntityType.CRAWL_SPACE, crawlSpaceVariant);
|
|
19
|
+
}
|
|
20
|
+
exports.getCrawlSpaces = getCrawlSpaces;
|
|
21
|
+
// The `getDoors` function is not located here because doors are collected via the `Room.GetDoor`
|
|
22
|
+
// method instead, which is faster.
|
|
23
|
+
/**
|
|
24
|
+
* Helper function to get all of the `GridEntityPit` in the room.
|
|
25
|
+
*
|
|
26
|
+
* @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
|
|
27
|
+
* is -1, which matches every variant.
|
|
28
|
+
*/
|
|
29
|
+
function getPits(pitVariant = -1) {
|
|
30
|
+
const pits = [];
|
|
31
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
32
|
+
const pit = gridEntity.ToPit();
|
|
33
|
+
if (pit !== undefined) {
|
|
34
|
+
const thisPitVariant = pit.GetVariant();
|
|
35
|
+
if (pitVariant === -1 || pitVariant === thisPitVariant) {
|
|
36
|
+
pits.push(pit);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return pits;
|
|
41
|
+
}
|
|
42
|
+
exports.getPits = getPits;
|
|
43
|
+
/**
|
|
44
|
+
* Helper function to get all of the `GridEntityPoop` in the room.
|
|
45
|
+
*
|
|
46
|
+
* @param poopVariant Optional. If specified, will only get the poops that match the variant.
|
|
47
|
+
* Default is -1, which matches every variant.
|
|
48
|
+
*/
|
|
49
|
+
function getPoops(poopVariant = -1) {
|
|
50
|
+
const poops = [];
|
|
51
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
52
|
+
const poop = gridEntity.ToPoop();
|
|
53
|
+
if (poop !== undefined) {
|
|
54
|
+
const thisPoopVariant = poop.GetVariant();
|
|
55
|
+
if (poopVariant === -1 || poopVariant === thisPoopVariant) {
|
|
56
|
+
poops.push(poop);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return poops;
|
|
61
|
+
}
|
|
62
|
+
exports.getPoops = getPoops;
|
|
63
|
+
/**
|
|
64
|
+
* Helper function to get all of the `GridEntityPressurePlate` in the room.
|
|
65
|
+
*
|
|
66
|
+
* @param pressurePlateVariant Optional. If specified, will only get the pressure plates that match
|
|
67
|
+
* the variant. Default is -1, which matches every variant.
|
|
68
|
+
*/
|
|
69
|
+
function getPressurePlates(pressurePlateVariant = -1) {
|
|
70
|
+
const pressurePlates = [];
|
|
71
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
72
|
+
const pressurePlate = gridEntity.ToPressurePlate();
|
|
73
|
+
if (pressurePlate !== undefined) {
|
|
74
|
+
const thisPressurePlateVariant = pressurePlate.GetVariant();
|
|
75
|
+
if (pressurePlateVariant === -1 ||
|
|
76
|
+
pressurePlateVariant === thisPressurePlateVariant) {
|
|
77
|
+
pressurePlates.push(pressurePlate);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return pressurePlates;
|
|
82
|
+
}
|
|
83
|
+
exports.getPressurePlates = getPressurePlates;
|
|
84
|
+
/**
|
|
85
|
+
* Helper function to get all of the `GridEntityRock` in the room.
|
|
86
|
+
*
|
|
87
|
+
* @param variant Optional. If specified, will only get the rocks that match the variant. Default is
|
|
88
|
+
* -1, which matches every variant. Note that this is not the same thing as the
|
|
89
|
+
* `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and other
|
|
90
|
+
* types of grid entities can be the `GridEntityRock` class.
|
|
91
|
+
*/
|
|
92
|
+
function getRocks(variant = -1) {
|
|
93
|
+
const rocks = [];
|
|
94
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
95
|
+
const rock = gridEntity.ToRock();
|
|
96
|
+
if (rock !== undefined) {
|
|
97
|
+
const thisVariant = rock.GetVariant();
|
|
98
|
+
if (variant === -1 || variant === thisVariant) {
|
|
99
|
+
rocks.push(rock);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return rocks;
|
|
104
|
+
}
|
|
105
|
+
exports.getRocks = getRocks;
|
|
106
|
+
/** Helper function to get all of the `GridEntitySpikes` in the room. */
|
|
107
|
+
function getSpikes(variant = -1) {
|
|
108
|
+
const spikes = [];
|
|
109
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
110
|
+
const spike = gridEntity.ToSpikes();
|
|
111
|
+
if (spike !== undefined) {
|
|
112
|
+
const thisVariant = spike.GetVariant();
|
|
113
|
+
if (variant === -1 || variant === thisVariant) {
|
|
114
|
+
spikes.push(spike);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return spikes;
|
|
119
|
+
}
|
|
120
|
+
exports.getSpikes = getSpikes;
|
|
121
|
+
/** Helper function to get all of the `GridEntityTNT` in the room. */
|
|
122
|
+
function getTNT(variant = -1) {
|
|
123
|
+
const tntArray = [];
|
|
124
|
+
for (const gridEntity of (0, gridEntities_1.getGridEntities)()) {
|
|
125
|
+
const tnt = gridEntity.ToTNT();
|
|
126
|
+
if (tnt !== undefined) {
|
|
127
|
+
const thisVariant = tnt.GetVariant();
|
|
128
|
+
if (variant === -1 || variant === thisVariant) {
|
|
129
|
+
tntArray.push(tnt);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return tntArray;
|
|
134
|
+
}
|
|
135
|
+
exports.getTNT = getTNT;
|
|
136
|
+
/**
|
|
137
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
|
|
138
|
+
* room.
|
|
139
|
+
*
|
|
140
|
+
* @param variant Optional. If specified, will only get the teleporters that match the variant.
|
|
141
|
+
* Default is -1, which matches every variant.
|
|
142
|
+
*/
|
|
143
|
+
function getTeleporters(variant = -1) {
|
|
144
|
+
if (variant === -1) {
|
|
145
|
+
return (0, gridEntities_1.getGridEntities)(isaac_typescript_definitions_1.GridEntityType.TELEPORTER);
|
|
146
|
+
}
|
|
147
|
+
return (0, gridEntities_1.getMatchingGridEntities)(isaac_typescript_definitions_1.GridEntityType.TELEPORTER, variant);
|
|
148
|
+
}
|
|
149
|
+
exports.getTeleporters = getTeleporters;
|
|
150
|
+
/**
|
|
151
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
152
|
+
* room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
153
|
+
*
|
|
154
|
+
* @param trapdoorVariant Optional. If specified, will only get the trapdoors that match the
|
|
155
|
+
* variant. Default is -1, which matches every variant.
|
|
156
|
+
*/
|
|
157
|
+
function getTrapdoors(trapdoorVariant = -1) {
|
|
158
|
+
if (trapdoorVariant === -1) {
|
|
159
|
+
return (0, gridEntities_1.getGridEntities)(isaac_typescript_definitions_1.GridEntityType.TRAPDOOR);
|
|
160
|
+
}
|
|
161
|
+
return (0, gridEntities_1.getMatchingGridEntities)(isaac_typescript_definitions_1.GridEntityType.TRAPDOOR, trapdoorVariant);
|
|
162
|
+
}
|
|
163
|
+
exports.getTrapdoors = getTrapdoors;
|
|
164
|
+
/**
|
|
165
|
+
* Helper function to remove all of the `GridEntityType.CRAWL_SPACE` (18) in the room.
|
|
166
|
+
*
|
|
167
|
+
* @param crawlSpaceVariant Optional. If specified, will only remove the crawl spaces that match
|
|
168
|
+
* this variant. Default is -1, which matches every variant.
|
|
169
|
+
* @param updateRoom Optional. Whether to update the room after the crawl spaces are removed.
|
|
170
|
+
* Default is false. For more information, see the description of the
|
|
171
|
+
* `removeGridEntities` helper function.
|
|
172
|
+
* @param cap Optional. If specified, will only remove the given amount of crawl spaces.
|
|
173
|
+
* @returns The crawl spaces that were removed.
|
|
174
|
+
*/
|
|
175
|
+
function removeAllCrawlSpaces(crawlSpaceVariant = -1, updateRoom = false, cap) {
|
|
176
|
+
const crawlSpaces = getCrawlSpaces(crawlSpaceVariant);
|
|
177
|
+
return (0, gridEntities_1.removeGridEntities)(crawlSpaces, updateRoom, cap);
|
|
178
|
+
}
|
|
179
|
+
exports.removeAllCrawlSpaces = removeAllCrawlSpaces;
|
|
180
|
+
// The `removeAllDoors` function is not located here because doors are removed via the
|
|
181
|
+
// `Room.RemoveDoor` method instead.
|
|
182
|
+
/**
|
|
183
|
+
* Helper function to remove all of the `GridEntityPit` in the room.
|
|
184
|
+
*
|
|
185
|
+
* @param pitVariant Optional. If specified, will only remove the pits that match this variant.
|
|
186
|
+
* Default is -1, which matches every variant.
|
|
187
|
+
* @param updateRoom Optional. Whether to update the room after the pits are removed. Default is
|
|
188
|
+
* false. For more information, see the description of the `removeGridEntities`
|
|
189
|
+
* helper function.
|
|
190
|
+
* @param cap Optional. If specified, will only remove the given amount of pits.
|
|
191
|
+
* @returns The pits that were removed.
|
|
192
|
+
*/
|
|
193
|
+
function removeAllPits(pitVariant = -1, updateRoom = false, cap) {
|
|
194
|
+
const pits = getPits(pitVariant);
|
|
195
|
+
return (0, gridEntities_1.removeGridEntities)(pits, updateRoom, cap);
|
|
196
|
+
}
|
|
197
|
+
exports.removeAllPits = removeAllPits;
|
|
198
|
+
/**
|
|
199
|
+
* Helper function to remove all of the `GridEntityPoop` in the room.
|
|
200
|
+
*
|
|
201
|
+
* Note that poops can either be an entity or a grid entity, depending on the situation. This
|
|
202
|
+
* function will only remove the grid entity poops.
|
|
203
|
+
*
|
|
204
|
+
* @param poopVariant Optional. If specified, will only remove the poops that match this variant.
|
|
205
|
+
* Default is -1, which matches every variant.
|
|
206
|
+
* @param updateRoom Optional. Whether to update the room after the poops are removed. Default is
|
|
207
|
+
* false. For more information, see the description of the `removeGridEntities`
|
|
208
|
+
* helper function.
|
|
209
|
+
* @param cap Optional. If specified, will only remove the given amount of poops.
|
|
210
|
+
* @returns The poops that were removed.
|
|
211
|
+
*/
|
|
212
|
+
function removeAllPoops(poopVariant = -1, updateRoom = false, cap) {
|
|
213
|
+
const poops = getPoops(poopVariant);
|
|
214
|
+
return (0, gridEntities_1.removeGridEntities)(poops, updateRoom, cap);
|
|
215
|
+
}
|
|
216
|
+
exports.removeAllPoops = removeAllPoops;
|
|
217
|
+
/**
|
|
218
|
+
* Helper function to remove all of the `GridEntityPressurePlate` in the room.
|
|
219
|
+
*
|
|
220
|
+
* @param pressurePlateVariant Optional. If specified, will only remove the pressure plates that
|
|
221
|
+
* match this variant. Default is -1, which matches every variant.
|
|
222
|
+
* @param updateRoom Optional. Whether to update the room after the pressure plates are removed.
|
|
223
|
+
* Default is false. For more information, see the description of the
|
|
224
|
+
* `removeGridEntities` helper function.
|
|
225
|
+
* @param cap Optional. If specified, will only remove the given amount of pressure plates.
|
|
226
|
+
* @returns The pressure plates that were removed.
|
|
227
|
+
*/
|
|
228
|
+
function removeAllPressurePlates(pressurePlateVariant = -1, updateRoom = false, cap) {
|
|
229
|
+
const pressurePlates = getPressurePlates(pressurePlateVariant);
|
|
230
|
+
return (0, gridEntities_1.removeGridEntities)(pressurePlates, updateRoom, cap);
|
|
231
|
+
}
|
|
232
|
+
exports.removeAllPressurePlates = removeAllPressurePlates;
|
|
233
|
+
/**
|
|
234
|
+
* Helper function to remove all of the `GridEntityRock` in the room.
|
|
235
|
+
*
|
|
236
|
+
* @param variant Optional. If specified, will only remove the rocks that match this variant.
|
|
237
|
+
* Default is -1, which matches every variant. Note that this is not the same thing
|
|
238
|
+
* as the `RockVariant` enum, since that only applies to `GridEntityType.ROCK`, and
|
|
239
|
+
* other types of grid entities can be the `GridEntityRock` class.
|
|
240
|
+
* @param updateRoom Optional. Whether to update the room after the rocks are removed. Default is
|
|
241
|
+
* false. For more information, see the description of the `removeGridEntities`
|
|
242
|
+
* helper function.
|
|
243
|
+
* @param cap Optional. If specified, will only remove the given amount of rocks.
|
|
244
|
+
* @returns The rocks that were removed.
|
|
245
|
+
*/
|
|
246
|
+
function removeAllRocks(variant = -1, updateRoom = false, cap) {
|
|
247
|
+
const rocks = getRocks(variant);
|
|
248
|
+
return (0, gridEntities_1.removeGridEntities)(rocks, updateRoom, cap);
|
|
249
|
+
}
|
|
250
|
+
exports.removeAllRocks = removeAllRocks;
|
|
251
|
+
/**
|
|
252
|
+
* Helper function to remove all of the `GridEntitySpikes` in the room.
|
|
253
|
+
*
|
|
254
|
+
* @param variant Optional. If specified, will only remove the spikes that match this variant.
|
|
255
|
+
* Default is -1, which matches every variant.
|
|
256
|
+
* @param updateRoom Optional. Whether to update the room after the spikes are removed. Default is
|
|
257
|
+
* false. For more information, see the description of the `removeGridEntities`
|
|
258
|
+
* helper function.
|
|
259
|
+
* @param cap Optional. If specified, will only remove the given amount of spikes.
|
|
260
|
+
* @returns The spikes that were removed.
|
|
261
|
+
*/
|
|
262
|
+
function removeAllSpikes(variant = -1, updateRoom = false, cap) {
|
|
263
|
+
const spikes = getSpikes(variant);
|
|
264
|
+
return (0, gridEntities_1.removeGridEntities)(spikes, updateRoom, cap);
|
|
265
|
+
}
|
|
266
|
+
exports.removeAllSpikes = removeAllSpikes;
|
|
267
|
+
/**
|
|
268
|
+
* Helper function to remove all of the `GridEntityTNT` in the room.
|
|
269
|
+
*
|
|
270
|
+
* @param variant Optional. If specified, will only remove the TNTs that match this variant. Default
|
|
271
|
+
* is -1, which matches every variant.
|
|
272
|
+
* @param updateRoom Optional. Whether to update the room after the TNTs are removed. Default is
|
|
273
|
+
* false. For more information, see the description of the `removeGridEntities`
|
|
274
|
+
* helper function.
|
|
275
|
+
* @param cap Optional. If specified, will only remove the given amount of TNTs.
|
|
276
|
+
* @returns The TNTs that were removed.
|
|
277
|
+
*/
|
|
278
|
+
function removeAllTNT(variant = -1, updateRoom = false, cap) {
|
|
279
|
+
const tnt = getTNT(variant);
|
|
280
|
+
return (0, gridEntities_1.removeGridEntities)(tnt, updateRoom, cap);
|
|
281
|
+
}
|
|
282
|
+
exports.removeAllTNT = removeAllTNT;
|
|
283
|
+
/**
|
|
284
|
+
* Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room.
|
|
285
|
+
*
|
|
286
|
+
* @param variant Optional. If specified, will only remove the teleporters that match this variant.
|
|
287
|
+
* Default is -1, which matches every variant.
|
|
288
|
+
* @param updateRoom Optional. Whether to update the room after the teleporters are removed. Default
|
|
289
|
+
* is false. For more information, see the description of the `removeGridEntities`
|
|
290
|
+
* helper function.
|
|
291
|
+
* @param cap Optional. If specified, will only remove the given amount of teleporters.
|
|
292
|
+
* @returns The teleporters that were removed.
|
|
293
|
+
*/
|
|
294
|
+
function removeAllTeleporters(variant = -1, updateRoom = false, cap) {
|
|
295
|
+
const teleporters = getTeleporters(variant);
|
|
296
|
+
return (0, gridEntities_1.removeGridEntities)(teleporters, updateRoom, cap);
|
|
297
|
+
}
|
|
298
|
+
exports.removeAllTeleporters = removeAllTeleporters;
|
|
299
|
+
/**
|
|
300
|
+
* Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
301
|
+
*
|
|
302
|
+
* @param trapdoorVariant Optional. If specified, will only remove the trapdoors that match this
|
|
303
|
+
* variant. Default is -1, which matches every variant.
|
|
304
|
+
* @param updateRoom Optional. Whether to update the room after the trapdoors are removed. Default
|
|
305
|
+
* is false. For more information, see the description of the `removeGridEntities`
|
|
306
|
+
* helper function.
|
|
307
|
+
* @param cap Optional. If specified, will only remove the given amount of trapdoors.
|
|
308
|
+
* @returns The trapdoors that were removed.
|
|
309
|
+
*/
|
|
310
|
+
function removeAllTrapdoors(trapdoorVariant = -1, updateRoom = false, cap) {
|
|
311
|
+
const trapdoors = getTrapdoors(trapdoorVariant);
|
|
312
|
+
return (0, gridEntities_1.removeGridEntities)(trapdoors, updateRoom, cap);
|
|
313
|
+
}
|
|
314
|
+
exports.removeAllTrapdoors = removeAllTrapdoors;
|
|
315
|
+
/** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18). */
|
|
316
|
+
function spawnCrawlSpace(gridIndexOrPosition) {
|
|
317
|
+
return spawnCrawlSpaceWithVariant(isaac_typescript_definitions_1.CrawlSpaceVariant.NORMAL, gridIndexOrPosition);
|
|
318
|
+
}
|
|
319
|
+
exports.spawnCrawlSpace = spawnCrawlSpace;
|
|
320
|
+
/** Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant. */
|
|
321
|
+
function spawnCrawlSpaceWithVariant(crawlSpaceVariant, gridIndexOrPosition) {
|
|
322
|
+
return (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.CRAWL_SPACE, crawlSpaceVariant, gridIndexOrPosition);
|
|
323
|
+
}
|
|
324
|
+
exports.spawnCrawlSpaceWithVariant = spawnCrawlSpaceWithVariant;
|
|
325
|
+
/** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */
|
|
326
|
+
function spawnDoor(gridIndexOrPosition) {
|
|
327
|
+
return spawnDoorWithVariant(isaac_typescript_definitions_1.DoorVariant.UNSPECIFIED, gridIndexOrPosition);
|
|
328
|
+
}
|
|
329
|
+
exports.spawnDoor = spawnDoor;
|
|
330
|
+
/** Helper function to spawn a `GridEntityType.DOOR` (16). */
|
|
331
|
+
function spawnDoorWithVariant(doorVariant, gridIndexOrPosition) {
|
|
332
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.DOOR, doorVariant, gridIndexOrPosition);
|
|
333
|
+
if (gridEntity === undefined) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
const door = gridEntity.ToDoor();
|
|
337
|
+
(0, utils_1.assertDefined)(door, "Failed to spawn a door.");
|
|
338
|
+
return door;
|
|
339
|
+
}
|
|
340
|
+
exports.spawnDoorWithVariant = spawnDoorWithVariant;
|
|
341
|
+
/** Helper function to spawn a `GridEntityType.DOOR` (16) with a specific variant. */
|
|
342
|
+
function spawnPit(gridIndexOrPosition) {
|
|
343
|
+
return spawnPitWithVariant(isaac_typescript_definitions_1.PitVariant.NORMAL, gridIndexOrPosition);
|
|
344
|
+
}
|
|
345
|
+
exports.spawnPit = spawnPit;
|
|
346
|
+
/** Helper function to spawn a `GridEntityType.PIT` (7) with a specific variant. */
|
|
347
|
+
function spawnPitWithVariant(pitVariant, gridIndexOrPosition) {
|
|
348
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.PIT, pitVariant, gridIndexOrPosition);
|
|
349
|
+
if (gridEntity === undefined) {
|
|
350
|
+
return undefined;
|
|
351
|
+
}
|
|
352
|
+
const pit = gridEntity.ToPit();
|
|
353
|
+
(0, utils_1.assertDefined)(pit, "Failed to spawn a pit.");
|
|
354
|
+
return pit;
|
|
355
|
+
}
|
|
356
|
+
exports.spawnPitWithVariant = spawnPitWithVariant;
|
|
357
|
+
/** Helper function to spawn a `GridEntityType.POOP` (14). */
|
|
358
|
+
function spawnPoop(gridIndexOrPosition) {
|
|
359
|
+
return spawnPoopWithVariant(isaac_typescript_definitions_1.PoopGridEntityVariant.NORMAL, gridIndexOrPosition);
|
|
360
|
+
}
|
|
361
|
+
exports.spawnPoop = spawnPoop;
|
|
362
|
+
/** Helper function to spawn a `GridEntityType.POOP` (14) with a specific variant. */
|
|
363
|
+
function spawnPoopWithVariant(poopVariant, gridIndexOrPosition) {
|
|
364
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.POOP, poopVariant, gridIndexOrPosition);
|
|
365
|
+
if (gridEntity === undefined) {
|
|
366
|
+
return undefined;
|
|
367
|
+
}
|
|
368
|
+
const poop = gridEntity.ToPoop();
|
|
369
|
+
(0, utils_1.assertDefined)(poop, "Failed to spawn a poop.");
|
|
370
|
+
return poop;
|
|
371
|
+
}
|
|
372
|
+
exports.spawnPoopWithVariant = spawnPoopWithVariant;
|
|
373
|
+
/** Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20). */
|
|
374
|
+
function spawnPressurePlate(gridIndexOrPosition) {
|
|
375
|
+
return spawnPressurePlateWithVariant(isaac_typescript_definitions_1.PressurePlateVariant.PRESSURE_PLATE, gridIndexOrPosition);
|
|
376
|
+
}
|
|
377
|
+
exports.spawnPressurePlate = spawnPressurePlate;
|
|
378
|
+
/** Helper function to spawn a `GridEntityType.PRESSURE_PLATE` (20) with a specific variant. */
|
|
379
|
+
function spawnPressurePlateWithVariant(pressurePlateVariant, gridIndexOrPosition) {
|
|
380
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.PRESSURE_PLATE, pressurePlateVariant, gridIndexOrPosition);
|
|
381
|
+
if (gridEntity === undefined) {
|
|
382
|
+
return undefined;
|
|
383
|
+
}
|
|
384
|
+
const pressurePlate = gridEntity.ToPressurePlate();
|
|
385
|
+
(0, utils_1.assertDefined)(pressurePlate, "Failed to spawn a pressure plate.");
|
|
386
|
+
return pressurePlate;
|
|
387
|
+
}
|
|
388
|
+
exports.spawnPressurePlateWithVariant = spawnPressurePlateWithVariant;
|
|
389
|
+
/** Helper function to spawn a `GridEntityType.ROCK` (2). */
|
|
390
|
+
function spawnRock(gridIndexOrPosition) {
|
|
391
|
+
return spawnRockWithVariant(isaac_typescript_definitions_1.RockVariant.NORMAL, gridIndexOrPosition);
|
|
392
|
+
}
|
|
393
|
+
exports.spawnRock = spawnRock;
|
|
394
|
+
/** Helper function to spawn a `GridEntityType.ROCK` (2) with a specific variant. */
|
|
395
|
+
function spawnRockWithVariant(rockVariant, gridIndexOrPosition) {
|
|
396
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.ROCK, rockVariant, gridIndexOrPosition);
|
|
397
|
+
if (gridEntity === undefined) {
|
|
398
|
+
return undefined;
|
|
399
|
+
}
|
|
400
|
+
const rock = gridEntity.ToRock();
|
|
401
|
+
(0, utils_1.assertDefined)(rock, "Failed to spawn a rock.");
|
|
402
|
+
return rock;
|
|
403
|
+
}
|
|
404
|
+
exports.spawnRockWithVariant = spawnRockWithVariant;
|
|
405
|
+
/** Helper function to spawn a `GridEntityType.SPIKES` (8). */
|
|
406
|
+
function spawnSpikes(gridIndexOrPosition) {
|
|
407
|
+
return spawnSpikesWithVariant(0, gridIndexOrPosition);
|
|
408
|
+
}
|
|
409
|
+
exports.spawnSpikes = spawnSpikes;
|
|
410
|
+
/** Helper function to spawn a `GridEntityType.SPIKES` (8) with a specific variant. */
|
|
411
|
+
function spawnSpikesWithVariant(variant, gridIndexOrPosition) {
|
|
412
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.SPIKES, variant, gridIndexOrPosition);
|
|
413
|
+
if (gridEntity === undefined) {
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
416
|
+
const spikes = gridEntity.ToSpikes();
|
|
417
|
+
(0, utils_1.assertDefined)(spikes, "Failed to spawn spikes.");
|
|
418
|
+
return spikes;
|
|
419
|
+
}
|
|
420
|
+
exports.spawnSpikesWithVariant = spawnSpikesWithVariant;
|
|
421
|
+
/** Helper function to spawn a `GridEntityType.TNT` (12). */
|
|
422
|
+
function spawnTNT(gridIndexOrPosition) {
|
|
423
|
+
return spawnTNTWithVariant(0, gridIndexOrPosition);
|
|
424
|
+
}
|
|
425
|
+
exports.spawnTNT = spawnTNT;
|
|
426
|
+
/** Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant. */
|
|
427
|
+
function spawnTNTWithVariant(variant, gridIndexOrPosition) {
|
|
428
|
+
const gridEntity = (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.TNT, variant, gridIndexOrPosition);
|
|
429
|
+
if (gridEntity === undefined) {
|
|
430
|
+
return undefined;
|
|
431
|
+
}
|
|
432
|
+
const tnt = gridEntity.ToTNT();
|
|
433
|
+
(0, utils_1.assertDefined)(tnt, "Failed to spawn TNT.");
|
|
434
|
+
return tnt;
|
|
435
|
+
}
|
|
436
|
+
exports.spawnTNTWithVariant = spawnTNTWithVariant;
|
|
437
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23). */
|
|
438
|
+
function spawnTeleporter(gridIndexOrPosition) {
|
|
439
|
+
return spawnTeleporterWithVariant(0, gridIndexOrPosition);
|
|
440
|
+
}
|
|
441
|
+
exports.spawnTeleporter = spawnTeleporter;
|
|
442
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant. */
|
|
443
|
+
function spawnTeleporterWithVariant(variant, gridIndexOrPosition) {
|
|
444
|
+
return (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.TELEPORTER, variant, gridIndexOrPosition);
|
|
445
|
+
}
|
|
446
|
+
exports.spawnTeleporterWithVariant = spawnTeleporterWithVariant;
|
|
447
|
+
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17). */
|
|
448
|
+
function spawnTrapdoor(gridIndexOrPosition) {
|
|
449
|
+
return spawnCrawlSpaceWithVariant(isaac_typescript_definitions_1.CrawlSpaceVariant.NORMAL, gridIndexOrPosition);
|
|
450
|
+
}
|
|
451
|
+
exports.spawnTrapdoor = spawnTrapdoor;
|
|
452
|
+
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17) with a specific variant. */
|
|
453
|
+
function spawnTrapdoorWithVariant(trapdoorVariant, gridIndexOrPosition) {
|
|
454
|
+
return (0, gridEntities_1.spawnGridEntityWithVariant)(isaac_typescript_definitions_1.GridEntityType.TRAPDOOR, trapdoorVariant, gridIndexOrPosition);
|
|
455
|
+
}
|
|
456
|
+
exports.spawnTrapdoorWithVariant = spawnTrapdoorWithVariant;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGridIndexesBetween = void 0;
|
|
4
|
+
const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
|
|
5
|
+
const roomShape_1 = require("./roomShape");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
9
|
+
* vertical line, inclusive on both ends.
|
|
10
|
+
*
|
|
11
|
+
* If the first grid index is greater than the second grid index, the two will be swapped.
|
|
12
|
+
*
|
|
13
|
+
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
14
|
+
* horizontal or vertical line.
|
|
15
|
+
*/
|
|
16
|
+
function getGridIndexesBetween(gridIndex1, gridIndex2, roomShape) {
|
|
17
|
+
if (gridIndex1 > gridIndex2) {
|
|
18
|
+
const oldGridIndex1 = gridIndex1;
|
|
19
|
+
const oldGridIndex2 = gridIndex2;
|
|
20
|
+
gridIndex1 = oldGridIndex2;
|
|
21
|
+
gridIndex2 = oldGridIndex1;
|
|
22
|
+
}
|
|
23
|
+
const delta = gridIndex2 - gridIndex1;
|
|
24
|
+
const gridWidth = (0, roomShape_1.getRoomShapeWidth)(roomShape);
|
|
25
|
+
const isOnHorizontalLine = delta <= gridWidth;
|
|
26
|
+
if (isOnHorizontalLine) {
|
|
27
|
+
return (0, utils_1.iRange)(gridIndex1, gridIndex2);
|
|
28
|
+
}
|
|
29
|
+
const isOnVerticalLine = delta % gridWidth === 0;
|
|
30
|
+
if (isOnVerticalLine) {
|
|
31
|
+
return (0, utils_1.iRange)(gridIndex1, gridIndex2, gridWidth);
|
|
32
|
+
}
|
|
33
|
+
error(`Failed to get the grid indexes between ${gridIndex1} and ${gridIndex2} for RoomShape.${isaac_typescript_definitions_1.RoomShape[roomShape]} (${roomShape}) since they are not on the same horizontal or vertical line.`);
|
|
34
|
+
}
|
|
35
|
+
exports.getGridIndexesBetween = getGridIndexesBetween;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.crc32 = void 0;
|
|
4
|
+
const CRC32 = [
|
|
5
|
+
0x00_00_00_00, 0x77_07_30_96, 0xee_0e_61_2c, 0x99_09_51_ba, 0x07_6d_c4_19,
|
|
6
|
+
0x70_6a_f4_8f, 0xe9_63_a5_35, 0x9e_64_95_a3, 0x0e_db_88_32, 0x79_dc_b8_a4,
|
|
7
|
+
0xe0_d5_e9_1e, 0x97_d2_d9_88, 0x09_b6_4c_2b, 0x7e_b1_7c_bd, 0xe7_b8_2d_07,
|
|
8
|
+
0x90_bf_1d_91, 0x1d_b7_10_64, 0x6a_b0_20_f2, 0xf3_b9_71_48, 0x84_be_41_de,
|
|
9
|
+
0x1a_da_d4_7d, 0x6d_dd_e4_eb, 0xf4_d4_b5_51, 0x83_d3_85_c7, 0x13_6c_98_56,
|
|
10
|
+
0x64_6b_a8_c0, 0xfd_62_f9_7a, 0x8a_65_c9_ec, 0x14_01_5c_4f, 0x63_06_6c_d9,
|
|
11
|
+
0xfa_0f_3d_63, 0x8d_08_0d_f5, 0x3b_6e_20_c8, 0x4c_69_10_5e, 0xd5_60_41_e4,
|
|
12
|
+
0xa2_67_71_72, 0x3c_03_e4_d1, 0x4b_04_d4_47, 0xd2_0d_85_fd, 0xa5_0a_b5_6b,
|
|
13
|
+
0x35_b5_a8_fa, 0x42_b2_98_6c, 0xdb_bb_c9_d6, 0xac_bc_f9_40, 0x32_d8_6c_e3,
|
|
14
|
+
0x45_df_5c_75, 0xdc_d6_0d_cf, 0xab_d1_3d_59, 0x26_d9_30_ac, 0x51_de_00_3a,
|
|
15
|
+
0xc8_d7_51_80, 0xbf_d0_61_16, 0x21_b4_f4_b5, 0x56_b3_c4_23, 0xcf_ba_95_99,
|
|
16
|
+
0xb8_bd_a5_0f, 0x28_02_b8_9e, 0x5f_05_88_08, 0xc6_0c_d9_b2, 0xb1_0b_e9_24,
|
|
17
|
+
0x2f_6f_7c_87, 0x58_68_4c_11, 0xc1_61_1d_ab, 0xb6_66_2d_3d, 0x76_dc_41_90,
|
|
18
|
+
0x01_db_71_06, 0x98_d2_20_bc, 0xef_d5_10_2a, 0x71_b1_85_89, 0x06_b6_b5_1f,
|
|
19
|
+
0x9f_bf_e4_a5, 0xe8_b8_d4_33, 0x78_07_c9_a2, 0x0f_00_f9_34, 0x96_09_a8_8e,
|
|
20
|
+
0xe1_0e_98_18, 0x7f_6a_0d_bb, 0x08_6d_3d_2d, 0x91_64_6c_97, 0xe6_63_5c_01,
|
|
21
|
+
0x6b_6b_51_f4, 0x1c_6c_61_62, 0x85_65_30_d8, 0xf2_62_00_4e, 0x6c_06_95_ed,
|
|
22
|
+
0x1b_01_a5_7b, 0x82_08_f4_c1, 0xf5_0f_c4_57, 0x65_b0_d9_c6, 0x12_b7_e9_50,
|
|
23
|
+
0x8b_be_b8_ea, 0xfc_b9_88_7c, 0x62_dd_1d_df, 0x15_da_2d_49, 0x8c_d3_7c_f3,
|
|
24
|
+
0xfb_d4_4c_65, 0x4d_b2_61_58, 0x3a_b5_51_ce, 0xa3_bc_00_74, 0xd4_bb_30_e2,
|
|
25
|
+
0x4a_df_a5_41, 0x3d_d8_95_d7, 0xa4_d1_c4_6d, 0xd3_d6_f4_fb, 0x43_69_e9_6a,
|
|
26
|
+
0x34_6e_d9_fc, 0xad_67_88_46, 0xda_60_b8_d0, 0x44_04_2d_73, 0x33_03_1d_e5,
|
|
27
|
+
0xaa_0a_4c_5f, 0xdd_0d_7c_c9, 0x50_05_71_3c, 0x27_02_41_aa, 0xbe_0b_10_10,
|
|
28
|
+
0xc9_0c_20_86, 0x57_68_b5_25, 0x20_6f_85_b3, 0xb9_66_d4_09, 0xce_61_e4_9f,
|
|
29
|
+
0x5e_de_f9_0e, 0x29_d9_c9_98, 0xb0_d0_98_22, 0xc7_d7_a8_b4, 0x59_b3_3d_17,
|
|
30
|
+
0x2e_b4_0d_81, 0xb7_bd_5c_3b, 0xc0_ba_6c_ad, 0xed_b8_83_20, 0x9a_bf_b3_b6,
|
|
31
|
+
0x03_b6_e2_0c, 0x74_b1_d2_9a, 0xea_d5_47_39, 0x9d_d2_77_af, 0x04_db_26_15,
|
|
32
|
+
0x73_dc_16_83, 0xe3_63_0b_12, 0x94_64_3b_84, 0x0d_6d_6a_3e, 0x7a_6a_5a_a8,
|
|
33
|
+
0xe4_0e_cf_0b, 0x93_09_ff_9d, 0x0a_00_ae_27, 0x7d_07_9e_b1, 0xf0_0f_93_44,
|
|
34
|
+
0x87_08_a3_d2, 0x1e_01_f2_68, 0x69_06_c2_fe, 0xf7_62_57_5d, 0x80_65_67_cb,
|
|
35
|
+
0x19_6c_36_71, 0x6e_6b_06_e7, 0xfe_d4_1b_76, 0x89_d3_2b_e0, 0x10_da_7a_5a,
|
|
36
|
+
0x67_dd_4a_cc, 0xf9_b9_df_6f, 0x8e_be_ef_f9, 0x17_b7_be_43, 0x60_b0_8e_d5,
|
|
37
|
+
0xd6_d6_a3_e8, 0xa1_d1_93_7e, 0x38_d8_c2_c4, 0x4f_df_f2_52, 0xd1_bb_67_f1,
|
|
38
|
+
0xa6_bc_57_67, 0x3f_b5_06_dd, 0x48_b2_36_4b, 0xd8_0d_2b_da, 0xaf_0a_1b_4c,
|
|
39
|
+
0x36_03_4a_f6, 0x41_04_7a_60, 0xdf_60_ef_c3, 0xa8_67_df_55, 0x31_6e_8e_ef,
|
|
40
|
+
0x46_69_be_79, 0xcb_61_b3_8c, 0xbc_66_83_1a, 0x25_6f_d2_a0, 0x52_68_e2_36,
|
|
41
|
+
0xcc_0c_77_95, 0xbb_0b_47_03, 0x22_02_16_b9, 0x55_05_26_2f, 0xc5_ba_3b_be,
|
|
42
|
+
0xb2_bd_0b_28, 0x2b_b4_5a_92, 0x5c_b3_6a_04, 0xc2_d7_ff_a7, 0xb5_d0_cf_31,
|
|
43
|
+
0x2c_d9_9e_8b, 0x5b_de_ae_1d, 0x9b_64_c2_b0, 0xec_63_f2_26, 0x75_6a_a3_9c,
|
|
44
|
+
0x02_6d_93_0a, 0x9c_09_06_a9, 0xeb_0e_36_3f, 0x72_07_67_85, 0x05_00_57_13,
|
|
45
|
+
0x95_bf_4a_82, 0xe2_b8_7a_14, 0x7b_b1_2b_ae, 0x0c_b6_1b_38, 0x92_d2_8e_9b,
|
|
46
|
+
0xe5_d5_be_0d, 0x7c_dc_ef_b7, 0x0b_db_df_21, 0x86_d3_d2_d4, 0xf1_d4_e2_42,
|
|
47
|
+
0x68_dd_b3_f8, 0x1f_da_83_6e, 0x81_be_16_cd, 0xf6_b9_26_5b, 0x6f_b0_77_e1,
|
|
48
|
+
0x18_b7_47_77, 0x88_08_5a_e6, 0xff_0f_6a_70, 0x66_06_3b_ca, 0x11_01_0b_5c,
|
|
49
|
+
0x8f_65_9e_ff, 0xf8_62_ae_69, 0x61_6b_ff_d3, 0x16_6c_cf_45, 0xa0_0a_e2_78,
|
|
50
|
+
0xd7_0d_d2_ee, 0x4e_04_83_54, 0x39_03_b3_c2, 0xa7_67_26_61, 0xd0_60_16_f7,
|
|
51
|
+
0x49_69_47_4d, 0x3e_6e_77_db, 0xae_d1_6a_4a, 0xd9_d6_5a_dc, 0x40_df_0b_66,
|
|
52
|
+
0x37_d8_3b_f0, 0xa9_bc_ae_53, 0xde_bb_9e_c5, 0x47_b2_cf_7f, 0x30_b5_ff_e9,
|
|
53
|
+
0xbd_bd_f2_1c, 0xca_ba_c2_8a, 0x53_b3_93_30, 0x24_b4_a3_a6, 0xba_d0_36_05,
|
|
54
|
+
0xcd_d7_06_93, 0x54_de_57_29, 0x23_d9_67_bf, 0xb3_66_7a_2e, 0xc4_61_4a_b8,
|
|
55
|
+
0x5d_68_1b_02, 0x2a_6f_2b_94, 0xb4_0b_be_37, 0xc3_0c_8e_a1, 0x5a_05_df_1b,
|
|
56
|
+
0x2d_02_ef_8d,
|
|
57
|
+
];
|
|
58
|
+
/** From: https://github.com/lancelijade/qqwry.lua/blob/master/crc32.lua */
|
|
59
|
+
function crc32(str) {
|
|
60
|
+
let count = str.length;
|
|
61
|
+
let crc = 0xff_ff_ff_ff;
|
|
62
|
+
let i = 1;
|
|
63
|
+
while (count > 0) {
|
|
64
|
+
const byte = string.byte(str, i);
|
|
65
|
+
const left = crc >>> 8;
|
|
66
|
+
const crcIndex = ((crc & 0xff) ^ byte) + 1;
|
|
67
|
+
const right = CRC32[crcIndex] ?? 0;
|
|
68
|
+
crc = left ^ right;
|
|
69
|
+
i++;
|
|
70
|
+
count--;
|
|
71
|
+
}
|
|
72
|
+
crc ^= 0xff_ff_ff_ff;
|
|
73
|
+
return crc;
|
|
74
|
+
}
|
|
75
|
+
exports.crc32 = crc32;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hexToKColor = exports.hexToColor = void 0;
|
|
4
|
+
const log_1 = require("./log");
|
|
5
|
+
const HEX_STRING_LENGTH = 6;
|
|
6
|
+
/**
|
|
7
|
+
* Converts a hex string like "#33aa33" to a KColor object.
|
|
8
|
+
*
|
|
9
|
+
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
10
|
+
* @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
|
|
11
|
+
*/
|
|
12
|
+
function hexToColor(hexString, alpha = 1) {
|
|
13
|
+
const { r, g, b } = hexToRGB(hexString);
|
|
14
|
+
// Color values should be between 0 and 1.
|
|
15
|
+
const base = 255;
|
|
16
|
+
return Color(r / base, g / base, b / base, alpha);
|
|
17
|
+
}
|
|
18
|
+
exports.hexToColor = hexToColor;
|
|
19
|
+
/**
|
|
20
|
+
* Converts a hex string like "#33aa33" to a Color object.
|
|
21
|
+
*
|
|
22
|
+
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
23
|
+
* @param alpha Range is from 0 to 1. Default is 1.
|
|
24
|
+
*/
|
|
25
|
+
function hexToKColor(hexString, alpha = 1) {
|
|
26
|
+
const { r, g, b } = hexToRGB(hexString);
|
|
27
|
+
// KColor values should be between 0 and 1.
|
|
28
|
+
const base = 255;
|
|
29
|
+
return KColor(r / base, g / base, b / base, alpha);
|
|
30
|
+
}
|
|
31
|
+
exports.hexToKColor = hexToKColor;
|
|
32
|
+
function hexToRGB(hexString) {
|
|
33
|
+
hexString = hexString.replace("#", "");
|
|
34
|
+
if (hexString.length !== HEX_STRING_LENGTH) {
|
|
35
|
+
(0, log_1.logError)(`Hex strings must be of length: ${HEX_STRING_LENGTH}`);
|
|
36
|
+
return { r: 0, g: 0, b: 0 };
|
|
37
|
+
}
|
|
38
|
+
const rString = hexString.slice(0, 2);
|
|
39
|
+
const r = tonumber(`0x${rString}`);
|
|
40
|
+
if (r === undefined) {
|
|
41
|
+
(0, log_1.logError)(`Failed to convert \`0x${rString}\` to a number.`);
|
|
42
|
+
return { r: 0, g: 0, b: 0 };
|
|
43
|
+
}
|
|
44
|
+
const gString = hexString.slice(2, 4);
|
|
45
|
+
const g = tonumber(`0x${gString}`);
|
|
46
|
+
if (g === undefined) {
|
|
47
|
+
(0, log_1.logError)(`Failed to convert \`0x${gString}\` to a number.`);
|
|
48
|
+
return { r: 0, g: 0, b: 0 };
|
|
49
|
+
}
|
|
50
|
+
const bString = hexString.slice(4, 6);
|
|
51
|
+
const b = tonumber(`0x${bString}`);
|
|
52
|
+
if (b === undefined) {
|
|
53
|
+
(0, log_1.logError)(`Failed to convert \`0x${bString}\` to a number.`);
|
|
54
|
+
return { r: 0, g: 0, b: 0 };
|
|
55
|
+
}
|
|
56
|
+
return { r, g, b };
|
|
57
|
+
}
|