isaacscript-common 4.0.2 → 4.0.5

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.
Files changed (370) hide show
  1. package/callbacks/postPlayerCollectible.lua +4 -2
  2. package/functions/collectibleSet.d.ts +37 -2
  3. package/functions/collectibleSet.lua +62 -15
  4. package/functions/player.lua +3 -4
  5. package/package.json +2 -2
  6. package/cachedClasses.ts +0 -39
  7. package/callbacks/customRevive.ts +0 -215
  8. package/callbacks/itemPickup.ts +0 -101
  9. package/callbacks/postAmbush.ts +0 -73
  10. package/callbacks/postBombExploded.ts +0 -26
  11. package/callbacks/postBombInitLate.ts +0 -36
  12. package/callbacks/postBoneSwing.ts +0 -64
  13. package/callbacks/postCollectibleInitFirst.ts +0 -40
  14. package/callbacks/postCursedTeleport.ts +0 -185
  15. package/callbacks/postCustomDoorEnter.ts +0 -292
  16. package/callbacks/postDiceRoomActivated.ts +0 -60
  17. package/callbacks/postDoorRender.ts +0 -26
  18. package/callbacks/postDoorUpdate.ts +0 -26
  19. package/callbacks/postEffectInitLate.ts +0 -36
  20. package/callbacks/postEffectStateChanged.ts +0 -43
  21. package/callbacks/postEsauJr.ts +0 -109
  22. package/callbacks/postFamiliarInitLate.ts +0 -36
  23. package/callbacks/postFamiliarStateChanged.ts +0 -43
  24. package/callbacks/postFlip.ts +0 -90
  25. package/callbacks/postGreedModeWave.ts +0 -41
  26. package/callbacks/postGridEntity.ts +0 -164
  27. package/callbacks/postGridEntityCollision.ts +0 -69
  28. package/callbacks/postGridEntityRender.ts +0 -26
  29. package/callbacks/postHolyMantleRemoved.ts +0 -55
  30. package/callbacks/postItemDischarged.ts +0 -154
  31. package/callbacks/postKnifeInitLate.ts +0 -36
  32. package/callbacks/postLaserInitLate.ts +0 -36
  33. package/callbacks/postNPCInitLate.ts +0 -36
  34. package/callbacks/postNPCStateChanged.ts +0 -42
  35. package/callbacks/postNewRoomEarly.ts +0 -96
  36. package/callbacks/postPickupCollect.ts +0 -48
  37. package/callbacks/postPickupInitFirst.ts +0 -70
  38. package/callbacks/postPickupInitLate.ts +0 -36
  39. package/callbacks/postPickupStateChanged.ts +0 -43
  40. package/callbacks/postPitRender.ts +0 -26
  41. package/callbacks/postPitUpdate.ts +0 -26
  42. package/callbacks/postPlayerChangeHealth.ts +0 -62
  43. package/callbacks/postPlayerChangeType.ts +0 -56
  44. package/callbacks/postPlayerCollectible.ts +0 -113
  45. package/callbacks/postPlayerFatalDamage.ts +0 -141
  46. package/callbacks/postPlayerInitLate.ts +0 -37
  47. package/callbacks/postPlayerReordered.ts +0 -142
  48. package/callbacks/postPoopRender.ts +0 -26
  49. package/callbacks/postPoopUpdate.ts +0 -26
  50. package/callbacks/postPressurePlateRender.ts +0 -26
  51. package/callbacks/postPressurePlateUpdate.ts +0 -26
  52. package/callbacks/postProjectileInitLate.ts +0 -36
  53. package/callbacks/postPurchase.ts +0 -64
  54. package/callbacks/postRockRender.ts +0 -26
  55. package/callbacks/postRockUpdate.ts +0 -26
  56. package/callbacks/postRoomClearChanged.ts +0 -57
  57. package/callbacks/postSacrifice.ts +0 -64
  58. package/callbacks/postSlotDestroyed.ts +0 -92
  59. package/callbacks/postSlotInitUpdate.ts +0 -68
  60. package/callbacks/postSlotRender.ts +0 -69
  61. package/callbacks/postSpikesRender.ts +0 -26
  62. package/callbacks/postSpikesUpdate.ts +0 -26
  63. package/callbacks/postTNTRender.ts +0 -26
  64. package/callbacks/postTNTUpdate.ts +0 -26
  65. package/callbacks/postTearInitLate.ts +0 -36
  66. package/callbacks/postTearInitVeryLate.ts +0 -41
  67. package/callbacks/postTransformation.ts +0 -59
  68. package/callbacks/postTrinketBreak.ts +0 -112
  69. package/callbacks/preBerserkDeath.ts +0 -49
  70. package/callbacks/preNewLevel.ts +0 -55
  71. package/callbacks/reorderedCallbacks.ts +0 -168
  72. package/callbacks/subscriptions/postAmbushFinished.ts +0 -32
  73. package/callbacks/subscriptions/postAmbushStarted.ts +0 -32
  74. package/callbacks/subscriptions/postBombInitLate.ts +0 -32
  75. package/callbacks/subscriptions/postBoneExploded.ts +0 -32
  76. package/callbacks/subscriptions/postBoneSwing.ts +0 -24
  77. package/callbacks/subscriptions/postCollectibleInitFirst.ts +0 -37
  78. package/callbacks/subscriptions/postCursedTeleport.ts +0 -24
  79. package/callbacks/subscriptions/postCustomDoorEnter.ts +0 -45
  80. package/callbacks/subscriptions/postCustomRevive.ts +0 -36
  81. package/callbacks/subscriptions/postDiceRoomActivated.ts +0 -38
  82. package/callbacks/subscriptions/postDoorRender.ts +0 -35
  83. package/callbacks/subscriptions/postDoorUpdate.ts +0 -35
  84. package/callbacks/subscriptions/postEffectInitLate.ts +0 -32
  85. package/callbacks/subscriptions/postEffectStateChanged.ts +0 -40
  86. package/callbacks/subscriptions/postEsauJr.ts +0 -24
  87. package/callbacks/subscriptions/postFamiliarInitLate.ts +0 -32
  88. package/callbacks/subscriptions/postFamiliarStateChanged.ts +0 -40
  89. package/callbacks/subscriptions/postFirstEsauJr.ts +0 -24
  90. package/callbacks/subscriptions/postFirstFlip.ts +0 -24
  91. package/callbacks/subscriptions/postFlip.ts +0 -22
  92. package/callbacks/subscriptions/postGameStartedReordered.ts +0 -24
  93. package/callbacks/subscriptions/postGreedModeWave.ts +0 -24
  94. package/callbacks/subscriptions/postGridEntityBroken.ts +0 -51
  95. package/callbacks/subscriptions/postGridEntityCollision.ts +0 -54
  96. package/callbacks/subscriptions/postGridEntityInit.ts +0 -51
  97. package/callbacks/subscriptions/postGridEntityRemove.ts +0 -52
  98. package/callbacks/subscriptions/postGridEntityRender.ts +0 -51
  99. package/callbacks/subscriptions/postGridEntityStateChanged.ts +0 -55
  100. package/callbacks/subscriptions/postGridEntityUpdate.ts +0 -51
  101. package/callbacks/subscriptions/postHolyMantleRemoved.ts +0 -48
  102. package/callbacks/subscriptions/postItemDischarged.ts +0 -43
  103. package/callbacks/subscriptions/postItemPickup.ts +0 -64
  104. package/callbacks/subscriptions/postKnifeInitLate.ts +0 -32
  105. package/callbacks/subscriptions/postLaserInitLate.ts +0 -32
  106. package/callbacks/subscriptions/postNPCInitLate.ts +0 -32
  107. package/callbacks/subscriptions/postNPCStateChanged.ts +0 -42
  108. package/callbacks/subscriptions/postNewLevelReordered.ts +0 -22
  109. package/callbacks/subscriptions/postNewRoomEarly.ts +0 -22
  110. package/callbacks/subscriptions/postNewRoomReordered.ts +0 -22
  111. package/callbacks/subscriptions/postPEffectUpdateReordered.ts +0 -40
  112. package/callbacks/subscriptions/postPickupCollect.ts +0 -35
  113. package/callbacks/subscriptions/postPickupInitFirst.ts +0 -32
  114. package/callbacks/subscriptions/postPickupInitLate.ts +0 -32
  115. package/callbacks/subscriptions/postPickupStateChanged.ts +0 -40
  116. package/callbacks/subscriptions/postPitRender.ts +0 -35
  117. package/callbacks/subscriptions/postPitUpdate.ts +0 -35
  118. package/callbacks/subscriptions/postPlayerChangeHealth.ts +0 -49
  119. package/callbacks/subscriptions/postPlayerChangeType.ts +0 -40
  120. package/callbacks/subscriptions/postPlayerCollectibleAdded.ts +0 -38
  121. package/callbacks/subscriptions/postPlayerCollectibleRemoved.ts +0 -38
  122. package/callbacks/subscriptions/postPlayerFatalDamage.ts +0 -68
  123. package/callbacks/subscriptions/postPlayerInitLate.ts +0 -40
  124. package/callbacks/subscriptions/postPlayerInitReordered.ts +0 -40
  125. package/callbacks/subscriptions/postPlayerRenderReordered.ts +0 -40
  126. package/callbacks/subscriptions/postPlayerUpdateReordered.ts +0 -40
  127. package/callbacks/subscriptions/postPoopRender.ts +0 -35
  128. package/callbacks/subscriptions/postPoopUpdate.ts +0 -35
  129. package/callbacks/subscriptions/postPressurePlateRender.ts +0 -37
  130. package/callbacks/subscriptions/postPressurePlateUpdate.ts +0 -37
  131. package/callbacks/subscriptions/postProjectileInitLate.ts +0 -35
  132. package/callbacks/subscriptions/postPurchase.ts +0 -31
  133. package/callbacks/subscriptions/postRockRender.ts +0 -35
  134. package/callbacks/subscriptions/postRockUpdate.ts +0 -35
  135. package/callbacks/subscriptions/postRoomClearChanged.ts +0 -30
  136. package/callbacks/subscriptions/postSacrifice.ts +0 -43
  137. package/callbacks/subscriptions/postSlotAnimationChanged.ts +0 -40
  138. package/callbacks/subscriptions/postSlotDestroyed.ts +0 -55
  139. package/callbacks/subscriptions/postSlotInit.ts +0 -32
  140. package/callbacks/subscriptions/postSlotRender.ts +0 -32
  141. package/callbacks/subscriptions/postSlotUpdate.ts +0 -32
  142. package/callbacks/subscriptions/postSpikesRender.ts +0 -35
  143. package/callbacks/subscriptions/postSpikesUpdate.ts +0 -35
  144. package/callbacks/subscriptions/postTNTRender.ts +0 -35
  145. package/callbacks/subscriptions/postTNTUpdate.ts +0 -35
  146. package/callbacks/subscriptions/postTearInitLate.ts +0 -32
  147. package/callbacks/subscriptions/postTearInitVeryLate.ts +0 -32
  148. package/callbacks/subscriptions/postTransformation.ts +0 -40
  149. package/callbacks/subscriptions/postTrinketBreak.ts +0 -38
  150. package/callbacks/subscriptions/preBerserkDeath.ts +0 -42
  151. package/callbacks/subscriptions/preCustomRevive.ts +0 -46
  152. package/callbacks/subscriptions/preItemPickup.ts +0 -64
  153. package/callbacks/subscriptions/preNewLevel.ts +0 -24
  154. package/classes/DefaultMap.ts +0 -174
  155. package/classes/ModUpgraded.ts +0 -84
  156. package/constants.ts +0 -162
  157. package/constantsFirstLast.ts +0 -217
  158. package/enums/AmbushType.ts +0 -4
  159. package/enums/HealthType.ts +0 -16
  160. package/enums/ModCallbackCustom.ts +0 -1278
  161. package/enums/PocketItemType.ts +0 -8
  162. package/enums/SerializationType.ts +0 -5
  163. package/enums/SlotDestructionType.ts +0 -4
  164. package/enums/private/CopyableIsaacAPIClassType.ts +0 -7
  165. package/enums/private/SaveDataKey.ts +0 -14
  166. package/enums/private/SerializationBrand.ts +0 -42
  167. package/features/characterHealthConversion.ts +0 -111
  168. package/features/characterStats.ts +0 -61
  169. package/features/debugDisplay/debugDisplay.ts +0 -221
  170. package/features/debugDisplay/exports.ts +0 -368
  171. package/features/debugDisplay/v.ts +0 -65
  172. package/features/deployJSONRoom.ts +0 -743
  173. package/features/disableInputs.ts +0 -193
  174. package/features/disableSound.ts +0 -77
  175. package/features/extraConsoleCommands/commandsDisplay.ts +0 -290
  176. package/features/extraConsoleCommands/commandsSubroutines.ts +0 -139
  177. package/features/extraConsoleCommands/init.ts +0 -334
  178. package/features/extraConsoleCommands/listCommands.ts +0 -1299
  179. package/features/extraConsoleCommands/v.ts +0 -14
  180. package/features/fadeInRemover.ts +0 -60
  181. package/features/fastReset.ts +0 -75
  182. package/features/forgottenSwitch.ts +0 -50
  183. package/features/getCollectibleItemPoolType.ts +0 -66
  184. package/features/persistentEntities.ts +0 -183
  185. package/features/playerInventory.ts +0 -135
  186. package/features/ponyDetection.ts +0 -74
  187. package/features/preventCollectibleRotation.ts +0 -115
  188. package/features/runInNFrames.ts +0 -148
  189. package/features/saveDataManager/constants.ts +0 -4
  190. package/features/saveDataManager/exports.ts +0 -229
  191. package/features/saveDataManager/load.ts +0 -99
  192. package/features/saveDataManager/main.ts +0 -195
  193. package/features/saveDataManager/maps.ts +0 -13
  194. package/features/saveDataManager/merge.ts +0 -194
  195. package/features/saveDataManager/save.ts +0 -74
  196. package/features/saveDataManager/serializationBrand.ts +0 -16
  197. package/features/sirenHelpers.ts +0 -129
  198. package/features/taintedLazarusPlayers.ts +0 -113
  199. package/featuresInitialized.ts +0 -20
  200. package/functions/ambush.ts +0 -47
  201. package/functions/array.ts +0 -410
  202. package/functions/benchmark.ts +0 -36
  203. package/functions/bitwise.ts +0 -24
  204. package/functions/bombs.ts +0 -12
  205. package/functions/boss.ts +0 -227
  206. package/functions/cacheFlag.ts +0 -12
  207. package/functions/cards.ts +0 -271
  208. package/functions/challenges.ts +0 -13
  209. package/functions/character.ts +0 -126
  210. package/functions/charge.ts +0 -237
  211. package/functions/chargeBar.ts +0 -67
  212. package/functions/collectibleCacheFlag.ts +0 -90
  213. package/functions/collectibleSet.ts +0 -56
  214. package/functions/collectibleTag.ts +0 -89
  215. package/functions/collectibles.ts +0 -659
  216. package/functions/color.ts +0 -128
  217. package/functions/debug.ts +0 -68
  218. package/functions/deepCopy.ts +0 -535
  219. package/functions/deepCopyTests.ts +0 -386
  220. package/functions/direction.ts +0 -49
  221. package/functions/doors.ts +0 -347
  222. package/functions/easing.ts +0 -182
  223. package/functions/eden.ts +0 -47
  224. package/functions/effects.ts +0 -20
  225. package/functions/entity.ts +0 -439
  226. package/functions/entitySpecific.ts +0 -889
  227. package/functions/entityTypes.ts +0 -6
  228. package/functions/enums.ts +0 -146
  229. package/functions/familiars.ts +0 -106
  230. package/functions/flag.ts +0 -165
  231. package/functions/flying.ts +0 -117
  232. package/functions/globals.ts +0 -242
  233. package/functions/gridEntity.ts +0 -511
  234. package/functions/gridEntitySpecific.ts +0 -112
  235. package/functions/input.ts +0 -139
  236. package/functions/isaacAPIClass.ts +0 -67
  237. package/functions/jsonHelpers.ts +0 -45
  238. package/functions/jsonRoom.ts +0 -100
  239. package/functions/kColor.ts +0 -129
  240. package/functions/language.ts +0 -13
  241. package/functions/level.ts +0 -31
  242. package/functions/log.ts +0 -720
  243. package/functions/map.ts +0 -56
  244. package/functions/math.ts +0 -149
  245. package/functions/mergeTests.ts +0 -288
  246. package/functions/npc.ts +0 -148
  247. package/functions/pickupVariants.ts +0 -60
  248. package/functions/pickups.ts +0 -499
  249. package/functions/pills.ts +0 -205
  250. package/functions/player.ts +0 -1056
  251. package/functions/playerDataStructures.ts +0 -150
  252. package/functions/playerHealth.ts +0 -382
  253. package/functions/playerIndex.ts +0 -195
  254. package/functions/pocketItems.ts +0 -149
  255. package/functions/positionVelocity.ts +0 -188
  256. package/functions/random.ts +0 -77
  257. package/functions/revive.ts +0 -201
  258. package/functions/rng.ts +0 -172
  259. package/functions/roomData.ts +0 -199
  260. package/functions/roomGrid.ts +0 -109
  261. package/functions/roomShape.ts +0 -80
  262. package/functions/rooms.ts +0 -648
  263. package/functions/run.ts +0 -36
  264. package/functions/saveFile.ts +0 -128
  265. package/functions/seeds.ts +0 -19
  266. package/functions/serialization.ts +0 -91
  267. package/functions/set.ts +0 -95
  268. package/functions/sound.ts +0 -9
  269. package/functions/spawnCollectible.ts +0 -104
  270. package/functions/sprite.ts +0 -107
  271. package/functions/stage.ts +0 -125
  272. package/functions/string.ts +0 -47
  273. package/functions/table.ts +0 -189
  274. package/functions/tears.ts +0 -32
  275. package/functions/transformations.ts +0 -131
  276. package/functions/trinketCacheFlag.ts +0 -60
  277. package/functions/trinketGive.ts +0 -157
  278. package/functions/trinkets.ts +0 -215
  279. package/functions/tstlClass.ts +0 -157
  280. package/functions/types.ts +0 -36
  281. package/functions/ui.ts +0 -138
  282. package/functions/utils.ts +0 -189
  283. package/functions/vector.ts +0 -126
  284. package/index.ts +0 -172
  285. package/initCustomCallbacks.ts +0 -132
  286. package/initFeatures.ts +0 -39
  287. package/interfaces/AddCallbackParameterCustom.ts +0 -188
  288. package/interfaces/ChargeBarSprites.ts +0 -12
  289. package/interfaces/JSONDoor.ts +0 -13
  290. package/interfaces/JSONEntity.ts +0 -16
  291. package/interfaces/JSONRoom.ts +0 -36
  292. package/interfaces/JSONRooms.ts +0 -12
  293. package/interfaces/JSONSpawn.ts +0 -14
  294. package/interfaces/PlayerHealth.ts +0 -16
  295. package/interfaces/PocketItemDescription.ts +0 -9
  296. package/interfaces/SaveData.ts +0 -29
  297. package/interfaces/TrinketSituation.ts +0 -9
  298. package/interfaces/private/TSTLClassMetatable.ts +0 -8
  299. package/maps/PHDPillConversions.ts +0 -21
  300. package/maps/cardMap.ts +0 -209
  301. package/maps/characterMap.ts +0 -87
  302. package/maps/collectibleDescriptionMap.ts +0 -732
  303. package/maps/collectibleNameMap.ts +0 -731
  304. package/maps/defaultPlayerStatMap.ts +0 -17
  305. package/maps/falsePHDPillConversions.ts +0 -35
  306. package/maps/gridEntityTypeToBrokenStateMap.ts +0 -50
  307. package/maps/gridEntityXMLMap.ts +0 -176
  308. package/maps/pillEffectMap.ts +0 -88
  309. package/maps/roomShapeToTopLeftWallGridIndexMap.ts +0 -18
  310. package/maps/roomTypeMap.ts +0 -40
  311. package/maps/trinketDescriptionMap.ts +0 -200
  312. package/maps/trinketNameMap.ts +0 -198
  313. package/objects/LRoomShapeToRectangles.ts +0 -44
  314. package/objects/callbackRegisterFunctions.ts +0 -187
  315. package/objects/cardDescriptions.ts +0 -105
  316. package/objects/cardNames.ts +0 -105
  317. package/objects/cardTypes.ts +0 -104
  318. package/objects/challengeNames.ts +0 -52
  319. package/objects/characterNames.ts +0 -48
  320. package/objects/coinSubTypeToValue.ts +0 -14
  321. package/objects/colors.ts +0 -16
  322. package/objects/directionNames.ts +0 -11
  323. package/objects/directionToDegrees.ts +0 -11
  324. package/objects/directionToVector.ts +0 -12
  325. package/objects/doorSlotFlagToDoorSlot.ts +0 -16
  326. package/objects/doorSlotToDirection.ts +0 -14
  327. package/objects/isaacAPIClassTypeToBrand.ts +0 -11
  328. package/objects/isaacAPIClassTypeToCopyFunction.ts +0 -18
  329. package/objects/languageNames.ts +0 -13
  330. package/objects/oppositeDoorSlots.ts +0 -15
  331. package/objects/pillEffectClasses.ts +0 -63
  332. package/objects/pillEffectNames.ts +0 -57
  333. package/objects/pillEffectTypes.ts +0 -62
  334. package/objects/roomShapeBounds.ts +0 -71
  335. package/objects/roomShapeLayoutSizes.ts +0 -45
  336. package/objects/roomShapeToBottomRightPosition.ts +0 -25
  337. package/objects/roomShapeToDoorSlots.ts +0 -83
  338. package/objects/roomShapeToDoorSlotsToGridIndexDelta.ts +0 -127
  339. package/objects/roomShapeToGridWidth.ts +0 -21
  340. package/objects/roomShapeToTopLeftPosition.ts +0 -26
  341. package/objects/roomShapeVolumes.ts +0 -38
  342. package/objects/roomTypeNames.ts +0 -36
  343. package/objects/serializedIsaacAPIClassTypeToIdentityFunction.ts +0 -14
  344. package/objects/stageTypeToLetter.ts +0 -15
  345. package/objects/transformationNames.ts +0 -18
  346. package/patchErrorFunctions.ts +0 -92
  347. package/sets/LRoomShapesSet.ts +0 -8
  348. package/sets/bossSets.ts +0 -470
  349. package/sets/charactersThatStartWithAnActiveItemSet.ts +0 -16
  350. package/sets/charactersWithBlackHeartFromEternalHeartSet.ts +0 -7
  351. package/sets/charactersWithFreeDevilDealsSet.ts +0 -4
  352. package/sets/charactersWithNoRedHeartsSet.ts +0 -17
  353. package/sets/charactersWithNoSoulHeartsSet.ts +0 -14
  354. package/sets/chestPickupVariantsSet.ts +0 -16
  355. package/sets/familiarsThatShootPlayerTearsSet.ts +0 -13
  356. package/sets/lostStyleCharactersSet.ts +0 -13
  357. package/sets/mineShaftRoomSubTypesSet.ts +0 -10
  358. package/sets/redHeartSubTypesSet.ts +0 -7
  359. package/sets/sinEntityTypesSet.ts +0 -11
  360. package/sets/singleUseActiveCollectibleTypesSet.ts +0 -13
  361. package/sets/storyBossesSet.ts +0 -17
  362. package/types/AnyEntity.ts +0 -12
  363. package/types/AwaitingTextInput.d.ts +0 -2
  364. package/types/CollectibleIndex.ts +0 -16
  365. package/types/PickingUpItem.ts +0 -89
  366. package/types/PlayerIndex.ts +0 -13
  367. package/types/private/IsaacAPIClass.ts +0 -3
  368. package/types/private/SerializedIsaacAPIClass.ts +0 -3
  369. package/types/private/TSTLClass.ts +0 -3
  370. package/upgradeMod.ts +0 -55
@@ -1,1299 +0,0 @@
1
- // This file is arbitrarily named "listCommands.ts" instead of "commands.ts" so that it will appear
2
- // below the "init" page.
3
-
4
- // cspell:ignore addcharges
5
- /**
6
- * This is a list of custom console commands that are included with the standard library.
7
- *
8
- * Note that as a quality of life feature, you do not have to match the casing of the command. For
9
- * example, you can type the "addCharges" command as "addcharges", and it will still work the same.
10
- *
11
- * In order for the custom console commands to work, you first have to call
12
- * `enableExtraConsoleCommands`. (See the "Extra Console Commands (Init)" page for more details.)
13
- *
14
- * @module
15
- */
16
-
17
- import {
18
- ActiveSlot,
19
- CacheFlag,
20
- Card,
21
- CollectibleType,
22
- Direction,
23
- DisplayFlag,
24
- GameStateFlag,
25
- GridEntityType,
26
- GridRoom,
27
- LevelStage,
28
- PillColor,
29
- PillEffect,
30
- PlayerType,
31
- RoomType,
32
- SoundEffect,
33
- TrinketType,
34
- } from "isaac-typescript-definitions";
35
- import { game, sfxManager } from "../../cachedClasses";
36
- import {
37
- FIRST_ROOM_TYPE,
38
- FIRST_STAGE,
39
- LAST_ROOM_TYPE,
40
- LAST_STAGE,
41
- MAX_LEVEL_GRID_INDEX,
42
- } from "../../constants";
43
- import {
44
- FIRST_CARD,
45
- FIRST_CHARACTER,
46
- FIRST_PILL_EFFECT,
47
- LAST_CARD,
48
- LAST_PILL_EFFECT,
49
- LAST_VANILLA_CHARACTER,
50
- } from "../../constantsFirstLast";
51
- import { HealthType } from "../../enums/HealthType";
52
- import { getCardName } from "../../functions/cards";
53
- import { getCharacterName } from "../../functions/character";
54
- import { isValidCollectibleType } from "../../functions/collectibles";
55
- import { getNPCs } from "../../functions/entitySpecific";
56
- import { getEnumValues } from "../../functions/enums";
57
- import { addFlag } from "../../functions/flag";
58
- import { spawnGrid } from "../../functions/gridEntity";
59
- import {
60
- logEffects,
61
- logRoom,
62
- logSeedEffects,
63
- logSounds,
64
- } from "../../functions/log";
65
- import { getMapPartialMatch } from "../../functions/map";
66
- import { spawnCard, spawnPill, spawnTrinket } from "../../functions/pickups";
67
- import { getPillEffectName } from "../../functions/pills";
68
- import { getPlayerName, useActiveItemTemp } from "../../functions/player";
69
- import { getPlayers } from "../../functions/playerIndex";
70
- import { gridCoordinatesToWorldPosition } from "../../functions/roomGrid";
71
- import { changeRoom, getRoomGridIndexesForType } from "../../functions/rooms";
72
- import { restart } from "../../functions/run";
73
- import { getGoldenTrinketType } from "../../functions/trinkets";
74
- import { irange, printConsole, printEnabled } from "../../functions/utils";
75
- import { CARD_MAP } from "../../maps/cardMap";
76
- import { CHARACTER_MAP } from "../../maps/characterMap";
77
- import { PILL_EFFECT_MAP } from "../../maps/pillEffectMap";
78
- import { ROOM_TYPE_MAP } from "../../maps/roomTypeMap";
79
- import {
80
- addHeart,
81
- devilAngel,
82
- listEntities,
83
- listGridEntities,
84
- movePlayer,
85
- spawnTrapdoorOrCrawlspace,
86
- warpToRoomType,
87
- } from "./commandsSubroutines";
88
- import v from "./v";
89
-
90
- /**
91
- * Adds a single charge to the player's specified active item. You must provide the active slot
92
- * number. Provide a second number to give a custom amount of charges. (You can use negative numbers
93
- * to remove charge.)
94
- */
95
- export function addCharges(params: string): void {
96
- if (params === "") {
97
- printConsole(
98
- "You must specify a slot number. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)",
99
- );
100
- return;
101
- }
102
-
103
- const args = params.split(" ");
104
-
105
- if (args.length !== 1 && args.length !== 2) {
106
- printConsole("That is an invalid amount of arguments.");
107
- return;
108
- }
109
-
110
- const [activeSlotString, chargeString] = args;
111
-
112
- const activeSlot = tonumber(activeSlotString) as ActiveSlot | undefined;
113
- if (activeSlot === undefined) {
114
- printConsole(`The provided slot number is invalid: ${activeSlotString}`);
115
- return;
116
- }
117
-
118
- if (
119
- activeSlot < ActiveSlot.PRIMARY ||
120
- activeSlot > ActiveSlot.POCKET_SINGLE_USE
121
- ) {
122
- printConsole(`The provided slot number is invalid: ${activeSlot}`);
123
- return;
124
- }
125
-
126
- let chargeNum = 1;
127
- if (chargeString !== undefined) {
128
- const chargeNumAttempt = tonumber(chargeString);
129
- if (chargeNumAttempt === undefined) {
130
- printConsole(`The provided charge amount is invalid: ${chargeString}`);
131
- return;
132
- }
133
- chargeNum = chargeNumAttempt;
134
- }
135
-
136
- const player = Isaac.GetPlayer();
137
- const currentCharge = player.GetActiveCharge(activeSlot);
138
- const newCharge = currentCharge + chargeNum;
139
- player.SetActiveCharge(newCharge, activeSlot);
140
- }
141
-
142
- /**
143
- * Warps to the Angel Room for the floor. If the Devil Room has already been visited or initialized,
144
- * this will uninitialize it and make an Angel Room instead.
145
- */
146
- export function angel(): void {
147
- devilAngel(false);
148
- }
149
-
150
- /** Activates the flags for the Ascent (i.e. Backwards Path). */
151
- export function ascent(): void {
152
- game.SetStateFlag(GameStateFlag.BACKWARDS_PATH_INIT, true);
153
- game.SetStateFlag(GameStateFlag.BACKWARDS_PATH, true);
154
-
155
- printConsole("Set Ascent flags.");
156
- }
157
-
158
- /** Warps to the first Clean Bedroom or Dirty Bedroom on the floor. */
159
- export function bedroom(): void {
160
- const cleanBedroomGridIndexes = getRoomGridIndexesForType(
161
- RoomType.CLEAN_BEDROOM,
162
- );
163
- if (cleanBedroomGridIndexes.length > 0) {
164
- warpToRoomType(RoomType.CLEAN_BEDROOM);
165
- return;
166
- }
167
-
168
- const dirtyBedroomGridIndexes = getRoomGridIndexesForType(
169
- RoomType.DIRTY_BEDROOM,
170
- );
171
- if (dirtyBedroomGridIndexes.length > 0) {
172
- warpToRoomType(RoomType.DIRTY_BEDROOM);
173
- return;
174
- }
175
-
176
- printConsole("There are no Clean Bedrooms or Dirty Bedrooms on this floor.");
177
- }
178
-
179
- /** Alias for the "blackhearts" command. */
180
- export function bh(params: string): void {
181
- blackHearts(params);
182
- }
183
-
184
- /**
185
- * Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
186
- * negative numbers to remove hearts.)
187
- */
188
- export function blackHearts(params: string): void {
189
- addHeart(params, HealthType.BLACK);
190
- }
191
-
192
- /** Warps to the Black Market for the floor. */
193
- export function blackMarket(): void {
194
- changeRoom(GridRoom.BLACK_MARKET);
195
- }
196
-
197
- /**
198
- * Gives a blood charge. This only affects Bethany. Provide a number to give a custom amount of
199
- * charges. (You can use negative numbers to remove charges.)
200
- */
201
- export function bloodCharges(params: string): void {
202
- let charges = 1;
203
- if (params !== "") {
204
- const num = tonumber(params);
205
- if (num === undefined) {
206
- printConsole("That is an invalid amount of charges to add.");
207
- return;
208
- }
209
-
210
- charges = num;
211
- }
212
-
213
- const player = Isaac.GetPlayer();
214
- player.AddBloodCharge(charges);
215
- }
216
-
217
- /** Alias for the "blackMarket" command. */
218
- export function bm(): void {
219
- blackMarket();
220
- }
221
-
222
- /**
223
- * Gives a bomb. Provide a number to give a custom amount of bombs. (You can use negative numbers to
224
- * remove bombs.)
225
- */
226
- export function bomb(params: string): void {
227
- let numBombs = 1;
228
- if (params !== "") {
229
- const num = tonumber(params);
230
- if (num === undefined) {
231
- printConsole("That is an invalid amount of bombs to add.");
232
- return;
233
- }
234
-
235
- numBombs = num;
236
- }
237
-
238
- const player = Isaac.GetPlayer();
239
- player.AddBombs(numBombs);
240
- }
241
-
242
- /**
243
- * Gives 99 bombs. Provide a number to give a custom amount of bombs. (You can use negative numbers
244
- * to remove bombs.)
245
- */
246
- export function bombs(params: string): void {
247
- let numBombs = 99;
248
- if (params !== "") {
249
- const num = tonumber(params);
250
- if (num === undefined) {
251
- printConsole("That is an invalid amount of bombs to add.");
252
- return;
253
- }
254
-
255
- numBombs = num;
256
- }
257
-
258
- const player = Isaac.GetPlayer();
259
- player.AddBombs(numBombs);
260
- }
261
-
262
- /**
263
- * Gives a bone heart. Provide a number to give a custom amount of hearts. (You can use negative
264
- * numbers to remove hearts.)
265
- */
266
- export function boneHearts(params: string): void {
267
- addHeart(params, HealthType.BONE);
268
- }
269
-
270
- /** Warps to the first Boss Room on the floor. */
271
- export function boss(): void {
272
- warpToRoomType(RoomType.BOSS);
273
- }
274
-
275
- /** Warps to the Boss Rush for the floor. */
276
- export function bossRush(): void {
277
- changeRoom(GridRoom.BOSS_RUSH);
278
- }
279
-
280
- /**
281
- * Gives a broken heart. Provide a number to give a custom amount of hearts. (You can use negative
282
- * numbers to remove hearts.)
283
- */
284
- export function brokenHearts(params: string): void {
285
- addHeart(params, HealthType.BROKEN);
286
- }
287
-
288
- /**
289
- * Gives the specified card. Accepts either the card sub-type or the partial name of the card.
290
- *
291
- * For example:
292
- * - card 5 - Gives The Emperor.
293
- * - card spa - Gives 2 of Spades.
294
- */
295
- export function card(params: string): void {
296
- if (params === "") {
297
- printConsole("You must specify a card name or number.");
298
- return;
299
- }
300
-
301
- let cardNum: Card;
302
- const num = tonumber(params) as Card | undefined;
303
- if (num === undefined) {
304
- const match = getMapPartialMatch(params, CARD_MAP);
305
- if (match === undefined) {
306
- printConsole(`Unknown card: ${params}`);
307
- return;
308
- }
309
-
310
- cardNum = match[1];
311
- } else {
312
- if (num < FIRST_CARD || num > LAST_CARD) {
313
- printConsole(`Invalid card sub-type: ${num}`);
314
- return;
315
- }
316
-
317
- cardNum = num;
318
- }
319
-
320
- const cardName = getCardName(cardNum);
321
- Isaac.ExecuteCommand(`g k${cardNum}`);
322
- printConsole(`Gave card: ${cardName} (${cardNum})`);
323
- }
324
-
325
- /** Spawns every card on the ground, starting at the top-left-most tile. */
326
- export function cards(): void {
327
- let cardType = 1;
328
- for (let y = 0; y <= 6; y++) {
329
- for (let x = 0; x <= 12; x++) {
330
- if ((cardType as Card) === LAST_CARD) {
331
- return;
332
- }
333
-
334
- const position = gridCoordinatesToWorldPosition(x, y);
335
- spawnCard(cardType as Card, position);
336
- cardType += 1;
337
- }
338
- }
339
- }
340
-
341
- /** Alias for the "chaosCardTears" command. */
342
- export function cc(): void {
343
- chaosCardTears();
344
- }
345
-
346
- /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
347
- export function chaosCardTears(): void {
348
- v.run.chaosCardTears = !v.run.chaosCardTears;
349
- printEnabled(v.run.chaosCardTears, "Chaos Card tears");
350
- }
351
-
352
- /**
353
- * Restart as the specified character. Accepts either the character sub-type or the partial name of
354
- * the character.
355
- *
356
- * For example:
357
- * - character 2 - Restarts as Cain.
358
- * - character ta - Restarts as Tainted Azazel.
359
- */
360
- export function characterCommand(params: string): void {
361
- if (params === "") {
362
- printConsole("You must specify a character name or number.");
363
- return;
364
- }
365
-
366
- let character: PlayerType;
367
- const num = tonumber(params) as PlayerType | undefined;
368
- if (num === undefined) {
369
- const match = getMapPartialMatch(params, CHARACTER_MAP);
370
- if (match === undefined) {
371
- printConsole(`Unknown character: ${params}`);
372
- return;
373
- }
374
-
375
- character = match[1];
376
- } else {
377
- if (num < FIRST_CHARACTER || num > LAST_VANILLA_CHARACTER) {
378
- printConsole(`Invalid player sub-type: ${num}`);
379
- return;
380
- }
381
-
382
- character = num;
383
- }
384
-
385
- const characterName = getCharacterName(character);
386
- restart(character);
387
- printConsole(`Restarting as character: ${characterName} (${character})`);
388
- }
389
-
390
- /** Alias for the "addCharges" command. */
391
- export function charge(params: string): void {
392
- addCharges(params);
393
- }
394
-
395
- /** Warps to the first Clean Bedroom on the floor. */
396
- export function cleanBedroom(): void {
397
- warpToRoomType(RoomType.CLEAN_BEDROOM);
398
- }
399
-
400
- /**
401
- * Gives a coin. Provide a number to give a custom amount of coins. (You can use negative numbers to
402
- * remove coins.)
403
- */
404
- export function coin(params: string): void {
405
- let numCoins = 1;
406
- if (params !== "") {
407
- const num = tonumber(params);
408
- if (num === undefined) {
409
- printConsole("That is an invalid amount of coins to add.");
410
- return;
411
- }
412
-
413
- numCoins = num;
414
- }
415
-
416
- const player = Isaac.GetPlayer();
417
- player.AddCoins(numCoins);
418
- }
419
-
420
- /**
421
- * Gives 999 coins. Provide a number to give a custom amount of coins. (You can use negative numbers
422
- * to remove coins.)
423
- */
424
- export function coins(params: string): void {
425
- let numCoins = 999;
426
- if (params !== "") {
427
- const num = tonumber(params);
428
- if (num === undefined) {
429
- printConsole("That is an invalid amount of coins to add.");
430
- return;
431
- }
432
-
433
- numCoins = num;
434
- }
435
-
436
- const player = Isaac.GetPlayer();
437
- player.AddCoins(numCoins);
438
- }
439
-
440
- /** Creates a crawlspace next to the player. */
441
- export function crawlspace(): void {
442
- spawnTrapdoorOrCrawlspace(false);
443
- }
444
-
445
- /** Uses the D20. */
446
- export function d20(): void {
447
- const player = Isaac.GetPlayer();
448
- useActiveItemTemp(player, CollectibleType.D20);
449
- }
450
-
451
- /** Uses the D6. */
452
- export function d6(): void {
453
- const player = Isaac.GetPlayer();
454
- useActiveItemTemp(player, CollectibleType.D6);
455
- }
456
-
457
- /** Toggles extremely high-damage tears. */
458
- export function damage(): void {
459
- v.run.maxDamage = !v.run.maxDamage;
460
- printEnabled(v.run.maxDamage, "debug damage");
461
- }
462
-
463
- /** Alias for the "devil" command. */
464
- export function dd(): void {
465
- devil();
466
- }
467
-
468
- /**
469
- * Warps to the Devil Room for the floor. If the Angel Room has already been visited or initialized,
470
- * this will uninitialize it and make an Devil Room instead.
471
- */
472
- export function devil(): void {
473
- devilAngel(true);
474
- }
475
-
476
- /** Warps to the first Dirty Bedroom on the floor. */
477
- export function dirtyBedroom(): void {
478
- warpToRoomType(RoomType.DIRTY_BEDROOM);
479
- }
480
-
481
- /** Toggles whether or not curses can appear. */
482
- export function disableCurses(): void {
483
- v.persistent.disableCurses = !v.persistent.disableCurses;
484
- printEnabled(!v.persistent.disableCurses, "curses");
485
- }
486
-
487
- /** Moves the player 0.5 units down. Provide a number to move a custom amount of units. */
488
- export function down(params: string): void {
489
- movePlayer(params, Direction.DOWN);
490
- }
491
-
492
- /** Warps to the Dungeon (i.e. Crawlspace) for the floor. */
493
- export function dungeon(): void {
494
- changeRoom(GridRoom.DUNGEON);
495
- }
496
-
497
- /** Logs the player's current temporary effects to the "log.txt" file. */
498
- export function effects(): void {
499
- const player = Isaac.GetPlayer();
500
- logEffects(player);
501
- printConsole('Logged the player\'s effects to the "log.txt" file.');
502
- }
503
-
504
- /** Alias for the "eternalHearts" command. */
505
- export function eh(params: string): void {
506
- eternalHearts(params);
507
- }
508
-
509
- /** Alias for the "iAmError" command. */
510
- export function error(): void {
511
- iAmError();
512
- }
513
-
514
- /**
515
- * Gives an eternal heart. Provide a number to give a custom amount of hearts. (You can use negative
516
- * numbers to remove hearts.)
517
- */
518
- export function eternalHearts(params: string): void {
519
- addHeart(params, HealthType.ETERNAL);
520
- }
521
-
522
- /** Alias for the "startingRoom" command. */
523
- export function fool(): void {
524
- startingRoom();
525
- }
526
-
527
- /** Prints the current position of all players. */
528
- export function getPosition(): void {
529
- for (const player of getPlayers()) {
530
- const playerName = getPlayerName(player);
531
- printConsole(
532
- `Player position for ${playerName}: (${player.Position.X}, ${player.Position.Y})`,
533
- );
534
- }
535
- }
536
-
537
- /**
538
- * Gives a Giga Bomb. Provide a number to give a custom amount of Giga Bombs. (You can use negative
539
- * numbers to remove bombs.)
540
- */
541
- export function gigaBomb(params: string): void {
542
- let numBombs = 1;
543
- if (params !== "") {
544
- const num = tonumber(params);
545
- if (num === undefined) {
546
- printConsole("That is an invalid amount of Giga Bombs to add.");
547
- return;
548
- }
549
-
550
- numBombs = num;
551
- }
552
-
553
- const player = Isaac.GetPlayer();
554
- player.AddGigaBombs(numBombs);
555
- }
556
-
557
- /** Alias for the "goldenBomb" command. */
558
- export function goldBomb(): void {
559
- goldenBomb();
560
- }
561
-
562
- /** Alias for the "goldenHearts" command. */
563
- export function goldHearts(params: string): void {
564
- goldenHearts(params);
565
- }
566
-
567
- /** Alias for the "goldenKey" command. */
568
- export function goldKey(): void {
569
- goldenKey();
570
- }
571
-
572
- /** Gives the player a golden bomb. */
573
- export function goldenBomb(): void {
574
- const player = Isaac.GetPlayer();
575
- player.AddGoldenBomb();
576
- }
577
-
578
- /**
579
- * Gives a golden heart. Provide a number to give a custom amount of hearts. (You can use negative
580
- * numbers to remove hearts.)
581
- */
582
- export function goldenHearts(params: string): void {
583
- addHeart(params, HealthType.GOLDEN);
584
- }
585
-
586
- /** Gives the player a golden key. */
587
- export function goldenKey(): void {
588
- const player = Isaac.GetPlayer();
589
- player.AddGoldenKey();
590
- }
591
-
592
- /** Alias for the "debug 2" command. */
593
- export function grid(): void {
594
- Isaac.ExecuteCommand("debug 2");
595
- }
596
-
597
- /** Alias for the "debug 11" command. */
598
- export function grid2(): void {
599
- Isaac.ExecuteCommand("debug 11");
600
- }
601
-
602
- /** Spawns every grid entity, starting at the top-left-most tile. */
603
- export function gridEntities(): void {
604
- const gridEntityTypes = getEnumValues(GridEntityType);
605
-
606
- let gridEntityTypeIndex = -1;
607
- for (let y = 0; y <= 6; y++) {
608
- for (let x = 0; x <= 12; x++) {
609
- gridEntityTypeIndex += 1;
610
- const gridEntityType = gridEntityTypes[gridEntityTypeIndex];
611
- if (gridEntityType === undefined) {
612
- return;
613
- }
614
-
615
- const position = gridCoordinatesToWorldPosition(x, y);
616
- spawnGrid(gridEntityType, position);
617
- }
618
- }
619
- }
620
-
621
- /** Alias for the "hearts" command. */
622
- export function h(params: string): void {
623
- hearts(params);
624
- }
625
-
626
- /**
627
- * Gives a half red heart. Provide a number to give a custom amount of hearts. (You can use negative
628
- * numbers to remove hearts.)
629
- */
630
- export function hearts(params: string): void {
631
- addHeart(params, HealthType.RED);
632
- }
633
-
634
- /** Alias for the "debug 6" command. */
635
- export function hitboxes(): void {
636
- Isaac.ExecuteCommand("debug 6");
637
- }
638
-
639
- /** Warps to the I AM ERROR room for the floor. */
640
- export function iAmError(): void {
641
- changeRoom(GridRoom.ERROR);
642
- }
643
-
644
- /**
645
- * Gives a key. Provide a number to give a custom amount of key. (You can use negative numbers to
646
- * remove keys.)
647
- */
648
- export function key(params: string): void {
649
- let numKeys = 1;
650
- if (params !== "") {
651
- const num = tonumber(params);
652
- if (num === undefined) {
653
- printConsole("That is an invalid amount of keys to add.");
654
- return;
655
- }
656
-
657
- numKeys = num;
658
- }
659
-
660
- const player = Isaac.GetPlayer();
661
- player.AddKeys(numKeys);
662
- }
663
-
664
- /**
665
- * Gives 99 keys. Provide a number to give a custom amount of coins. (You can use negative numbers
666
- * to remove keys.)
667
- */
668
- export function keys(params: string): void {
669
- let numKeys = 99;
670
- if (params !== "") {
671
- const num = tonumber(params);
672
- if (num === undefined) {
673
- printConsole("That is an invalid amount of keys to add.");
674
- return;
675
- }
676
-
677
- numKeys = num;
678
- }
679
-
680
- const player = Isaac.GetPlayer();
681
- player.AddKeys(numKeys);
682
- }
683
-
684
- /** Moves the player 0.5 units left. Provide a number to move a custom amount of units. */
685
- export function left(params: string): void {
686
- movePlayer(params, Direction.LEFT);
687
- }
688
-
689
- /** Warps to the first Library on the floor. */
690
- export function library(): void {
691
- warpToRoomType(RoomType.LIBRARY);
692
- }
693
-
694
- /**
695
- * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
696
- * `EntityType`.
697
- *
698
- * By default, this command will exclude background effects. If that is not desired, use the
699
- * "listAll" command instead.
700
- */
701
- export function list(params: string): void {
702
- listEntities(params, false);
703
- }
704
-
705
- /**
706
- * Logs the entities in the room to the "log.txt" file. Provide a number to only log that specific
707
- * `EntityType`.
708
- */
709
- export function listAll(params: string): void {
710
- listEntities(params, true);
711
- }
712
-
713
- /**
714
- * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
715
- * specific `GridEntityType`.
716
- *
717
- * By default, this command will exclude walls. If that is not desired, use the "listGridAll"
718
- * command instead.
719
- */
720
- export function listGrid(params: string): void {
721
- listGridEntities(params, false);
722
- }
723
-
724
- /**
725
- * Logs the grid entities in the room to the "log.txt" file. Provide a number to only log that
726
- * specific `GridEntityType`.
727
- */
728
- export function listGridAll(params: string): void {
729
- listGridEntities(params, true);
730
- }
731
-
732
- /** Alias for the "1hp" command. */
733
- export function lowHP(): void {
734
- oneHP();
735
- }
736
-
737
- /** Alias for "debug 9". */
738
- export function luck(): void {
739
- Isaac.ExecuteCommand("debug 9");
740
- }
741
-
742
- /** Completely reveals the entire map, including the Ultra Secret Room. */
743
- export function map(): void {
744
- const level = game.GetLevel();
745
-
746
- const displayFlags = addFlag(
747
- DisplayFlag.VISIBLE, // 1 << 0
748
- DisplayFlag.SHADOW, // 1 << 1
749
- DisplayFlag.SHOW_ICON, // 1 << 2
750
- );
751
-
752
- for (const roomGridIndex of irange(MAX_LEVEL_GRID_INDEX)) {
753
- const roomDesc = level.GetRoomByIdx(roomGridIndex);
754
- roomDesc.DisplayFlags = displayFlags;
755
- }
756
-
757
- // Setting the display flag will not actually update the map.
758
- level.UpdateVisibility();
759
- }
760
-
761
- /**
762
- * Gives a heart container. Provide a number to give a custom amount of heart containers. (You can
763
- * use negative numbers to remove heart containers.)
764
- */
765
- export function maxHearts(params: string): void {
766
- addHeart(params, HealthType.MAX_HEARTS);
767
- }
768
-
769
- /** Alias for the "maxHearts" command. */
770
- export function mh(params: string): void {
771
- maxHearts(params);
772
- }
773
-
774
- /** Warps to the first Miniboss Room on the floor. */
775
- export function miniboss(): void {
776
- warpToRoomType(RoomType.MINI_BOSS);
777
- }
778
-
779
- /** Alias for the "disableCurses" command. */
780
- export function noCurses(): void {
781
- disableCurses();
782
- }
783
-
784
- /** Sets every NPC in the room to 1 HP. */
785
- export function oneHP(): void {
786
- for (const npc of getNPCs()) {
787
- npc.HitPoints = 1;
788
- }
789
-
790
- printConsole("Set every NPC to 1 HP.");
791
- }
792
-
793
- /**
794
- * Gives a pill with the specified pill effect. Accepts either the effect ID or the partial name of
795
- * the effect.
796
- *
797
- * For example:
798
- *
799
- * - `pill 5` - Gives a "Full Health" pill.
800
- * - `pill suns` - Gives a "Feels like I'm walking on sunshine" pill.
801
- */
802
- export function pill(params: string): void {
803
- if (params === "") {
804
- printConsole("You must specify a pill name or number.");
805
- return;
806
- }
807
-
808
- let pillEffect: PillEffect;
809
- const num = tonumber(params) as PillEffect | undefined;
810
- if (num === undefined) {
811
- const match = getMapPartialMatch(params, PILL_EFFECT_MAP);
812
- if (match === undefined) {
813
- printConsole(`Unknown pill effect: ${params}`);
814
- return;
815
- }
816
-
817
- pillEffect = match[1];
818
- } else {
819
- if (num < FIRST_PILL_EFFECT || num > LAST_PILL_EFFECT) {
820
- printConsole(`Invalid pill effect ID: ${num}`);
821
- return;
822
- }
823
-
824
- pillEffect = num;
825
- }
826
-
827
- const pillEffectName = getPillEffectName(pillEffect);
828
- Isaac.ExecuteCommand(`g p${pillEffect}`);
829
- printConsole(`Gave pill: ${pillEffectName} (${pillEffect})`);
830
- }
831
-
832
- /** Spawns every pill on the ground, starting at the top-left-most tile. */
833
- export function pills(): void {
834
- const pillColors = getEnumValues(PillColor).filter(
835
- (pillColor) => pillColor !== PillColor.NULL,
836
- );
837
-
838
- let pillColorIndex = -1;
839
- for (let y = 0; y <= 6; y++) {
840
- for (let x = 0; x <= 12; x++) {
841
- pillColorIndex += 1;
842
- const pillColor = pillColors[pillColorIndex];
843
- if (pillColor === undefined) {
844
- return;
845
- }
846
-
847
- const position = gridCoordinatesToWorldPosition(x, y);
848
- spawnPill(pillColor, position);
849
- }
850
- }
851
- }
852
-
853
- /** Warps to the first Planetarium on the floor. */
854
- export function planetarium(): void {
855
- warpToRoomType(RoomType.PLANETARIUM);
856
- }
857
-
858
- /** Alias for the "sound" command. */
859
- export function playSound(params: string): void {
860
- sound(params);
861
- }
862
-
863
- /** Sets the player's pocket item to the specified collectible type. */
864
- export function pocket(params: string): void {
865
- if (params === "") {
866
- printConsole(
867
- "You must supply a collectible type to put as the pocket item.",
868
- );
869
- return;
870
- }
871
-
872
- const collectibleType = tonumber(params) as CollectibleType | undefined;
873
- if (collectibleType === undefined) {
874
- printConsole("That is an invalid collectible type.");
875
- return;
876
- }
877
-
878
- if (!isValidCollectibleType(collectibleType)) {
879
- printConsole("That is an invalid collectible type.");
880
- return;
881
- }
882
-
883
- const player = Isaac.GetPlayer();
884
- player.SetPocketActiveItem(collectibleType, ActiveSlot.POCKET);
885
- }
886
-
887
- /**
888
- * Gives a poop mana charge. This only affects Tainted Blue Baby. Provide a number to give a custom
889
- * amount of charges. (You can use negative numbers to remove charges.)
890
- */
891
- export function poopMana(params: string): void {
892
- let charges = 1;
893
- if (params !== "") {
894
- const num = tonumber(params);
895
- if (num === undefined) {
896
- printConsole("That is an invalid amount of mana to add.");
897
- return;
898
- }
899
-
900
- charges = num;
901
- }
902
-
903
- const player = Isaac.GetPlayer();
904
- player.AddPoopMana(charges);
905
- }
906
-
907
- /** Alias for the "getPosition" command. */
908
- export function positionCommand(): void {
909
- getPosition();
910
- }
911
-
912
- /** Alias for the "hearts" command. */
913
- export function redHearts(params: string): void {
914
- hearts(params);
915
- }
916
-
917
- /** Alias for the "redHearts" command. */
918
- export function rh(params: string): void {
919
- redHearts(params);
920
- }
921
-
922
- /** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
923
- export function right(params: string): void {
924
- movePlayer(params, Direction.RIGHT);
925
- }
926
-
927
- /** Logs information about the room to the "log.txt" file. */
928
- export function roomCommand(): void {
929
- logRoom();
930
- printConsole('Logged room information to the "log.txt" file.');
931
- }
932
-
933
- /**
934
- * Gives a rotten heart. Provide a number to give a custom amount of hearts. (You can use negative
935
- * numbers to remove hearts.)
936
- */
937
- export function rottenHearts(params: string): void {
938
- addHeart(params, HealthType.ROTTEN);
939
- }
940
-
941
- /**
942
- * Alias for the "stage" command.
943
- *
944
- * For example:
945
- * - s 3 - Warps to Caves 1.
946
- * - s 1c - Warps to Downpour 1.
947
- */
948
- export function s(params: string): void {
949
- if (params === "") {
950
- printConsole("You must specify a stage number.");
951
- return;
952
- }
953
-
954
- const finalCharacter = params.slice(-1);
955
- let stageString: string;
956
- let stageTypeLetter: string;
957
- if (
958
- finalCharacter === "a" ||
959
- finalCharacter === "b" ||
960
- finalCharacter === "c" ||
961
- finalCharacter === "d"
962
- ) {
963
- // e.g. "s 11a" for going to The Chest
964
- stageString = params.slice(0, params.length - 1);
965
- stageTypeLetter = finalCharacter;
966
- } else {
967
- // e.g. "s 11" for going to the Dark Room
968
- stageString = params;
969
- stageTypeLetter = "";
970
- }
971
-
972
- const stage = tonumber(stageString) as LevelStage | undefined;
973
- if (stage === undefined) {
974
- printConsole(`That is an invalid stage number: ${stage}`);
975
- return;
976
- }
977
-
978
- if (stage < FIRST_STAGE || stage > LAST_STAGE) {
979
- printConsole(
980
- `Invalid stage number; must be between ${FIRST_STAGE} and ${LAST_STAGE}.`,
981
- );
982
- return;
983
- }
984
-
985
- Isaac.ExecuteCommand(`stage ${stage}${stageTypeLetter}`);
986
- }
987
-
988
- /** Warps to the first Sacrifice Room on the floor. */
989
- export function sacrifice(): void {
990
- warpToRoomType(RoomType.SACRIFICE);
991
- }
992
-
993
- /** Warps to the first Secret Room on the floor. */
994
- export function secret(): void {
995
- warpToRoomType(RoomType.SECRET);
996
- }
997
-
998
- /** Changes to a seeded run, using the seed of the current run. */
999
- export function seedStick(): void {
1000
- const seeds = game.GetSeeds();
1001
- const startSeedString = seeds.GetStartSeedString();
1002
- Isaac.ExecuteCommand(`seed ${startSeedString}`);
1003
- }
1004
-
1005
- /** Logs all of the current run's seed effects to the "log.txt" file. */
1006
- export function seedsCommand(): void {
1007
- logSeedEffects();
1008
- printConsole('Logged the seed effects to the "log.txt" file.');
1009
- }
1010
-
1011
- /**
1012
- * Sets a charge to the player's specified active item. You must provide the active slot number and
1013
- * the number of charges to set.
1014
- */
1015
- export function setCharges(params: string): void {
1016
- if (params === "") {
1017
- printConsole(
1018
- "You must specify a slot number and a charge amount. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)",
1019
- );
1020
- return;
1021
- }
1022
-
1023
- const args = params.split(" ");
1024
-
1025
- if (args.length === 1) {
1026
- printConsole("You must specify the amount of charge to set.");
1027
- return;
1028
- }
1029
-
1030
- if (args.length !== 2) {
1031
- printConsole("That is an invalid amount of arguments.");
1032
- return;
1033
- }
1034
-
1035
- const [activeSlotString, chargeString] = args;
1036
-
1037
- const activeSlot = tonumber(activeSlotString) as ActiveSlot | undefined;
1038
- if (activeSlot === undefined) {
1039
- printConsole(`The provided slot number is invalid: ${activeSlotString}`);
1040
- return;
1041
- }
1042
-
1043
- const activeSlots = getEnumValues(ActiveSlot);
1044
- if (!activeSlots.includes(activeSlot)) {
1045
- printConsole(`The provided slot number is invalid: ${activeSlot}`);
1046
- return;
1047
- }
1048
-
1049
- const chargeNum = tonumber(chargeString);
1050
- if (chargeNum === undefined) {
1051
- printConsole(`The provided charge amount is invalid: ${chargeString}`);
1052
- return;
1053
- }
1054
-
1055
- if (chargeNum < 0) {
1056
- printConsole(`The provided charge amount is invalid: ${chargeNum}`);
1057
- return;
1058
- }
1059
-
1060
- const player = Isaac.GetPlayer();
1061
- player.SetActiveCharge(chargeNum, activeSlot);
1062
- }
1063
-
1064
- /**
1065
- * Moves the first player to the specified position.
1066
- *
1067
- * For example:
1068
- * - setPosition 100 50
1069
- */
1070
- export function setPosition(params: string): void {
1071
- if (params === "") {
1072
- printConsole('You must specify a position. (e.g. "setPosition 100 50")');
1073
- return;
1074
- }
1075
-
1076
- const args = params.split(" ");
1077
- if (args.length !== 2) {
1078
- printConsole('You must specify a position. (e.g. "setPosition 100 50")');
1079
- return;
1080
- }
1081
-
1082
- const [xString, yString] = args;
1083
-
1084
- const x = tonumber(xString);
1085
- if (x === undefined) {
1086
- printConsole(`That is an invalid x value: ${xString}`);
1087
- return;
1088
- }
1089
-
1090
- const y = tonumber(yString);
1091
- if (y === undefined) {
1092
- printConsole(`That is an invalid y value: ${yString}`);
1093
- return;
1094
- }
1095
-
1096
- const player = Isaac.GetPlayer();
1097
- const position = Vector(x, y);
1098
- player.Position = position;
1099
- }
1100
-
1101
- /** Alias for the "soulHearts" command. */
1102
- export function sh(params: string): void {
1103
- soulHearts(params);
1104
- }
1105
-
1106
- /** Warps to the first shop on the floor. */
1107
- export function shop(): void {
1108
- warpToRoomType(RoomType.SHOP);
1109
- }
1110
-
1111
- /** Uses the Smelter to smelt the current player's trinket. */
1112
- export function smelt(): void {
1113
- const player = Isaac.GetPlayer();
1114
- useActiveItemTemp(player, CollectibleType.SMELTER);
1115
- }
1116
-
1117
- /**
1118
- * Gives a soul charge. This only affects Tainted Bethany. Provide a number to give a custom amount
1119
- * of charges. (You can use negative numbers to remove charges.)
1120
- */
1121
- export function soulCharges(params: string): void {
1122
- let charges = 1;
1123
- if (params !== "") {
1124
- const num = tonumber(params);
1125
- if (num === undefined) {
1126
- printConsole("That is an invalid amount of charges to add.");
1127
- return;
1128
- }
1129
-
1130
- charges = num;
1131
- }
1132
-
1133
- const player = Isaac.GetPlayer();
1134
- player.AddSoulCharge(charges);
1135
- }
1136
-
1137
- /**
1138
- * Gives a half soul heart. Provide a number to give a custom amount of hearts. (You can use
1139
- * negative numbers to remove hearts.)
1140
- */
1141
- export function soulHearts(params: string): void {
1142
- addHeart(params, HealthType.SOUL);
1143
- }
1144
-
1145
- /**
1146
- * Play the supplied sound effect.
1147
- *
1148
- * For example:
1149
- * - sound 1 - Plays the 1-Up sound effect.
1150
- */
1151
- export function sound(params: string): void {
1152
- const soundEffect = tonumber(params) as SoundEffect | undefined;
1153
- if (soundEffect === undefined) {
1154
- printConsole("That is an invalid sound effect ID.");
1155
- return;
1156
- }
1157
-
1158
- sfxManager.Play(soundEffect);
1159
- }
1160
-
1161
- /** Logs all of the currently playing sound effects to the "log.txt" file. */
1162
- export function sounds(): void {
1163
- logSounds();
1164
- printConsole(
1165
- 'Logged the currently playing sound effects to the "log.txt" file.',
1166
- );
1167
- }
1168
-
1169
- /**
1170
- * Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
1171
- * "debug 10".
1172
- */
1173
- export function spam(): void {
1174
- v.run.spamBloodRights = !v.run.spamBloodRights;
1175
- printEnabled(v.run.maxSpeed, "spamming Blood Rights");
1176
- }
1177
-
1178
- /** Spawns a golden version of the specified trinket type. */
1179
- export function spawnGoldenTrinket(params: string): void {
1180
- if (params === "") {
1181
- printConsole(
1182
- "You must specify the number corresponding to the trinket type.",
1183
- );
1184
- return;
1185
- }
1186
-
1187
- const trinketType = tonumber(params) as TrinketType | undefined;
1188
- if (trinketType === undefined) {
1189
- printConsole(`That is an invalid trinket type: ${params}`);
1190
- return;
1191
- }
1192
-
1193
- const goldenTrinketType = getGoldenTrinketType(trinketType);
1194
- const room = game.GetRoom();
1195
- const centerPos = room.GetCenterPos();
1196
- spawnTrinket(goldenTrinketType, centerPos);
1197
- }
1198
-
1199
- /** Toggles maximum movement speed and flight. */
1200
- export function speed(): void {
1201
- const player = Isaac.GetPlayer();
1202
-
1203
- v.run.maxSpeed = !v.run.maxSpeed;
1204
-
1205
- if (v.run.maxSpeed && !player.CanFly) {
1206
- const numEternalHearts = player.GetEternalHearts();
1207
- if (numEternalHearts === 0) {
1208
- player.AddCollectible(CollectibleType.FATE);
1209
- player.AddEternalHearts(-1);
1210
- } else {
1211
- player.AddEternalHearts(-1);
1212
- player.AddCollectible(CollectibleType.FATE);
1213
- }
1214
- }
1215
-
1216
- player.AddCacheFlags(CacheFlag.SPEED);
1217
- player.EvaluateItems();
1218
-
1219
- printEnabled(v.run.maxSpeed, "max speed");
1220
- }
1221
-
1222
- /** Warps to the starting room of the floor. */
1223
- export function startingRoom(): void {
1224
- const level = game.GetLevel();
1225
- const startingRoomIndex = level.GetStartingRoomIndex();
1226
- changeRoom(startingRoomIndex);
1227
- }
1228
-
1229
- /** Warps to the first Super Secret Room on the floor. */
1230
- export function superSecret(): void {
1231
- warpToRoomType(RoomType.SUPER_SECRET);
1232
- }
1233
-
1234
- /** Toggles extremely high tears stat (e.g. fire rate), equivalent of that to soy milk. */
1235
- export function tears(): void {
1236
- v.run.maxTears = !v.run.maxTears;
1237
-
1238
- const player = Isaac.GetPlayer();
1239
- player.AddCacheFlags(CacheFlag.FIRE_DELAY);
1240
- player.EvaluateItems();
1241
-
1242
- printEnabled(v.run.maxDamage, "debug tear-rate");
1243
- }
1244
-
1245
- /** Creates a trapdoor next to the player. */
1246
- export function trapdoorCommand(): void {
1247
- spawnTrapdoorOrCrawlspace(true);
1248
- }
1249
-
1250
- /** Warps to the first Treasure Room on the floor. */
1251
- export function treasure(): void {
1252
- warpToRoomType(RoomType.TREASURE);
1253
- }
1254
-
1255
- /** Warps to the first Ultra Secret Room on the floor. */
1256
- export function ultraSecret(): void {
1257
- warpToRoomType(RoomType.ULTRA_SECRET);
1258
- }
1259
-
1260
- /** Moves the player 0.5 units up. Provide a number to move a custom amount of units. */
1261
- export function up(params: string): void {
1262
- movePlayer(params, Direction.UP);
1263
- }
1264
-
1265
- /**
1266
- * Warps to the specified room type. Accepts either the room type number or the partial name of the
1267
- * room type.
1268
- *
1269
- * For example:
1270
- * - warp 5 - Warps to the first Boss Room on the floor, if any.
1271
- * - warp tr - Warps to the first Treasure Room on the floor, if any.
1272
- */
1273
- export function warp(params: string): void {
1274
- if (params === "") {
1275
- printConsole("You must specify a room type name or number.");
1276
- return;
1277
- }
1278
-
1279
- let roomType: RoomType;
1280
- const num = tonumber(params) as RoomType | undefined;
1281
- if (num === undefined) {
1282
- const match = getMapPartialMatch(params, ROOM_TYPE_MAP);
1283
- if (match === undefined) {
1284
- printConsole(`Unknown room type: ${params}`);
1285
- return;
1286
- }
1287
-
1288
- roomType = match[1];
1289
- } else {
1290
- if (num < FIRST_ROOM_TYPE || num > LAST_ROOM_TYPE) {
1291
- printConsole(`Invalid room type: ${num}`);
1292
- return;
1293
- }
1294
-
1295
- roomType = num;
1296
- }
1297
-
1298
- warpToRoomType(roomType);
1299
- }