isaacscript-common 20.3.2 → 20.4.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.
Files changed (58) hide show
  1. package/dist/index.d.ts +103 -50
  2. package/dist/isaacscript-common.lua +414 -389
  3. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts +0 -8
  4. package/dist/src/classes/callbacks/PostSlotDestroyed.d.ts.map +1 -1
  5. package/dist/src/classes/callbacks/PostSlotDestroyed.lua +3 -51
  6. package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts +36 -0
  7. package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.d.ts.map +1 -0
  8. package/dist/src/classes/features/callbackLogic/SlotDestroyedDetection.lua +91 -0
  9. package/dist/src/classes/features/other/ExtraConsoleCommands.d.ts.map +1 -1
  10. package/dist/src/classes/features/other/ExtraConsoleCommands.lua +2 -3
  11. package/dist/src/classes/features/other/RoomHistory.d.ts.map +1 -1
  12. package/dist/src/classes/features/other/RoomHistory.lua +6 -1
  13. package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
  14. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +69 -127
  15. package/dist/src/classes/features/other/extraConsoleCommands/subroutines.d.ts.map +1 -1
  16. package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +11 -22
  17. package/dist/src/enums/ISCFeature.d.ts +44 -43
  18. package/dist/src/enums/ISCFeature.d.ts.map +1 -1
  19. package/dist/src/enums/ISCFeature.lua +45 -43
  20. package/dist/src/enums/SlotDestructionType.d.ts +13 -0
  21. package/dist/src/enums/SlotDestructionType.d.ts.map +1 -1
  22. package/dist/src/features.d.ts +46 -43
  23. package/dist/src/features.d.ts.map +1 -1
  24. package/dist/src/features.lua +3 -0
  25. package/dist/src/functions/deepCopyTests.d.ts.map +1 -1
  26. package/dist/src/functions/deepCopyTests.lua +1 -3
  27. package/dist/src/functions/logMisc.d.ts.map +1 -1
  28. package/dist/src/functions/logMisc.lua +1 -3
  29. package/dist/src/functions/mergeTests.d.ts.map +1 -1
  30. package/dist/src/functions/mergeTests.lua +2 -5
  31. package/dist/src/functions/slots.d.ts +4 -0
  32. package/dist/src/functions/slots.d.ts.map +1 -0
  33. package/dist/src/functions/slots.lua +27 -0
  34. package/dist/src/functions/utils.d.ts +3 -4
  35. package/dist/src/functions/utils.d.ts.map +1 -1
  36. package/dist/src/functions/utils.lua +8 -6
  37. package/dist/src/index.d.ts +1 -0
  38. package/dist/src/index.d.ts.map +1 -1
  39. package/dist/src/index.lua +8 -0
  40. package/dist/src/interfaces/RoomDescription.d.ts +1 -0
  41. package/dist/src/interfaces/RoomDescription.d.ts.map +1 -1
  42. package/package.json +1 -1
  43. package/src/classes/callbacks/PostSlotDestroyed.ts +2 -72
  44. package/src/classes/features/callbackLogic/SlotDestroyedDetection.ts +163 -0
  45. package/src/classes/features/other/ExtraConsoleCommands.ts +3 -6
  46. package/src/classes/features/other/RoomHistory.ts +6 -0
  47. package/src/classes/features/other/extraConsoleCommands/commands.ts +70 -78
  48. package/src/classes/features/other/extraConsoleCommands/subroutines.ts +11 -12
  49. package/src/enums/ISCFeature.ts +1 -0
  50. package/src/enums/SlotDestructionType.ts +14 -0
  51. package/src/features.ts +6 -0
  52. package/src/functions/deepCopyTests.ts +1 -2
  53. package/src/functions/logMisc.ts +1 -2
  54. package/src/functions/mergeTests.ts +2 -4
  55. package/src/functions/slots.ts +23 -0
  56. package/src/functions/utils.ts +7 -6
  57. package/src/index.ts +1 -0
  58. package/src/interfaces/RoomDescription.ts +1 -0
@@ -102,7 +102,6 @@ local asCollectibleType = ____types.asCollectibleType
102
102
  local asTrinketType = ____types.asTrinketType
103
103
  local ____utils = require("src.functions.utils")
104
104
  local iRange = ____utils.iRange
105
- local printConsole = ____utils.printConsole
106
105
  local printEnabled = ____utils.printEnabled
107
106
  local ____cardNameToTypeMap = require("src.maps.cardNameToTypeMap")
108
107
  local CARD_NAME_TO_TYPE_MAP = ____cardNameToTypeMap.CARD_NAME_TO_TYPE_MAP
@@ -170,7 +169,7 @@ function ____exports.oneHP(self)
170
169
  for ____, npc in ipairs(getNPCs(nil)) do
171
170
  npc.HitPoints = 1
172
171
  end
173
- printConsole(nil, "Set every NPC to 1 HP.")
172
+ print("Set every NPC to 1 HP.")
174
173
  end
175
174
  --- Gives a poop mana charge. This only affects Tainted Blue Baby. Provide a number to give a custom
176
175
  -- amount of charges. (You can use negative numbers to remove charges.)
@@ -179,7 +178,7 @@ function ____exports.poopMana(self, params)
179
178
  if params ~= "" then
180
179
  local num = tonumber(params)
181
180
  if num == nil then
182
- printConsole(nil, "That is an invalid amount of mana to add.")
181
+ print("That is an invalid amount of mana to add.")
183
182
  return
184
183
  end
185
184
  charges = num
@@ -194,7 +193,7 @@ end
194
193
  function ____exports.sound(self, params)
195
194
  local soundEffect = tonumber(params)
196
195
  if soundEffect == nil then
197
- printConsole(nil, "That is an invalid sound effect ID.")
196
+ print("That is an invalid sound effect ID.")
198
197
  return
199
198
  end
200
199
  sfxManager:Play(soundEffect)
@@ -210,35 +209,29 @@ end
210
209
  -- to remove charge.)
211
210
  function ____exports.addCharges(self, params)
212
211
  if params == "" then
213
- printConsole(nil, "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.)")
212
+ print("You must specify a slot number. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)")
214
213
  return
215
214
  end
216
215
  local args = __TS__StringSplit(params, " ")
217
216
  if #args ~= 1 and #args ~= 2 then
218
- printConsole(nil, "That is an invalid amount of arguments.")
217
+ print("That is an invalid amount of arguments.")
219
218
  return
220
219
  end
221
220
  local activeSlotString, numChargeString = table.unpack(args)
222
221
  local activeSlot = tonumber(activeSlotString)
223
222
  if activeSlot == nil then
224
- printConsole(
225
- nil,
226
- "The provided slot number is invalid: " .. tostring(activeSlotString)
227
- )
223
+ print("The provided slot number is invalid: " .. tostring(activeSlotString))
228
224
  return
229
225
  end
230
226
  if activeSlot < ActiveSlot.PRIMARY or activeSlot > ActiveSlot.POCKET_SINGLE_USE then
231
- printConsole(
232
- nil,
233
- "The provided slot number is invalid: " .. tostring(activeSlot)
234
- )
227
+ print("The provided slot number is invalid: " .. tostring(activeSlot))
235
228
  return
236
229
  end
237
230
  local numCharges = 1
238
231
  if numChargeString ~= nil then
239
232
  local numChargesAttempt = tonumber(numChargeString)
240
233
  if numChargesAttempt == nil then
241
- printConsole(nil, "The provided charge amount is invalid: " .. numChargeString)
234
+ print("The provided charge amount is invalid: " .. numChargeString)
242
235
  return
243
236
  end
244
237
  numCharges = numChargesAttempt
@@ -255,7 +248,7 @@ end
255
248
  function ____exports.ascent(self)
256
249
  game:SetStateFlag(GameStateFlag.BACKWARDS_PATH_INIT, true)
257
250
  game:SetStateFlag(GameStateFlag.BACKWARDS_PATH, true)
258
- printConsole(nil, "Set Ascent flags.")
251
+ print("Set Ascent flags.")
259
252
  end
260
253
  --- Warps to the first Clean Bedroom or Dirty Bedroom on the floor.
261
254
  function ____exports.bedroom(self)
@@ -269,7 +262,7 @@ function ____exports.bedroom(self)
269
262
  warpToRoomType(nil, RoomType.DIRTY_BEDROOM)
270
263
  return
271
264
  end
272
- printConsole(nil, "There are no Clean Bedrooms or Dirty Bedrooms on this floor.")
265
+ print("There are no Clean Bedrooms or Dirty Bedrooms on this floor.")
273
266
  end
274
267
  --- Gives a half black heart. Provide a number to give a custom amount of hearts. (You can use
275
268
  -- negative numbers to remove hearts.)
@@ -292,7 +285,7 @@ function ____exports.bloodCharges(self, params)
292
285
  if params ~= "" then
293
286
  local num = tonumber(params)
294
287
  if num == nil then
295
- printConsole(nil, "That is an invalid amount of charges to add.")
288
+ print("That is an invalid amount of charges to add.")
296
289
  return
297
290
  end
298
291
  charges = num
@@ -311,7 +304,7 @@ function ____exports.bomb(self, params)
311
304
  if params ~= "" then
312
305
  local num = tonumber(params)
313
306
  if num == nil then
314
- printConsole(nil, "That is an invalid amount of bombs to add.")
307
+ print("That is an invalid amount of bombs to add.")
315
308
  return
316
309
  end
317
310
  numBombs = num
@@ -326,7 +319,7 @@ function ____exports.bombs(self, params)
326
319
  if params ~= "" then
327
320
  local num = tonumber(params)
328
321
  if num == nil then
329
- printConsole(nil, "That is an invalid amount of bombs to add.")
322
+ print("That is an invalid amount of bombs to add.")
330
323
  return
331
324
  end
332
325
  numBombs = num
@@ -363,7 +356,7 @@ end
363
356
  -- - card spa - Gives 2 of Spades.
364
357
  function ____exports.card(self, params)
365
358
  if params == "" then
366
- printConsole(nil, "You must specify a card name or number.")
359
+ print("You must specify a card name or number.")
367
360
  return
368
361
  end
369
362
  local cardType
@@ -371,26 +364,20 @@ function ____exports.card(self, params)
371
364
  if num == nil then
372
365
  local match = getMapPartialMatch(nil, params, CARD_NAME_TO_TYPE_MAP)
373
366
  if match == nil then
374
- printConsole(nil, "Unknown card: " .. params)
367
+ print("Unknown card: " .. params)
375
368
  return
376
369
  end
377
370
  cardType = match[2]
378
371
  else
379
372
  if num < FIRST_CARD_TYPE or num > LAST_VANILLA_CARD_TYPE then
380
- printConsole(
381
- nil,
382
- "Invalid card sub-type: " .. tostring(num)
383
- )
373
+ print("Invalid card sub-type: " .. tostring(num))
384
374
  return
385
375
  end
386
376
  cardType = num
387
377
  end
388
378
  local cardName = getCardName(nil, cardType)
389
379
  Isaac.ExecuteCommand("g k" .. tostring(cardType))
390
- printConsole(
391
- nil,
392
- ((("Gave card: " .. cardName) .. " (") .. tostring(cardType)) .. ")"
393
- )
380
+ print(((("Gave card: " .. cardName) .. " (") .. tostring(cardType)) .. ")")
394
381
  end
395
382
  --- Spawns every card on the ground, starting at the top-left-most tile.
396
383
  function ____exports.cards(self)
@@ -430,7 +417,7 @@ end
430
417
  -- - character ta - Restarts as Tainted Azazel.
431
418
  function ____exports.character(self, params)
432
419
  if params == "" then
433
- printConsole(nil, "You must specify a character name or number.")
420
+ print("You must specify a character name or number.")
434
421
  return
435
422
  end
436
423
  local playerType
@@ -438,26 +425,20 @@ function ____exports.character(self, params)
438
425
  if num == nil then
439
426
  local match = getMapPartialMatch(nil, params, CHARACTER_NAME_TO_TYPE_MAP)
440
427
  if match == nil then
441
- printConsole(nil, "Unknown character: " .. params)
428
+ print("Unknown character: " .. params)
442
429
  return
443
430
  end
444
431
  playerType = match[2]
445
432
  else
446
433
  if num < FIRST_CHARACTER or num > LAST_VANILLA_CHARACTER then
447
- printConsole(
448
- nil,
449
- "Invalid player sub-type: " .. tostring(num)
450
- )
434
+ print("Invalid player sub-type: " .. tostring(num))
451
435
  return
452
436
  end
453
437
  playerType = num
454
438
  end
455
439
  local characterName = getCharacterName(nil, playerType)
456
440
  restart(nil, playerType)
457
- printConsole(
458
- nil,
459
- ((("Restarting as character: " .. characterName) .. " (") .. tostring(playerType)) .. ")"
460
- )
441
+ print(((("Restarting as character: " .. characterName) .. " (") .. tostring(playerType)) .. ")")
461
442
  end
462
443
  --- Alias for the "addCharges" command.
463
444
  function ____exports.charge(self, params)
@@ -474,7 +455,7 @@ function ____exports.coin(self, params)
474
455
  if params ~= "" then
475
456
  local num = tonumber(params)
476
457
  if num == nil then
477
- printConsole(nil, "That is an invalid amount of coins to add.")
458
+ print("That is an invalid amount of coins to add.")
478
459
  return
479
460
  end
480
461
  numCoins = num
@@ -489,7 +470,7 @@ function ____exports.coins(self, params)
489
470
  if params ~= "" then
490
471
  local num = tonumber(params)
491
472
  if num == nil then
492
- printConsole(nil, "That is an invalid amount of coins to add.")
473
+ print("That is an invalid amount of coins to add.")
493
474
  return
494
475
  end
495
476
  numCoins = num
@@ -528,7 +509,7 @@ function ____exports.damage(self, params)
528
509
  if params ~= "" then
529
510
  local num = tonumber(params)
530
511
  if num == nil then
531
- printConsole(nil, "The provided damage amount is invalid: " .. params)
512
+ print("The provided damage amount is invalid: " .. params)
532
513
  return
533
514
  end
534
515
  v.persistent.damageAmount = num
@@ -574,7 +555,7 @@ end
574
555
  function ____exports.effects(self)
575
556
  local player = Isaac.GetPlayer()
576
557
  logPlayerEffects(nil, player)
577
- printConsole(nil, "Logged the player's effects to the \"log.txt\" file.")
558
+ print("Logged the player's effects to the \"log.txt\" file.")
578
559
  end
579
560
  --- Alias for the "iAmError" command.
580
561
  function ____exports.errorRoom(self)
@@ -613,7 +594,7 @@ function ____exports.getChallenge(self)
613
594
  local challenge = Isaac.GetChallenge()
614
595
  local challengeName = Challenge[challenge]
615
596
  local challengeDescription = challengeName == nil and tostring(challenge) .. " (custom)" or ((("Challenge." .. challengeName) .. " (") .. tostring(challenge)) .. ")"
616
- printConsole(nil, "The current challenge is: " .. challengeDescription)
597
+ print("The current challenge is: " .. challengeDescription)
617
598
  end
618
599
  --- Prints the charge for the specified slot. By default, will use `ActiveSlot.PRIMARY`.
619
600
  function ____exports.getCharge(self, params)
@@ -621,26 +602,20 @@ function ____exports.getCharge(self, params)
621
602
  if params ~= "" then
622
603
  local num = tonumber(params)
623
604
  if num == nil then
624
- printConsole(nil, "The provided slot number is invalid: " .. params)
605
+ print("The provided slot number is invalid: " .. params)
625
606
  return
626
607
  end
627
608
  activeSlot = num
628
609
  end
629
610
  local player = Isaac.GetPlayer()
630
611
  local totalCharge = getTotalCharge(nil, player, activeSlot)
631
- printConsole(
632
- nil,
633
- (((("Total charge for ActiveSlot." .. ActiveSlot[activeSlot]) .. " (") .. tostring(activeSlot)) .. ") is: ") .. tostring(totalCharge)
634
- )
612
+ print((((("Total charge for ActiveSlot." .. ActiveSlot[activeSlot]) .. " (") .. tostring(activeSlot)) .. ") is: ") .. tostring(totalCharge))
635
613
  end
636
614
  --- Prints the current position of all players.
637
615
  function ____exports.getPosition(self)
638
616
  for ____, player in ipairs(getPlayers(nil)) do
639
617
  local playerName = getPlayerName(nil, player)
640
- printConsole(
641
- nil,
642
- ((((("Player position for " .. playerName) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")"
643
- )
618
+ print(((((("Player position for " .. playerName) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")")
644
619
  end
645
620
  end
646
621
  --- Toggles permanent Curse of the Giant.
@@ -655,7 +630,7 @@ function ____exports.gigaBomb(self, params)
655
630
  if params ~= "" then
656
631
  local num = tonumber(params)
657
632
  if num == nil then
658
- printConsole(nil, "That is an invalid amount of Giga Bombs to add.")
633
+ print("That is an invalid amount of Giga Bombs to add.")
659
634
  return
660
635
  end
661
636
  numBombs = num
@@ -729,7 +704,7 @@ function ____exports.key(self, params)
729
704
  if params ~= "" then
730
705
  local num = tonumber(params)
731
706
  if num == nil then
732
- printConsole(nil, "That is an invalid amount of keys to add.")
707
+ print("That is an invalid amount of keys to add.")
733
708
  return
734
709
  end
735
710
  numKeys = num
@@ -744,7 +719,7 @@ function ____exports.keys(self, params)
744
719
  if params ~= "" then
745
720
  local num = tonumber(params)
746
721
  if num == nil then
747
- printConsole(nil, "That is an invalid amount of keys to add.")
722
+ print("That is an invalid amount of keys to add.")
748
723
  return
749
724
  end
750
725
  numKeys = num
@@ -845,7 +820,7 @@ end
845
820
  -- - `pill suns` - Gives a "Feels like I'm walking on sunshine" pill.
846
821
  function ____exports.pill(self, params)
847
822
  if params == "" then
848
- printConsole(nil, "You must specify a pill name or number.")
823
+ print("You must specify a pill name or number.")
849
824
  return
850
825
  end
851
826
  local pillEffect
@@ -853,26 +828,20 @@ function ____exports.pill(self, params)
853
828
  if num == nil then
854
829
  local match = getMapPartialMatch(nil, params, PILL_NAME_TO_EFFECT_MAP)
855
830
  if match == nil then
856
- printConsole(nil, "Unknown pill effect: " .. params)
831
+ print("Unknown pill effect: " .. params)
857
832
  return
858
833
  end
859
834
  pillEffect = match[2]
860
835
  else
861
836
  if num < FIRST_PILL_EFFECT or num > LAST_VANILLA_PILL_EFFECT then
862
- printConsole(
863
- nil,
864
- "Invalid pill effect ID: " .. tostring(num)
865
- )
837
+ print("Invalid pill effect ID: " .. tostring(num))
866
838
  return
867
839
  end
868
840
  pillEffect = num
869
841
  end
870
842
  local pillEffectName = getPillEffectName(nil, pillEffect)
871
843
  Isaac.ExecuteCommand("g p" .. tostring(pillEffect))
872
- printConsole(
873
- nil,
874
- ((("Gave pill: " .. pillEffectName) .. " (") .. tostring(pillEffect)) .. ")"
875
- )
844
+ print(((("Gave pill: " .. pillEffectName) .. " (") .. tostring(pillEffect)) .. ")")
876
845
  end
877
846
  --- Spawns every pill on the ground, starting at the top-left-most tile.
878
847
  function ____exports.pills(self)
@@ -907,16 +876,16 @@ end
907
876
  --- Sets the player's pocket item to the specified collectible type.
908
877
  function ____exports.pocket(self, params)
909
878
  if params == "" then
910
- printConsole(nil, "You must supply a collectible type to put as the pocket item.")
879
+ print("You must supply a collectible type to put as the pocket item.")
911
880
  return
912
881
  end
913
882
  local collectibleType = tonumber(params)
914
883
  if collectibleType == nil then
915
- printConsole(nil, "That is an invalid collectible type.")
884
+ print("That is an invalid collectible type.")
916
885
  return
917
886
  end
918
887
  if not isValidCollectibleType(nil, collectibleType) then
919
- printConsole(nil, "That is an invalid collectible type.")
888
+ print("That is an invalid collectible type.")
920
889
  return
921
890
  end
922
891
  local player = Isaac.GetPlayer()
@@ -941,7 +910,7 @@ end
941
910
  --- Logs information about the room to the "log.txt" file.
942
911
  function ____exports.room(self)
943
912
  logRoom(nil)
944
- printConsole(nil, "Logged room information to the \"log.txt\" file.")
913
+ print("Logged room information to the \"log.txt\" file.")
945
914
  end
946
915
  --- Gives a rotten heart. Provide a number to give a custom amount of hearts. (You can use negative
947
916
  -- numbers to remove hearts.)
@@ -964,7 +933,7 @@ end
964
933
  -- - s 1c - Warps to Downpour 1.
965
934
  function ____exports.s(self, params)
966
935
  if params == "" then
967
- printConsole(nil, "You must specify a stage number.")
936
+ print("You must specify a stage number.")
968
937
  return
969
938
  end
970
939
  local finalCharacter = string.sub(params, -1)
@@ -979,17 +948,11 @@ function ____exports.s(self, params)
979
948
  end
980
949
  local stage = tonumber(stageString)
981
950
  if stage == nil then
982
- printConsole(
983
- nil,
984
- "That is an invalid stage number: " .. tostring(stage)
985
- )
951
+ print("That is an invalid stage number: " .. tostring(stage))
986
952
  return
987
953
  end
988
954
  if stage < FIRST_STAGE or stage > LAST_STAGE then
989
- printConsole(
990
- nil,
991
- ((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(LAST_STAGE)) .. "."
992
- )
955
+ print(((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(LAST_STAGE)) .. ".")
993
956
  return
994
957
  end
995
958
  Isaac.ExecuteCommand(("stage " .. tostring(stage)) .. stageTypeLetter)
@@ -1015,54 +978,42 @@ end
1015
978
  --- Logs all of the current run's seed effects to the "log.txt" file.
1016
979
  function ____exports.seeds(self)
1017
980
  logSeedEffects(nil)
1018
- printConsole(nil, "Logged the seed effects to the \"log.txt\" file.")
981
+ print("Logged the seed effects to the \"log.txt\" file.")
1019
982
  end
1020
983
  --- Sets a charge to the player's specified active item. You must provide the active slot number and
1021
984
  -- the number of charges to set.
1022
985
  function ____exports.setCharges(self, params)
1023
986
  if params == "" then
1024
- printConsole(nil, "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.)")
987
+ print("You must specify a slot number and a charge amount. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)")
1025
988
  return
1026
989
  end
1027
990
  local args = __TS__StringSplit(params, " ")
1028
991
  if #args == 1 then
1029
- printConsole(nil, "You must specify the amount of charge to set.")
992
+ print("You must specify the amount of charge to set.")
1030
993
  return
1031
994
  end
1032
995
  if #args ~= 2 then
1033
- printConsole(nil, "That is an invalid amount of arguments.")
996
+ print("That is an invalid amount of arguments.")
1034
997
  return
1035
998
  end
1036
999
  local activeSlotString, chargeString = table.unpack(args)
1037
1000
  local activeSlot = tonumber(activeSlotString)
1038
1001
  if activeSlot == nil then
1039
- printConsole(
1040
- nil,
1041
- "The provided slot number is invalid: " .. tostring(activeSlotString)
1042
- )
1002
+ print("The provided slot number is invalid: " .. tostring(activeSlotString))
1043
1003
  return
1044
1004
  end
1045
1005
  local activeSlots = getEnumValues(nil, ActiveSlot)
1046
1006
  if not __TS__ArrayIncludes(activeSlots, activeSlot) then
1047
- printConsole(
1048
- nil,
1049
- "The provided slot number is invalid: " .. tostring(activeSlot)
1050
- )
1007
+ print("The provided slot number is invalid: " .. tostring(activeSlot))
1051
1008
  return
1052
1009
  end
1053
1010
  local chargeNum = tonumber(chargeString)
1054
1011
  if chargeNum == nil then
1055
- printConsole(
1056
- nil,
1057
- "The provided charge amount is invalid: " .. tostring(chargeString)
1058
- )
1012
+ print("The provided charge amount is invalid: " .. tostring(chargeString))
1059
1013
  return
1060
1014
  end
1061
1015
  if chargeNum < 0 then
1062
- printConsole(
1063
- nil,
1064
- "The provided charge amount is invalid: " .. tostring(chargeNum)
1065
- )
1016
+ print("The provided charge amount is invalid: " .. tostring(chargeNum))
1066
1017
  return
1067
1018
  end
1068
1019
  local player = Isaac.GetPlayer()
@@ -1074,29 +1025,23 @@ end
1074
1025
  -- - setPosition 100 50
1075
1026
  function ____exports.setPosition(self, params)
1076
1027
  if params == "" then
1077
- printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
1028
+ print("You must specify a position. (e.g. \"setPosition 100 50\")")
1078
1029
  return
1079
1030
  end
1080
1031
  local args = __TS__StringSplit(params, " ")
1081
1032
  if #args ~= 2 then
1082
- printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
1033
+ print("You must specify a position. (e.g. \"setPosition 100 50\")")
1083
1034
  return
1084
1035
  end
1085
1036
  local xString, yString = table.unpack(args)
1086
1037
  local x = tonumber(xString)
1087
1038
  if x == nil then
1088
- printConsole(
1089
- nil,
1090
- "That is an invalid x value: " .. tostring(xString)
1091
- )
1039
+ print("That is an invalid x value: " .. tostring(xString))
1092
1040
  return
1093
1041
  end
1094
1042
  local y = tonumber(yString)
1095
1043
  if y == nil then
1096
- printConsole(
1097
- nil,
1098
- "That is an invalid y value: " .. tostring(yString)
1099
- )
1044
+ print("That is an invalid y value: " .. tostring(yString))
1100
1045
  return
1101
1046
  end
1102
1047
  local player = Isaac.GetPlayer()
@@ -1119,7 +1064,7 @@ function ____exports.soulCharges(self, params)
1119
1064
  if params ~= "" then
1120
1065
  local num = tonumber(params)
1121
1066
  if num == nil then
1122
- printConsole(nil, "That is an invalid amount of charges to add.")
1067
+ print("That is an invalid amount of charges to add.")
1123
1068
  return
1124
1069
  end
1125
1070
  charges = num
@@ -1135,7 +1080,7 @@ end
1135
1080
  --- Logs all of the currently playing sound effects to the "log.txt" file.
1136
1081
  function ____exports.sounds(self)
1137
1082
  logSounds(nil)
1138
- printConsole(nil, "Logged the currently playing sound effects to the \"log.txt\" file.")
1083
+ print("Logged the currently playing sound effects to the \"log.txt\" file.")
1139
1084
  end
1140
1085
  --- Toggles spamming Blood Rights on every frame. Useful for killing enemies very fast without using
1141
1086
  -- "debug 10".
@@ -1145,7 +1090,7 @@ function ____exports.spam(self)
1145
1090
  end
1146
1091
  function ____exports.spawnCollectible(self, params)
1147
1092
  if params == "" then
1148
- printConsole(nil, "You must specify the name or number corresponding to the collectible type.")
1093
+ print("You must specify the name or number corresponding to the collectible type.")
1149
1094
  return
1150
1095
  end
1151
1096
  local collectibleTypeNumber = tonumber(params)
@@ -1153,7 +1098,7 @@ function ____exports.spawnCollectible(self, params)
1153
1098
  if collectibleTypeNumber == nil then
1154
1099
  local match = getMapPartialMatch(nil, params, COLLECTIBLE_NAME_TO_TYPE_MAP)
1155
1100
  if match == nil then
1156
- printConsole(nil, "Unknown collectible: " .. params)
1101
+ print("Unknown collectible: " .. params)
1157
1102
  return
1158
1103
  end
1159
1104
  collectibleType = match[2]
@@ -1167,7 +1112,7 @@ end
1167
1112
  --- Spawns a golden version of the specified trinket type.
1168
1113
  function ____exports.spawnGoldenTrinket(self, params)
1169
1114
  if params == "" then
1170
- printConsole(nil, "You must specify the name or number corresponding to the trinket type.")
1115
+ print("You must specify the name or number corresponding to the trinket type.")
1171
1116
  return
1172
1117
  end
1173
1118
  local trinketTypeNumber = tonumber(params)
@@ -1175,7 +1120,7 @@ function ____exports.spawnGoldenTrinket(self, params)
1175
1120
  if trinketTypeNumber == nil then
1176
1121
  local match = getMapPartialMatch(nil, params, TRINKET_NAME_TO_TYPE_MAP)
1177
1122
  if match == nil then
1178
- printConsole(nil, "Unknown trinket: " .. params)
1123
+ print("Unknown trinket: " .. params)
1179
1124
  return
1180
1125
  end
1181
1126
  trinketType = match[2]
@@ -1189,7 +1134,7 @@ function ____exports.spawnGoldenTrinket(self, params)
1189
1134
  end
1190
1135
  function ____exports.spawnTrinket(self, params)
1191
1136
  if params == "" then
1192
- printConsole(nil, "You must specify the name or number corresponding to the trinket type.")
1137
+ print("You must specify the name or number corresponding to the trinket type.")
1193
1138
  return
1194
1139
  end
1195
1140
  local trinketTypeNumber = tonumber(params)
@@ -1197,7 +1142,7 @@ function ____exports.spawnTrinket(self, params)
1197
1142
  if trinketTypeNumber == nil then
1198
1143
  local match = getMapPartialMatch(nil, params, TRINKET_NAME_TO_TYPE_MAP)
1199
1144
  if match == nil then
1200
- printConsole(nil, "Unknown trinket: " .. params)
1145
+ print("Unknown trinket: " .. params)
1201
1146
  return
1202
1147
  end
1203
1148
  trinketType = match[2]
@@ -1216,7 +1161,7 @@ function ____exports.speed(self, params)
1216
1161
  if params ~= "" then
1217
1162
  local num = tonumber(params)
1218
1163
  if num == nil then
1219
- printConsole(nil, "The provided speed amount is invalid: " .. params)
1164
+ print("The provided speed amount is invalid: " .. params)
1220
1165
  return
1221
1166
  end
1222
1167
  v.persistent.damageAmount = num
@@ -1243,7 +1188,7 @@ function ____exports.tears(self, params)
1243
1188
  if params ~= "" then
1244
1189
  local num = tonumber(params)
1245
1190
  if num == nil then
1246
- printConsole(nil, "The provided tear delay amount is invalid: " .. params)
1191
+ print("The provided tear delay amount is invalid: " .. params)
1247
1192
  return
1248
1193
  end
1249
1194
  v.persistent.tearsAmount = num
@@ -1278,7 +1223,7 @@ end
1278
1223
  --- If currently on a set seed, changes to an unseeded state and restarts the game.
1279
1224
  function ____exports.unseed(self)
1280
1225
  if not onSetSeed(nil) then
1281
- printConsole(nil, "You are not on a set seed, so you cannot unseed the run.")
1226
+ print("You are not on a set seed, so you cannot unseed the run.")
1282
1227
  return
1283
1228
  end
1284
1229
  setUnseeded(nil)
@@ -1296,7 +1241,7 @@ end
1296
1241
  -- - warp tr - Warps to the first Treasure Room on the floor, if any.
1297
1242
  function ____exports.warp(self, params)
1298
1243
  if params == "" then
1299
- printConsole(nil, "You must specify a room type name or number.")
1244
+ print("You must specify a room type name or number.")
1300
1245
  return
1301
1246
  end
1302
1247
  local roomType
@@ -1304,16 +1249,13 @@ function ____exports.warp(self, params)
1304
1249
  if num == nil then
1305
1250
  local match = getMapPartialMatch(nil, params, ROOM_NAME_TO_TYPE_MAP)
1306
1251
  if match == nil then
1307
- printConsole(nil, "Unknown room type: " .. params)
1252
+ print("Unknown room type: " .. params)
1308
1253
  return
1309
1254
  end
1310
1255
  roomType = match[2]
1311
1256
  else
1312
1257
  if num < FIRST_ROOM_TYPE or num > LAST_ROOM_TYPE then
1313
- printConsole(
1314
- nil,
1315
- "Invalid room type: " .. tostring(num)
1316
- )
1258
+ print("Invalid room type: " .. tostring(num))
1317
1259
  return
1318
1260
  end
1319
1261
  roomType = num
@@ -1 +1 @@
1
- {"version":3,"file":"subroutines.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/subroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAmB1D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAcrE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAqBlD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,wBAAwB,EAAE,OAAO,GAChC,IAAI,CAYN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAY5E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAgBrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAUjE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAWvD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAuB3D"}
1
+ {"version":3,"file":"subroutines.d.ts","sourceRoot":"","sources":["../../../../../../src/classes/features/other/extraConsoleCommands/subroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAkB1D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAcrE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAqBlD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,wBAAwB,EAAE,OAAO,GAChC,IAAI,CAYN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAY5E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAgBrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAUjE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAWvD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAuB3D"}