isaacscript-common 20.12.2 → 20.12.3

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 (52) hide show
  1. package/dist/index.d.ts +44 -40
  2. package/dist/isaacscript-common.lua +262 -416
  3. package/dist/src/classes/ModFeature.lua +0 -4
  4. package/dist/src/classes/ModUpgradedBase.lua +3 -9
  5. package/dist/src/classes/callbacks/PostNewRoomEarly.lua +2 -2
  6. package/dist/src/classes/features/callbackLogic/CustomRevive.lua +2 -5
  7. package/dist/src/classes/features/other/CustomStages.lua +4 -16
  8. package/dist/src/classes/features/other/CustomTrapdoors.lua +1 -4
  9. package/dist/src/classes/features/other/DeployJSONRoom.lua +8 -14
  10. package/dist/src/classes/features/other/Pause.lua +2 -2
  11. package/dist/src/classes/features/other/TaintedLazarusPlayers.lua +1 -1
  12. package/dist/src/classes/features/other/customStages/utils.lua +4 -16
  13. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +4 -4
  14. package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +2 -2
  15. package/dist/src/classes/features/other/saveDataManager/loadFromDisk.lua +4 -7
  16. package/dist/src/classes/features/other/saveDataManager/restoreDefaults.lua +2 -2
  17. package/dist/src/classes/features/other/saveDataManager/saveToDisk.lua +1 -1
  18. package/dist/src/functions/benchmark.lua +2 -8
  19. package/dist/src/functions/debugFunctions.d.ts +2 -2
  20. package/dist/src/functions/debugFunctions.d.ts.map +1 -1
  21. package/dist/src/functions/debugFunctions.lua +4 -4
  22. package/dist/src/functions/deepCopy.lua +7 -7
  23. package/dist/src/functions/deepCopyTests.lua +1 -1
  24. package/dist/src/functions/globals.lua +3 -6
  25. package/dist/src/functions/hex.lua +4 -7
  26. package/dist/src/functions/jsonHelpers.lua +1 -1
  27. package/dist/src/functions/jsonRoom.lua +4 -16
  28. package/dist/src/functions/log.d.ts +8 -4
  29. package/dist/src/functions/log.d.ts.map +1 -1
  30. package/dist/src/functions/log.lua +18 -5
  31. package/dist/src/functions/logEntities.d.ts +8 -8
  32. package/dist/src/functions/logEntities.d.ts.map +1 -1
  33. package/dist/src/functions/logEntities.lua +24 -27
  34. package/dist/src/functions/logMisc.d.ts +26 -26
  35. package/dist/src/functions/logMisc.d.ts.map +1 -1
  36. package/dist/src/functions/logMisc.lua +114 -226
  37. package/dist/src/functions/merge.lua +6 -6
  38. package/dist/src/functions/run.lua +2 -5
  39. package/dist/src/functions/utils.d.ts.map +1 -1
  40. package/dist/src/functions/utils.lua +20 -1
  41. package/dist/src/lib/jsonLua.lua +16 -7
  42. package/dist/src/patchErrorFunctions.lua +1 -1
  43. package/package.json +1 -1
  44. package/src/classes/ModFeature.ts +0 -6
  45. package/src/classes/features/other/saveDataManager/saveToDisk.ts +3 -4
  46. package/src/functions/debugFunctions.ts +2 -2
  47. package/src/functions/deepCopy.ts +2 -0
  48. package/src/functions/log.ts +15 -4
  49. package/src/functions/logEntities.ts +14 -8
  50. package/src/functions/logMisc.ts +56 -39
  51. package/src/functions/utils.ts +30 -0
  52. package/src/lib/jsonLua.lua +16 -7
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.12.2
3
+ isaacscript-common 20.12.3
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -15561,7 +15561,7 @@ return ____exports
15561
15561
  end,
15562
15562
  ["src.functions.log"] = function(...)
15563
15563
  local ____exports = {}
15564
- function ____exports.getParentFunctionDescription(self, levels)
15564
+ function ____exports.getParentFunctionDescription(levels)
15565
15565
  if levels == nil then
15566
15566
  levels = 3
15567
15567
  end
@@ -15576,8 +15576,17 @@ function ____exports.getParentFunctionDescription(self, levels)
15576
15576
  end
15577
15577
  return nil
15578
15578
  end
15579
- function ____exports.log(self, msg)
15580
- local parentFunctionDescription = ____exports.getParentFunctionDescription(nil)
15579
+ function ____exports.log(msg, includeParentFunction)
15580
+ if includeParentFunction == nil then
15581
+ includeParentFunction = true
15582
+ end
15583
+ local ____includeParentFunction_0
15584
+ if includeParentFunction then
15585
+ ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
15586
+ else
15587
+ ____includeParentFunction_0 = nil
15588
+ end
15589
+ local parentFunctionDescription = ____includeParentFunction_0
15581
15590
  local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
15582
15591
  Isaac.DebugString(debugMsg)
15583
15592
  end
@@ -15639,7 +15648,7 @@ function ____exports.isVanillaConsoleCommand(self, commandName)
15639
15648
  return CONSOLE_COMMANDS_SET:has(commandName)
15640
15649
  end
15641
15650
  function ____exports.logAndPrint(self, msg)
15642
- log(nil, msg)
15651
+ log(msg)
15643
15652
  print(msg)
15644
15653
  end
15645
15654
  function ____exports.printEnabled(self, enabled, description)
@@ -15658,6 +15667,20 @@ end
15658
15667
  function ____exports.todo(self, ...)
15659
15668
  end
15660
15669
  function ____exports.twoDimensionalSort(self, array1, array2)
15670
+ local type1 = type(array1)
15671
+ local type2 = type(array2)
15672
+ if type1 ~= type2 then
15673
+ error(((((((("Failed to two-dimensional sort since the two elements were disparate types: " .. tostring(array1)) .. " & ") .. tostring(array2)) .. " (") .. type1) .. " & ") .. type2) .. ")")
15674
+ end
15675
+ if type1 == "string" or type1 == "number" then
15676
+ if array1 == array2 then
15677
+ return 0
15678
+ end
15679
+ return array1 < array2 and -1 or 1
15680
+ end
15681
+ if type1 ~= "table" then
15682
+ error("Failed to two-dimensional sort since the elements were not a string, number, or table.")
15683
+ end
15661
15684
  local firstElement1 = array1[1]
15662
15685
  local firstElement2 = array2[1]
15663
15686
  if firstElement1 == nil or firstElement1 == nil then
@@ -15666,6 +15689,11 @@ function ____exports.twoDimensionalSort(self, array1, array2)
15666
15689
  if firstElement2 == nil or firstElement2 == nil then
15667
15690
  error("Failed to two-dimensional sort since the first element of the second array was undefined.")
15668
15691
  end
15692
+ local elementType1 = type(firstElement1)
15693
+ local elementType2 = type(firstElement2)
15694
+ if elementType1 ~= elementType2 then
15695
+ error(((((((("Failed to two-dimensional sort since the first element of each array were disparate types: " .. tostring(firstElement1)) .. " & ") .. tostring(firstElement2)) .. " (") .. elementType1) .. " & ") .. elementType2) .. ")")
15696
+ end
15669
15697
  if firstElement1 == firstElement2 then
15670
15698
  return 0
15671
15699
  end
@@ -23729,7 +23757,7 @@ end
23729
23757
  function ____exports.restart(self, character)
23730
23758
  if character == nil then
23731
23759
  local command = "restart"
23732
- log(nil, "Restarting the run with a console command of: " .. command)
23760
+ log("Restarting the run with a console command of: " .. command)
23733
23761
  Isaac.ExecuteCommand(command)
23734
23762
  return
23735
23763
  end
@@ -23737,10 +23765,7 @@ function ____exports.restart(self, character)
23737
23765
  error(("Restarting as a character of " .. tostring(character)) .. " would crash the game.")
23738
23766
  end
23739
23767
  local command = "restart " .. tostring(character)
23740
- log(
23741
- nil,
23742
- (((("Restarting the run as PlayerType." .. PlayerType[character]) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command
23743
- )
23768
+ log((((("Restarting the run as PlayerType." .. PlayerType[character]) .. " (") .. tostring(character)) .. ") with a console command of: ") .. command)
23744
23769
  Isaac.ExecuteCommand(command)
23745
23770
  end
23746
23771
  function ____exports.setUnseeded(self)
@@ -27783,76 +27808,64 @@ local isTable = ____types.isTable
27783
27808
  local isUserdata = ____types.isUserdata
27784
27809
  local ____vector = require("src.functions.vector")
27785
27810
  local vectorToString = ____vector.vectorToString
27786
- function ____exports.logFlags(self, flags, flagEnum, description)
27811
+ function ____exports.logFlags(flags, flagEnum, description)
27787
27812
  if description == nil then
27788
27813
  description = ""
27789
27814
  end
27790
27815
  if description ~= "" then
27791
27816
  description = "flag"
27792
27817
  end
27793
- log(
27794
- nil,
27795
- (("Logging " .. description) .. " values for: ") .. tostring(flags)
27796
- )
27818
+ log((("Logging " .. description) .. " values for: ") .. tostring(flags))
27797
27819
  local hasNoFlags = true
27798
27820
  for ____, ____value in ipairs(getEnumEntries(nil, flagEnum)) do
27799
27821
  local key = ____value[1]
27800
27822
  local value = ____value[2]
27801
27823
  if hasFlag(nil, flags, value) then
27802
- log(
27803
- nil,
27804
- (((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")"
27805
- )
27824
+ log((((" Has flag: " .. key) .. " (") .. tostring(value)) .. ")")
27806
27825
  hasNoFlags = false
27807
27826
  end
27808
27827
  end
27809
27828
  if hasNoFlags then
27810
- log(nil, " n/a (no flags)")
27829
+ log(" n/a (no flags)")
27811
27830
  end
27812
27831
  end
27813
- function ____exports.logArray(self, array)
27832
+ function ____exports.logArray(array)
27814
27833
  if not isArray(nil, array, false) then
27815
- log(nil, "Tried to log an array, but the given object was not an array.")
27834
+ log("Tried to log an array, but the given object was not an array.")
27816
27835
  return
27817
27836
  end
27818
27837
  local arrayString = arrayToString(nil, array)
27819
- log(nil, "Array: " .. arrayString)
27838
+ log("Array: " .. arrayString)
27820
27839
  end
27821
- function ____exports.logCollectibleTypes(self, collectibleTypes)
27822
- log(nil, "Collectibles:")
27840
+ function ____exports.logCollectibleTypes(collectibleTypes)
27841
+ log("Collectibles:")
27823
27842
  local i = 1
27824
27843
  for ____, collectibleType in ipairs(collectibleTypes) do
27825
27844
  local collectibleName = getCollectibleName(nil, collectibleType)
27826
- log(
27827
- nil,
27828
- ((((tostring(i) .. ") ") .. collectibleName) .. " (") .. tostring(collectibleType)) .. ")"
27829
- )
27845
+ log(((((tostring(i) .. ") ") .. collectibleName) .. " (") .. tostring(collectibleType)) .. ")")
27830
27846
  i = i + 1
27831
27847
  end
27832
27848
  end
27833
- function ____exports.logColor(self, color)
27834
- log(
27835
- nil,
27836
- (((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO)
27837
- )
27849
+ function ____exports.logColor(color)
27850
+ log((((((((((((("Color: R" .. tostring(color.R)) .. ", G") .. tostring(color.G)) .. ", B") .. tostring(color.B)) .. ", A") .. tostring(color.A)) .. ", RO") .. tostring(color.RO)) .. ", BO") .. tostring(color.BO)) .. ", GO") .. tostring(color.GO))
27838
27851
  end
27839
- function ____exports.logDamageFlags(self, flags)
27840
- ____exports.logFlags(nil, flags, DamageFlag, "damage")
27852
+ function ____exports.logDamageFlags(flags)
27853
+ ____exports.logFlags(flags, DamageFlag, "damage")
27841
27854
  end
27842
- function ____exports.logEntityFlags(self, flags)
27843
- ____exports.logFlags(nil, flags, EntityFlag, "entity")
27855
+ function ____exports.logEntityFlags(flags)
27856
+ ____exports.logFlags(flags, EntityFlag, "entity")
27844
27857
  end
27845
- function ____exports.logEntityID(self, entity)
27858
+ function ____exports.logEntityID(entity)
27846
27859
  local entityID = getEntityID(nil, entity)
27847
- log(nil, "Entity: " .. entityID)
27860
+ log("Entity: " .. entityID)
27848
27861
  end
27849
- function ____exports.logError(self, msg)
27862
+ function ____exports.logError(msg)
27850
27863
  local errorMsg = "Error: " .. msg
27851
- log(nil, errorMsg)
27864
+ log(errorMsg)
27852
27865
  print(errorMsg)
27853
27866
  end
27854
- function ____exports.logGameStateFlags(self)
27855
- log(nil, "Logging game state flags:")
27867
+ function ____exports.logGameStateFlags()
27868
+ log("Logging game state flags:")
27856
27869
  local gameStateFlagEntries = getEnumEntries(nil, GameStateFlag)
27857
27870
  local hasNoFlags = true
27858
27871
  for ____, ____value in ipairs(gameStateFlagEntries) do
@@ -27860,69 +27873,54 @@ function ____exports.logGameStateFlags(self)
27860
27873
  local gameStateFlag = ____value[2]
27861
27874
  local flagValue = game:GetStateFlag(gameStateFlag)
27862
27875
  if flagValue then
27863
- log(
27864
- nil,
27865
- (((" Has flag: " .. key) .. " (") .. tostring(gameStateFlag)) .. ")"
27866
- )
27876
+ log((((" Has flag: " .. key) .. " (") .. tostring(gameStateFlag)) .. ")")
27867
27877
  hasNoFlags = false
27868
27878
  end
27869
27879
  end
27870
27880
  if hasNoFlags then
27871
- log(nil, " n/a (no flags)")
27881
+ log(" n/a (no flags)")
27872
27882
  end
27873
27883
  end
27874
- function ____exports.logKColor(self, kColor)
27875
- log(
27876
- nil,
27877
- (((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
27878
- )
27884
+ function ____exports.logKColor(kColor)
27885
+ log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
27879
27886
  end
27880
- function ____exports.logLevelStateFlags(self)
27887
+ function ____exports.logLevelStateFlags()
27881
27888
  local level = game:GetLevel()
27882
27889
  local levelStateFlagEntries = getEnumEntries(nil, LevelStateFlag)
27883
- log(nil, "Logging level state flags:")
27890
+ log("Logging level state flags:")
27884
27891
  local hasNoFlags = true
27885
27892
  for ____, ____value in ipairs(levelStateFlagEntries) do
27886
27893
  local key = ____value[1]
27887
27894
  local levelStateFlag = ____value[2]
27888
27895
  local flagValue = level:GetStateFlag(levelStateFlag)
27889
27896
  if flagValue then
27890
- log(
27891
- nil,
27892
- (((" Has flag: " .. key) .. " (") .. tostring(levelStateFlag)) .. ")"
27893
- )
27897
+ log((((" Has flag: " .. key) .. " (") .. tostring(levelStateFlag)) .. ")")
27894
27898
  hasNoFlags = false
27895
27899
  end
27896
27900
  end
27897
27901
  if hasNoFlags then
27898
- log(nil, " n/a (no flags)")
27902
+ log(" n/a (no flags)")
27899
27903
  end
27900
27904
  end
27901
- function ____exports.logMap(self, map)
27905
+ function ____exports.logMap(map)
27902
27906
  if not isTSTLMap(nil, map) and not isDefaultMap(nil, map) then
27903
- log(nil, "Tried to log a TSTL map, but the given object was not a TSTL map.")
27907
+ log("Tried to log a TSTL map, but the given object was not a TSTL map.")
27904
27908
  return
27905
27909
  end
27906
- log(nil, "Printing out a TSTL map:")
27910
+ log("Printing out a TSTL map:")
27907
27911
  local mapKeys = {__TS__Spread(map:keys())}
27908
27912
  __TS__ArraySort(mapKeys)
27909
27913
  for ____, key in ipairs(mapKeys) do
27910
27914
  local value = map:get(key)
27911
- log(
27912
- nil,
27913
- ((" " .. tostring(key)) .. " --> ") .. tostring(value)
27914
- )
27915
+ log(((" " .. tostring(key)) .. " --> ") .. tostring(value))
27915
27916
  end
27916
- log(
27917
- nil,
27918
- " The size of the map was: " .. tostring(map.size)
27919
- )
27917
+ log(" The size of the map was: " .. tostring(map.size))
27920
27918
  end
27921
- function ____exports.logPlayerEffects(self, player)
27919
+ function ____exports.logPlayerEffects(player)
27922
27920
  local effects = getEffectsList(nil, player)
27923
- log(nil, "Logging player effects:")
27921
+ log("Logging player effects:")
27924
27922
  if #effects == 0 then
27925
- log(nil, " n/a (no effects)")
27923
+ log(" n/a (no effects)")
27926
27924
  return
27927
27925
  end
27928
27926
  __TS__ArrayForEach(
@@ -27940,164 +27938,101 @@ function ____exports.logPlayerEffects(self, player)
27940
27938
  else
27941
27939
  effectDescription = "Unknown type of effect: " .. tostring(effect.Item.ID)
27942
27940
  end
27943
- log(
27944
- nil,
27945
- (((((" " .. tostring(i + 1)) .. ") ") .. effectDescription) .. " (x") .. tostring(effect.Count)) .. ")"
27946
- )
27941
+ log((((((" " .. tostring(i + 1)) .. ") ") .. effectDescription) .. " (x") .. tostring(effect.Count)) .. ")")
27947
27942
  end
27948
27943
  )
27949
27944
  end
27950
- function ____exports.logPlayerHealth(self, player)
27945
+ function ____exports.logPlayerHealth(player)
27951
27946
  local playerName = getPlayerName(nil, player)
27952
27947
  local playerHealth = getPlayerHealth(nil, player)
27953
- log(nil, ("Player health for " .. playerName) .. ":")
27954
- log(
27955
- nil,
27956
- " Max hearts: " .. tostring(playerHealth.maxHearts)
27957
- )
27958
- log(
27959
- nil,
27960
- " Hearts: " .. tostring(playerHealth.hearts)
27961
- )
27962
- log(
27963
- nil,
27964
- " Eternal hearts: " .. tostring(playerHealth.eternalHearts)
27965
- )
27966
- log(
27967
- nil,
27968
- " Soul hearts: " .. tostring(playerHealth.soulHearts)
27969
- )
27970
- log(
27971
- nil,
27972
- " Bone hearts: " .. tostring(playerHealth.boneHearts)
27973
- )
27974
- log(
27975
- nil,
27976
- " Golden hearts: " .. tostring(playerHealth.goldenHearts)
27977
- )
27978
- log(
27979
- nil,
27980
- " Rotten hearts: " .. tostring(playerHealth.rottenHearts)
27981
- )
27982
- log(
27983
- nil,
27984
- " Broken hearts: " .. tostring(playerHealth.brokenHearts)
27985
- )
27986
- log(
27987
- nil,
27988
- " Soul charges: " .. tostring(playerHealth.soulCharges)
27989
- )
27990
- log(
27991
- nil,
27992
- " Blood charges: " .. tostring(playerHealth.bloodCharges)
27993
- )
27994
- log(nil, " Soul heart types: [")
27948
+ log(("Player health for " .. playerName) .. ":")
27949
+ log(" Max hearts: " .. tostring(playerHealth.maxHearts))
27950
+ log(" Hearts: " .. tostring(playerHealth.hearts))
27951
+ log(" Eternal hearts: " .. tostring(playerHealth.eternalHearts))
27952
+ log(" Soul hearts: " .. tostring(playerHealth.soulHearts))
27953
+ log(" Bone hearts: " .. tostring(playerHealth.boneHearts))
27954
+ log(" Golden hearts: " .. tostring(playerHealth.goldenHearts))
27955
+ log(" Rotten hearts: " .. tostring(playerHealth.rottenHearts))
27956
+ log(" Broken hearts: " .. tostring(playerHealth.brokenHearts))
27957
+ log(" Soul charges: " .. tostring(playerHealth.soulCharges))
27958
+ log(" Blood charges: " .. tostring(playerHealth.bloodCharges))
27959
+ log(" Soul heart types: [")
27995
27960
  for ____, soulHeartType in ipairs(playerHealth.soulHeartTypes) do
27996
- log(nil, " HeartSubType." .. HeartSubType[soulHeartType])
27961
+ log(" HeartSubType." .. HeartSubType[soulHeartType])
27997
27962
  end
27998
- log(nil, " ]")
27963
+ log(" ]")
27999
27964
  end
28000
- function ____exports.logProjectileFlags(self, flags)
28001
- ____exports.logFlags(nil, flags, ProjectileFlag, "projectile")
27965
+ function ____exports.logProjectileFlags(flags)
27966
+ ____exports.logFlags(flags, ProjectileFlag, "projectile")
28002
27967
  end
28003
- function ____exports.logRoom(self)
27968
+ function ____exports.logRoom()
28004
27969
  local room = game:GetRoom()
28005
27970
  local bossID = room:GetBossID()
28006
27971
  local roomGridIndex = getRoomGridIndex(nil)
28007
27972
  local roomListIndex = getRoomListIndex(nil)
28008
27973
  local roomData = getRoomData(nil)
28009
- log(nil, "Current room information:")
27974
+ log("Current room information:")
28010
27975
  if roomData == nil then
28011
- log(nil, "- Room data is undefined.")
27976
+ log("- Room data is undefined.")
28012
27977
  else
28013
- log(
28014
- nil,
28015
- "- Room stage ID: " .. tostring(roomData.StageID)
28016
- )
28017
- log(
28018
- nil,
28019
- (((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype)
28020
- )
28021
- log(nil, "- Name: " .. roomData.Name)
27978
+ log("- Room stage ID: " .. tostring(roomData.StageID))
27979
+ log((((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
27980
+ log("- Name: " .. roomData.Name)
28022
27981
  end
28023
27982
  local roomGridIndexName = GridRoom[roomGridIndex]
28024
27983
  if roomGridIndexName == nil then
28025
- log(
28026
- nil,
28027
- "- Grid index: " .. tostring(roomGridIndex)
28028
- )
27984
+ log("- Grid index: " .. tostring(roomGridIndex))
28029
27985
  else
28030
- log(
28031
- nil,
28032
- ((("- Grid index: GridRoom." .. roomGridIndexName) .. " (") .. tostring(roomGridIndex)) .. ")"
28033
- )
27986
+ log(((("- Grid index: GridRoom." .. roomGridIndexName) .. " (") .. tostring(roomGridIndex)) .. ")")
28034
27987
  end
28035
- log(
28036
- nil,
28037
- "- List index: " .. tostring(roomListIndex)
28038
- )
28039
- log(
28040
- nil,
28041
- "- Boss ID: " .. tostring(bossID)
28042
- )
27988
+ log("- List index: " .. tostring(roomListIndex))
27989
+ log("- Boss ID: " .. tostring(bossID))
28043
27990
  end
28044
- function ____exports.logSeedEffects(self)
27991
+ function ____exports.logSeedEffects()
28045
27992
  local seeds = game:GetSeeds()
28046
27993
  local seedEffectEntries = getEnumEntries(nil, SeedEffect)
28047
- log(nil, "Logging seed effects:")
27994
+ log("Logging seed effects:")
28048
27995
  local hasNoSeedEffects = true
28049
27996
  for ____, ____value in ipairs(seedEffectEntries) do
28050
27997
  local key = ____value[1]
28051
27998
  local seedEffect = ____value[2]
28052
27999
  if seeds:HasSeedEffect(seedEffect) then
28053
- log(
28054
- nil,
28055
- (((" " .. key) .. " (") .. tostring(seedEffect)) .. ")"
28056
- )
28000
+ log((((" " .. key) .. " (") .. tostring(seedEffect)) .. ")")
28057
28001
  hasNoSeedEffects = false
28058
28002
  end
28059
28003
  end
28060
28004
  if hasNoSeedEffects then
28061
- log(nil, " n/a (no seed effects)")
28005
+ log(" n/a (no seed effects)")
28062
28006
  end
28063
28007
  end
28064
- function ____exports.logSet(self, set)
28008
+ function ____exports.logSet(set)
28065
28009
  if not isTSTLSet(nil, set) then
28066
- log(nil, "Tried to log a TSTL set, but the given object was not a TSTL set.")
28010
+ log("Tried to log a TSTL set, but the given object was not a TSTL set.")
28067
28011
  return
28068
28012
  end
28069
- log(nil, "Printing out a TSTL set:")
28013
+ log("Printing out a TSTL set:")
28070
28014
  local setValues = getSortedSetValues(nil, set)
28071
28015
  for ____, value in ipairs(setValues) do
28072
- log(
28073
- nil,
28074
- " Value: " .. tostring(value)
28075
- )
28016
+ log(" Value: " .. tostring(value))
28076
28017
  end
28077
- log(
28078
- nil,
28079
- " The size of the set was: " .. tostring(set.size)
28080
- )
28018
+ log(" The size of the set was: " .. tostring(set.size))
28081
28019
  end
28082
- function ____exports.logSounds(self)
28020
+ function ____exports.logSounds()
28083
28021
  local soundEffects = getEnumEntries(nil, SoundEffect)
28084
28022
  for ____, ____value in ipairs(soundEffects) do
28085
28023
  local key = ____value[1]
28086
28024
  local soundEffect = ____value[2]
28087
28025
  if sfxManager:IsPlaying(soundEffect) then
28088
- log(
28089
- nil,
28090
- ((("Currently playing sound effect: " .. key) .. " (") .. tostring(soundEffect)) .. ")"
28091
- )
28026
+ log(((("Currently playing sound effect: " .. key) .. " (") .. tostring(soundEffect)) .. ")")
28092
28027
  end
28093
28028
  end
28094
28029
  end
28095
- function ____exports.logTable(self, luaTable, parentTables)
28030
+ function ____exports.logTable(luaTable, parentTables)
28096
28031
  if parentTables == nil then
28097
28032
  parentTables = 0
28098
28033
  end
28099
28034
  if parentTables == 0 then
28100
- log(nil, "Printing out a Lua table:")
28035
+ log("Printing out a Lua table:", false)
28101
28036
  elseif parentTables > 10 then
28102
28037
  return
28103
28038
  end
@@ -28107,12 +28042,10 @@ function ____exports.logTable(self, luaTable, parentTables)
28107
28042
  math.floor(numSpaces)
28108
28043
  )
28109
28044
  if not isTable(nil, luaTable) then
28110
- (function(self)
28111
- log(
28112
- nil,
28113
- ((indentation .. "n/a (encountered a variable of type \"") .. __TS__TypeOf(luaTable)) .. "\" instead of a table)"
28114
- )
28115
- end)(nil)
28045
+ log(
28046
+ ((indentation .. "n/a (encountered a variable of type \"") .. __TS__TypeOf(luaTable)) .. "\" instead of a table)",
28047
+ false
28048
+ )
28116
28049
  return
28117
28050
  end
28118
28051
  local numElements = 0
@@ -28121,28 +28054,26 @@ function ____exports.logTable(self, luaTable, parentTables)
28121
28054
  luaTable,
28122
28055
  function(____, key, value)
28123
28056
  log(
28124
- nil,
28125
- ((indentation .. tostring(key)) .. " --> ") .. tostring(value)
28057
+ ((indentation .. tostring(key)) .. " --> ") .. tostring(value),
28058
+ false
28126
28059
  )
28127
28060
  if isTable(nil, value) then
28128
28061
  if key == "__class" then
28129
- log(nil, indentation .. " (skipping enumerating this key to avoid infinite recursion)")
28062
+ log(indentation .. " (skipping enumerating this key to avoid infinite recursion)", false)
28130
28063
  else
28131
- ____exports.logTable(nil, value, parentTables + 1)
28064
+ ____exports.logTable(value, parentTables + 1)
28132
28065
  end
28133
28066
  end
28134
28067
  numElements = numElements + 1
28135
28068
  end
28136
- );
28137
- (function(self)
28138
- log(
28139
- nil,
28140
- (indentation .. "The size of the table was: ") .. tostring(numElements)
28141
- )
28142
- end)(nil)
28069
+ )
28070
+ log(
28071
+ (indentation .. "The size of the table was: ") .. tostring(numElements),
28072
+ false
28073
+ )
28143
28074
  end
28144
- function ____exports.logTableDifferences(self, table1, table2)
28145
- log(nil, "Comparing two Lua tables:")
28075
+ function ____exports.logTableDifferences(table1, table2)
28076
+ log("Comparing two Lua tables:")
28146
28077
  local table1Keys = __TS__ObjectKeys(table1)
28147
28078
  local table1KeysSet = __TS__New(Set, table1Keys)
28148
28079
  local table2Keys = __TS__ObjectKeys(table2)
@@ -28152,34 +28083,22 @@ function ____exports.logTableDifferences(self, table1, table2)
28152
28083
  __TS__ArraySort(keys)
28153
28084
  for ____, key in ipairs(keys) do
28154
28085
  if not table1KeysSet:has(key) then
28155
- log(
28156
- nil,
28157
- " Table 1 is missing key: " .. tostring(key)
28158
- )
28086
+ log(" Table 1 is missing key: " .. tostring(key))
28159
28087
  elseif not table2KeysSet:has(key) then
28160
- log(
28161
- nil,
28162
- " Table 2 is missing key: " .. tostring(key)
28163
- )
28088
+ log(" Table 2 is missing key: " .. tostring(key))
28164
28089
  else
28165
28090
  local value1 = table1[key]
28166
28091
  local value2 = table2[key]
28167
28092
  if value1 ~= value2 then
28168
- log(
28169
- nil,
28170
- (((((" " .. tostring(key)) .. " --> \"") .. tostring(value1)) .. "\" versus \"") .. tostring(value2)) .. "\""
28171
- )
28093
+ log((((((" " .. tostring(key)) .. " --> \"") .. tostring(value1)) .. "\" versus \"") .. tostring(value2)) .. "\"")
28172
28094
  end
28173
28095
  end
28174
28096
  end
28175
28097
  end
28176
- function ____exports.logTableKeys(self, luaTable)
28177
- log(nil, "Printing out the keys of a Lua table:")
28098
+ function ____exports.logTableKeys(luaTable)
28099
+ log("Printing out the keys of a Lua table:")
28178
28100
  if not isTable(nil, luaTable) then
28179
- log(
28180
- nil,
28181
- (" n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)"
28182
- )
28101
+ log((" n/a (encountered a variable of type \"" .. __TS__TypeOf(luaTable)) .. "\" instead of a table)")
28183
28102
  return
28184
28103
  end
28185
28104
  local numElements = 0
@@ -28187,48 +28106,42 @@ function ____exports.logTableKeys(self, luaTable)
28187
28106
  nil,
28188
28107
  luaTable,
28189
28108
  function(____, key)
28190
- log(
28191
- nil,
28192
- tostring(key)
28193
- )
28109
+ log(tostring(key))
28194
28110
  numElements = numElements + 1
28195
28111
  end
28196
28112
  )
28197
- log(
28198
- nil,
28199
- " The size of the table was: " .. tostring(numElements)
28200
- )
28113
+ log(" The size of the table was: " .. tostring(numElements))
28201
28114
  end
28202
- function ____exports.logTearFlags(self, flags)
28203
- ____exports.logFlags(nil, flags, TearFlag, "tear")
28115
+ function ____exports.logTearFlags(flags)
28116
+ ____exports.logFlags(flags, TearFlag, "tear")
28204
28117
  end
28205
- function ____exports.logUseFlags(self, flags)
28206
- ____exports.logFlags(nil, flags, UseFlag, "use")
28118
+ function ____exports.logUseFlags(flags)
28119
+ ____exports.logFlags(flags, UseFlag, "use")
28207
28120
  end
28208
- function ____exports.logUserdata(self, userdata)
28121
+ function ____exports.logUserdata(userdata)
28209
28122
  if not isUserdata(nil, userdata) then
28210
- log(nil, "Userdata: [not userdata]")
28123
+ log("Userdata: [not userdata]")
28211
28124
  return
28212
28125
  end
28213
28126
  local metatable = getmetatable(userdata)
28214
28127
  if metatable == nil then
28215
- log(nil, "Userdata: [no metatable]")
28128
+ log("Userdata: [no metatable]")
28216
28129
  return
28217
28130
  end
28218
28131
  local classType = getIsaacAPIClassName(nil, userdata)
28219
28132
  if classType == nil then
28220
- log(nil, "Userdata: [no class type]")
28133
+ log("Userdata: [no class type]")
28221
28134
  else
28222
- log(nil, "Userdata: " .. classType)
28135
+ log("Userdata: " .. classType)
28223
28136
  end
28224
- ____exports.logTable(nil, metatable)
28137
+ ____exports.logTable(metatable)
28225
28138
  end
28226
- function ____exports.logVector(self, vector, round)
28139
+ function ____exports.logVector(vector, round)
28227
28140
  if round == nil then
28228
28141
  round = false
28229
28142
  end
28230
28143
  local vectorString = vectorToString(nil, vector, round)
28231
- log(nil, "Vector: " .. vectorString)
28144
+ log("Vector: " .. vectorString)
28232
28145
  end
28233
28146
  return ____exports
28234
28147
  end,
@@ -28280,14 +28193,14 @@ function PostNewRoomEarly.prototype.isNewRoom(self)
28280
28193
  if topLeftWall == nil then
28281
28194
  topLeftWall = spawnGridEntity(nil, GridEntityType.WALL, topLeftWallGridIndex)
28282
28195
  if topLeftWall == nil then
28283
- logError(nil, "Failed to spawn a new wall (1) for the POST_NEW_ROOM_EARLY callback.")
28196
+ logError("Failed to spawn a new wall (1) for the POST_NEW_ROOM_EARLY callback.")
28284
28197
  return false
28285
28198
  end
28286
28199
  end
28287
28200
  if topLeftWall2 == nil then
28288
28201
  topLeftWall2 = spawnGridEntity(nil, GridEntityType.WALL, rightOfTopWallGridIndex)
28289
28202
  if topLeftWall2 == nil then
28290
- logError(nil, "Failed to spawn a new wall (2) for the POST_NEW_ROOM_EARLY callback.")
28203
+ logError("Failed to spawn a new wall (2) for the POST_NEW_ROOM_EARLY callback.")
28291
28204
  return false
28292
28205
  end
28293
28206
  end
@@ -32273,16 +32186,13 @@ function CustomRevive.prototype.playerIsAboutToDie(self, player)
32273
32186
  if futurePlayer:IsDead() then
32274
32187
  return
32275
32188
  end
32276
- logError(nil, "The player is still alive after initializing a custom revive. Explicitly killing the player.")
32189
+ logError("The player is still alive after initializing a custom revive. Explicitly killing the player.")
32277
32190
  futurePlayer:Kill()
32278
32191
  end)
32279
32192
  end
32280
32193
  function CustomRevive.prototype.logStateChanged(self)
32281
32194
  if DEBUG then
32282
- log(
32283
- nil,
32284
- ((("Custom revive state changed: " .. CustomReviveState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")"
32285
- )
32195
+ log(((("Custom revive state changed: " .. CustomReviveState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")")
32286
32196
  end
32287
32197
  end
32288
32198
  return ____exports
@@ -35477,7 +35387,7 @@ function ____exports.deepCopy(self, value, serializationType, traversalDescripti
35477
35387
  logString = logString .. " (deserializing)"
35478
35388
  end
35479
35389
  logString = logString .. ": " .. tostring(value)
35480
- log(nil, logString)
35390
+ log(logString)
35481
35391
  end
35482
35392
  local valueType = type(value)
35483
35393
  repeat
@@ -35595,7 +35505,7 @@ function deepCopyTable(self, luaMap, serializationType, traversalDescription, cl
35595
35505
  end
35596
35506
  function deepCopyDefaultMap(self, defaultMap, serializationType, traversalDescription, classConstructors, insideMap)
35597
35507
  if SAVE_DATA_MANAGER_DEBUG then
35598
- log(nil, "deepCopy is copying a DefaultMap.")
35508
+ log("deepCopy is copying a DefaultMap.")
35599
35509
  end
35600
35510
  local ____isDefaultMap_result_0
35601
35511
  if isDefaultMap(nil, defaultMap) then
@@ -35690,7 +35600,7 @@ function getNewDefaultMap(self, defaultMap, serializationType, traversalDescript
35690
35600
  end
35691
35601
  function deepCopyMap(self, map, serializationType, traversalDescription, classConstructors, insideMap)
35692
35602
  if SAVE_DATA_MANAGER_DEBUG then
35693
- log(nil, "deepCopy is copying a Map.")
35603
+ log("deepCopy is copying a Map.")
35694
35604
  end
35695
35605
  local newMap
35696
35606
  if serializationType == SerializationType.SERIALIZE then
@@ -35731,7 +35641,7 @@ function deepCopyMap(self, map, serializationType, traversalDescription, classCo
35731
35641
  end
35732
35642
  function deepCopySet(self, set, serializationType, traversalDescription, classConstructors, insideMap)
35733
35643
  if SAVE_DATA_MANAGER_DEBUG then
35734
- log(nil, "deepCopy is copying a Set.")
35644
+ log("deepCopy is copying a Set.")
35735
35645
  end
35736
35646
  local newSet
35737
35647
  if serializationType == SerializationType.SERIALIZE then
@@ -35769,7 +35679,7 @@ function deepCopySet(self, set, serializationType, traversalDescription, classCo
35769
35679
  end
35770
35680
  function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescription, classConstructors, insideMap)
35771
35681
  if SAVE_DATA_MANAGER_DEBUG then
35772
- log(nil, "deepCopy is copying a TSTL class.")
35682
+ log("deepCopy is copying a TSTL class.")
35773
35683
  end
35774
35684
  local newClass
35775
35685
  repeat
@@ -35830,7 +35740,7 @@ function deepCopyTSTLClass(self, tstlClass, serializationType, traversalDescript
35830
35740
  end
35831
35741
  function deepCopyArray(self, array, serializationType, traversalDescription, classConstructors, insideMap)
35832
35742
  if SAVE_DATA_MANAGER_DEBUG then
35833
- log(nil, "deepCopy is copying an array.")
35743
+ log("deepCopy is copying an array.")
35834
35744
  end
35835
35745
  local newArray = {}
35836
35746
  for ____, value in ipairs(array) do
@@ -35848,7 +35758,7 @@ function deepCopyArray(self, array, serializationType, traversalDescription, cla
35848
35758
  end
35849
35759
  function deepCopyNormalLuaTable(self, luaMap, serializationType, traversalDescription, classConstructors, insideMap)
35850
35760
  if SAVE_DATA_MANAGER_DEBUG then
35851
- log(nil, "deepCopy is copying a normal Lua table.")
35761
+ log("deepCopy is copying a normal Lua table.")
35852
35762
  end
35853
35763
  local newTable = {}
35854
35764
  local ____getCopiedEntries_result_5 = getCopiedEntries(
@@ -36016,7 +35926,7 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription, clas
36016
35926
  classConstructors = {}
36017
35927
  end
36018
35928
  if SAVE_DATA_MANAGER_DEBUG then
36019
- log(nil, "merge is traversing: " .. traversalDescription)
35929
+ log("merge is traversing: " .. traversalDescription)
36020
35930
  end
36021
35931
  if not isTable(nil, oldObject) then
36022
35932
  error("The first argument given to the merge function is not a table.")
@@ -36054,7 +35964,7 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription, clas
36054
35964
  end
36055
35965
  function mergeSerializedArray(self, oldArray, newArray, traversalDescription, classConstructors)
36056
35966
  if SAVE_DATA_MANAGER_DEBUG then
36057
- log(nil, "merge encountered an array: " .. traversalDescription)
35967
+ log("merge encountered an array: " .. traversalDescription)
36058
35968
  end
36059
35969
  clearTable(nil, oldArray)
36060
35970
  iterateTableInOrder(
@@ -36075,7 +35985,7 @@ function mergeSerializedArray(self, oldArray, newArray, traversalDescription, cl
36075
35985
  end
36076
35986
  function mergeSerializedTSTLObject(self, oldObject, newTable, traversalDescription, classConstructors)
36077
35987
  if SAVE_DATA_MANAGER_DEBUG then
36078
- log(nil, "merge encountered a TSTL object: " .. traversalDescription)
35988
+ log("merge encountered a TSTL object: " .. traversalDescription)
36079
35989
  end
36080
35990
  oldObject:clear()
36081
35991
  local convertStringKeysToNumbers = newTable[SerializationBrand.OBJECT_WITH_NUMBER_KEYS] ~= nil
@@ -36112,7 +36022,7 @@ function mergeSerializedTSTLObject(self, oldObject, newTable, traversalDescripti
36112
36022
  end
36113
36023
  function mergeSerializedTable(self, oldTable, newTable, traversalDescription, classConstructors)
36114
36024
  if SAVE_DATA_MANAGER_DEBUG then
36115
- log(nil, "merge encountered a Lua table: " .. traversalDescription)
36025
+ log("merge encountered a Lua table: " .. traversalDescription)
36116
36026
  end
36117
36027
  iterateTableInOrder(
36118
36028
  nil,
@@ -36120,14 +36030,14 @@ function mergeSerializedTable(self, oldTable, newTable, traversalDescription, cl
36120
36030
  function(____, key, value)
36121
36031
  if SAVE_DATA_MANAGER_DEBUG then
36122
36032
  local valueToPrint = value == "" and "(empty string)" or tostring(value)
36123
- log(nil, (("merge is merging: " .. traversalDescription) .. " --> ") .. valueToPrint)
36033
+ log((("merge is merging: " .. traversalDescription) .. " --> ") .. valueToPrint)
36124
36034
  end
36125
36035
  if isSerializationBrand(nil, key) then
36126
36036
  return
36127
36037
  end
36128
36038
  if isSerializedIsaacAPIClass(nil, value) then
36129
36039
  if SAVE_DATA_MANAGER_DEBUG then
36130
- log(nil, "merge found a serialized Isaac API class.")
36040
+ log("merge found a serialized Isaac API class.")
36131
36041
  end
36132
36042
  local deserializedObject = deserializeIsaacAPIClass(nil, value)
36133
36043
  oldTable[key] = deserializedObject
@@ -36268,7 +36178,7 @@ end
36268
36178
  function ____exports.jsonDecode(self, jsonString)
36269
36179
  local ok, luaTableOrErrMsg = pcall(tryDecode, jsonString)
36270
36180
  if not ok then
36271
- logError(nil, "Failed to convert the JSON string to a Lua table: " .. jsonString)
36181
+ logError("Failed to convert the JSON string to a Lua table: " .. jsonString)
36272
36182
  return {}
36273
36183
  end
36274
36184
  return luaTableOrErrMsg
@@ -36309,6 +36219,9 @@ return ____exports
36309
36219
  -- SOFTWARE.
36310
36220
  --
36311
36221
 
36222
+ -- The IsaacScript version of this file contains modifications for better error messages, which
36223
+ -- assist when debugging.
36224
+
36312
36225
  local json = { _version = "0.1.2" }
36313
36226
 
36314
36227
  -------------------------------------------------------------------------------
@@ -36343,9 +36256,10 @@ local function encode_nil(val)
36343
36256
  end
36344
36257
 
36345
36258
 
36346
- local function encode_table(val, stack)
36259
+ local function encode_table(val, stack, traversalDescription)
36347
36260
  local res = {}
36348
36261
  stack = stack or {}
36262
+ traversalDescription = traversalDescription or ""
36349
36263
 
36350
36264
  -- Circular reference?
36351
36265
  if stack[val] then error("circular reference") end
@@ -36357,7 +36271,7 @@ local function encode_table(val, stack)
36357
36271
  local n = 0
36358
36272
  for k in pairs(val) do
36359
36273
  if type(k) ~= "number" then
36360
- error("invalid table: mixed or invalid key types")
36274
+ error("invalid table: mixed or invalid key types for array, excepted number, got: " .. tostring(type(k)))
36361
36275
  end
36362
36276
  n = n + 1
36363
36277
  end
@@ -36366,7 +36280,8 @@ local function encode_table(val, stack)
36366
36280
  end
36367
36281
  -- Encode
36368
36282
  for i, v in ipairs(val) do
36369
- table.insert(res, encode(v, stack))
36283
+ local newTraversalDescription = traversalDescription .. tostring(i) .. " - "
36284
+ table.insert(res, encode(v, stack, newTraversalDescription))
36370
36285
  end
36371
36286
  stack[val] = nil
36372
36287
  return "[" .. table.concat(res, ",") .. "]"
@@ -36374,10 +36289,14 @@ local function encode_table(val, stack)
36374
36289
  else
36375
36290
  -- Treat as an object
36376
36291
  for k, v in pairs(val) do
36292
+ local newTraversalDescription = traversalDescription .. tostring(k) .. " - "
36377
36293
  if type(k) ~= "string" then
36378
- error("invalid table: mixed or invalid key types")
36294
+ error(
36295
+ "invalid table: mixed or invalid key types for object \"" .. newTraversalDescription .. "\", "
36296
+ .. "excepted string, got: " .. tostring(type(k))
36297
+ )
36379
36298
  end
36380
- table.insert(res, encode(k, stack) .. ":" .. encode(v, stack))
36299
+ table.insert(res, encode(k, stack, newTraversalDescription) .. ":" .. encode(v, stack, newTraversalDescription))
36381
36300
  end
36382
36301
  stack[val] = nil
36383
36302
  return "{" .. table.concat(res, ",") .. "}"
@@ -36408,11 +36327,11 @@ local type_func_map = {
36408
36327
  }
36409
36328
 
36410
36329
 
36411
- encode = function(val, stack)
36330
+ encode = function(val, stack, traversalDescription)
36412
36331
  local t = type(val)
36413
36332
  local f = type_func_map[t]
36414
36333
  if f then
36415
- return f(val, stack)
36334
+ return f(val, stack, traversalDescription)
36416
36335
  end
36417
36336
  error("unexpected type '" .. t .. "'")
36418
36337
  end
@@ -36698,10 +36617,7 @@ function readSaveDatFile(self, mod)
36698
36617
  local renderFrameCount = Isaac.GetFrameCount()
36699
36618
  local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
36700
36619
  if not ok then
36701
- logError(
36702
- nil,
36703
- (("Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg
36704
- )
36620
+ logError((("Failed to read from the \"save#.dat\" file on render frame " .. tostring(renderFrameCount)) .. ": ") .. jsonStringOrErrMsg)
36705
36621
  return DEFAULT_MOD_DATA
36706
36622
  end
36707
36623
  if jsonStringOrErrMsg == nil then
@@ -36724,7 +36640,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
36724
36640
  local jsonString = readSaveDatFile(nil, mod)
36725
36641
  local newSaveData = jsonDecode(nil, jsonString)
36726
36642
  if SAVE_DATA_MANAGER_DEBUG then
36727
- log(nil, "Converted data from the \"save#.dat\" to a Lua table.")
36643
+ log("Converted data from the \"save#.dat\" to a Lua table.")
36728
36644
  end
36729
36645
  iterateTableInOrder(
36730
36646
  nil,
@@ -36741,7 +36657,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
36741
36657
  return
36742
36658
  end
36743
36659
  if SAVE_DATA_MANAGER_DEBUG then
36744
- log(nil, "Merging in stored data for feature: " .. subscriberName)
36660
+ log("Merging in stored data for feature: " .. subscriberName)
36745
36661
  end
36746
36662
  merge(
36747
36663
  nil,
@@ -36753,7 +36669,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData, classConstructors)
36753
36669
  end,
36754
36670
  SAVE_DATA_MANAGER_DEBUG
36755
36671
  )
36756
- log(nil, "The save data manager loaded data from the \"save#.dat\" file.")
36672
+ log("The save data manager loaded data from the \"save#.dat\" file.")
36757
36673
  end
36758
36674
  return ____exports
36759
36675
  end,
@@ -36803,12 +36719,12 @@ function ____exports.restoreDefaultForFeatureKey(self, saveDataDefaultsMap, subs
36803
36719
  end
36804
36720
  local saveDataDefaults = saveDataDefaultsMap[subscriberName]
36805
36721
  if saveDataDefaults == nil then
36806
- logError(nil, "Failed to find the default copy of the save data for subscriber: " .. subscriberName)
36722
+ logError("Failed to find the default copy of the save data for subscriber: " .. subscriberName)
36807
36723
  return
36808
36724
  end
36809
36725
  local childTableDefaults = saveDataDefaults[saveDataKey]
36810
36726
  if childTableDefaults == nil then
36811
- logError(nil, ((("Failed to find the default copy of the child table \"" .. saveDataKey) .. "\" for subscriber \"") .. subscriberName) .. "\". This error usually means that your save data is out of date. You can try purging all of your save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data")
36727
+ logError(((("Failed to find the default copy of the child table \"" .. saveDataKey) .. "\" for subscriber \"") .. subscriberName) .. "\". This error usually means that your save data is out of date. You can try purging all of your save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data")
36812
36728
  return
36813
36729
  end
36814
36730
  local childTableDefaultsCopy = deepCopy(nil, childTableDefaults, SerializationType.NONE, (subscriberName .. " --> ") .. saveDataKey)
@@ -36872,7 +36788,7 @@ function ____exports.saveToDisk(self, mod, saveDataMap, saveDataConditionalFuncM
36872
36788
  local allSaveData = getAllSaveDataToWriteToDisk(nil, saveDataMap, saveDataConditionalFuncMap)
36873
36789
  local jsonString = jsonEncode(nil, allSaveData)
36874
36790
  mod:SaveData(jsonString)
36875
- log(nil, "The save data manager wrote data to the \"save#.dat\" file.")
36791
+ log("The save data manager wrote data to the \"save#.dat\" file.")
36876
36792
  end
36877
36793
  return ____exports
36878
36794
  end,
@@ -39598,10 +39514,7 @@ function CustomTrapdoors.prototype.shouldTrapdoorSpawnOpen(self, gridEntity, fir
39598
39514
  end
39599
39515
  function CustomTrapdoors.prototype.logStateChanged(self)
39600
39516
  if DEBUG then
39601
- log(
39602
- nil,
39603
- ((("Custom trapdoors state changed: " .. StageTravelState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")"
39604
- )
39517
+ log(((("Custom trapdoors state changed: " .. StageTravelState[self.v.run.state]) .. " (") .. tostring(self.v.run.state)) .. ")")
39605
39518
  end
39606
39519
  end
39607
39520
  function CustomTrapdoors.prototype.registerCustomTrapdoorDestination(self, destinationName, destinationFunc)
@@ -40345,17 +40258,11 @@ function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, ve
40345
40258
  end
40346
40259
  local totalWeight = getTotalWeightOfCustomStageRooms(nil, roomsMetadata)
40347
40260
  if verbose then
40348
- log(
40349
- nil,
40350
- "Total weight of the custom stage rooms provided: " .. tostring(totalWeight)
40351
- )
40261
+ log("Total weight of the custom stage rooms provided: " .. tostring(totalWeight))
40352
40262
  end
40353
40263
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
40354
40264
  if verbose then
40355
- log(
40356
- nil,
40357
- "Randomly chose weight for custom stage room: " .. tostring(chosenWeight)
40358
- )
40265
+ log("Randomly chose weight for custom stage room: " .. tostring(chosenWeight))
40359
40266
  end
40360
40267
  return getCustomStageRoomWithChosenWeight(nil, roomsMetadata, chosenWeight)
40361
40268
  end
@@ -40368,17 +40275,11 @@ function ____exports.getRandomBossRoomFromPool(self, roomsMetadata, bossPool, se
40368
40275
  end
40369
40276
  local totalWeight = getTotalWeightOfBossPool(nil, bossPool)
40370
40277
  if verbose then
40371
- log(
40372
- nil,
40373
- "Total weight of the custom stage boss pool provided: " .. tostring(totalWeight)
40374
- )
40278
+ log("Total weight of the custom stage boss pool provided: " .. tostring(totalWeight))
40375
40279
  end
40376
40280
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
40377
40281
  if verbose then
40378
- log(
40379
- nil,
40380
- "Randomly chose weight for custom stage boss pool: " .. tostring(chosenWeight)
40381
- )
40282
+ log("Randomly chose weight for custom stage boss pool: " .. tostring(chosenWeight))
40382
40283
  end
40383
40284
  local bossEntry = getBossEntryWithChosenWeight(nil, bossPool, chosenWeight)
40384
40285
  local roomsMetadataForBoss = __TS__ArrayFilter(
@@ -41847,7 +41748,7 @@ function Pause.prototype.isPaused(self)
41847
41748
  end
41848
41749
  function Pause.prototype.pause(self)
41849
41750
  if self.v.run.isPseudoPaused then
41850
- logError(nil, "Failed to pseudo-pause the game, since it was already pseudo-paused.")
41751
+ logError("Failed to pseudo-pause the game, since it was already pseudo-paused.")
41851
41752
  return
41852
41753
  end
41853
41754
  self.v.run.isPseudoPaused = true
@@ -41886,7 +41787,7 @@ function Pause.prototype.pause(self)
41886
41787
  end
41887
41788
  function Pause.prototype.unpause(self)
41888
41789
  if not self.v.run.isPseudoPaused then
41889
- logError(nil, "Failed to pseudo-unpause the game, since it was not already pseudo-paused.")
41790
+ logError("Failed to pseudo-unpause the game, since it was not already pseudo-paused.")
41890
41791
  return
41891
41792
  end
41892
41793
  self.v.run.isPseudoPaused = false
@@ -42417,20 +42318,14 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42417
42318
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
42418
42319
  if roomShapeMap == nil then
42419
42320
  if roomType == RoomType.DEFAULT then
42420
- logError(
42421
- nil,
42422
- (((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name
42423
- )
42321
+ logError((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name)
42424
42322
  end
42425
42323
  goto __continue27
42426
42324
  end
42427
42325
  local roomShape = room.Data.Shape
42428
42326
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
42429
42327
  if roomDoorSlotFlagMap == nil then
42430
- logError(
42431
- nil,
42432
- (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name
42433
- )
42328
+ logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name)
42434
42329
  goto __continue27
42435
42330
  end
42436
42331
  local doorSlotFlags = room.Data.Doors
@@ -42440,10 +42335,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42440
42335
  local allDoorSlotFlags = doorSlotsToDoorSlotFlags(nil, allDoorSlots)
42441
42336
  roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
42442
42337
  if roomsMetadata == nil then
42443
- logError(
42444
- nil,
42445
- (((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name
42446
- )
42338
+ logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name)
42447
42339
  goto __continue27
42448
42340
  end
42449
42341
  end
@@ -42466,10 +42358,7 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
42466
42358
  if newRoomData == nil then
42467
42359
  newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
42468
42360
  if newRoomData == nil then
42469
- logError(
42470
- nil,
42471
- (("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name
42472
- )
42361
+ logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
42473
42362
  goto __continue27
42474
42363
  end
42475
42364
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
@@ -43779,17 +43668,11 @@ function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
43779
43668
  end
43780
43669
  local totalWeight = getTotalWeightOfJSONObject(nil, jsonEntities)
43781
43670
  if verbose then
43782
- log(
43783
- nil,
43784
- "Total weight of the JSON entities provided: " .. tostring(totalWeight)
43785
- )
43671
+ log("Total weight of the JSON entities provided: " .. tostring(totalWeight))
43786
43672
  end
43787
43673
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
43788
43674
  if verbose then
43789
- log(
43790
- nil,
43791
- "Randomly chose weight for JSON entity: " .. tostring(chosenWeight)
43792
- )
43675
+ log("Randomly chose weight for JSON entity: " .. tostring(chosenWeight))
43793
43676
  end
43794
43677
  local randomJSONEntity = getJSONObjectWithChosenWeight(nil, jsonEntities, chosenWeight)
43795
43678
  if randomJSONEntity == nil then
@@ -43806,17 +43689,11 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seedOrRNG, verbose)
43806
43689
  end
43807
43690
  local totalWeight = getTotalWeightOfJSONObject(nil, jsonRooms)
43808
43691
  if verbose then
43809
- log(
43810
- nil,
43811
- "Total weight of the JSON rooms provided: " .. tostring(totalWeight)
43812
- )
43692
+ log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
43813
43693
  end
43814
43694
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seedOrRNG)
43815
43695
  if verbose then
43816
- log(
43817
- nil,
43818
- "Randomly chose weight for JSON room: " .. tostring(chosenWeight)
43819
- )
43696
+ log("Randomly chose weight for JSON room: " .. tostring(chosenWeight))
43820
43697
  end
43821
43698
  local randomJSONRoom = getJSONObjectWithChosenWeight(nil, jsonRooms, chosenWeight)
43822
43699
  if randomJSONRoom == nil then
@@ -44493,10 +44370,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
44493
44370
  if isGridEntity then
44494
44371
  local gridEntityXMLType = entityTypeNumber
44495
44372
  if verbose then
44496
- log(
44497
- nil,
44498
- ((((((("Spawning grid entity " .. tostring(gridEntityXMLType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
44499
- )
44373
+ log(((((((("Spawning grid entity " .. tostring(gridEntityXMLType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
44500
44374
  end
44501
44375
  spawnGridEntityForJSONRoom(
44502
44376
  nil,
@@ -44509,10 +44383,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
44509
44383
  local entityType = entityTypeNumber
44510
44384
  if verbose then
44511
44385
  local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
44512
- log(
44513
- nil,
44514
- ((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
44515
- )
44386
+ log(((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
44516
44387
  end
44517
44388
  local entity = self:spawnNormalEntityForJSONRoom(
44518
44389
  entityType,
@@ -44530,11 +44401,11 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
44530
44401
  end
44531
44402
  if shouldUnclearRoom then
44532
44403
  if verbose then
44533
- log(nil, "Setting the room to be uncleared since there were one or more battle NPCs spawned.")
44404
+ log("Setting the room to be uncleared since there were one or more battle NPCs spawned.")
44534
44405
  end
44535
44406
  setRoomUncleared(nil)
44536
44407
  elseif verbose then
44537
- log(nil, "Leaving the room cleared since there were no battle NPCs spawned.")
44408
+ log("Leaving the room cleared since there were no battle NPCs spawned.")
44538
44409
  end
44539
44410
  end
44540
44411
  function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType, variant, subType, x, y, rng)
@@ -44576,19 +44447,19 @@ function DeployJSONRoom.prototype.deployJSONRoom(self, jsonRoom, seedOrRNG, verb
44576
44447
  end
44577
44448
  local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
44578
44449
  if verbose then
44579
- log(nil, "Starting to empty the room of entities and grid entities.")
44450
+ log("Starting to empty the room of entities and grid entities.")
44580
44451
  end
44581
44452
  emptyRoom(nil)
44582
44453
  if verbose then
44583
- log(nil, "Finished emptying the room of entities and grid entities.")
44454
+ log("Finished emptying the room of entities and grid entities.")
44584
44455
  end
44585
44456
  setRoomCleared(nil)
44586
44457
  if verbose then
44587
- log(nil, "Starting to spawn all of the new entities and grid entities.")
44458
+ log("Starting to spawn all of the new entities and grid entities.")
44588
44459
  end
44589
44460
  self:spawnAllEntities(jsonRoom, rng, verbose)
44590
44461
  if verbose then
44591
- log(nil, "Finished spawning all of the new entities and grid entities.")
44462
+ log("Finished spawning all of the new entities and grid entities.")
44592
44463
  end
44593
44464
  fixPitGraphics(nil)
44594
44465
  self.preventGridEntityRespawn:preventGridEntityRespawn()
@@ -44954,7 +44825,7 @@ function ____exports.runDeepCopyTests(self)
44954
44825
  copiedSerializedDefaultMapHasStringKey(nil)
44955
44826
  copiedSerializedDefaultMapHasNumberKey(nil)
44956
44827
  local successText = "All deep copy tests passed!"
44957
- log(nil, successText)
44828
+ log(successText)
44958
44829
  print(successText)
44959
44830
  end
44960
44831
  return ____exports
@@ -46364,11 +46235,11 @@ local getGridEntities = ____gridEntities.getGridEntities
46364
46235
  local getGridEntityID = ____gridEntities.getGridEntityID
46365
46236
  local ____log = require("src.functions.log")
46366
46237
  local log = ____log.log
46367
- function ____exports.logEntity(self, entity)
46368
- local msg = getEntityLogLine(nil, entity)
46369
- log(nil, msg)
46238
+ function ____exports.logEntity(entity)
46239
+ local msg = getEntityLogLine(entity)
46240
+ log(msg)
46370
46241
  end
46371
- function getEntityLogLine(self, entity, num)
46242
+ function getEntityLogLine(entity, num)
46372
46243
  local msg = num == nil and "" or tostring(num) .. ") "
46373
46244
  msg = msg .. getEntityID(nil, entity)
46374
46245
  local bomb = entity:ToBomb()
@@ -46427,11 +46298,11 @@ function getEntityLogLine(self, entity, num)
46427
46298
  end
46428
46299
  return msg
46429
46300
  end
46430
- function ____exports.logGridEntity(self, gridEntity)
46431
- local msg = getGridEntityLogLine(nil, gridEntity)
46432
- log(nil, msg)
46301
+ function ____exports.logGridEntity(gridEntity)
46302
+ local msg = getGridEntityLogLine(gridEntity)
46303
+ log(msg)
46433
46304
  end
46434
- function getGridEntityLogLine(self, gridEntity, num)
46305
+ function getGridEntityLogLine(gridEntity, num)
46435
46306
  local gridEntityDesc = gridEntity:GetSaveState()
46436
46307
  local msg = num == nil and "" or tostring(num) .. ") "
46437
46308
  msg = msg .. getGridEntityID(nil, gridEntity)
@@ -46487,7 +46358,7 @@ local IGNORE_EFFECT_VARIANTS = __TS__New(Set, {
46487
46358
  EffectVariant.LIGHT,
46488
46359
  EffectVariant.TADPOLE
46489
46360
  })
46490
- function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFilter)
46361
+ function ____exports.logAllEntities(includeBackgroundEffects, entityTypeFilter)
46491
46362
  local msg = "Entities in the room"
46492
46363
  if entityTypeFilter ~= nil then
46493
46364
  msg = msg .. (" (filtered to entity type " .. tostring(entityTypeFilter)) .. ")"
@@ -46507,7 +46378,7 @@ function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFi
46507
46378
  if not includeBackgroundEffects and effect ~= nil and IGNORE_EFFECT_VARIANTS:has(effect.Variant) then
46508
46379
  return
46509
46380
  end
46510
- msg = msg .. getEntityLogLine(nil, entity, i + 1)
46381
+ msg = msg .. getEntityLogLine(entity, i + 1)
46511
46382
  numMatchedEntities = numMatchedEntities + 1
46512
46383
  end
46513
46384
  )
@@ -46520,10 +46391,10 @@ function ____exports.logAllEntities(self, includeBackgroundEffects, entityTypeFi
46520
46391
  __TS__StringTrim(msg),
46521
46392
  "\n"
46522
46393
  )) do
46523
- log(nil, line)
46394
+ log(line)
46524
46395
  end
46525
46396
  end
46526
- function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter)
46397
+ function ____exports.logAllGridEntities(includeWalls, gridEntityTypeFilter)
46527
46398
  if includeWalls == nil then
46528
46399
  includeWalls = false
46529
46400
  end
@@ -46547,7 +46418,7 @@ function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter
46547
46418
  if not includeWalls and gridEntityType == GridEntityType.WALL and gridEntityTypeFilter ~= GridEntityType.WALL then
46548
46419
  return
46549
46420
  end
46550
- msg = msg .. getGridEntityLogLine(nil, gridEntity, gridEntityIndex)
46421
+ msg = msg .. getGridEntityLogLine(gridEntity, gridEntityIndex)
46551
46422
  numMatchedEntities = numMatchedEntities + 1
46552
46423
  end
46553
46424
  )
@@ -46560,34 +46431,31 @@ function ____exports.logAllGridEntities(self, includeWalls, gridEntityTypeFilter
46560
46431
  __TS__StringTrim(msg),
46561
46432
  "\n"
46562
46433
  )) do
46563
- log(nil, line)
46434
+ log(line)
46564
46435
  end
46565
46436
  end
46566
- function ____exports.logEntities(self, entities)
46437
+ function ____exports.logEntities(entities)
46567
46438
  for ____, entity in ipairs(entities) do
46568
- ____exports.logEntity(nil, entity)
46439
+ ____exports.logEntity(entity)
46569
46440
  end
46570
46441
  end
46571
- function ____exports.logGridEntities(self, gridEntities)
46442
+ function ____exports.logGridEntities(gridEntities)
46572
46443
  for ____, gridEntity in ipairs(gridEntities) do
46573
- ____exports.logGridEntity(nil, gridEntity)
46444
+ ____exports.logGridEntity(gridEntity)
46574
46445
  end
46575
46446
  end
46576
- function ____exports.logPtrHash(self, ptrHash)
46577
- log(
46578
- nil,
46579
- "PtrHash: " .. tostring(ptrHash)
46580
- )
46447
+ function ____exports.logPtrHash(ptrHash)
46448
+ log("PtrHash: " .. tostring(ptrHash))
46581
46449
  local entity = getEntityFromPtrHash(nil, ptrHash)
46582
46450
  if entity == nil then
46583
- log(nil, "No corresponding entity found.")
46451
+ log("No corresponding entity found.")
46584
46452
  else
46585
- ____exports.logEntity(nil, entity)
46453
+ ____exports.logEntity(entity)
46586
46454
  end
46587
46455
  end
46588
- function ____exports.logPtrHashes(self, ptrHashes)
46456
+ function ____exports.logPtrHashes(ptrHashes)
46589
46457
  for ____, ptrHash in ipairs(ptrHashes) do
46590
- ____exports.logPtrHash(nil, ptrHash)
46458
+ ____exports.logPtrHash(ptrHash)
46591
46459
  end
46592
46460
  end
46593
46461
  return ____exports
@@ -46664,7 +46532,7 @@ function ____exports.listEntities(self, params, includeBackgroundEffects)
46664
46532
  return
46665
46533
  end
46666
46534
  end
46667
- logAllEntities(nil, includeBackgroundEffects, entityTypeFilter)
46535
+ logAllEntities(includeBackgroundEffects, entityTypeFilter)
46668
46536
  print("Logged the entities in the room to the \"log.txt\" file.")
46669
46537
  end
46670
46538
  function ____exports.listGridEntities(self, params, includeWalls)
@@ -46676,7 +46544,7 @@ function ____exports.listGridEntities(self, params, includeWalls)
46676
46544
  return
46677
46545
  end
46678
46546
  end
46679
- logAllGridEntities(nil, includeWalls, gridEntityTypeFilter)
46547
+ logAllGridEntities(includeWalls, gridEntityTypeFilter)
46680
46548
  print("Logged the grid entities in the room to the \"log.txt\" file.")
46681
46549
  end
46682
46550
  function ____exports.movePlayer(self, params, direction)
@@ -47239,7 +47107,7 @@ function ____exports.dungeon(self)
47239
47107
  end
47240
47108
  function ____exports.effects(self)
47241
47109
  local player = Isaac.GetPlayer()
47242
- logPlayerEffects(nil, player)
47110
+ logPlayerEffects(player)
47243
47111
  print("Logged the player's effects to the \"log.txt\" file.")
47244
47112
  end
47245
47113
  function ____exports.errorRoom(self)
@@ -47525,7 +47393,7 @@ function ____exports.right(self, params)
47525
47393
  movePlayer(nil, params, Direction.RIGHT)
47526
47394
  end
47527
47395
  function ____exports.room(self)
47528
- logRoom(nil)
47396
+ logRoom()
47529
47397
  print("Logged room information to the \"log.txt\" file.")
47530
47398
  end
47531
47399
  function ____exports.rottenHearts(self, params)
@@ -47576,7 +47444,7 @@ function ____exports.seedStick(self)
47576
47444
  Isaac.ExecuteCommand("seed " .. startSeedString)
47577
47445
  end
47578
47446
  function ____exports.seeds(self)
47579
- logSeedEffects(nil)
47447
+ logSeedEffects()
47580
47448
  print("Logged the seed effects to the \"log.txt\" file.")
47581
47449
  end
47582
47450
  function ____exports.setCharges(self, params)
@@ -47665,7 +47533,7 @@ function ____exports.soulHearts(self, params)
47665
47533
  addHeart(nil, params, HealthType.SOUL)
47666
47534
  end
47667
47535
  function ____exports.sounds(self)
47668
- logSounds(nil)
47536
+ logSounds()
47669
47537
  print("Logged the currently playing sound effects to the \"log.txt\" file.")
47670
47538
  end
47671
47539
  function ____exports.spam(self)
@@ -49315,7 +49183,7 @@ function TaintedLazarusPlayers.prototype.checkDequeue(self)
49315
49183
  local taintedLazarusPtrHash = GetPtrHash(taintedLazarus)
49316
49184
  local deadTaintedLazarusPtrHash = GetPtrHash(deadTaintedLazarus)
49317
49185
  if taintedLazarusPtrHash == deadTaintedLazarusPtrHash then
49318
- logError(nil, "Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
49186
+ logError("Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
49319
49187
  return
49320
49188
  end
49321
49189
  self.v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarus)
@@ -49596,7 +49464,7 @@ function ____exports.getTime(self, useSocketIfAvailable)
49596
49464
  end
49597
49465
  return Isaac.GetTime()
49598
49466
  end
49599
- function ____exports.getTraceback(self)
49467
+ function ____exports.getTraceback()
49600
49468
  if SandboxGetTraceback ~= nil then
49601
49469
  return SandboxGetTraceback()
49602
49470
  end
@@ -49605,9 +49473,9 @@ function ____exports.getTraceback(self)
49605
49473
  end
49606
49474
  return "stack traceback:\n(the \"--luadebug\" flag is not enabled)"
49607
49475
  end
49608
- function ____exports.traceback(self)
49609
- local tracebackOutput = ____exports.getTraceback(nil)
49610
- log(nil, tracebackOutput)
49476
+ function ____exports.traceback()
49477
+ local tracebackOutput = ____exports.getTraceback()
49478
+ log(tracebackOutput)
49611
49479
  end
49612
49480
  return ____exports
49613
49481
  end,
@@ -49686,7 +49554,7 @@ function ModUpgradedBase.prototype.AddPriorityCallback(self, modCallback, priori
49686
49554
  if self.debug then
49687
49555
  local callback = args[1]
49688
49556
  local optionalArg = args[2]
49689
- local parentFunctionDescription = getParentFunctionDescription(nil)
49557
+ local parentFunctionDescription = getParentFunctionDescription()
49690
49558
  local customCallback = type(modCallback) == "string"
49691
49559
  local callbackName = customCallback and tostring(modCallback) .. " (custom callback)" or "ModCallback." .. ModCallback[modCallback]
49692
49560
  local signature = parentFunctionDescription == nil and callbackName or (parentFunctionDescription .. " - ") .. callbackName
@@ -49754,10 +49622,7 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
49754
49622
  if modCallbackCustom == nil then
49755
49623
  error("Failed to convert an index on the callbacks object to a number.")
49756
49624
  end
49757
- log(
49758
- nil,
49759
- ((("- ModCallbackCustom." .. tostring(ModCallbackCustom[modCallbackCustom])) .. " (") .. tostring(modCallbackCustom)) .. ")"
49760
- )
49625
+ log(((("- ModCallbackCustom." .. tostring(ModCallbackCustom[modCallbackCustom])) .. " (") .. tostring(modCallbackCustom)) .. ")")
49761
49626
  end
49762
49627
  ::__continue18::
49763
49628
  end
@@ -49772,10 +49637,7 @@ function ModUpgradedBase.prototype.logUsedFeatures(self)
49772
49637
  if iscFeature == nil then
49773
49638
  error("Failed to convert an index on the features object to a number.")
49774
49639
  end
49775
- log(
49776
- nil,
49777
- ((("- ISCFeature." .. tostring(ISCFeature[iscFeature])) .. " (") .. tostring(iscFeature)) .. ")"
49778
- )
49640
+ log(((("- ISCFeature." .. tostring(ISCFeature[iscFeature])) .. " (") .. tostring(iscFeature)) .. ")")
49779
49641
  end
49780
49642
  ::__continue22::
49781
49643
  end
@@ -50022,15 +49884,11 @@ function removeCallback(self, modFeatureConstructor, mod, modCallback, vanilla)
50022
49884
  end
50023
49885
  end
50024
49886
  function initSaveDataManager(self, modFeature, tstlClassName, init)
50025
- if tstlClassName == "AtePoopBaby" then
50026
- Isaac.DebugString("GETTING HERE 1")
50027
- end
50028
49887
  local ____modFeature_0 = modFeature
50029
49888
  local v = ____modFeature_0.v
50030
49889
  if v == nil then
50031
49890
  return
50032
49891
  end
50033
- Isaac.DebugString("GETTING HERE 2")
50034
49892
  if not isTable(nil, v) then
50035
49893
  error("Failed to initialize a mod feature class due to having a \"v\" property that is not an object. (The \"v\" property is supposed to be an object that holds the variables for the class, managed by the save data manager.)")
50036
49894
  end
@@ -50123,7 +49981,7 @@ function errorWithTraceback(message, level)
50123
49981
  if level == nil then
50124
49982
  level = 1
50125
49983
  end
50126
- local tracebackOutput = getTraceback(nil)
49984
+ local tracebackOutput = getTraceback()
50127
49985
  local slimmedTracebackOutput = slimTracebackOutput(nil, tracebackOutput)
50128
49986
  message = message .. "\n"
50129
49987
  message = message .. slimmedTracebackOutput
@@ -50306,10 +50164,7 @@ local ____log = require("src.functions.log")
50306
50164
  local log = ____log.log
50307
50165
  function ____exports.benchmark(self, numTrials, ...)
50308
50166
  local functions = {...}
50309
- log(
50310
- nil,
50311
- ((("Benchmarking " .. tostring(#functions)) .. " function(s) with ") .. tostring(numTrials)) .. " trials."
50312
- )
50167
+ log(((("Benchmarking " .. tostring(#functions)) .. " function(s) with ") .. tostring(numTrials)) .. " trials.")
50313
50168
  local averages = {}
50314
50169
  __TS__ArrayForEach(
50315
50170
  functions,
@@ -50327,10 +50182,7 @@ function ____exports.benchmark(self, numTrials, ...)
50327
50182
  end
50328
50183
  end
50329
50184
  local averageTimeMilliseconds = totalTimeMilliseconds / numTrials
50330
- log(
50331
- nil,
50332
- ((("The average time of the function at index " .. tostring(i)) .. " is: ") .. tostring(averageTimeMilliseconds)) .. " milliseconds"
50333
- )
50185
+ log(((("The average time of the function at index " .. tostring(i)) .. " is: ") .. tostring(averageTimeMilliseconds)) .. " milliseconds")
50334
50186
  averages[#averages + 1] = averageTimeMilliseconds
50335
50187
  end
50336
50188
  )
@@ -50752,9 +50604,9 @@ function ____exports.getNewGlobals(self)
50752
50604
  end
50753
50605
  function ____exports.logNewGlobals(self)
50754
50606
  local newGlobals = ____exports.getNewGlobals(nil)
50755
- log(nil, "List of added global variables in the Isaac environment:")
50607
+ log("List of added global variables in the Isaac environment:")
50756
50608
  if #newGlobals == 0 then
50757
- log(nil, "- n/a (no extra global variables found)")
50609
+ log("- n/a (no extra global variables found)")
50758
50610
  end
50759
50611
  __TS__ArrayForEach(
50760
50612
  newGlobals,
@@ -50763,10 +50615,7 @@ function ____exports.logNewGlobals(self)
50763
50615
  local key
50764
50616
  key = ____bindingPattern0[1]
50765
50617
  value = ____bindingPattern0[2]
50766
- log(
50767
- nil,
50768
- (((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value)
50769
- )
50618
+ log((((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value))
50770
50619
  end
50771
50620
  )
50772
50621
  end
@@ -50798,28 +50647,25 @@ local logError = ____logMisc.logError
50798
50647
  function hexToRGB(self, hexString)
50799
50648
  hexString = __TS__StringReplace(hexString, "#", "")
50800
50649
  if #hexString ~= HEX_STRING_LENGTH then
50801
- logError(
50802
- nil,
50803
- "Hex strings must be of length: " .. tostring(HEX_STRING_LENGTH)
50804
- )
50650
+ logError("Hex strings must be of length: " .. tostring(HEX_STRING_LENGTH))
50805
50651
  return {0, 0, 0}
50806
50652
  end
50807
50653
  local rString = __TS__StringSubstring(hexString, 0, 2)
50808
50654
  local r = tonumber("0x" .. rString)
50809
50655
  if r == nil then
50810
- logError(nil, ("Failed to convert `0x" .. rString) .. "` to a number.")
50656
+ logError(("Failed to convert `0x" .. rString) .. "` to a number.")
50811
50657
  return {0, 0, 0}
50812
50658
  end
50813
50659
  local gString = __TS__StringSubstring(hexString, 2, 4)
50814
50660
  local g = tonumber("0x" .. gString)
50815
50661
  if g == nil then
50816
- logError(nil, ("Failed to convert `0x" .. gString) .. "` to a number.")
50662
+ logError(("Failed to convert `0x" .. gString) .. "` to a number.")
50817
50663
  return {0, 0, 0}
50818
50664
  end
50819
50665
  local bString = __TS__StringSubstring(hexString, 4, 6)
50820
50666
  local b = tonumber("0x" .. bString)
50821
50667
  if b == nil then
50822
- logError(nil, ("Failed to convert `0x" .. bString) .. "` to a number.")
50668
+ logError(("Failed to convert `0x" .. bString) .. "` to a number.")
50823
50669
  return {0, 0, 0}
50824
50670
  end
50825
50671
  return {r, g, b}