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
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.3.2
3
+ isaacscript-common 20.4.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -15557,6 +15557,30 @@ ____exports.CONSOLE_COMMANDS_SET = __TS__New(Set, {
15557
15557
  "rewind",
15558
15558
  "testbosspool"
15559
15559
  })
15560
+ return ____exports
15561
+ end,
15562
+ ["src.functions.log"] = function(...)
15563
+ local ____exports = {}
15564
+ function ____exports.getParentFunctionDescription(self, levels)
15565
+ if levels == nil then
15566
+ levels = 3
15567
+ end
15568
+ if debug ~= nil then
15569
+ local debugTable = debug.getinfo(levels)
15570
+ if debugTable ~= nil then
15571
+ return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
15572
+ end
15573
+ end
15574
+ if SandboxGetParentFunctionDescription ~= nil then
15575
+ return SandboxGetParentFunctionDescription(levels)
15576
+ end
15577
+ return nil
15578
+ end
15579
+ function ____exports.log(self, msg)
15580
+ local parentFunctionDescription = ____exports.getParentFunctionDescription(nil)
15581
+ local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
15582
+ Isaac.DebugString(debugMsg)
15583
+ end
15560
15584
  return ____exports
15561
15585
  end,
15562
15586
  ["src.functions.utils"] = function(...)
@@ -15567,6 +15591,8 @@ local ____cachedClasses = require("src.core.cachedClasses")
15567
15591
  local game = ____cachedClasses.game
15568
15592
  local ____consoleCommandsSet = require("src.sets.consoleCommandsSet")
15569
15593
  local CONSOLE_COMMANDS_SET = ____consoleCommandsSet.CONSOLE_COMMANDS_SET
15594
+ local ____log = require("src.functions.log")
15595
+ local log = ____log.log
15570
15596
  function ____exports.eRange(self, start, ____end, increment)
15571
15597
  if increment == nil then
15572
15598
  increment = 1
@@ -15612,12 +15638,13 @@ end
15612
15638
  function ____exports.isVanillaConsoleCommand(self, commandName)
15613
15639
  return CONSOLE_COMMANDS_SET:has(commandName)
15614
15640
  end
15615
- function ____exports.printConsole(self, msg)
15616
- Isaac.ConsoleOutput(msg .. "\n")
15641
+ function ____exports.logAndPrint(self, msg)
15642
+ log(nil, msg)
15643
+ print(msg)
15617
15644
  end
15618
15645
  function ____exports.printEnabled(self, enabled, description)
15619
15646
  local enabledText = enabled and "Enabled" or "Disabled"
15620
- ____exports.printConsole(nil, ((enabledText .. " ") .. description) .. ".")
15647
+ print(((enabledText .. " ") .. description) .. ".")
15621
15648
  end
15622
15649
  ____exports["repeat"] = function(self, n, func)
15623
15650
  do
@@ -15694,91 +15721,93 @@ ____exports.ISCFeature.PLAYER_COLLECTIBLE_DETECTION = 8
15694
15721
  ____exports.ISCFeature[____exports.ISCFeature.PLAYER_COLLECTIBLE_DETECTION] = "PLAYER_COLLECTIBLE_DETECTION"
15695
15722
  ____exports.ISCFeature.PLAYER_REORDERED_CALLBACKS = 9
15696
15723
  ____exports.ISCFeature[____exports.ISCFeature.PLAYER_REORDERED_CALLBACKS] = "PLAYER_REORDERED_CALLBACKS"
15697
- ____exports.ISCFeature.SLOT_RENDER_DETECTION = 10
15724
+ ____exports.ISCFeature.SLOT_DESTROYED_DETECTION = 10
15725
+ ____exports.ISCFeature[____exports.ISCFeature.SLOT_DESTROYED_DETECTION] = "SLOT_DESTROYED_DETECTION"
15726
+ ____exports.ISCFeature.SLOT_RENDER_DETECTION = 11
15698
15727
  ____exports.ISCFeature[____exports.ISCFeature.SLOT_RENDER_DETECTION] = "SLOT_RENDER_DETECTION"
15699
- ____exports.ISCFeature.SLOT_UPDATE_DETECTION = 11
15728
+ ____exports.ISCFeature.SLOT_UPDATE_DETECTION = 12
15700
15729
  ____exports.ISCFeature[____exports.ISCFeature.SLOT_UPDATE_DETECTION] = "SLOT_UPDATE_DETECTION"
15701
- ____exports.ISCFeature.CHARACTER_HEALTH_CONVERSION = 12
15730
+ ____exports.ISCFeature.CHARACTER_HEALTH_CONVERSION = 13
15702
15731
  ____exports.ISCFeature[____exports.ISCFeature.CHARACTER_HEALTH_CONVERSION] = "CHARACTER_HEALTH_CONVERSION"
15703
- ____exports.ISCFeature.CHARACTER_STATS = 13
15732
+ ____exports.ISCFeature.CHARACTER_STATS = 14
15704
15733
  ____exports.ISCFeature[____exports.ISCFeature.CHARACTER_STATS] = "CHARACTER_STATS"
15705
- ____exports.ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE = 14
15734
+ ____exports.ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE = 15
15706
15735
  ____exports.ISCFeature[____exports.ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE] = "COLLECTIBLE_ITEM_POOL_TYPE"
15707
- ____exports.ISCFeature.CUSTOM_GRID_ENTITIES = 15
15736
+ ____exports.ISCFeature.CUSTOM_GRID_ENTITIES = 16
15708
15737
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_GRID_ENTITIES] = "CUSTOM_GRID_ENTITIES"
15709
- ____exports.ISCFeature.CUSTOM_ITEM_POOLS = 16
15738
+ ____exports.ISCFeature.CUSTOM_ITEM_POOLS = 17
15710
15739
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_ITEM_POOLS] = "CUSTOM_ITEM_POOLS"
15711
- ____exports.ISCFeature.CUSTOM_HOTKEYS = 17
15740
+ ____exports.ISCFeature.CUSTOM_HOTKEYS = 18
15712
15741
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_HOTKEYS] = "CUSTOM_HOTKEYS"
15713
- ____exports.ISCFeature.CUSTOM_PICKUPS = 18
15742
+ ____exports.ISCFeature.CUSTOM_PICKUPS = 19
15714
15743
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_PICKUPS] = "CUSTOM_PICKUPS"
15715
- ____exports.ISCFeature.CUSTOM_STAGES = 19
15744
+ ____exports.ISCFeature.CUSTOM_STAGES = 20
15716
15745
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_STAGES] = "CUSTOM_STAGES"
15717
- ____exports.ISCFeature.CUSTOM_TRAPDOORS = 20
15746
+ ____exports.ISCFeature.CUSTOM_TRAPDOORS = 21
15718
15747
  ____exports.ISCFeature[____exports.ISCFeature.CUSTOM_TRAPDOORS] = "CUSTOM_TRAPDOORS"
15719
- ____exports.ISCFeature.DEBUG_DISPLAY = 21
15748
+ ____exports.ISCFeature.DEBUG_DISPLAY = 22
15720
15749
  ____exports.ISCFeature[____exports.ISCFeature.DEBUG_DISPLAY] = "DEBUG_DISPLAY"
15721
- ____exports.ISCFeature.DEPLOY_JSON_ROOM = 22
15750
+ ____exports.ISCFeature.DEPLOY_JSON_ROOM = 23
15722
15751
  ____exports.ISCFeature[____exports.ISCFeature.DEPLOY_JSON_ROOM] = "DEPLOY_JSON_ROOM"
15723
- ____exports.ISCFeature.DISABLE_ALL_SOUND = 23
15752
+ ____exports.ISCFeature.DISABLE_ALL_SOUND = 24
15724
15753
  ____exports.ISCFeature[____exports.ISCFeature.DISABLE_ALL_SOUND] = "DISABLE_ALL_SOUND"
15725
- ____exports.ISCFeature.DISABLE_INPUTS = 24
15754
+ ____exports.ISCFeature.DISABLE_INPUTS = 25
15726
15755
  ____exports.ISCFeature[____exports.ISCFeature.DISABLE_INPUTS] = "DISABLE_INPUTS"
15727
- ____exports.ISCFeature.FADE_IN_REMOVER = 25
15756
+ ____exports.ISCFeature.FADE_IN_REMOVER = 26
15728
15757
  ____exports.ISCFeature[____exports.ISCFeature.FADE_IN_REMOVER] = "FADE_IN_REMOVER"
15729
- ____exports.ISCFeature.FAST_RESET = 26
15758
+ ____exports.ISCFeature.FAST_RESET = 27
15730
15759
  ____exports.ISCFeature[____exports.ISCFeature.FAST_RESET] = "FAST_RESET"
15731
- ____exports.ISCFeature.FLYING_DETECTION = 27
15760
+ ____exports.ISCFeature.FLYING_DETECTION = 28
15732
15761
  ____exports.ISCFeature[____exports.ISCFeature.FLYING_DETECTION] = "FLYING_DETECTION"
15733
- ____exports.ISCFeature.FORGOTTEN_SWITCH = 28
15762
+ ____exports.ISCFeature.FORGOTTEN_SWITCH = 29
15734
15763
  ____exports.ISCFeature[____exports.ISCFeature.FORGOTTEN_SWITCH] = "FORGOTTEN_SWITCH"
15735
- ____exports.ISCFeature.EXTRA_CONSOLE_COMMANDS = 29
15764
+ ____exports.ISCFeature.EXTRA_CONSOLE_COMMANDS = 30
15736
15765
  ____exports.ISCFeature[____exports.ISCFeature.EXTRA_CONSOLE_COMMANDS] = "EXTRA_CONSOLE_COMMANDS"
15737
- ____exports.ISCFeature.ITEM_POOL_DETECTION = 30
15766
+ ____exports.ISCFeature.ITEM_POOL_DETECTION = 31
15738
15767
  ____exports.ISCFeature[____exports.ISCFeature.ITEM_POOL_DETECTION] = "ITEM_POOL_DETECTION"
15739
- ____exports.ISCFeature.MODDED_ELEMENT_DETECTION = 31
15768
+ ____exports.ISCFeature.MODDED_ELEMENT_DETECTION = 32
15740
15769
  ____exports.ISCFeature[____exports.ISCFeature.MODDED_ELEMENT_DETECTION] = "MODDED_ELEMENT_DETECTION"
15741
- ____exports.ISCFeature.MODDED_ELEMENT_SETS = 32
15770
+ ____exports.ISCFeature.MODDED_ELEMENT_SETS = 33
15742
15771
  ____exports.ISCFeature[____exports.ISCFeature.MODDED_ELEMENT_SETS] = "MODDED_ELEMENT_SETS"
15743
- ____exports.ISCFeature.NO_SIREN_STEAL = 33
15772
+ ____exports.ISCFeature.NO_SIREN_STEAL = 34
15744
15773
  ____exports.ISCFeature[____exports.ISCFeature.NO_SIREN_STEAL] = "NO_SIREN_STEAL"
15745
- ____exports.ISCFeature.PAUSE = 34
15774
+ ____exports.ISCFeature.PAUSE = 35
15746
15775
  ____exports.ISCFeature[____exports.ISCFeature.PAUSE] = "PAUSE"
15747
- ____exports.ISCFeature.PERSISTENT_ENTITIES = 35
15776
+ ____exports.ISCFeature.PERSISTENT_ENTITIES = 36
15748
15777
  ____exports.ISCFeature[____exports.ISCFeature.PERSISTENT_ENTITIES] = "PERSISTENT_ENTITIES"
15749
- ____exports.ISCFeature.PICKUP_INDEX_CREATION = 36
15778
+ ____exports.ISCFeature.PICKUP_INDEX_CREATION = 37
15750
15779
  ____exports.ISCFeature[____exports.ISCFeature.PICKUP_INDEX_CREATION] = "PICKUP_INDEX_CREATION"
15751
- ____exports.ISCFeature.PLAYER_INVENTORY = 37
15780
+ ____exports.ISCFeature.PLAYER_INVENTORY = 38
15752
15781
  ____exports.ISCFeature[____exports.ISCFeature.PLAYER_INVENTORY] = "PLAYER_INVENTORY"
15753
- ____exports.ISCFeature.PONY_DETECTION = 38
15782
+ ____exports.ISCFeature.PONY_DETECTION = 39
15754
15783
  ____exports.ISCFeature[____exports.ISCFeature.PONY_DETECTION] = "PONY_DETECTION"
15755
- ____exports.ISCFeature.PRESS_INPUT = 39
15784
+ ____exports.ISCFeature.PRESS_INPUT = 40
15756
15785
  ____exports.ISCFeature[____exports.ISCFeature.PRESS_INPUT] = "PRESS_INPUT"
15757
- ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 40
15786
+ ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 41
15758
15787
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_CHILD_ENTITIES] = "PREVENT_CHILD_ENTITIES"
15759
- ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 41
15788
+ ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 42
15760
15789
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = "PREVENT_COLLECTIBLE_ROTATION"
15761
- ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 42
15790
+ ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 43
15762
15791
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = "PREVENT_GRID_ENTITY_RESPAWN"
15763
- ____exports.ISCFeature.ROOM_CLEAR_FRAME = 43
15792
+ ____exports.ISCFeature.ROOM_CLEAR_FRAME = 44
15764
15793
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_CLEAR_FRAME] = "ROOM_CLEAR_FRAME"
15765
- ____exports.ISCFeature.ROOM_HISTORY = 44
15794
+ ____exports.ISCFeature.ROOM_HISTORY = 45
15766
15795
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_HISTORY] = "ROOM_HISTORY"
15767
- ____exports.ISCFeature.RUN_IN_N_FRAMES = 45
15796
+ ____exports.ISCFeature.RUN_IN_N_FRAMES = 46
15768
15797
  ____exports.ISCFeature[____exports.ISCFeature.RUN_IN_N_FRAMES] = "RUN_IN_N_FRAMES"
15769
- ____exports.ISCFeature.RUN_NEXT_ROOM = 46
15798
+ ____exports.ISCFeature.RUN_NEXT_ROOM = 47
15770
15799
  ____exports.ISCFeature[____exports.ISCFeature.RUN_NEXT_ROOM] = "RUN_NEXT_ROOM"
15771
- ____exports.ISCFeature.SAVE_DATA_MANAGER = 47
15800
+ ____exports.ISCFeature.SAVE_DATA_MANAGER = 48
15772
15801
  ____exports.ISCFeature[____exports.ISCFeature.SAVE_DATA_MANAGER] = "SAVE_DATA_MANAGER"
15773
- ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 48
15802
+ ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 49
15774
15803
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS] = "SPAWN_ALT_ROCK_REWARDS"
15775
- ____exports.ISCFeature.SPAWN_COLLECTIBLE = 49
15804
+ ____exports.ISCFeature.SPAWN_COLLECTIBLE = 50
15776
15805
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_COLLECTIBLE] = "SPAWN_COLLECTIBLE"
15777
- ____exports.ISCFeature.STAGE_HISTORY = 50
15806
+ ____exports.ISCFeature.STAGE_HISTORY = 51
15778
15807
  ____exports.ISCFeature[____exports.ISCFeature.STAGE_HISTORY] = "STAGE_HISTORY"
15779
- ____exports.ISCFeature.START_AMBUSH = 51
15808
+ ____exports.ISCFeature.START_AMBUSH = 52
15780
15809
  ____exports.ISCFeature[____exports.ISCFeature.START_AMBUSH] = "START_AMBUSH"
15781
- ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 52
15810
+ ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 53
15782
15811
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
15783
15812
  return ____exports
15784
15813
  end,
@@ -23643,30 +23672,6 @@ function ____exports.spawnTearWithSeed(self, tearVariant, subType, positionOrGri
23643
23672
  seedOrRNG
23644
23673
  )
23645
23674
  end
23646
- return ____exports
23647
- end,
23648
- ["src.functions.log"] = function(...)
23649
- local ____exports = {}
23650
- function ____exports.getParentFunctionDescription(self, levels)
23651
- if levels == nil then
23652
- levels = 3
23653
- end
23654
- if debug ~= nil then
23655
- local debugTable = debug.getinfo(levels)
23656
- if debugTable ~= nil then
23657
- return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
23658
- end
23659
- end
23660
- if SandboxGetParentFunctionDescription ~= nil then
23661
- return SandboxGetParentFunctionDescription(levels)
23662
- end
23663
- return nil
23664
- end
23665
- function ____exports.log(self, msg)
23666
- local parentFunctionDescription = ____exports.getParentFunctionDescription(nil)
23667
- local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
23668
- Isaac.DebugString(debugMsg)
23669
- end
23670
23675
  return ____exports
23671
23676
  end,
23672
23677
  ["src.functions.run"] = function(...)
@@ -27756,8 +27761,6 @@ local isTSTLSet = ____tstlClass.isTSTLSet
27756
27761
  local ____types = require("src.functions.types")
27757
27762
  local isTable = ____types.isTable
27758
27763
  local isUserdata = ____types.isUserdata
27759
- local ____utils = require("src.functions.utils")
27760
- local printConsole = ____utils.printConsole
27761
27764
  local ____vector = require("src.functions.vector")
27762
27765
  local vectorToString = ____vector.vectorToString
27763
27766
  function ____exports.logFlags(self, flags, flagEnum, description)
@@ -27826,7 +27829,7 @@ end
27826
27829
  function ____exports.logError(self, msg)
27827
27830
  local errorMsg = "Error: " .. msg
27828
27831
  log(nil, errorMsg)
27829
- printConsole(nil, errorMsg)
27832
+ print(errorMsg)
27830
27833
  end
27831
27834
  function ____exports.logGameStateFlags(self)
27832
27835
  log(nil, "Logging game state flags:")
@@ -30222,69 +30225,21 @@ return ____exports
30222
30225
  local ____lualib = require("lualib_bundle")
30223
30226
  local __TS__Class = ____lualib.__TS__Class
30224
30227
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
30225
- local Set = ____lualib.Set
30226
- local __TS__New = ____lualib.__TS__New
30227
- local Map = ____lualib.Map
30228
30228
  local ____exports = {}
30229
- local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
30230
- local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
30231
- local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
30232
- local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
30233
- local ____cachedClasses = require("src.core.cachedClasses")
30234
- local game = ____cachedClasses.game
30235
- local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
30236
- local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
30237
- local ____SlotDestructionType = require("src.enums.SlotDestructionType")
30238
- local SlotDestructionType = ____SlotDestructionType.SlotDestructionType
30229
+ local ____ISCFeature = require("src.enums.ISCFeature")
30230
+ local ISCFeature = ____ISCFeature.ISCFeature
30239
30231
  local ____shouldFire = require("src.shouldFire")
30240
30232
  local shouldFireSlot = ____shouldFire.shouldFireSlot
30241
30233
  local ____CustomCallback = require("src.classes.private.CustomCallback")
30242
30234
  local CustomCallback = ____CustomCallback.CustomCallback
30243
- local PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL = 3
30244
30235
  ____exports.PostSlotDestroyed = __TS__Class()
30245
30236
  local PostSlotDestroyed = ____exports.PostSlotDestroyed
30246
30237
  PostSlotDestroyed.name = "PostSlotDestroyed"
30247
30238
  __TS__ClassExtends(PostSlotDestroyed, CustomCallback)
30248
30239
  function PostSlotDestroyed.prototype.____constructor(self)
30249
30240
  CustomCallback.prototype.____constructor(self)
30250
- self.v = {room = {
30251
- brokenSlots = __TS__New(Set),
30252
- slotPrizeAnimationGameFrame = __TS__New(Map)
30253
- }}
30254
30241
  self.shouldFire = shouldFireSlot
30255
- self.postEntityRemoveSlot = function(____, entity)
30256
- local slot = entity
30257
- local ptrHash = GetPtrHash(slot)
30258
- local gameFrameCount = game:GetFrameCount()
30259
- local prizeFrame = self.v.room.slotPrizeAnimationGameFrame:get(ptrHash)
30260
- if prizeFrame == nil then
30261
- return
30262
- end
30263
- if prizeFrame + PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL == gameFrameCount then
30264
- self:fire(slot, SlotDestructionType.COLLECTIBLE_PAYOUT)
30265
- end
30266
- end
30267
- self.postSlotAnimationChanged = function(____, slot)
30268
- local ptrHash = GetPtrHash(slot)
30269
- local gameFrameCount = game:GetFrameCount()
30270
- local alreadyBroken = self.v.room.brokenSlots:has(ptrHash)
30271
- if alreadyBroken then
30272
- return
30273
- end
30274
- if slot.GridCollisionClass == EntityGridCollisionClass.GROUND then
30275
- self.v.room.brokenSlots:add(ptrHash)
30276
- self:fire(slot, SlotDestructionType.NORMAL)
30277
- end
30278
- local sprite = slot:GetSprite()
30279
- local animation = sprite:GetAnimation()
30280
- if animation == "Prize" then
30281
- self.v.room.slotPrizeAnimationGameFrame:set(ptrHash, gameFrameCount)
30282
- else
30283
- self.v.room.slotPrizeAnimationGameFrame:delete(ptrHash)
30284
- end
30285
- end
30286
- self.callbacksUsed = {{ModCallback.POST_ENTITY_REMOVE, self.postEntityRemoveSlot, {EntityType.SLOT}}}
30287
- self.customCallbacksUsed = {{ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED, self.postSlotAnimationChanged}}
30242
+ self.featuresUsed = {ISCFeature.SLOT_DESTROYED_DETECTION}
30288
30243
  end
30289
30244
  return ____exports
30290
30245
  end,
@@ -34104,6 +34059,236 @@ function PlayerReorderedCallbacks.prototype.____constructor(self, postPEffectUpd
34104
34059
  self.postPlayerRenderReordered = postPlayerRenderReordered
34105
34060
  self.postPlayerUpdateReordered = postPlayerUpdateReordered
34106
34061
  end
34062
+ return ____exports
34063
+ end,
34064
+ ["src.functions.slots"] = function(...)
34065
+ local ____lualib = require("lualib_bundle")
34066
+ local Set = ____lualib.Set
34067
+ local __TS__New = ____lualib.__TS__New
34068
+ local ____exports = {}
34069
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
34070
+ local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
34071
+ local ____entityTypes = require("src.functions.entityTypes")
34072
+ local isSlot = ____entityTypes.isSlot
34073
+ local SLOT_MACHINE_VARIANTS = __TS__New(Set, {
34074
+ SlotVariant.SLOT_MACHINE,
34075
+ SlotVariant.BLOOD_DONATION_MACHINE,
34076
+ SlotVariant.FORTUNE_TELLING_MACHINE,
34077
+ SlotVariant.DONATION_MACHINE,
34078
+ SlotVariant.SHOP_RESTOCK_MACHINE,
34079
+ SlotVariant.GREED_DONATION_MACHINE,
34080
+ SlotVariant.MOMS_DRESSING_TABLE,
34081
+ SlotVariant.CRANE_GAME,
34082
+ SlotVariant.CONFESSIONAL
34083
+ })
34084
+ function ____exports.isSlotMachine(self, entity)
34085
+ if not isSlot(nil, entity) then
34086
+ return false
34087
+ end
34088
+ return SLOT_MACHINE_VARIANTS:has(entity.Variant)
34089
+ end
34090
+ return ____exports
34091
+ end,
34092
+ ["src.interfaces.RoomDescription"] = function(...)
34093
+ local ____exports = {}
34094
+ return ____exports
34095
+ end,
34096
+ ["src.classes.features.other.RoomHistory"] = function(...)
34097
+ local ____lualib = require("lualib_bundle")
34098
+ local __TS__Class = ____lualib.__TS__Class
34099
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
34100
+ local __TS__Decorate = ____lualib.__TS__Decorate
34101
+ local ____exports = {}
34102
+ local ____cachedClasses = require("src.core.cachedClasses")
34103
+ local game = ____cachedClasses.game
34104
+ local ____decorators = require("src.decorators")
34105
+ local Exported = ____decorators.Exported
34106
+ local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
34107
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
34108
+ local ____array = require("src.functions.array")
34109
+ local getLastElement = ____array.getLastElement
34110
+ local ____dimensions = require("src.functions.dimensions")
34111
+ local getDimension = ____dimensions.getDimension
34112
+ local ____roomData = require("src.functions.roomData")
34113
+ local getRoomGridIndex = ____roomData.getRoomGridIndex
34114
+ local getRoomListIndex = ____roomData.getRoomListIndex
34115
+ local getRoomName = ____roomData.getRoomName
34116
+ local getRoomStageID = ____roomData.getRoomStageID
34117
+ local getRoomSubType = ____roomData.getRoomSubType
34118
+ local getRoomVariant = ____roomData.getRoomVariant
34119
+ local getRoomVisitedCount = ____roomData.getRoomVisitedCount
34120
+ local ____Feature = require("src.classes.private.Feature")
34121
+ local Feature = ____Feature.Feature
34122
+ ____exports.RoomHistory = __TS__Class()
34123
+ local RoomHistory = ____exports.RoomHistory
34124
+ RoomHistory.name = "RoomHistory"
34125
+ __TS__ClassExtends(RoomHistory, Feature)
34126
+ function RoomHistory.prototype.____constructor(self)
34127
+ Feature.prototype.____constructor(self)
34128
+ self.v = {run = {roomHistory = {}}}
34129
+ self.postNewRoomEarly = function()
34130
+ local level = game:GetLevel()
34131
+ local stage = level:GetStage()
34132
+ local stageType = level:GetStageType()
34133
+ local room = game:GetRoom()
34134
+ local roomType = room:GetType()
34135
+ local seeds = game:GetSeeds()
34136
+ local startSeedString = seeds:GetStartSeedString()
34137
+ local stageID = getRoomStageID(nil)
34138
+ local dimension = getDimension(nil)
34139
+ local roomVariant = getRoomVariant(nil)
34140
+ local roomSubType = getRoomSubType(nil)
34141
+ local roomName = getRoomName(nil)
34142
+ local roomGridIndex = getRoomGridIndex(nil)
34143
+ local roomListIndex = getRoomListIndex(nil)
34144
+ local roomVisitedCount = getRoomVisitedCount(nil)
34145
+ local roomDescription = {
34146
+ startSeedString = startSeedString,
34147
+ stage = stage,
34148
+ stageType = stageType,
34149
+ stageID = stageID,
34150
+ dimension = dimension,
34151
+ roomType = roomType,
34152
+ roomVariant = roomVariant,
34153
+ roomSubType = roomSubType,
34154
+ roomName = roomName,
34155
+ roomGridIndex = roomGridIndex,
34156
+ roomListIndex = roomListIndex,
34157
+ roomVisitedCount = roomVisitedCount
34158
+ }
34159
+ local ____self_v_run_roomHistory_0 = self.v.run.roomHistory
34160
+ ____self_v_run_roomHistory_0[#____self_v_run_roomHistory_0 + 1] = roomDescription
34161
+ end
34162
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_EARLY, self.postNewRoomEarly}}
34163
+ end
34164
+ function RoomHistory.prototype.getRoomHistory(self)
34165
+ return self.v.run.roomHistory
34166
+ end
34167
+ function RoomHistory.prototype.getPreviousRoomDescription(self)
34168
+ local previousRoomDescription = self.v.run.roomHistory[#self.v.run.roomHistory - 2 + 1]
34169
+ if previousRoomDescription ~= nil then
34170
+ return previousRoomDescription
34171
+ end
34172
+ local startingRoomDescription = self.v.run.roomHistory[1]
34173
+ if startingRoomDescription ~= nil then
34174
+ return startingRoomDescription
34175
+ end
34176
+ error("Failed to find a room description for any rooms thus far on this run.")
34177
+ end
34178
+ function RoomHistory.prototype.getLatestRoomDescription(self)
34179
+ return getLastElement(nil, self.v.run.roomHistory)
34180
+ end
34181
+ function RoomHistory.prototype.isLeavingRoom(self)
34182
+ local level = game:GetLevel()
34183
+ local stage = level:GetStage()
34184
+ local stageType = level:GetStageType()
34185
+ local seeds = game:GetSeeds()
34186
+ local startSeedString = seeds:GetStartSeedString()
34187
+ local roomListIndex = getRoomListIndex(nil)
34188
+ local roomVisitedCount = getRoomVisitedCount(nil)
34189
+ local latestRoomDescription = self:getLatestRoomDescription()
34190
+ if latestRoomDescription == nil then
34191
+ return false
34192
+ end
34193
+ return startSeedString ~= latestRoomDescription.startSeedString or stage ~= latestRoomDescription.stage or stageType ~= latestRoomDescription.stageType or roomListIndex ~= latestRoomDescription.roomListIndex or roomVisitedCount ~= latestRoomDescription.roomVisitedCount
34194
+ end
34195
+ __TS__Decorate({Exported}, RoomHistory.prototype, "getRoomHistory", true)
34196
+ __TS__Decorate({Exported}, RoomHistory.prototype, "getPreviousRoomDescription", true)
34197
+ __TS__Decorate({Exported}, RoomHistory.prototype, "getLatestRoomDescription", true)
34198
+ __TS__Decorate({Exported}, RoomHistory.prototype, "isLeavingRoom", true)
34199
+ return ____exports
34200
+ end,
34201
+ ["src.classes.features.callbackLogic.SlotDestroyedDetection"] = function(...)
34202
+ local ____lualib = require("lualib_bundle")
34203
+ local __TS__Class = ____lualib.__TS__Class
34204
+ local __TS__ClassExtends = ____lualib.__TS__ClassExtends
34205
+ local Set = ____lualib.Set
34206
+ local __TS__New = ____lualib.__TS__New
34207
+ local ____exports = {}
34208
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
34209
+ local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
34210
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
34211
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
34212
+ local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
34213
+ local ____cachedClasses = require("src.core.cachedClasses")
34214
+ local game = ____cachedClasses.game
34215
+ local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
34216
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
34217
+ local ____SlotDestructionType = require("src.enums.SlotDestructionType")
34218
+ local SlotDestructionType = ____SlotDestructionType.SlotDestructionType
34219
+ local ____slots = require("src.functions.slots")
34220
+ local isSlotMachine = ____slots.isSlotMachine
34221
+ local ____vector = require("src.functions.vector")
34222
+ local vectorEquals = ____vector.vectorEquals
34223
+ local ____Feature = require("src.classes.private.Feature")
34224
+ local Feature = ____Feature.Feature
34225
+ ____exports.SlotDestroyedDetection = __TS__Class()
34226
+ local SlotDestroyedDetection = ____exports.SlotDestroyedDetection
34227
+ SlotDestroyedDetection.name = "SlotDestroyedDetection"
34228
+ __TS__ClassExtends(SlotDestroyedDetection, Feature)
34229
+ function SlotDestroyedDetection.prototype.____constructor(self, postSlotDestroyed, roomHistory)
34230
+ Feature.prototype.____constructor(self)
34231
+ self.v = {room = {
34232
+ destroyedSlotSet = __TS__New(Set),
34233
+ despawnedSlots = {}
34234
+ }}
34235
+ self.postPickupInitCollectible = function(____, pickup)
34236
+ local gameFrameCount = game:GetFrameCount()
34237
+ for ____, despawnedSlotTuple in ipairs(self.v.room.despawnedSlots) do
34238
+ local gameFrame, position, entityPtr = table.unpack(despawnedSlotTuple)
34239
+ if gameFrame == gameFrameCount and vectorEquals(nil, position, pickup.Position) then
34240
+ local entity = entityPtr.Ref
34241
+ if entity ~= nil then
34242
+ local slot = entity
34243
+ self.postSlotDestroyed:fire(slot, SlotDestructionType.COLLECTIBLE_PAYOUT)
34244
+ end
34245
+ end
34246
+ end
34247
+ end
34248
+ self.postEntityRemoveSlot = function(____, entity)
34249
+ local slot = entity
34250
+ if self.roomHistory:isLeavingRoom() then
34251
+ return
34252
+ end
34253
+ if isSlotMachine(nil, slot) then
34254
+ self:postEntityRemoveSlotMachine(slot)
34255
+ else
34256
+ self:postEntityRemoveBeggar(slot)
34257
+ end
34258
+ end
34259
+ self.postSlotUpdate = function(____, slot)
34260
+ local ptrHash = GetPtrHash(slot)
34261
+ local alreadyDestroyed = self.v.room.destroyedSlotSet:has(ptrHash)
34262
+ if alreadyDestroyed then
34263
+ return
34264
+ end
34265
+ self:checkDestroyedFromCollisionClass(slot)
34266
+ end
34267
+ self.callbacksUsed = {{ModCallback.POST_PICKUP_INIT, self.postPickupInitCollectible, {PickupVariant.COLLECTIBLE}}, {ModCallback.POST_ENTITY_REMOVE, self.postEntityRemoveSlot, {EntityType.SLOT}}}
34268
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_SLOT_UPDATE, self.postSlotUpdate}}
34269
+ self.postSlotDestroyed = postSlotDestroyed
34270
+ self.roomHistory = roomHistory
34271
+ end
34272
+ function SlotDestroyedDetection.prototype.postEntityRemoveSlotMachine(self, slot)
34273
+ local gameFrameCount = game:GetFrameCount()
34274
+ local entityPtr = EntityPtr(slot)
34275
+ local despawnedSlotTuple = {gameFrameCount, slot.Position, entityPtr}
34276
+ local ____self_v_room_despawnedSlots_0 = self.v.room.despawnedSlots
34277
+ ____self_v_room_despawnedSlots_0[#____self_v_room_despawnedSlots_0 + 1] = despawnedSlotTuple
34278
+ end
34279
+ function SlotDestroyedDetection.prototype.postEntityRemoveBeggar(self, slot)
34280
+ local sprite = slot:GetSprite()
34281
+ local animation = sprite:GetAnimation()
34282
+ local slotDestructionType = animation == "Teleport" and SlotDestructionType.COLLECTIBLE_PAYOUT or SlotDestructionType.NORMAL
34283
+ self.postSlotDestroyed:fire(slot, slotDestructionType)
34284
+ end
34285
+ function SlotDestroyedDetection.prototype.checkDestroyedFromCollisionClass(self, slot)
34286
+ if slot.GridCollisionClass == EntityGridCollisionClass.GROUND then
34287
+ local ptrHash = GetPtrHash(slot)
34288
+ self.v.room.destroyedSlotSet:add(ptrHash)
34289
+ self.postSlotDestroyed:fire(slot, SlotDestructionType.NORMAL)
34290
+ end
34291
+ end
34107
34292
  return ____exports
34108
34293
  end,
34109
34294
  ["src.classes.features.callbackLogic.SlotRenderDetection"] = function(...)
@@ -35013,110 +35198,6 @@ return ____exports
35013
35198
  end,
35014
35199
  ["src.types.PickupIndex"] = function(...)
35015
35200
  local ____exports = {}
35016
- return ____exports
35017
- end,
35018
- ["src.interfaces.RoomDescription"] = function(...)
35019
- local ____exports = {}
35020
- return ____exports
35021
- end,
35022
- ["src.classes.features.other.RoomHistory"] = function(...)
35023
- local ____lualib = require("lualib_bundle")
35024
- local __TS__Class = ____lualib.__TS__Class
35025
- local __TS__ClassExtends = ____lualib.__TS__ClassExtends
35026
- local __TS__Decorate = ____lualib.__TS__Decorate
35027
- local ____exports = {}
35028
- local ____cachedClasses = require("src.core.cachedClasses")
35029
- local game = ____cachedClasses.game
35030
- local ____decorators = require("src.decorators")
35031
- local Exported = ____decorators.Exported
35032
- local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
35033
- local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
35034
- local ____array = require("src.functions.array")
35035
- local getLastElement = ____array.getLastElement
35036
- local ____dimensions = require("src.functions.dimensions")
35037
- local getDimension = ____dimensions.getDimension
35038
- local ____roomData = require("src.functions.roomData")
35039
- local getRoomGridIndex = ____roomData.getRoomGridIndex
35040
- local getRoomListIndex = ____roomData.getRoomListIndex
35041
- local getRoomName = ____roomData.getRoomName
35042
- local getRoomStageID = ____roomData.getRoomStageID
35043
- local getRoomSubType = ____roomData.getRoomSubType
35044
- local getRoomVariant = ____roomData.getRoomVariant
35045
- local getRoomVisitedCount = ____roomData.getRoomVisitedCount
35046
- local ____Feature = require("src.classes.private.Feature")
35047
- local Feature = ____Feature.Feature
35048
- ____exports.RoomHistory = __TS__Class()
35049
- local RoomHistory = ____exports.RoomHistory
35050
- RoomHistory.name = "RoomHistory"
35051
- __TS__ClassExtends(RoomHistory, Feature)
35052
- function RoomHistory.prototype.____constructor(self)
35053
- Feature.prototype.____constructor(self)
35054
- self.v = {run = {roomHistory = {}}}
35055
- self.postNewRoomEarly = function()
35056
- local level = game:GetLevel()
35057
- local stage = level:GetStage()
35058
- local stageType = level:GetStageType()
35059
- local room = game:GetRoom()
35060
- local roomType = room:GetType()
35061
- local stageID = getRoomStageID(nil)
35062
- local dimension = getDimension(nil)
35063
- local roomVariant = getRoomVariant(nil)
35064
- local roomSubType = getRoomSubType(nil)
35065
- local roomName = getRoomName(nil)
35066
- local roomGridIndex = getRoomGridIndex(nil)
35067
- local roomListIndex = getRoomListIndex(nil)
35068
- local roomVisitedCount = getRoomVisitedCount(nil)
35069
- local roomDescription = {
35070
- stage = stage,
35071
- stageType = stageType,
35072
- stageID = stageID,
35073
- dimension = dimension,
35074
- roomType = roomType,
35075
- roomVariant = roomVariant,
35076
- roomSubType = roomSubType,
35077
- roomName = roomName,
35078
- roomGridIndex = roomGridIndex,
35079
- roomListIndex = roomListIndex,
35080
- roomVisitedCount = roomVisitedCount
35081
- }
35082
- local ____self_v_run_roomHistory_0 = self.v.run.roomHistory
35083
- ____self_v_run_roomHistory_0[#____self_v_run_roomHistory_0 + 1] = roomDescription
35084
- end
35085
- self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_EARLY, self.postNewRoomEarly}}
35086
- end
35087
- function RoomHistory.prototype.getRoomHistory(self)
35088
- return self.v.run.roomHistory
35089
- end
35090
- function RoomHistory.prototype.getPreviousRoomDescription(self)
35091
- local previousRoomDescription = self.v.run.roomHistory[#self.v.run.roomHistory - 2 + 1]
35092
- if previousRoomDescription ~= nil then
35093
- return previousRoomDescription
35094
- end
35095
- local startingRoomDescription = self.v.run.roomHistory[1]
35096
- if startingRoomDescription ~= nil then
35097
- return startingRoomDescription
35098
- end
35099
- error("Failed to find a room description for any rooms thus far on this run.")
35100
- end
35101
- function RoomHistory.prototype.getLatestRoomDescription(self)
35102
- return getLastElement(nil, self.v.run.roomHistory)
35103
- end
35104
- function RoomHistory.prototype.isLeavingRoom(self)
35105
- local level = game:GetLevel()
35106
- local stage = level:GetStage()
35107
- local stageType = level:GetStageType()
35108
- local roomListIndex = getRoomListIndex(nil)
35109
- local roomVisitedCount = getRoomVisitedCount(nil)
35110
- local latestRoomDescription = self:getLatestRoomDescription()
35111
- if latestRoomDescription == nil then
35112
- return false
35113
- end
35114
- return stage ~= latestRoomDescription.stage or stageType ~= latestRoomDescription.stageType or roomListIndex ~= latestRoomDescription.roomListIndex or roomVisitedCount ~= latestRoomDescription.roomVisitedCount
35115
- end
35116
- __TS__Decorate({Exported}, RoomHistory.prototype, "getRoomHistory", true)
35117
- __TS__Decorate({Exported}, RoomHistory.prototype, "getPreviousRoomDescription", true)
35118
- __TS__Decorate({Exported}, RoomHistory.prototype, "getLatestRoomDescription", true)
35119
- __TS__Decorate({Exported}, RoomHistory.prototype, "isLeavingRoom", true)
35120
35201
  return ____exports
35121
35202
  end,
35122
35203
  ["src.enums.SaveDataKey"] = function(...)
@@ -44422,8 +44503,6 @@ local ____types = require("src.functions.types")
44422
44503
  local isNumber = ____types.isNumber
44423
44504
  local isString = ____types.isString
44424
44505
  local isTable = ____types.isTable
44425
- local ____utils = require("src.functions.utils")
44426
- local printConsole = ____utils.printConsole
44427
44506
  function copiedObjectIsTable(self)
44428
44507
  local oldObject = {abc = "def"}
44429
44508
  local newObject = deepCopy(nil, oldObject, SerializationType.NONE, "copiedObjectIsTable")
@@ -44755,7 +44834,7 @@ function ____exports.runDeepCopyTests(self)
44755
44834
  copiedSerializedDefaultMapHasNumberKey(nil)
44756
44835
  local successText = "All deep copy tests passed!"
44757
44836
  log(nil, successText)
44758
- printConsole(nil, successText)
44837
+ print(successText)
44759
44838
  end
44760
44839
  return ____exports
44761
44840
  end,
@@ -45063,8 +45142,6 @@ local ____SerializationType = require("src.enums.SerializationType")
45063
45142
  local SerializationType = ____SerializationType.SerializationType
45064
45143
  local ____deepCopy = require("src.functions.deepCopy")
45065
45144
  local deepCopy = ____deepCopy.deepCopy
45066
- local ____log = require("src.functions.log")
45067
- local log = ____log.log
45068
45145
  local ____merge = require("src.functions.merge")
45069
45146
  local merge = ____merge.merge
45070
45147
  local ____rng = require("src.functions.rng")
@@ -45073,7 +45150,7 @@ local newRNG = ____rng.newRNG
45073
45150
  local ____serialization = require("src.functions.serialization")
45074
45151
  local isSerializedIsaacAPIClass = ____serialization.isSerializedIsaacAPIClass
45075
45152
  local ____utils = require("src.functions.utils")
45076
- local printConsole = ____utils.printConsole
45153
+ local logAndPrint = ____utils.logAndPrint
45077
45154
  local ____vector = require("src.functions.vector")
45078
45155
  local isVector = ____vector.isVector
45079
45156
  local serializeVector = ____vector.serializeVector
@@ -45305,8 +45382,7 @@ function ____exports.runMergeTests(self)
45305
45382
  oldTableHasRNG(nil)
45306
45383
  oldTableHasRNGSerialized(nil)
45307
45384
  local successText = "All merge tests passed!"
45308
- log(nil, successText)
45309
- printConsole(nil, successText)
45385
+ logAndPrint(nil, successText)
45310
45386
  end
45311
45387
  return ____exports
45312
45388
  end,
@@ -46424,8 +46500,6 @@ local getRoomData = ____roomData.getRoomData
46424
46500
  local getRoomDescriptor = ____roomData.getRoomDescriptor
46425
46501
  local ____rooms = require("src.functions.rooms")
46426
46502
  local changeRoom = ____rooms.changeRoom
46427
- local ____utils = require("src.functions.utils")
46428
- local printConsole = ____utils.printConsole
46429
46503
  local ____roomTypeNames = require("src.objects.roomTypeNames")
46430
46504
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
46431
46505
  local DEFAULT_MOVE_UNITS = 0.5
@@ -46434,7 +46508,7 @@ function ____exports.addHeart(self, params, healthType)
46434
46508
  if params ~= "" then
46435
46509
  local num = tonumber(params)
46436
46510
  if num == nil then
46437
- printConsole(nil, "That is an invalid amount of hearts to add.")
46511
+ print("That is an invalid amount of hearts to add.")
46438
46512
  return
46439
46513
  end
46440
46514
  numHearts = num
@@ -46465,31 +46539,31 @@ function ____exports.listEntities(self, params, includeBackgroundEffects)
46465
46539
  if params ~= "" then
46466
46540
  entityTypeFilter = tonumber(params)
46467
46541
  if entityTypeFilter == nil then
46468
- printConsole(nil, "That is an invalid entity type to filter by.")
46542
+ print("That is an invalid entity type to filter by.")
46469
46543
  return
46470
46544
  end
46471
46545
  end
46472
46546
  logAllEntities(nil, includeBackgroundEffects, entityTypeFilter)
46473
- printConsole(nil, "Logged the entities in the room to the \"log.txt\" file.")
46547
+ print("Logged the entities in the room to the \"log.txt\" file.")
46474
46548
  end
46475
46549
  function ____exports.listGridEntities(self, params, includeWalls)
46476
46550
  local gridEntityTypeFilter
46477
46551
  if params ~= "" then
46478
46552
  gridEntityTypeFilter = tonumber(params)
46479
46553
  if gridEntityTypeFilter == nil then
46480
- printConsole(nil, "That is an invalid grid entity type to filter by.")
46554
+ print("That is an invalid grid entity type to filter by.")
46481
46555
  return
46482
46556
  end
46483
46557
  end
46484
46558
  logAllGridEntities(nil, includeWalls, gridEntityTypeFilter)
46485
- printConsole(nil, "Logged the grid entities in the room to the \"log.txt\" file.")
46559
+ print("Logged the grid entities in the room to the \"log.txt\" file.")
46486
46560
  end
46487
46561
  function ____exports.movePlayer(self, params, direction)
46488
46562
  local amount = DEFAULT_MOVE_UNITS
46489
46563
  if params ~= "" then
46490
46564
  local num = tonumber(params)
46491
46565
  if num == nil then
46492
- printConsole(nil, "That is an invalid amount of units to move.")
46566
+ print("That is an invalid amount of units to move.")
46493
46567
  return
46494
46568
  end
46495
46569
  amount = num
@@ -46512,21 +46586,18 @@ function ____exports.warpToRoomType(self, roomType)
46512
46586
  local gridIndexes = getRoomGridIndexesForType(nil, roomType)
46513
46587
  local firstGridIndex = gridIndexes[1]
46514
46588
  if firstGridIndex == nil then
46515
- printConsole(nil, ("There are no " .. roomTypeName) .. "s on this floor.")
46589
+ print(("There are no " .. roomTypeName) .. "s on this floor.")
46516
46590
  return
46517
46591
  end
46518
46592
  changeRoom(nil, firstGridIndex)
46519
- printConsole(
46520
- nil,
46521
- ((("Warped to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")"
46522
- )
46593
+ print(((("Warped to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")")
46523
46594
  end
46524
46595
  function ____exports.warpNextToRoomType(self, roomType)
46525
46596
  local roomTypeName = ROOM_TYPE_NAMES[roomType]
46526
46597
  local gridIndexes = getRoomGridIndexesForType(nil, roomType)
46527
46598
  local firstGridIndex = gridIndexes[1]
46528
46599
  if firstGridIndex == nil then
46529
- printConsole(nil, ("There are no " .. roomTypeName) .. "s on this floor.")
46600
+ print(("There are no " .. roomTypeName) .. "s on this floor.")
46530
46601
  return
46531
46602
  end
46532
46603
  local adjacentRoomGridIndexes = getRoomAdjacentGridIndexes(nil, firstGridIndex)
@@ -46536,17 +46607,11 @@ function ____exports.warpNextToRoomType(self, roomType)
46536
46607
  local roomData = getRoomData(nil, roomGridIndex)
46537
46608
  if roomData ~= nil and roomData.Type == RoomType.DEFAULT then
46538
46609
  changeRoom(nil, roomGridIndex)
46539
- printConsole(
46540
- nil,
46541
- ((("Warped next to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")"
46542
- )
46610
+ print(((("Warped next to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")")
46543
46611
  return
46544
46612
  end
46545
46613
  end
46546
- printConsole(
46547
- nil,
46548
- ((("Failed to find the room next to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")"
46549
- )
46614
+ print(((("Failed to find the room next to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")")
46550
46615
  end
46551
46616
  return ____exports
46552
46617
  end,
@@ -46679,7 +46744,6 @@ local asCollectibleType = ____types.asCollectibleType
46679
46744
  local asTrinketType = ____types.asTrinketType
46680
46745
  local ____utils = require("src.functions.utils")
46681
46746
  local iRange = ____utils.iRange
46682
- local printConsole = ____utils.printConsole
46683
46747
  local printEnabled = ____utils.printEnabled
46684
46748
  local ____cardNameToTypeMap = require("src.maps.cardNameToTypeMap")
46685
46749
  local CARD_NAME_TO_TYPE_MAP = ____cardNameToTypeMap.CARD_NAME_TO_TYPE_MAP
@@ -46735,14 +46799,14 @@ function ____exports.oneHP(self)
46735
46799
  for ____, npc in ipairs(getNPCs(nil)) do
46736
46800
  npc.HitPoints = 1
46737
46801
  end
46738
- printConsole(nil, "Set every NPC to 1 HP.")
46802
+ print("Set every NPC to 1 HP.")
46739
46803
  end
46740
46804
  function ____exports.poopMana(self, params)
46741
46805
  local charges = 1
46742
46806
  if params ~= "" then
46743
46807
  local num = tonumber(params)
46744
46808
  if num == nil then
46745
- printConsole(nil, "That is an invalid amount of mana to add.")
46809
+ print("That is an invalid amount of mana to add.")
46746
46810
  return
46747
46811
  end
46748
46812
  charges = num
@@ -46753,7 +46817,7 @@ end
46753
46817
  function ____exports.sound(self, params)
46754
46818
  local soundEffect = tonumber(params)
46755
46819
  if soundEffect == nil then
46756
- printConsole(nil, "That is an invalid sound effect ID.")
46820
+ print("That is an invalid sound effect ID.")
46757
46821
  return
46758
46822
  end
46759
46823
  sfxManager:Play(soundEffect)
@@ -46765,35 +46829,29 @@ function ____exports.startingRoom(self)
46765
46829
  end
46766
46830
  function ____exports.addCharges(self, params)
46767
46831
  if params == "" then
46768
- 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.)")
46832
+ 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.)")
46769
46833
  return
46770
46834
  end
46771
46835
  local args = __TS__StringSplit(params, " ")
46772
46836
  if #args ~= 1 and #args ~= 2 then
46773
- printConsole(nil, "That is an invalid amount of arguments.")
46837
+ print("That is an invalid amount of arguments.")
46774
46838
  return
46775
46839
  end
46776
46840
  local activeSlotString, numChargeString = table.unpack(args)
46777
46841
  local activeSlot = tonumber(activeSlotString)
46778
46842
  if activeSlot == nil then
46779
- printConsole(
46780
- nil,
46781
- "The provided slot number is invalid: " .. tostring(activeSlotString)
46782
- )
46843
+ print("The provided slot number is invalid: " .. tostring(activeSlotString))
46783
46844
  return
46784
46845
  end
46785
46846
  if activeSlot < ActiveSlot.PRIMARY or activeSlot > ActiveSlot.POCKET_SINGLE_USE then
46786
- printConsole(
46787
- nil,
46788
- "The provided slot number is invalid: " .. tostring(activeSlot)
46789
- )
46847
+ print("The provided slot number is invalid: " .. tostring(activeSlot))
46790
46848
  return
46791
46849
  end
46792
46850
  local numCharges = 1
46793
46851
  if numChargeString ~= nil then
46794
46852
  local numChargesAttempt = tonumber(numChargeString)
46795
46853
  if numChargesAttempt == nil then
46796
- printConsole(nil, "The provided charge amount is invalid: " .. numChargeString)
46854
+ print("The provided charge amount is invalid: " .. numChargeString)
46797
46855
  return
46798
46856
  end
46799
46857
  numCharges = numChargesAttempt
@@ -46807,7 +46865,7 @@ end
46807
46865
  function ____exports.ascent(self)
46808
46866
  game:SetStateFlag(GameStateFlag.BACKWARDS_PATH_INIT, true)
46809
46867
  game:SetStateFlag(GameStateFlag.BACKWARDS_PATH, true)
46810
- printConsole(nil, "Set Ascent flags.")
46868
+ print("Set Ascent flags.")
46811
46869
  end
46812
46870
  function ____exports.bedroom(self)
46813
46871
  local cleanBedroomGridIndexes = getRoomGridIndexesForType(nil, RoomType.CLEAN_BEDROOM)
@@ -46820,7 +46878,7 @@ function ____exports.bedroom(self)
46820
46878
  warpToRoomType(nil, RoomType.DIRTY_BEDROOM)
46821
46879
  return
46822
46880
  end
46823
- printConsole(nil, "There are no Clean Bedrooms or Dirty Bedrooms on this floor.")
46881
+ print("There are no Clean Bedrooms or Dirty Bedrooms on this floor.")
46824
46882
  end
46825
46883
  function ____exports.blackHearts(self, params)
46826
46884
  addHeart(nil, params, HealthType.BLACK)
@@ -46837,7 +46895,7 @@ function ____exports.bloodCharges(self, params)
46837
46895
  if params ~= "" then
46838
46896
  local num = tonumber(params)
46839
46897
  if num == nil then
46840
- printConsole(nil, "That is an invalid amount of charges to add.")
46898
+ print("That is an invalid amount of charges to add.")
46841
46899
  return
46842
46900
  end
46843
46901
  charges = num
@@ -46853,7 +46911,7 @@ function ____exports.bomb(self, params)
46853
46911
  if params ~= "" then
46854
46912
  local num = tonumber(params)
46855
46913
  if num == nil then
46856
- printConsole(nil, "That is an invalid amount of bombs to add.")
46914
+ print("That is an invalid amount of bombs to add.")
46857
46915
  return
46858
46916
  end
46859
46917
  numBombs = num
@@ -46866,7 +46924,7 @@ function ____exports.bombs(self, params)
46866
46924
  if params ~= "" then
46867
46925
  local num = tonumber(params)
46868
46926
  if num == nil then
46869
- printConsole(nil, "That is an invalid amount of bombs to add.")
46927
+ print("That is an invalid amount of bombs to add.")
46870
46928
  return
46871
46929
  end
46872
46930
  numBombs = num
@@ -46891,7 +46949,7 @@ function ____exports.brokenHearts(self, params)
46891
46949
  end
46892
46950
  function ____exports.card(self, params)
46893
46951
  if params == "" then
46894
- printConsole(nil, "You must specify a card name or number.")
46952
+ print("You must specify a card name or number.")
46895
46953
  return
46896
46954
  end
46897
46955
  local cardType
@@ -46899,26 +46957,20 @@ function ____exports.card(self, params)
46899
46957
  if num == nil then
46900
46958
  local match = getMapPartialMatch(nil, params, CARD_NAME_TO_TYPE_MAP)
46901
46959
  if match == nil then
46902
- printConsole(nil, "Unknown card: " .. params)
46960
+ print("Unknown card: " .. params)
46903
46961
  return
46904
46962
  end
46905
46963
  cardType = match[2]
46906
46964
  else
46907
46965
  if num < FIRST_CARD_TYPE or num > LAST_VANILLA_CARD_TYPE then
46908
- printConsole(
46909
- nil,
46910
- "Invalid card sub-type: " .. tostring(num)
46911
- )
46966
+ print("Invalid card sub-type: " .. tostring(num))
46912
46967
  return
46913
46968
  end
46914
46969
  cardType = num
46915
46970
  end
46916
46971
  local cardName = getCardName(nil, cardType)
46917
46972
  Isaac.ExecuteCommand("g k" .. tostring(cardType))
46918
- printConsole(
46919
- nil,
46920
- ((("Gave card: " .. cardName) .. " (") .. tostring(cardType)) .. ")"
46921
- )
46973
+ print(((("Gave card: " .. cardName) .. " (") .. tostring(cardType)) .. ")")
46922
46974
  end
46923
46975
  function ____exports.cards(self)
46924
46976
  local cardType = FIRST_CARD_TYPE
@@ -46950,7 +47002,7 @@ function ____exports.cc(self)
46950
47002
  end
46951
47003
  function ____exports.character(self, params)
46952
47004
  if params == "" then
46953
- printConsole(nil, "You must specify a character name or number.")
47005
+ print("You must specify a character name or number.")
46954
47006
  return
46955
47007
  end
46956
47008
  local playerType
@@ -46958,26 +47010,20 @@ function ____exports.character(self, params)
46958
47010
  if num == nil then
46959
47011
  local match = getMapPartialMatch(nil, params, CHARACTER_NAME_TO_TYPE_MAP)
46960
47012
  if match == nil then
46961
- printConsole(nil, "Unknown character: " .. params)
47013
+ print("Unknown character: " .. params)
46962
47014
  return
46963
47015
  end
46964
47016
  playerType = match[2]
46965
47017
  else
46966
47018
  if num < FIRST_CHARACTER or num > LAST_VANILLA_CHARACTER then
46967
- printConsole(
46968
- nil,
46969
- "Invalid player sub-type: " .. tostring(num)
46970
- )
47019
+ print("Invalid player sub-type: " .. tostring(num))
46971
47020
  return
46972
47021
  end
46973
47022
  playerType = num
46974
47023
  end
46975
47024
  local characterName = getCharacterName(nil, playerType)
46976
47025
  restart(nil, playerType)
46977
- printConsole(
46978
- nil,
46979
- ((("Restarting as character: " .. characterName) .. " (") .. tostring(playerType)) .. ")"
46980
- )
47026
+ print(((("Restarting as character: " .. characterName) .. " (") .. tostring(playerType)) .. ")")
46981
47027
  end
46982
47028
  function ____exports.charge(self, params)
46983
47029
  ____exports.addCharges(nil, params)
@@ -46990,7 +47036,7 @@ function ____exports.coin(self, params)
46990
47036
  if params ~= "" then
46991
47037
  local num = tonumber(params)
46992
47038
  if num == nil then
46993
- printConsole(nil, "That is an invalid amount of coins to add.")
47039
+ print("That is an invalid amount of coins to add.")
46994
47040
  return
46995
47041
  end
46996
47042
  numCoins = num
@@ -47003,7 +47049,7 @@ function ____exports.coins(self, params)
47003
47049
  if params ~= "" then
47004
47050
  local num = tonumber(params)
47005
47051
  if num == nil then
47006
- printConsole(nil, "That is an invalid amount of coins to add.")
47052
+ print("That is an invalid amount of coins to add.")
47007
47053
  return
47008
47054
  end
47009
47055
  numCoins = num
@@ -47035,7 +47081,7 @@ function ____exports.damage(self, params)
47035
47081
  if params ~= "" then
47036
47082
  local num = tonumber(params)
47037
47083
  if num == nil then
47038
- printConsole(nil, "The provided damage amount is invalid: " .. params)
47084
+ print("The provided damage amount is invalid: " .. params)
47039
47085
  return
47040
47086
  end
47041
47087
  v.persistent.damageAmount = num
@@ -47073,7 +47119,7 @@ end
47073
47119
  function ____exports.effects(self)
47074
47120
  local player = Isaac.GetPlayer()
47075
47121
  logPlayerEffects(nil, player)
47076
- printConsole(nil, "Logged the player's effects to the \"log.txt\" file.")
47122
+ print("Logged the player's effects to the \"log.txt\" file.")
47077
47123
  end
47078
47124
  function ____exports.errorRoom(self)
47079
47125
  ____exports.iAmErrorRoom(nil)
@@ -47106,32 +47152,26 @@ function ____exports.getChallenge(self)
47106
47152
  local challenge = Isaac.GetChallenge()
47107
47153
  local challengeName = Challenge[challenge]
47108
47154
  local challengeDescription = challengeName == nil and tostring(challenge) .. " (custom)" or ((("Challenge." .. challengeName) .. " (") .. tostring(challenge)) .. ")"
47109
- printConsole(nil, "The current challenge is: " .. challengeDescription)
47155
+ print("The current challenge is: " .. challengeDescription)
47110
47156
  end
47111
47157
  function ____exports.getCharge(self, params)
47112
47158
  local activeSlot = ActiveSlot.PRIMARY
47113
47159
  if params ~= "" then
47114
47160
  local num = tonumber(params)
47115
47161
  if num == nil then
47116
- printConsole(nil, "The provided slot number is invalid: " .. params)
47162
+ print("The provided slot number is invalid: " .. params)
47117
47163
  return
47118
47164
  end
47119
47165
  activeSlot = num
47120
47166
  end
47121
47167
  local player = Isaac.GetPlayer()
47122
47168
  local totalCharge = getTotalCharge(nil, player, activeSlot)
47123
- printConsole(
47124
- nil,
47125
- (((("Total charge for ActiveSlot." .. ActiveSlot[activeSlot]) .. " (") .. tostring(activeSlot)) .. ") is: ") .. tostring(totalCharge)
47126
- )
47169
+ print((((("Total charge for ActiveSlot." .. ActiveSlot[activeSlot]) .. " (") .. tostring(activeSlot)) .. ") is: ") .. tostring(totalCharge))
47127
47170
  end
47128
47171
  function ____exports.getPosition(self)
47129
47172
  for ____, player in ipairs(getPlayers(nil)) do
47130
47173
  local playerName = getPlayerName(nil, player)
47131
- printConsole(
47132
- nil,
47133
- ((((("Player position for " .. playerName) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")"
47134
- )
47174
+ print(((((("Player position for " .. playerName) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")")
47135
47175
  end
47136
47176
  end
47137
47177
  function ____exports.giant(self)
@@ -47143,7 +47183,7 @@ function ____exports.gigaBomb(self, params)
47143
47183
  if params ~= "" then
47144
47184
  local num = tonumber(params)
47145
47185
  if num == nil then
47146
- printConsole(nil, "That is an invalid amount of Giga Bombs to add.")
47186
+ print("That is an invalid amount of Giga Bombs to add.")
47147
47187
  return
47148
47188
  end
47149
47189
  numBombs = num
@@ -47204,7 +47244,7 @@ function ____exports.key(self, params)
47204
47244
  if params ~= "" then
47205
47245
  local num = tonumber(params)
47206
47246
  if num == nil then
47207
- printConsole(nil, "That is an invalid amount of keys to add.")
47247
+ print("That is an invalid amount of keys to add.")
47208
47248
  return
47209
47249
  end
47210
47250
  numKeys = num
@@ -47217,7 +47257,7 @@ function ____exports.keys(self, params)
47217
47257
  if params ~= "" then
47218
47258
  local num = tonumber(params)
47219
47259
  if num == nil then
47220
- printConsole(nil, "That is an invalid amount of keys to add.")
47260
+ print("That is an invalid amount of keys to add.")
47221
47261
  return
47222
47262
  end
47223
47263
  numKeys = num
@@ -47284,7 +47324,7 @@ function ____exports.noCurses(self)
47284
47324
  end
47285
47325
  function ____exports.pill(self, params)
47286
47326
  if params == "" then
47287
- printConsole(nil, "You must specify a pill name or number.")
47327
+ print("You must specify a pill name or number.")
47288
47328
  return
47289
47329
  end
47290
47330
  local pillEffect
@@ -47292,26 +47332,20 @@ function ____exports.pill(self, params)
47292
47332
  if num == nil then
47293
47333
  local match = getMapPartialMatch(nil, params, PILL_NAME_TO_EFFECT_MAP)
47294
47334
  if match == nil then
47295
- printConsole(nil, "Unknown pill effect: " .. params)
47335
+ print("Unknown pill effect: " .. params)
47296
47336
  return
47297
47337
  end
47298
47338
  pillEffect = match[2]
47299
47339
  else
47300
47340
  if num < FIRST_PILL_EFFECT or num > LAST_VANILLA_PILL_EFFECT then
47301
- printConsole(
47302
- nil,
47303
- "Invalid pill effect ID: " .. tostring(num)
47304
- )
47341
+ print("Invalid pill effect ID: " .. tostring(num))
47305
47342
  return
47306
47343
  end
47307
47344
  pillEffect = num
47308
47345
  end
47309
47346
  local pillEffectName = getPillEffectName(nil, pillEffect)
47310
47347
  Isaac.ExecuteCommand("g p" .. tostring(pillEffect))
47311
- printConsole(
47312
- nil,
47313
- ((("Gave pill: " .. pillEffectName) .. " (") .. tostring(pillEffect)) .. ")"
47314
- )
47348
+ print(((("Gave pill: " .. pillEffectName) .. " (") .. tostring(pillEffect)) .. ")")
47315
47349
  end
47316
47350
  function ____exports.pills(self)
47317
47351
  local pillColor = FIRST_PILL_COLOR
@@ -47342,16 +47376,16 @@ function ____exports.playSound(self, params)
47342
47376
  end
47343
47377
  function ____exports.pocket(self, params)
47344
47378
  if params == "" then
47345
- printConsole(nil, "You must supply a collectible type to put as the pocket item.")
47379
+ print("You must supply a collectible type to put as the pocket item.")
47346
47380
  return
47347
47381
  end
47348
47382
  local collectibleType = tonumber(params)
47349
47383
  if collectibleType == nil then
47350
- printConsole(nil, "That is an invalid collectible type.")
47384
+ print("That is an invalid collectible type.")
47351
47385
  return
47352
47386
  end
47353
47387
  if not isValidCollectibleType(nil, collectibleType) then
47354
- printConsole(nil, "That is an invalid collectible type.")
47388
+ print("That is an invalid collectible type.")
47355
47389
  return
47356
47390
  end
47357
47391
  local player = Isaac.GetPlayer()
@@ -47371,7 +47405,7 @@ function ____exports.right(self, params)
47371
47405
  end
47372
47406
  function ____exports.room(self)
47373
47407
  logRoom(nil)
47374
- printConsole(nil, "Logged room information to the \"log.txt\" file.")
47408
+ print("Logged room information to the \"log.txt\" file.")
47375
47409
  end
47376
47410
  function ____exports.rottenHearts(self, params)
47377
47411
  addHeart(nil, params, HealthType.ROTTEN)
@@ -47382,7 +47416,7 @@ function ____exports.runTests(self)
47382
47416
  end
47383
47417
  function ____exports.s(self, params)
47384
47418
  if params == "" then
47385
- printConsole(nil, "You must specify a stage number.")
47419
+ print("You must specify a stage number.")
47386
47420
  return
47387
47421
  end
47388
47422
  local finalCharacter = string.sub(params, -1)
@@ -47397,17 +47431,11 @@ function ____exports.s(self, params)
47397
47431
  end
47398
47432
  local stage = tonumber(stageString)
47399
47433
  if stage == nil then
47400
- printConsole(
47401
- nil,
47402
- "That is an invalid stage number: " .. tostring(stage)
47403
- )
47434
+ print("That is an invalid stage number: " .. tostring(stage))
47404
47435
  return
47405
47436
  end
47406
47437
  if stage < FIRST_STAGE or stage > LAST_STAGE then
47407
- printConsole(
47408
- nil,
47409
- ((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(LAST_STAGE)) .. "."
47410
- )
47438
+ print(((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(LAST_STAGE)) .. ".")
47411
47439
  return
47412
47440
  end
47413
47441
  Isaac.ExecuteCommand(("stage " .. tostring(stage)) .. stageTypeLetter)
@@ -47428,52 +47456,40 @@ function ____exports.seedStick(self)
47428
47456
  end
47429
47457
  function ____exports.seeds(self)
47430
47458
  logSeedEffects(nil)
47431
- printConsole(nil, "Logged the seed effects to the \"log.txt\" file.")
47459
+ print("Logged the seed effects to the \"log.txt\" file.")
47432
47460
  end
47433
47461
  function ____exports.setCharges(self, params)
47434
47462
  if params == "" then
47435
- 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.)")
47463
+ 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.)")
47436
47464
  return
47437
47465
  end
47438
47466
  local args = __TS__StringSplit(params, " ")
47439
47467
  if #args == 1 then
47440
- printConsole(nil, "You must specify the amount of charge to set.")
47468
+ print("You must specify the amount of charge to set.")
47441
47469
  return
47442
47470
  end
47443
47471
  if #args ~= 2 then
47444
- printConsole(nil, "That is an invalid amount of arguments.")
47472
+ print("That is an invalid amount of arguments.")
47445
47473
  return
47446
47474
  end
47447
47475
  local activeSlotString, chargeString = table.unpack(args)
47448
47476
  local activeSlot = tonumber(activeSlotString)
47449
47477
  if activeSlot == nil then
47450
- printConsole(
47451
- nil,
47452
- "The provided slot number is invalid: " .. tostring(activeSlotString)
47453
- )
47478
+ print("The provided slot number is invalid: " .. tostring(activeSlotString))
47454
47479
  return
47455
47480
  end
47456
47481
  local activeSlots = getEnumValues(nil, ActiveSlot)
47457
47482
  if not __TS__ArrayIncludes(activeSlots, activeSlot) then
47458
- printConsole(
47459
- nil,
47460
- "The provided slot number is invalid: " .. tostring(activeSlot)
47461
- )
47483
+ print("The provided slot number is invalid: " .. tostring(activeSlot))
47462
47484
  return
47463
47485
  end
47464
47486
  local chargeNum = tonumber(chargeString)
47465
47487
  if chargeNum == nil then
47466
- printConsole(
47467
- nil,
47468
- "The provided charge amount is invalid: " .. tostring(chargeString)
47469
- )
47488
+ print("The provided charge amount is invalid: " .. tostring(chargeString))
47470
47489
  return
47471
47490
  end
47472
47491
  if chargeNum < 0 then
47473
- printConsole(
47474
- nil,
47475
- "The provided charge amount is invalid: " .. tostring(chargeNum)
47476
- )
47492
+ print("The provided charge amount is invalid: " .. tostring(chargeNum))
47477
47493
  return
47478
47494
  end
47479
47495
  local player = Isaac.GetPlayer()
@@ -47481,29 +47497,23 @@ function ____exports.setCharges(self, params)
47481
47497
  end
47482
47498
  function ____exports.setPosition(self, params)
47483
47499
  if params == "" then
47484
- printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
47500
+ print("You must specify a position. (e.g. \"setPosition 100 50\")")
47485
47501
  return
47486
47502
  end
47487
47503
  local args = __TS__StringSplit(params, " ")
47488
47504
  if #args ~= 2 then
47489
- printConsole(nil, "You must specify a position. (e.g. \"setPosition 100 50\")")
47505
+ print("You must specify a position. (e.g. \"setPosition 100 50\")")
47490
47506
  return
47491
47507
  end
47492
47508
  local xString, yString = table.unpack(args)
47493
47509
  local x = tonumber(xString)
47494
47510
  if x == nil then
47495
- printConsole(
47496
- nil,
47497
- "That is an invalid x value: " .. tostring(xString)
47498
- )
47511
+ print("That is an invalid x value: " .. tostring(xString))
47499
47512
  return
47500
47513
  end
47501
47514
  local y = tonumber(yString)
47502
47515
  if y == nil then
47503
- printConsole(
47504
- nil,
47505
- "That is an invalid y value: " .. tostring(yString)
47506
- )
47516
+ print("That is an invalid y value: " .. tostring(yString))
47507
47517
  return
47508
47518
  end
47509
47519
  local player = Isaac.GetPlayer()
@@ -47522,7 +47532,7 @@ function ____exports.soulCharges(self, params)
47522
47532
  if params ~= "" then
47523
47533
  local num = tonumber(params)
47524
47534
  if num == nil then
47525
- printConsole(nil, "That is an invalid amount of charges to add.")
47535
+ print("That is an invalid amount of charges to add.")
47526
47536
  return
47527
47537
  end
47528
47538
  charges = num
@@ -47535,7 +47545,7 @@ function ____exports.soulHearts(self, params)
47535
47545
  end
47536
47546
  function ____exports.sounds(self)
47537
47547
  logSounds(nil)
47538
- printConsole(nil, "Logged the currently playing sound effects to the \"log.txt\" file.")
47548
+ print("Logged the currently playing sound effects to the \"log.txt\" file.")
47539
47549
  end
47540
47550
  function ____exports.spam(self)
47541
47551
  v.persistent.spamBloodRights = not v.persistent.spamBloodRights
@@ -47543,7 +47553,7 @@ function ____exports.spam(self)
47543
47553
  end
47544
47554
  function ____exports.spawnCollectible(self, params)
47545
47555
  if params == "" then
47546
- printConsole(nil, "You must specify the name or number corresponding to the collectible type.")
47556
+ print("You must specify the name or number corresponding to the collectible type.")
47547
47557
  return
47548
47558
  end
47549
47559
  local collectibleTypeNumber = tonumber(params)
@@ -47551,7 +47561,7 @@ function ____exports.spawnCollectible(self, params)
47551
47561
  if collectibleTypeNumber == nil then
47552
47562
  local match = getMapPartialMatch(nil, params, COLLECTIBLE_NAME_TO_TYPE_MAP)
47553
47563
  if match == nil then
47554
- printConsole(nil, "Unknown collectible: " .. params)
47564
+ print("Unknown collectible: " .. params)
47555
47565
  return
47556
47566
  end
47557
47567
  collectibleType = match[2]
@@ -47564,7 +47574,7 @@ function ____exports.spawnCollectible(self, params)
47564
47574
  end
47565
47575
  function ____exports.spawnGoldenTrinket(self, params)
47566
47576
  if params == "" then
47567
- printConsole(nil, "You must specify the name or number corresponding to the trinket type.")
47577
+ print("You must specify the name or number corresponding to the trinket type.")
47568
47578
  return
47569
47579
  end
47570
47580
  local trinketTypeNumber = tonumber(params)
@@ -47572,7 +47582,7 @@ function ____exports.spawnGoldenTrinket(self, params)
47572
47582
  if trinketTypeNumber == nil then
47573
47583
  local match = getMapPartialMatch(nil, params, TRINKET_NAME_TO_TYPE_MAP)
47574
47584
  if match == nil then
47575
- printConsole(nil, "Unknown trinket: " .. params)
47585
+ print("Unknown trinket: " .. params)
47576
47586
  return
47577
47587
  end
47578
47588
  trinketType = match[2]
@@ -47586,7 +47596,7 @@ function ____exports.spawnGoldenTrinket(self, params)
47586
47596
  end
47587
47597
  function ____exports.spawnTrinket(self, params)
47588
47598
  if params == "" then
47589
- printConsole(nil, "You must specify the name or number corresponding to the trinket type.")
47599
+ print("You must specify the name or number corresponding to the trinket type.")
47590
47600
  return
47591
47601
  end
47592
47602
  local trinketTypeNumber = tonumber(params)
@@ -47594,7 +47604,7 @@ function ____exports.spawnTrinket(self, params)
47594
47604
  if trinketTypeNumber == nil then
47595
47605
  local match = getMapPartialMatch(nil, params, TRINKET_NAME_TO_TYPE_MAP)
47596
47606
  if match == nil then
47597
- printConsole(nil, "Unknown trinket: " .. params)
47607
+ print("Unknown trinket: " .. params)
47598
47608
  return
47599
47609
  end
47600
47610
  trinketType = match[2]
@@ -47610,7 +47620,7 @@ function ____exports.speed(self, params)
47610
47620
  if params ~= "" then
47611
47621
  local num = tonumber(params)
47612
47622
  if num == nil then
47613
- printConsole(nil, "The provided speed amount is invalid: " .. params)
47623
+ print("The provided speed amount is invalid: " .. params)
47614
47624
  return
47615
47625
  end
47616
47626
  v.persistent.damageAmount = num
@@ -47632,7 +47642,7 @@ function ____exports.tears(self, params)
47632
47642
  if params ~= "" then
47633
47643
  local num = tonumber(params)
47634
47644
  if num == nil then
47635
- printConsole(nil, "The provided tear delay amount is invalid: " .. params)
47645
+ print("The provided tear delay amount is invalid: " .. params)
47636
47646
  return
47637
47647
  end
47638
47648
  v.persistent.tearsAmount = num
@@ -47661,7 +47671,7 @@ function ____exports.unknown(self)
47661
47671
  end
47662
47672
  function ____exports.unseed(self)
47663
47673
  if not onSetSeed(nil) then
47664
- printConsole(nil, "You are not on a set seed, so you cannot unseed the run.")
47674
+ print("You are not on a set seed, so you cannot unseed the run.")
47665
47675
  return
47666
47676
  end
47667
47677
  setUnseeded(nil)
@@ -47672,7 +47682,7 @@ function ____exports.up(self, params)
47672
47682
  end
47673
47683
  function ____exports.warp(self, params)
47674
47684
  if params == "" then
47675
- printConsole(nil, "You must specify a room type name or number.")
47685
+ print("You must specify a room type name or number.")
47676
47686
  return
47677
47687
  end
47678
47688
  local roomType
@@ -47680,16 +47690,13 @@ function ____exports.warp(self, params)
47680
47690
  if num == nil then
47681
47691
  local match = getMapPartialMatch(nil, params, ROOM_NAME_TO_TYPE_MAP)
47682
47692
  if match == nil then
47683
- printConsole(nil, "Unknown room type: " .. params)
47693
+ print("Unknown room type: " .. params)
47684
47694
  return
47685
47695
  end
47686
47696
  roomType = match[2]
47687
47697
  else
47688
47698
  if num < FIRST_ROOM_TYPE or num > LAST_ROOM_TYPE then
47689
- printConsole(
47690
- nil,
47691
- "Invalid room type: " .. tostring(num)
47692
- )
47699
+ print("Invalid room type: " .. tostring(num))
47693
47700
  return
47694
47701
  end
47695
47702
  roomType = num
@@ -47724,7 +47731,6 @@ local ____map = require("src.functions.map")
47724
47731
  local getMapPartialMatch = ____map.getMapPartialMatch
47725
47732
  local ____utils = require("src.functions.utils")
47726
47733
  local isVanillaConsoleCommand = ____utils.isVanillaConsoleCommand
47727
- local printConsole = ____utils.printConsole
47728
47734
  local ____Feature = require("src.classes.private.Feature")
47729
47735
  local Feature = ____Feature.Feature
47730
47736
  local commands = require("src.classes.features.other.extraConsoleCommands.commands")
@@ -47804,11 +47810,11 @@ function ExtraConsoleCommands.prototype.____constructor(self)
47804
47810
  self.executeCmd = function(____, command, params)
47805
47811
  local resultTuple = getMapPartialMatch(nil, command, self.commandFunctionMap)
47806
47812
  if resultTuple == nil then
47807
- printConsole(nil, "That is an invalid console command.")
47813
+ print("That is an invalid console command.")
47808
47814
  return
47809
47815
  end
47810
47816
  local commandName, commandFunction = table.unpack(resultTuple)
47811
- printConsole(nil, "Command: " .. commandName)
47817
+ print("Command: " .. commandName)
47812
47818
  commandFunction(nil, params)
47813
47819
  end
47814
47820
  self.postFireTear = function(____, tear)
@@ -49227,6 +49233,8 @@ local ____PlayerCollectibleDetection = require("src.classes.features.callbackLog
49227
49233
  local PlayerCollectibleDetection = ____PlayerCollectibleDetection.PlayerCollectibleDetection
49228
49234
  local ____PlayerReorderedCallbacks = require("src.classes.features.callbackLogic.PlayerReorderedCallbacks")
49229
49235
  local PlayerReorderedCallbacks = ____PlayerReorderedCallbacks.PlayerReorderedCallbacks
49236
+ local ____SlotDestroyedDetection = require("src.classes.features.callbackLogic.SlotDestroyedDetection")
49237
+ local SlotDestroyedDetection = ____SlotDestroyedDetection.SlotDestroyedDetection
49230
49238
  local ____SlotRenderDetection = require("src.classes.features.callbackLogic.SlotRenderDetection")
49231
49239
  local SlotRenderDetection = ____SlotRenderDetection.SlotRenderDetection
49232
49240
  local ____SlotUpdateDetection = require("src.classes.features.callbackLogic.SlotUpdateDetection")
@@ -49385,6 +49393,7 @@ function ____exports.getFeatures(self, mod, callbacks)
49385
49393
  runInNFrames
49386
49394
  ),
49387
49395
  [ISCFeature.PLAYER_REORDERED_CALLBACKS] = __TS__New(PlayerReorderedCallbacks, callbacks[ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED], callbacks[ModCallbackCustom.POST_PLAYER_RENDER_REORDERED], callbacks[ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED]),
49396
+ [ISCFeature.SLOT_DESTROYED_DETECTION] = __TS__New(SlotDestroyedDetection, callbacks[ModCallbackCustom.POST_SLOT_DESTROYED], roomHistory),
49388
49397
  [ISCFeature.SLOT_RENDER_DETECTION] = __TS__New(SlotRenderDetection, callbacks[ModCallbackCustom.POST_SLOT_RENDER], callbacks[ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED]),
49389
49398
  [ISCFeature.SLOT_UPDATE_DETECTION] = __TS__New(SlotUpdateDetection, callbacks[ModCallbackCustom.POST_SLOT_INIT], callbacks[ModCallbackCustom.POST_SLOT_UPDATE]),
49390
49399
  [ISCFeature.CHARACTER_HEALTH_CONVERSION] = __TS__New(CharacterHealthConversion),
@@ -52075,6 +52084,14 @@ do
52075
52084
  end
52076
52085
  end
52077
52086
  end
52087
+ do
52088
+ local ____export = require("src.functions.slots")
52089
+ for ____exportKey, ____exportValue in pairs(____export) do
52090
+ if ____exportKey ~= "default" then
52091
+ ____exports[____exportKey] = ____exportValue
52092
+ end
52093
+ end
52094
+ end
52078
52095
  do
52079
52096
  local ____export = require("src.functions.sound")
52080
52097
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -53119,6 +53136,14 @@ do
53119
53136
  end
53120
53137
  end
53121
53138
  end
53139
+ do
53140
+ local ____export = require("src.functions.slots")
53141
+ for ____exportKey, ____exportValue in pairs(____export) do
53142
+ if ____exportKey ~= "default" then
53143
+ ____exports[____exportKey] = ____exportValue
53144
+ end
53145
+ end
53146
+ end
53122
53147
  do
53123
53148
  local ____export = require("src.functions.sound")
53124
53149
  for ____exportKey, ____exportValue in pairs(____export) do