isaacscript-common 1.0.575 → 1.0.579

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 (137) hide show
  1. package/dist/callbacks/itemPickup.lua +2 -6
  2. package/dist/callbacks/postBombInitLate.lua +1 -5
  3. package/dist/callbacks/postCursedTeleport.lua +8 -10
  4. package/dist/callbacks/postEffectInitLate.lua +1 -5
  5. package/dist/callbacks/postEsauJr.lua +2 -4
  6. package/dist/callbacks/postFamiliarInitLate.lua +1 -5
  7. package/dist/callbacks/postFlip.lua +2 -4
  8. package/dist/callbacks/postGridEntity.lua +8 -20
  9. package/dist/callbacks/postKnifeInitLate.lua +1 -5
  10. package/dist/callbacks/postLaserInitLate.lua +1 -5
  11. package/dist/callbacks/postNPCInitLate.lua +1 -5
  12. package/dist/callbacks/postPickupCollect.lua +1 -5
  13. package/dist/callbacks/postPickupInitLate.lua +1 -5
  14. package/dist/callbacks/postPlayerChangeHealth.lua +19 -23
  15. package/dist/callbacks/postPlayerChangeType.lua +1 -5
  16. package/dist/callbacks/postPlayerFatalDamage.lua +5 -9
  17. package/dist/callbacks/postPlayerInitLate.lua +1 -5
  18. package/dist/callbacks/postPlayerReordered.lua +8 -2
  19. package/dist/callbacks/postProjectileInitLate.lua +1 -5
  20. package/dist/callbacks/postPurchase.lua +19 -19
  21. package/dist/callbacks/postSacrifice.lua +3 -3
  22. package/dist/callbacks/postSlotInitUpdate.lua +3 -11
  23. package/dist/callbacks/postSlotRenderBroken.lua +2 -8
  24. package/dist/callbacks/postTearInitLate.lua +1 -5
  25. package/dist/callbacks/postTearInitVeryLate.lua +1 -5
  26. package/dist/callbacks/postTransformation.lua +1 -5
  27. package/dist/callbacks/postTrinketBreak.lua +5 -9
  28. package/dist/callbacks/preNewLevel.lua +1 -1
  29. package/dist/callbacks/reorderedCallbacks.lua +4 -4
  30. package/dist/callbacks/subscriptions/PreNewLevel.lua +1 -2
  31. package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -5
  32. package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -2
  33. package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -5
  34. package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -5
  35. package/dist/callbacks/subscriptions/postEsauJr.lua +1 -2
  36. package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -5
  37. package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -2
  38. package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -2
  39. package/dist/callbacks/subscriptions/postFlip.lua +1 -2
  40. package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -2
  41. package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -5
  42. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -5
  43. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -5
  44. package/dist/callbacks/subscriptions/postItemPickup.lua +5 -8
  45. package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -5
  46. package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -5
  47. package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -5
  48. package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -2
  49. package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -2
  50. package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -2
  51. package/dist/callbacks/subscriptions/postPEffectUpdateReordered.lua +3 -5
  52. package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -5
  53. package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -5
  54. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -5
  55. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -2
  56. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -5
  57. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -5
  58. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -5
  59. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -5
  60. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -5
  61. package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -5
  62. package/dist/callbacks/subscriptions/postPurchase.lua +8 -3
  63. package/dist/callbacks/subscriptions/postSacrifice.lua +1 -2
  64. package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -5
  65. package/dist/callbacks/subscriptions/postSlotInit.lua +3 -5
  66. package/dist/callbacks/subscriptions/postSlotRender.lua +3 -5
  67. package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -5
  68. package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -5
  69. package/dist/callbacks/subscriptions/postTearInitVeryLate.lua +3 -5
  70. package/dist/callbacks/subscriptions/postTransformation.lua +3 -5
  71. package/dist/callbacks/subscriptions/postTrinketBreak.lua +3 -5
  72. package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -2
  73. package/dist/callbacks/subscriptions/preItemPickup.lua +5 -8
  74. package/dist/constants.lua +57 -6
  75. package/dist/features/deployJSONRoom.lua +95 -68
  76. package/dist/features/disableInputs.lua +9 -3
  77. package/dist/features/forgottenSwitch.lua +1 -1
  78. package/dist/features/getCollectibleItemPoolType.lua +4 -10
  79. package/dist/features/preventCollectibleRotate.lua +3 -9
  80. package/dist/features/saveDataManager/load.lua +2 -6
  81. package/dist/features/saveDataManager/main.lua +1 -1
  82. package/dist/features/saveDataManager/merge.lua +2 -4
  83. package/dist/features/sirenHelpers.lua +5 -7
  84. package/dist/functions/array.lua +6 -10
  85. package/dist/functions/bitwise.lua +1 -1
  86. package/dist/functions/challenges.lua +1 -1
  87. package/dist/functions/charge.lua +10 -12
  88. package/dist/functions/collectibles.lua +18 -23
  89. package/dist/functions/color.lua +9 -1
  90. package/dist/functions/deepCopy.lua +46 -28
  91. package/dist/functions/deepCopyTests.lua +12 -20
  92. package/dist/functions/doors.lua +9 -21
  93. package/dist/functions/entity.lua +8 -2
  94. package/dist/functions/flag.lua +1 -1
  95. package/dist/functions/gridEntity.lua +14 -9
  96. package/dist/functions/input.lua +17 -27
  97. package/dist/functions/jsonRoom.lua +3 -9
  98. package/dist/functions/language.lua +9 -1
  99. package/dist/functions/log.lua +33 -85
  100. package/dist/functions/math.lua +15 -17
  101. package/dist/functions/npc.lua +15 -17
  102. package/dist/functions/pickups.lua +14 -1
  103. package/dist/functions/player.lua +38 -60
  104. package/dist/functions/playerHealth.lua +19 -9
  105. package/dist/functions/pocketItems.lua +4 -4
  106. package/dist/functions/random.lua +2 -2
  107. package/dist/functions/revive.lua +4 -4
  108. package/dist/functions/rooms.d.ts +14 -2
  109. package/dist/functions/rooms.lua +56 -40
  110. package/dist/functions/spawnCollectible.lua +10 -2
  111. package/dist/functions/sprite.lua +2 -2
  112. package/dist/functions/stage.lua +11 -11
  113. package/dist/functions/tears.lua +1 -1
  114. package/dist/functions/transformations.lua +4 -10
  115. package/dist/functions/trinketGive.lua +3 -3
  116. package/dist/functions/trinkets.lua +10 -6
  117. package/dist/functions/ui.lua +3 -3
  118. package/dist/functions/util.d.ts +0 -11
  119. package/dist/functions/util.lua +6 -26
  120. package/dist/functions/vector.lua +8 -8
  121. package/dist/lualib_bundle.lua +795 -735
  122. package/dist/maps/cardDescriptionMap.lua +99 -1
  123. package/dist/maps/cardNameMap.lua +99 -1
  124. package/dist/maps/challengeNameMap.lua +47 -1
  125. package/dist/maps/collectibleDescriptionMap.lua +722 -1
  126. package/dist/maps/collectibleNameMap.lua +722 -1
  127. package/dist/maps/gridEntityXMLMap.lua +36 -1
  128. package/dist/maps/pillEffectNameMap.lua +52 -1
  129. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +7 -1
  130. package/dist/maps/transformationMaps.lua +21 -16
  131. package/dist/maps/transformationNameMap.lua +17 -1
  132. package/dist/maps/trinketDescriptionMap.lua +190 -1
  133. package/dist/maps/trinketNameMap.lua +190 -1
  134. package/dist/patchErrorFunctions.lua +2 -1
  135. package/dist/sets/cards.lua +98 -2
  136. package/dist/types/ModUpgraded.lua +95 -105
  137. package/package.json +5 -5
@@ -40,7 +40,7 @@ function queueNotEmpty(self, player, pickingUpItem)
40
40
  if queuedItem == nil then
41
41
  return
42
42
  end
43
- if (queuedItem.Type ~= pickingUpItem.type) or (queuedItem.ID ~= pickingUpItem.id) then
43
+ if queuedItem.Type ~= pickingUpItem.type or queuedItem.ID ~= pickingUpItem.id then
44
44
  pickingUpItem.type = queuedItem.Type
45
45
  pickingUpItem.id = queuedItem.ID
46
46
  preItemPickupFire(nil, player, pickingUpItem)
@@ -55,11 +55,7 @@ function getPickingUpItemForPlayer(self, player)
55
55
  end
56
56
  return pickingUpItem
57
57
  end
58
- v = {
59
- run = {
60
- pickingUpItem = __TS__New(Map)
61
- }
62
- }
58
+ v = {run = {pickingUpItem = __TS__New(Map)}}
63
59
  function ____exports.itemPickupCallbacksInit(self, mod)
64
60
  saveDataManager(nil, "itemPickup", v, hasSubscriptions)
65
61
  mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -20,11 +20,7 @@ function postBombUpdate(self, bomb)
20
20
  postBombInitLateFire(nil, bomb)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postBombInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, postBombUpdate)
@@ -33,7 +33,7 @@ function setDamageFrame(self, tookDamage, damageFlags)
33
33
  local trackingArray = v.run.damageFrameMap:get(playerIndex)
34
34
  if trackingArray ~= nil then
35
35
  local lastDamageFrame, callbackActivatedOnThisFrame = table.unpack(trackingArray)
36
- if (lastDamageFrame == gameFrameCount) and callbackActivatedOnThisFrame then
36
+ if lastDamageFrame == gameFrameCount and callbackActivatedOnThisFrame then
37
37
  return
38
38
  end
39
39
  end
@@ -47,16 +47,16 @@ function isPotentialNaturalTeleportFromSacrificeRoom(self, damageFlags)
47
47
  local room = game:GetRoom()
48
48
  local roomType = room:GetType()
49
49
  local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
50
- return ((roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage) and ((v.level.numSacrifices == 6) or (v.level.numSacrifices >= 12))
50
+ return roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage and (v.level.numSacrifices == 6 or v.level.numSacrifices >= 12)
51
51
  end
52
52
  function incrementNumSacrifices(self, damageFlags)
53
53
  local game = Game()
54
54
  local room = game:GetRoom()
55
55
  local roomType = room:GetType()
56
56
  local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
57
- if (roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage then
58
- local ____obj, ____index = v.level, "numSacrifices"
59
- ____obj[____index] = ____obj[____index] + 1
57
+ if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
58
+ local ____v_level_0, ____numSacrifices_1 = v.level, "numSacrifices"
59
+ ____v_level_0[____numSacrifices_1] = ____v_level_0[____numSacrifices_1] + 1
60
60
  end
61
61
  end
62
62
  function postPlayerRenderPlayer(self, player)
@@ -87,22 +87,20 @@ function playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
87
87
  return false
88
88
  end
89
89
  local sprite = player:GetSprite()
90
- if (not sprite:IsPlaying("TeleportUp")) or (sprite:GetFrame() ~= 1) then
90
+ if not sprite:IsPlaying("TeleportUp") or sprite:GetFrame() ~= 1 then
91
91
  return false
92
92
  end
93
93
  if player:HasCollectible(CollectibleType.COLLECTIBLE_CURSED_EYE) then
94
94
  return true
95
95
  end
96
96
  local numHitsLeft = getPlayerNumAllHearts(nil, player)
97
- if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and (numHitsLeft == 1) then
97
+ if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and numHitsLeft == 1 then
98
98
  return true
99
99
  end
100
100
  return false
101
101
  end
102
102
  v = {
103
- run = {
104
- damageFrameMap = __TS__New(Map)
105
- },
103
+ run = {damageFrameMap = __TS__New(Map)},
106
104
  level = {numSacrifices = 0}
107
105
  }
108
106
  function ____exports.postCursedTeleportCallbackInit(self, mod)
@@ -20,11 +20,7 @@ function postEffectUpdate(self, effect)
20
20
  postEffectInitLateFire(nil, effect)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postEffectInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdate)
@@ -20,7 +20,7 @@ function postUpdate(self)
20
20
  end
21
21
  local game = Game()
22
22
  local gameFrameCount = game:GetFrameCount()
23
- if (v.run.usedEsauJrFrame == nil) or (gameFrameCount < (v.run.usedEsauJrFrame + 1)) then
23
+ if v.run.usedEsauJrFrame == nil or gameFrameCount < v.run.usedEsauJrFrame + 1 then
24
24
  return
25
25
  end
26
26
  v.run.usedEsauJrFrame = nil
@@ -39,9 +39,7 @@ function postUpdate(self)
39
39
  postEsauJrFire(nil, player)
40
40
  end
41
41
  function getPlayerWithControllerIndex(self, controllerIndex)
42
- for ____, player in ipairs(
43
- getPlayers(nil)
44
- ) do
42
+ for ____, player in ipairs(getPlayers(nil)) do
45
43
  if player.ControllerIndex == controllerIndex then
46
44
  return player
47
45
  end
@@ -20,11 +20,7 @@ function postFamiliarUpdate(self, familiar)
20
20
  postFamiliarInitLateFire(nil, familiar)
21
21
  end
22
22
  end
23
- v = {
24
- run = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {run = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postFamiliarInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, postFamiliarUpdate)
@@ -39,11 +39,9 @@ function getNewLazarus(self, oldLazarus)
39
39
  else
40
40
  error("Failed to determine the character in the postFlip callback.")
41
41
  end
42
- for ____, player in ipairs(
43
- getPlayers(nil)
44
- ) do
42
+ for ____, player in ipairs(getPlayers(nil)) do
45
43
  local character = player:GetPlayerType()
46
- if (character == newCharacter) and (player.FrameCount == oldLazarus.FrameCount) then
44
+ if character == newCharacter and player.FrameCount == oldLazarus.FrameCount then
47
45
  return player
48
46
  end
49
47
  end
@@ -16,15 +16,13 @@ local ____postGridEntityUpdate = require("callbacks.subscriptions.postGridEntity
16
16
  local postGridEntityUpdateFire = ____postGridEntityUpdate.postGridEntityUpdateFire
17
17
  local postGridEntityUpdateHasSubscriptions = ____postGridEntityUpdate.postGridEntityUpdateHasSubscriptions
18
18
  function hasSubscriptions(self)
19
- return (postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil)) or postGridEntityRemoveHasSubscriptions(nil)
19
+ return postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil) or postGridEntityRemoveHasSubscriptions(nil)
20
20
  end
21
21
  function postUpdate(self)
22
22
  if not hasSubscriptions(nil) then
23
23
  return
24
24
  end
25
- for ____, gridEntity in ipairs(
26
- getGridEntities(nil)
27
- ) do
25
+ for ____, gridEntity in ipairs(getGridEntities(nil)) do
28
26
  checkNewGridEntity(nil, gridEntity)
29
27
  postGridEntityUpdateFire(nil, gridEntity)
30
28
  end
@@ -33,15 +31,11 @@ end
33
31
  function checkGridEntityRemoved(self)
34
32
  local game = Game()
35
33
  local room = game:GetRoom()
36
- for ____, ____value in __TS__Iterator(
37
- v.room.initializedGridEntities:entries()
38
- ) do
39
- local gridIndex
40
- gridIndex = ____value[1]
41
- local gridEntityType
42
- gridEntityType = ____value[2]
34
+ for ____, ____value in __TS__Iterator(v.room.initializedGridEntities:entries()) do
35
+ local gridIndex = ____value[1]
36
+ local gridEntityType = ____value[2]
43
37
  local gridEntity = room:GetGridEntity(gridIndex)
44
- if (gridEntity == nil) or (gridEntity:GetType() ~= gridEntityType) then
38
+ if gridEntity == nil or gridEntity:GetType() ~= gridEntityType then
45
39
  v.room.initializedGridEntities:delete(gridIndex)
46
40
  postGridEntityRemoveFire(nil, gridIndex, gridEntityType)
47
41
  end
@@ -51,9 +45,7 @@ function postNewRoom(self)
51
45
  if not hasSubscriptions(nil) then
52
46
  return
53
47
  end
54
- for ____, gridEntity in ipairs(
55
- getGridEntities(nil)
56
- ) do
48
+ for ____, gridEntity in ipairs(getGridEntities(nil)) do
57
49
  checkNewGridEntity(nil, gridEntity)
58
50
  end
59
51
  end
@@ -66,11 +58,7 @@ function checkNewGridEntity(self, gridEntity)
66
58
  postGridEntityInitFire(nil, gridEntity)
67
59
  end
68
60
  end
69
- v = {
70
- room = {
71
- initializedGridEntities = __TS__New(Map)
72
- }
73
- }
61
+ v = {room = {initializedGridEntities = __TS__New(Map)}}
74
62
  function ____exports.postGridEntityCallbacksInit(self, mod)
75
63
  saveDataManager(nil, "postGridEntity", v, hasSubscriptions)
76
64
  mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
@@ -20,11 +20,7 @@ function postKnifeUpdate(self, knife)
20
20
  postKnifeInitLateFire(nil, knife)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postKnifeInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_KNIFE_UPDATE, postKnifeUpdate)
@@ -20,11 +20,7 @@ function postLaserUpdate(self, laser)
20
20
  postLaserInitLateFire(nil, laser)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postLaserInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_LASER_UPDATE, postLaserUpdate)
@@ -20,11 +20,7 @@ function postNPCUpdate(self, npc)
20
20
  postNPCInitLateFire(nil, npc)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postNPCInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, postNPCUpdate)
@@ -28,11 +28,7 @@ function postPickupRender(self, pickup)
28
28
  postPickupCollectFire(nil, pickup, player)
29
29
  end
30
30
  end
31
- v = {
32
- room = {
33
- firedSet = __TS__New(Set)
34
- }
35
- }
31
+ v = {room = {firedSet = __TS__New(Set)}}
36
32
  function ____exports.postPickupCollectCallbackInit(self, mod)
37
33
  saveDataManager(nil, "postPickupCollect", v, hasSubscriptions)
38
34
  mod:AddCallback(ModCallbacks.MC_POST_PICKUP_RENDER, postPickupRender)
@@ -20,11 +20,7 @@ function postPickupUpdate(self, pickup)
20
20
  postPickupInitLateFire(nil, pickup)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postPickupInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, postPickupUpdate)
@@ -32,7 +32,7 @@ function postPEffectUpdateReordered(self, player)
32
32
  for ____, healthType in ipairs(healthTypes) do
33
33
  local storedHealthValue = storedHealth:get(healthType)
34
34
  local currentHealthValue = getCurrentHealthValue(nil, player, healthType)
35
- if (storedHealthValue ~= nil) and (storedHealthValue ~= currentHealthValue) then
35
+ if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
36
36
  local amount = currentHealthValue - storedHealthValue
37
37
  postPlayerChangeHealthFire(nil, player, healthType, amount)
38
38
  end
@@ -40,51 +40,51 @@ function postPEffectUpdateReordered(self, player)
40
40
  end
41
41
  function getCurrentHealthValue(self, player, healthType)
42
42
  repeat
43
- local ____switch10 = healthType
44
- local ____cond10 = ____switch10 == HealthType.RED
45
- if ____cond10 then
43
+ local ____switch11 = healthType
44
+ local ____cond11 = ____switch11 == HealthType.RED
45
+ if ____cond11 then
46
46
  do
47
47
  return player:GetHearts()
48
48
  end
49
49
  end
50
- ____cond10 = ____cond10 or (____switch10 == HealthType.SOUL)
51
- if ____cond10 then
50
+ ____cond11 = ____cond11 or ____switch11 == HealthType.SOUL
51
+ if ____cond11 then
52
52
  do
53
53
  return player:GetSoulHearts()
54
54
  end
55
55
  end
56
- ____cond10 = ____cond10 or (____switch10 == HealthType.ETERNAL)
57
- if ____cond10 then
56
+ ____cond11 = ____cond11 or ____switch11 == HealthType.ETERNAL
57
+ if ____cond11 then
58
58
  do
59
59
  return player:GetEternalHearts()
60
60
  end
61
61
  end
62
- ____cond10 = ____cond10 or (____switch10 == HealthType.BLACK)
63
- if ____cond10 then
62
+ ____cond11 = ____cond11 or ____switch11 == HealthType.BLACK
63
+ if ____cond11 then
64
64
  do
65
65
  return player:GetBlackHearts()
66
66
  end
67
67
  end
68
- ____cond10 = ____cond10 or (____switch10 == HealthType.GOLDEN)
69
- if ____cond10 then
68
+ ____cond11 = ____cond11 or ____switch11 == HealthType.GOLDEN
69
+ if ____cond11 then
70
70
  do
71
71
  return player:GetGoldenHearts()
72
72
  end
73
73
  end
74
- ____cond10 = ____cond10 or (____switch10 == HealthType.BONE)
75
- if ____cond10 then
74
+ ____cond11 = ____cond11 or ____switch11 == HealthType.BONE
75
+ if ____cond11 then
76
76
  do
77
77
  return player:GetBoneHearts()
78
78
  end
79
79
  end
80
- ____cond10 = ____cond10 or (____switch10 == HealthType.ROTTEN)
81
- if ____cond10 then
80
+ ____cond11 = ____cond11 or ____switch11 == HealthType.ROTTEN
81
+ if ____cond11 then
82
82
  do
83
83
  return player:GetRottenHearts()
84
84
  end
85
85
  end
86
- ____cond10 = ____cond10 or (____switch10 == HealthType.MAX_HEARTS)
87
- if ____cond10 then
86
+ ____cond11 = ____cond11 or ____switch11 == HealthType.MAX_HEARTS
87
+ if ____cond11 then
88
88
  do
89
89
  return player:GetMaxHearts()
90
90
  end
@@ -97,11 +97,7 @@ function getCurrentHealthValue(self, player, healthType)
97
97
  end
98
98
  until true
99
99
  end
100
- v = {
101
- run = {
102
- healthMap = __TS__New(Map)
103
- }
104
- }
100
+ v = {run = {healthMap = __TS__New(Map)}}
105
101
  function ____exports.postPlayerChangeHealthCallbackInit(self, mod)
106
102
  saveDataManager(nil, "postPlayerChangeHealth", v, hasSubscriptions)
107
103
  mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -30,11 +30,7 @@ function postPEffectUpdateReordered(self, player)
30
30
  postPlayerChangeTypeFire(nil, player, character)
31
31
  end
32
32
  end
33
- v = {
34
- run = {
35
- characterMap = __TS__New(Map)
36
- }
37
- }
33
+ v = {run = {characterMap = __TS__New(Map)}}
38
34
  function ____exports.postPlayerChangeTypeCallbackInit(self, mod)
39
35
  saveDataManager(nil, "postPlayerChangeType", v, hasSubscriptions)
40
36
  mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
@@ -40,7 +40,7 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags, _dama
40
40
  if willPlayerRevive(nil, player) then
41
41
  return nil
42
42
  end
43
- if (not damageIsFatal(nil, player, damageAmount, lastDamageFrame)) and (not hasLostCurse(nil, player)) then
43
+ if not damageIsFatal(nil, player, damageAmount, lastDamageFrame) and not hasLostCurse(nil, player) then
44
44
  return nil
45
45
  end
46
46
  local shouldSustainDeath = postPlayerFatalDamageFire(nil, player)
@@ -61,26 +61,22 @@ function damageIsFatal(self, player, damageAmount, lastDamageFrame)
61
61
  return false
62
62
  end
63
63
  local playerAvailableHeartSlots = getPlayerAvailableHeartSlots(nil, player)
64
- if player:HasCollectible(CollectibleType.COLLECTIBLE_HEARTBREAK) and (playerAvailableHeartSlots >= 2) then
64
+ if player:HasCollectible(CollectibleType.COLLECTIBLE_HEARTBREAK) and playerAvailableHeartSlots >= 2 then
65
65
  return false
66
66
  end
67
- if player:HasCollectible(CollectibleType.COLLECTIBLE_BROKEN_GLASS_CANNON) and (gameFrameCount == lastDamageFrame) then
67
+ if player:HasCollectible(CollectibleType.COLLECTIBLE_BROKEN_GLASS_CANNON) and gameFrameCount == lastDamageFrame then
68
68
  return false
69
69
  end
70
70
  local hearts = player:GetHearts()
71
71
  local eternalHearts = player:GetEternalHearts()
72
72
  local soulHearts = player:GetSoulHearts()
73
73
  local boneHearts = player:GetBoneHearts()
74
- if (((((hearts > 0) and (soulHearts > 0)) or ((hearts > 0) and (boneHearts > 0))) or ((soulHearts > 0) and (boneHearts > 0))) or ((soulHearts > 0) and (eternalHearts > 0))) or (boneHearts >= 2) then
74
+ if hearts > 0 and soulHearts > 0 or hearts > 0 and boneHearts > 0 or soulHearts > 0 and boneHearts > 0 or soulHearts > 0 and eternalHearts > 0 or boneHearts >= 2 then
75
75
  return false
76
76
  end
77
77
  return true
78
78
  end
79
- v = {
80
- run = {
81
- playerLastDamageFrame = __TS__New(Map)
82
- }
83
- }
79
+ v = {run = {playerLastDamageFrame = __TS__New(Map)}}
84
80
  function ____exports.postPlayerFatalDamageCallbackInit(self, mod)
85
81
  saveDataManager(nil, "postPlayerFatalDamage", v)
86
82
  mod:AddCallback(ModCallbacks.MC_ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.ENTITY_PLAYER)
@@ -22,11 +22,7 @@ function postPlayerUpdate(self, player)
22
22
  postPlayerInitLateFire(nil, player)
23
23
  end
24
24
  end
25
- v = {
26
- run = {
27
- firedSet = __TS__New(Set)
28
- }
29
- }
25
+ v = {run = {firedSet = __TS__New(Set)}}
30
26
  function ____exports.postPlayerInitLateCallbackInit(self, mod)
31
27
  saveDataManager(nil, "postPlayerInitLate", v, hasSubscriptions)
32
28
  mod:AddCallback(ModCallbacks.MC_POST_PLAYER_UPDATE, postPlayerUpdate)
@@ -22,7 +22,7 @@ local ____postPlayerUpdateReordered = require("callbacks.subscriptions.postPlaye
22
22
  local postPlayerUpdateReorderedFire = ____postPlayerUpdateReordered.postPlayerUpdateReorderedFire
23
23
  local postPlayerUpdateReorderedHasSubscriptions = ____postPlayerUpdateReordered.postPlayerUpdateReorderedHasSubscriptions
24
24
  function hasSubscriptions(self)
25
- return ((postPlayerInitReorderedHasSubscriptions(nil) or postPEffectUpdateReorderedHasSubscriptions(nil)) or postPlayerUpdateReorderedHasSubscriptions(nil)) or postPlayerRenderReorderedHasSubscriptions(nil)
25
+ return postPlayerInitReorderedHasSubscriptions(nil) or postPEffectUpdateReorderedHasSubscriptions(nil) or postPlayerUpdateReorderedHasSubscriptions(nil) or postPlayerRenderReorderedHasSubscriptions(nil)
26
26
  end
27
27
  function postPEffectUpdate(self, player)
28
28
  if not hasSubscriptions(nil) then
@@ -90,7 +90,13 @@ function dequeue(self, playerIndexes, fireFunction)
90
90
  end
91
91
  arrayEmpty(nil, playerIndexes)
92
92
  end
93
- v = {run = {postGameStartedFiredOnThisRun = false, postPlayerInitQueue = {}, postPEffectUpdateQueue = {}, postPlayerUpdateQueue = {}, postPlayerRenderQueue = {}}}
93
+ v = {run = {
94
+ postGameStartedFiredOnThisRun = false,
95
+ postPlayerInitQueue = {},
96
+ postPEffectUpdateQueue = {},
97
+ postPlayerUpdateQueue = {},
98
+ postPlayerRenderQueue = {}
99
+ }}
94
100
  function ____exports.postPlayerReorderedCallbacksInit(self, mod)
95
101
  saveDataManager(nil, "postPlayerReordered", v, hasSubscriptions)
96
102
  mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, postPEffectUpdate)
@@ -20,11 +20,7 @@ function postProjectileUpdate(self, projectile)
20
20
  postProjectileInitLateFire(nil, projectile)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postProjectileInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_PROJECTILE_UPDATE, postProjectileUpdate)
@@ -24,13 +24,9 @@ function postUpdate(self)
24
24
  storePlayersInMap(nil, players)
25
25
  end
26
26
  function checkPickupsPurchased(self, pickups, players)
27
- for ____, ____value in __TS__Iterator(
28
- v.room.pickupMap:entries()
29
- ) do
30
- local index
31
- index = ____value[1]
32
- local pickupDescription
33
- pickupDescription = ____value[2]
27
+ for ____, ____value in __TS__Iterator(v.room.pickupMap:entries()) do
28
+ local index = ____value[1]
29
+ local pickupDescription = ____value[2]
34
30
  do
35
31
  if pickupIndexExists(nil, index, pickups) then
36
32
  goto __continue7
@@ -44,8 +40,14 @@ function checkPickupsPurchased(self, pickups, players)
44
40
  if playerHoldingItemLastFrame == nil then
45
41
  goto __continue9
46
42
  end
47
- if (not playerHoldingItemLastFrame) and playerHoldingItem then
48
- postPurchaseFire(nil, player, pickupDescription.variant, pickupDescription.subtype, pickupDescription.price)
43
+ if not playerHoldingItemLastFrame and playerHoldingItem then
44
+ postPurchaseFire(
45
+ nil,
46
+ player,
47
+ pickupDescription.variant,
48
+ pickupDescription.subtype,
49
+ pickupDescription.price
50
+ )
49
51
  break
50
52
  end
51
53
  end
@@ -59,12 +61,12 @@ function storePickupsInMap(self, pickups)
59
61
  for ____, entity in ipairs(pickups) do
60
62
  do
61
63
  local pickup = entity:ToPickup()
62
- if (pickup == nil) or (pickup.Price == 0) then
63
- goto __continue13
64
+ if pickup == nil or pickup.Price == 0 then
65
+ goto __continue15
64
66
  end
65
67
  v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subtype = pickup.SubType, price = pickup.Price})
66
68
  end
67
- ::__continue13::
69
+ ::__continue15::
68
70
  end
69
71
  end
70
72
  function storePlayersInMap(self, players)
@@ -76,18 +78,16 @@ function storePlayersInMap(self, players)
76
78
  end
77
79
  function pickupIndexExists(self, index, pickups)
78
80
  for ____, entity in ipairs(pickups) do
79
- if (entity.Index == index) and entity:Exists() then
81
+ if entity.Index == index and entity:Exists() then
80
82
  return true
81
83
  end
82
84
  end
83
85
  return false
84
86
  end
85
- v = {
86
- room = {
87
- pickupMap = __TS__New(Map),
88
- playerHoldingItemLastFrameMap = __TS__New(Map)
89
- }
90
- }
87
+ v = {room = {
88
+ pickupMap = __TS__New(Map),
89
+ playerHoldingItemLastFrameMap = __TS__New(Map)
90
+ }}
91
91
  function ____exports.postPurchaseCallbackInit(self, mod)
92
92
  saveDataManager(nil, "postPurchase", v, hasSubscriptions)
93
93
  mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
@@ -23,9 +23,9 @@ function entityTakeDmgPlayer(self, tookDamage, _damageAmount, damageFlags, _dama
23
23
  local room = game:GetRoom()
24
24
  local roomType = room:GetType()
25
25
  local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
26
- if (roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage then
27
- local ____obj, ____index = v.level, "numSacrifices"
28
- ____obj[____index] = ____obj[____index] + 1
26
+ if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
27
+ local ____v_level_0, ____numSacrifices_1 = v.level, "numSacrifices"
28
+ ____v_level_0[____numSacrifices_1] = ____v_level_0[____numSacrifices_1] + 1
29
29
  postSacrificeFire(nil, player, v.level.numSacrifices)
30
30
  end
31
31
  end
@@ -19,9 +19,7 @@ function postUpdate(self)
19
19
  if not hasSubscriptions(nil) then
20
20
  return
21
21
  end
22
- for ____, slot in ipairs(
23
- getSlots(nil)
24
- ) do
22
+ for ____, slot in ipairs(getSlots(nil)) do
25
23
  checkNewEntity(nil, slot)
26
24
  postSlotUpdateFire(nil, slot)
27
25
  end
@@ -30,9 +28,7 @@ function postNewRoom(self)
30
28
  if not hasSubscriptions(nil) then
31
29
  return
32
30
  end
33
- for ____, slot in ipairs(
34
- getSlots(nil)
35
- ) do
31
+ for ____, slot in ipairs(getSlots(nil)) do
36
32
  checkNewEntity(nil, slot)
37
33
  end
38
34
  end
@@ -43,11 +39,7 @@ function checkNewEntity(self, slot)
43
39
  postSlotInitFire(nil, slot)
44
40
  end
45
41
  end
46
- v = {
47
- room = {
48
- initializedSlots = __TS__New(Set)
49
- }
50
- }
42
+ v = {room = {initializedSlots = __TS__New(Set)}}
51
43
  function ____exports.postSlotInitUpdateCallbacksInit(self, mod)
52
44
  saveDataManager(nil, "postSlotInitUpdate", v, hasSubscriptions)
53
45
  mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
@@ -19,9 +19,7 @@ function postRender(self)
19
19
  if not hasSubscriptions(nil) then
20
20
  return
21
21
  end
22
- for ____, slot in ipairs(
23
- getSlots(nil)
24
- ) do
22
+ for ____, slot in ipairs(getSlots(nil)) do
25
23
  postSlotRenderFire(nil, slot)
26
24
  checkSlotBroken(nil, slot)
27
25
  end
@@ -40,11 +38,7 @@ function checkSlotBroken(self, slot)
40
38
  end
41
39
  end
42
40
  BROKEN_ANIMATIONS = __TS__New(Set, {"Broken", "Death"})
43
- v = {
44
- room = {
45
- brokenSlots = __TS__New(Set)
46
- }
47
- }
41
+ v = {room = {brokenSlots = __TS__New(Set)}}
48
42
  function ____exports.postSlotRenderBrokenCallbacksInit(self, mod)
49
43
  saveDataManager(nil, "postSlotRenderBroken", v, hasSubscriptions)
50
44
  mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
@@ -20,11 +20,7 @@ function postTearUpdate(self, tear)
20
20
  postTearInitLateFire(nil, tear)
21
21
  end
22
22
  end
23
- v = {
24
- room = {
25
- firedSet = __TS__New(Set)
26
- }
27
- }
23
+ v = {room = {firedSet = __TS__New(Set)}}
28
24
  function ____exports.postTearInitLateCallbackInit(self, mod)
29
25
  saveDataManager(nil, "postTearInitLate", v, hasSubscriptions)
30
26
  mod:AddCallback(ModCallbacks.MC_POST_TEAR_UPDATE, postTearUpdate)
@@ -23,11 +23,7 @@ function postTearUpdate(self, tear)
23
23
  postTearInitVeryLateFire(nil, tear)
24
24
  end
25
25
  end
26
- v = {
27
- room = {
28
- firedSet = __TS__New(Set)
29
- }
30
- }
26
+ v = {room = {firedSet = __TS__New(Set)}}
31
27
  function ____exports.postTearInitVeryLateCallbackInit(self, mod)
32
28
  saveDataManager(nil, "postTearInitVeryLate", v, hasSubscriptions)
33
29
  mod:AddCallback(ModCallbacks.MC_POST_TEAR_UPDATE, postTearUpdate)