isaacscript-common 1.0.511 → 1.0.515

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 (125) hide show
  1. package/dist/callbacks/itemPickup.lua +6 -2
  2. package/dist/callbacks/postBombInitLate.lua +5 -1
  3. package/dist/callbacks/postCursedTeleport.lua +10 -8
  4. package/dist/callbacks/postEffectInitLate.lua +5 -1
  5. package/dist/callbacks/postEsauJr.lua +4 -2
  6. package/dist/callbacks/postFamiliarInitLate.lua +5 -1
  7. package/dist/callbacks/postFlip.lua +4 -2
  8. package/dist/callbacks/postGridEntity.lua +18 -8
  9. package/dist/callbacks/postKnifeInitLate.lua +5 -1
  10. package/dist/callbacks/postLaserInitLate.lua +5 -1
  11. package/dist/callbacks/postNPCInitLate.lua +5 -1
  12. package/dist/callbacks/postPickupCollect.lua +5 -1
  13. package/dist/callbacks/postPickupInitLate.lua +5 -1
  14. package/dist/callbacks/postPlayerChangeHealth.lua +13 -9
  15. package/dist/callbacks/postPlayerChangeType.lua +5 -1
  16. package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
  17. package/dist/callbacks/postPlayerInitLate.lua +5 -1
  18. package/dist/callbacks/postPlayerReordered.lua +1 -1
  19. package/dist/callbacks/postProjectileInitLate.lua +5 -1
  20. package/dist/callbacks/postPurchase.lua +15 -17
  21. package/dist/callbacks/postSacrifice.lua +3 -3
  22. package/dist/callbacks/postSlotInitUpdate.lua +11 -3
  23. package/dist/callbacks/postSlotRenderBroken.lua +8 -2
  24. package/dist/callbacks/postTearInitLate.lua +5 -1
  25. package/dist/callbacks/postTransformation.lua +5 -1
  26. package/dist/callbacks/reorderedCallbacks.lua +4 -4
  27. package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
  28. package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
  29. package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
  30. package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
  31. package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
  32. package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
  33. package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
  34. package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
  35. package/dist/callbacks/subscriptions/postFlip.lua +1 -1
  36. package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
  37. package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  38. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
  39. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  40. package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
  41. package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
  42. package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
  43. package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
  44. package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
  45. package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -1
  46. package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
  47. package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
  48. package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
  49. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
  50. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
  51. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
  52. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
  53. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
  54. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
  55. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
  56. package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
  57. package/dist/callbacks/subscriptions/postPurchase.lua +2 -8
  58. package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
  59. package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
  60. package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
  61. package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
  62. package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
  63. package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
  64. package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
  65. package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
  66. package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
  67. package/dist/constants.lua +5 -47
  68. package/dist/features/deployJSONRoom.lua +61 -90
  69. package/dist/features/disableInputs.lua +3 -9
  70. package/dist/features/forgottenSwitch.lua +1 -1
  71. package/dist/features/getCollectibleItemPoolType.lua +10 -4
  72. package/dist/features/preventCollectibleRotate.lua +9 -3
  73. package/dist/features/saveDataManager/load.lua +6 -2
  74. package/dist/features/saveDataManager/main.lua +1 -1
  75. package/dist/features/saveDataManager/merge.lua +4 -2
  76. package/dist/features/sirenHelpers.lua +5 -5
  77. package/dist/functions/array.lua +7 -5
  78. package/dist/functions/bitwise.lua +1 -1
  79. package/dist/functions/charge.lua +12 -10
  80. package/dist/functions/collectibles.lua +23 -18
  81. package/dist/functions/color.lua +1 -9
  82. package/dist/functions/deepCopy.lua +22 -42
  83. package/dist/functions/deepCopyTests.lua +20 -12
  84. package/dist/functions/doors.lua +19 -7
  85. package/dist/functions/entity.lua +2 -8
  86. package/dist/functions/flag.lua +1 -1
  87. package/dist/functions/gridEntity.lua +9 -14
  88. package/dist/functions/input.lua +18 -14
  89. package/dist/functions/jsonRoom.lua +9 -3
  90. package/dist/functions/language.lua +1 -9
  91. package/dist/functions/log.lua +46 -18
  92. package/dist/functions/math.lua +17 -15
  93. package/dist/functions/npc.lua +17 -15
  94. package/dist/functions/pickups.lua +1 -14
  95. package/dist/functions/player.lua +47 -25
  96. package/dist/functions/playerHealth.lua +9 -19
  97. package/dist/functions/pocketItems.lua +4 -4
  98. package/dist/functions/random.lua +2 -2
  99. package/dist/functions/revive.lua +4 -4
  100. package/dist/functions/rooms.d.ts +14 -1
  101. package/dist/functions/rooms.lua +77 -17
  102. package/dist/functions/spawnCollectible.lua +2 -10
  103. package/dist/functions/sprite.lua +2 -2
  104. package/dist/functions/stage.lua +6 -6
  105. package/dist/functions/tears.lua +1 -1
  106. package/dist/functions/transformations.lua +10 -4
  107. package/dist/functions/trinketGive.lua +2 -2
  108. package/dist/functions/trinkets.lua +5 -3
  109. package/dist/functions/ui.lua +3 -3
  110. package/dist/functions/util.lua +8 -4
  111. package/dist/functions/vector.lua +8 -8
  112. package/dist/lualib_bundle.lua +555 -603
  113. package/dist/maps/cardDescriptionMap.lua +1 -99
  114. package/dist/maps/cardNameMap.lua +1 -99
  115. package/dist/maps/collectibleDescriptionMap.lua +1 -722
  116. package/dist/maps/collectibleNameMap.lua +1 -722
  117. package/dist/maps/gridEntityXMLMap.lua +1 -36
  118. package/dist/maps/pillEffectNameMap.lua +1 -52
  119. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -7
  120. package/dist/maps/transformationMap.lua +12 -19
  121. package/dist/maps/trinketDescriptionMap.lua +1 -190
  122. package/dist/maps/trinketNameMap.lua +1 -190
  123. package/dist/sets/cards.lua +2 -98
  124. package/dist/types/ModUpgraded.lua +50 -44
  125. package/package.json +2 -2
@@ -16,7 +16,9 @@ function ____exports.getDebugPrependString(self, msg, numParentFunctions)
16
16
  end
17
17
  end
18
18
  if getParentFunctionDescription ~= nil then
19
- return (tostring(getParentFunctionDescription(numParentFunctions + 1)) .. " - ") .. msg
19
+ return (tostring(
20
+ getParentFunctionDescription(numParentFunctions + 1)
21
+ ) .. " - ") .. msg
20
22
  end
21
23
  return msg
22
24
  end
@@ -34,7 +36,9 @@ function ____exports.logAllFlags(flags, flagEnum, description)
34
36
  ____exports.log(("Logging all " .. description) .. "flags:")
35
37
  for key, value in pairs(flagEnum) do
36
38
  if hasFlag(nil, flags, value) then
37
- ____exports.log("- Has flag: " .. tostring(key))
39
+ ____exports.log(
40
+ "- Has flag: " .. tostring(key)
41
+ )
38
42
  end
39
43
  end
40
44
  end
@@ -47,10 +51,12 @@ end
47
51
  function ____exports.logAllGameStateFlags()
48
52
  local game = Game()
49
53
  ____exports.log("Logging all game state flags:")
50
- local value
51
- local key
52
- for ____, ____value in ipairs(__TS__ObjectEntries(GameStateFlag)) do
54
+ for ____, ____value in ipairs(
55
+ __TS__ObjectEntries(GameStateFlag)
56
+ ) do
57
+ local key
53
58
  key = ____value[1]
59
+ local value
54
60
  value = ____value[2]
55
61
  local gameStateFlag = value
56
62
  local flagValue = game:GetStateFlag(gameStateFlag)
@@ -73,40 +79,62 @@ function ____exports.logArray(array)
73
79
  ____exports.log("Array: " .. arrayString)
74
80
  end
75
81
  function ____exports.logColor(color)
76
- ____exports.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))
82
+ ____exports.log(
83
+ (((((((((((("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)
84
+ )
77
85
  end
78
86
  function ____exports.logEntity(entity)
79
- ____exports.log((((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType))
87
+ ____exports.log(
88
+ (((("Entity: " .. tostring(entity.Type)) .. ".") .. tostring(entity.Variant)) .. ".") .. tostring(entity.SubType)
89
+ )
80
90
  end
81
91
  function ____exports.logKColor(kColor)
82
- ____exports.log((((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha))
92
+ ____exports.log(
93
+ (((((("Color: R" .. tostring(kColor.Red)) .. ", G") .. tostring(kColor.Green)) .. ", B") .. tostring(kColor.Blue)) .. ", A") .. tostring(kColor.Alpha)
94
+ )
83
95
  end
84
96
  function ____exports.logMap(map)
85
97
  ____exports.log("Printing out a TSTL Map:")
86
- local value
87
- local key
88
- for ____, ____value in __TS__Iterator(map:entries()) do
98
+ for ____, ____value in __TS__Iterator(
99
+ map:entries()
100
+ ) do
101
+ local key
89
102
  key = ____value[1]
103
+ local value
90
104
  value = ____value[2]
91
- ____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
105
+ ____exports.log(
106
+ ((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
107
+ )
92
108
  end
93
- ____exports.log("The size of the map was: " .. tostring(map.size))
109
+ ____exports.log(
110
+ "The size of the map was: " .. tostring(map.size)
111
+ )
94
112
  end
95
113
  function ____exports.logTable(____table)
96
114
  ____exports.log("Printing out a Lua table:")
97
115
  for key, value in pairs(____table) do
98
- ____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
116
+ ____exports.log(
117
+ ((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value)
118
+ )
99
119
  end
100
120
  end
101
121
  function ____exports.logSet(set)
102
122
  ____exports.log("Printing out a TSTL Set:")
103
- for ____, value in __TS__Iterator(set:values()) do
104
- ____exports.log(" Value: " .. tostring(value))
123
+ for ____, value in __TS__Iterator(
124
+ set:values()
125
+ ) do
126
+ ____exports.log(
127
+ " Value: " .. tostring(value)
128
+ )
105
129
  end
106
- ____exports.log("The size of the set was: " .. tostring(set.size))
130
+ ____exports.log(
131
+ "The size of the set was: " .. tostring(set.size)
132
+ )
107
133
  end
108
134
  function ____exports.logVector(vector)
109
- ____exports.log(((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")")
135
+ ____exports.log(
136
+ ((("Vector: (" .. tostring(vector.X)) .. ", ") .. tostring(vector.Y)) .. ")"
137
+ )
110
138
  end
111
139
  function ____exports.setLogFunctionsGlobal(self)
112
140
  local globals = _G
@@ -13,25 +13,25 @@ function getCircleInitialPosition(self, direction, radius)
13
13
  return Vector.Zero
14
14
  end
15
15
  end
16
- ____cond6 = ____cond6 or ____switch6 == Direction.LEFT
16
+ ____cond6 = ____cond6 or (____switch6 == Direction.LEFT)
17
17
  if ____cond6 then
18
18
  do
19
19
  return Vector(-radius, 0)
20
20
  end
21
21
  end
22
- ____cond6 = ____cond6 or ____switch6 == Direction.UP
22
+ ____cond6 = ____cond6 or (____switch6 == Direction.UP)
23
23
  if ____cond6 then
24
24
  do
25
25
  return Vector(0, -radius)
26
26
  end
27
27
  end
28
- ____cond6 = ____cond6 or ____switch6 == Direction.RIGHT
28
+ ____cond6 = ____cond6 or (____switch6 == Direction.RIGHT)
29
29
  if ____cond6 then
30
30
  do
31
31
  return Vector(radius, 0)
32
32
  end
33
33
  end
34
- ____cond6 = ____cond6 or ____switch6 == Direction.DOWN
34
+ ____cond6 = ____cond6 or (____switch6 == Direction.DOWN)
35
35
  if ____cond6 then
36
36
  do
37
37
  return Vector(0, radius)
@@ -47,7 +47,7 @@ function getCircleInitialPosition(self, direction, radius)
47
47
  end
48
48
  function ____exports.getAngleDifference(self, angle1, angle2)
49
49
  local subtractedAngle = angle1 - angle2
50
- return (subtractedAngle + 180) % 360 - 180
50
+ return ((subtractedAngle + 180) % 360) - 180
51
51
  end
52
52
  function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoints, xMultiplier, yMultiplier, initialDirection)
53
53
  if xMultiplier == nil then
@@ -64,7 +64,7 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
64
64
  do
65
65
  local i = 0
66
66
  while i < numPoints do
67
- local rotatedPosition = initialPosition:Rotated(i * 360 / numPoints)
67
+ local rotatedPosition = initialPosition:Rotated((i * 360) / numPoints)
68
68
  rotatedPosition.X = rotatedPosition.X * xMultiplier
69
69
  rotatedPosition.Y = rotatedPosition.Y * yMultiplier
70
70
  local positionFromCenter = centerPos + rotatedPosition
@@ -75,26 +75,28 @@ function ____exports.getCircleDiscretizedPoints(self, centerPos, radius, numPoin
75
75
  return positions
76
76
  end
77
77
  function ____exports.isEven(self, num)
78
- return num & 1 == 0
78
+ return (num & 1) == 0
79
79
  end
80
80
  function ____exports.isOdd(self, num)
81
- return num & 1 == 1
81
+ return (num & 1) == 1
82
82
  end
83
83
  function ____exports.lerp(self, a, b, pos)
84
- return a + (b - a) * pos
84
+ return a + ((b - a) * pos)
85
85
  end
86
86
  function ____exports.lerpAngleDegrees(self, aStart, aEnd, percent)
87
- return aStart + ____exports.getAngleDifference(nil, aStart, aEnd) * percent
87
+ return aStart + (____exports.getAngleDifference(nil, aStart, aEnd) * percent)
88
88
  end
89
89
  function ____exports.round(self, num, numDecimalPlaces)
90
90
  if numDecimalPlaces == nil then
91
91
  numDecimalPlaces = 0
92
92
  end
93
- local roundedNum = tonumber(string.format(
94
- ("%." .. tostring(numDecimalPlaces)) .. "f",
95
- num
96
- ))
97
- return roundedNum == nil and 0 or roundedNum
93
+ local roundedNum = tonumber(
94
+ string.format(
95
+ ("%." .. tostring(numDecimalPlaces)) .. "f",
96
+ num
97
+ )
98
+ )
99
+ return ((roundedNum == nil) and 0) or roundedNum
98
100
  end
99
101
  function ____exports.tanh(self, x)
100
102
  return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))
@@ -9,7 +9,9 @@ local getEntities = ____entity.getEntities
9
9
  local removeEntities = ____entity.removeEntities
10
10
  function ____exports.getBosses(self)
11
11
  local bosses = {}
12
- for ____, npc in ipairs(____exports.getNPCs(nil)) do
12
+ for ____, npc in ipairs(
13
+ ____exports.getNPCs(nil)
14
+ ) do
13
15
  if npc:IsBoss() then
14
16
  __TS__ArrayPush(bosses, npc)
15
17
  end
@@ -20,13 +22,7 @@ function ____exports.getNPCs(self, matchingEntityType, matchingVariant, matching
20
22
  if ignoreFriendly == nil then
21
23
  ignoreFriendly = false
22
24
  end
23
- local entities = getEntities(
24
- nil,
25
- matchingEntityType,
26
- matchingVariant,
27
- matchingSubType,
28
- ignoreFriendly
29
- )
25
+ local entities = getEntities(nil, matchingEntityType, matchingVariant, matchingSubType, ignoreFriendly)
30
26
  local npcs = {}
31
27
  for ____, entity in ipairs(entities) do
32
28
  local npc = entity:ToNPC()
@@ -54,10 +50,10 @@ function ____exports.isAliveExceptionNPC(self, npc)
54
50
  return false
55
51
  end
56
52
  function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
57
- return npc.State == NpcState.STATE_SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
53
+ return (npc.State == NpcState.STATE_SUICIDE) and (npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER)
58
54
  end
59
55
  function ____exports.isRaglingDeathPatch(self, npc)
60
- return npc.Type == EntityType.ENTITY_RAGLING and npc.Variant == 1 and npc.State == NpcState.STATE_SPECIAL
56
+ return ((npc.Type == EntityType.ENTITY_RAGLING) and (npc.Variant == 1)) and (npc.State == NpcState.STATE_SPECIAL)
61
57
  end
62
58
  NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
63
59
  Set,
@@ -75,12 +71,16 @@ NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
75
71
  )
76
72
  NON_ALIVE_NPCS_TYPE_VARIANT_SUBTYPE = __TS__New(
77
73
  Set,
78
- {(((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1}
74
+ {
75
+ (((tostring(EntityType.ENTITY_CHARGER) .. ".") .. 0) .. ".") .. 1
76
+ }
79
77
  )
80
78
  function ____exports.getAliveBosses(self)
81
79
  local aliveBosses = {}
82
- for ____, boss in ipairs(____exports.getBosses(nil)) do
83
- if not boss:IsDead() and not ____exports.isAliveExceptionNPC(nil, boss) then
80
+ for ____, boss in ipairs(
81
+ ____exports.getBosses(nil)
82
+ ) do
83
+ if (not boss:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, boss)) then
84
84
  __TS__ArrayPush(aliveBosses, boss)
85
85
  end
86
86
  end
@@ -88,8 +88,10 @@ function ____exports.getAliveBosses(self)
88
88
  end
89
89
  function ____exports.getAliveNPCs(self)
90
90
  local aliveNPCs = {}
91
- for ____, npc in ipairs(____exports.getNPCs(nil)) do
92
- if not npc:IsDead() and not ____exports.isAliveExceptionNPC(nil, npc) then
91
+ for ____, npc in ipairs(
92
+ ____exports.getNPCs(nil)
93
+ ) do
94
+ if (not npc:IsDead()) and (not ____exports.isAliveExceptionNPC(nil, npc)) then
93
95
  __TS__ArrayPush(aliveNPCs, npc)
94
96
  end
95
97
  end
@@ -15,20 +15,7 @@ function ____exports.getRandomHeartSubType(self, seed, exceptions)
15
15
  local heartSubTypes = getEnumValues(nil, HeartSubType)
16
16
  return getRandomArrayElement(nil, heartSubTypes, seed, exceptions)
17
17
  end
18
- local CHEST_PICKUP_VARIANTS = __TS__New(Set, {
19
- PickupVariant.PICKUP_CHEST,
20
- PickupVariant.PICKUP_BOMBCHEST,
21
- PickupVariant.PICKUP_SPIKEDCHEST,
22
- PickupVariant.PICKUP_ETERNALCHEST,
23
- PickupVariant.PICKUP_MIMICCHEST,
24
- PickupVariant.PICKUP_OLDCHEST,
25
- PickupVariant.PICKUP_WOODENCHEST,
26
- PickupVariant.PICKUP_MEGACHEST,
27
- PickupVariant.PICKUP_HAUNTEDCHEST,
28
- PickupVariant.PICKUP_LOCKEDCHEST,
29
- PickupVariant.PICKUP_REDCHEST,
30
- PickupVariant.PICKUP_MOMSCHEST
31
- })
18
+ local CHEST_PICKUP_VARIANTS = __TS__New(Set, {PickupVariant.PICKUP_CHEST, PickupVariant.PICKUP_BOMBCHEST, PickupVariant.PICKUP_SPIKEDCHEST, PickupVariant.PICKUP_ETERNALCHEST, PickupVariant.PICKUP_MIMICCHEST, PickupVariant.PICKUP_OLDCHEST, PickupVariant.PICKUP_WOODENCHEST, PickupVariant.PICKUP_MEGACHEST, PickupVariant.PICKUP_HAUNTEDCHEST, PickupVariant.PICKUP_LOCKEDCHEST, PickupVariant.PICKUP_REDCHEST, PickupVariant.PICKUP_MOMSCHEST})
32
19
  function ____exports.isChest(self, pickup)
33
20
  return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
34
21
  end
@@ -48,7 +48,7 @@ function ____exports.getPlayers(self, performExclusions)
48
48
  end
49
49
  function ____exports.getPlayerIndex(self, player)
50
50
  local character = player:GetPlayerType()
51
- local collectibleToUse = character == PlayerType.PLAYER_LAZARUS2_B and CollectibleType.COLLECTIBLE_INNER_EYE or CollectibleType.COLLECTIBLE_SAD_ONION
51
+ local collectibleToUse = ((character == PlayerType.PLAYER_LAZARUS2_B) and CollectibleType.COLLECTIBLE_INNER_EYE) or CollectibleType.COLLECTIBLE_SAD_ONION
52
52
  local collectibleRNG = player:GetCollectibleRNG(collectibleToUse)
53
53
  local seed = collectibleRNG:GetSeed()
54
54
  return seed
@@ -74,7 +74,9 @@ function ____exports.addTrinketCostume(self, player, trinketType)
74
74
  player:AddCostume(itemConfigTrinket, false)
75
75
  end
76
76
  function ____exports.anyPlayerCloserThan(self, position, distance)
77
- for ____, player in ipairs(____exports.getPlayers(nil)) do
77
+ for ____, player in ipairs(
78
+ ____exports.getPlayers(nil)
79
+ ) do
78
80
  if player.Position:Distance(position) <= distance then
79
81
  return true
80
82
  end
@@ -82,7 +84,9 @@ function ____exports.anyPlayerCloserThan(self, position, distance)
82
84
  return false
83
85
  end
84
86
  function ____exports.anyPlayerHasCollectible(self, collectibleType)
85
- for ____, player in ipairs(____exports.getPlayers(nil)) do
87
+ for ____, player in ipairs(
88
+ ____exports.getPlayers(nil)
89
+ ) do
86
90
  if player:HasCollectible(collectibleType) then
87
91
  return true
88
92
  end
@@ -90,7 +94,9 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType)
90
94
  return false
91
95
  end
92
96
  function ____exports.anyPlayerHasTrinket(self, trinketType)
93
- for ____, player in ipairs(____exports.getPlayers(nil)) do
97
+ for ____, player in ipairs(
98
+ ____exports.getPlayers(nil)
99
+ ) do
94
100
  if player:HasTrinket(trinketType) then
95
101
  return true
96
102
  end
@@ -98,7 +104,9 @@ function ____exports.anyPlayerHasTrinket(self, trinketType)
98
104
  return false
99
105
  end
100
106
  function ____exports.anyPlayerIs(self, matchingCharacter)
101
- for ____, player in ipairs(____exports.getPlayers(nil)) do
107
+ for ____, player in ipairs(
108
+ ____exports.getPlayers(nil)
109
+ ) do
102
110
  local character = player:GetPlayerType()
103
111
  if character == matchingCharacter then
104
112
  return true
@@ -118,12 +126,14 @@ function ____exports.getAzazelBrimstoneDistance(self, playerOrTearHeight)
118
126
  local player = playerOrTearHeight
119
127
  tearHeight = player.TearHeight
120
128
  end
121
- return 32 - 2.5 * tearHeight
129
+ return 32 - (2.5 * tearHeight)
122
130
  end
123
131
  function ____exports.getClosestPlayer(self, position)
124
132
  local closestPlayer = nil
125
133
  local closestDistance = math.huge
126
- for ____, player in ipairs(____exports.getPlayers(nil)) do
134
+ for ____, player in ipairs(
135
+ ____exports.getPlayers(nil)
136
+ ) do
127
137
  local distance = position:Distance(player.Position)
128
138
  if distance < closestDistance then
129
139
  closestPlayer = player
@@ -154,10 +164,10 @@ function ____exports.getLastHeart(self, player)
154
164
  local boneHearts = player:GetBoneHearts()
155
165
  local rottenHearts = player:GetRottenHearts()
156
166
  local soulHeartSlots = soulHearts / 2
157
- local lastHeartIndex = boneHearts + soulHeartSlots - 1
167
+ local lastHeartIndex = (boneHearts + soulHeartSlots) - 1
158
168
  local isLastHeartBone = player:IsBoneHeart(lastHeartIndex)
159
169
  if isLastHeartBone then
160
- local isLastContainerEmpty = hearts <= effectiveMaxHearts - 2
170
+ local isLastContainerEmpty = hearts <= (effectiveMaxHearts - 2)
161
171
  if isLastContainerEmpty then
162
172
  return HealthType.BONE
163
173
  end
@@ -189,7 +199,9 @@ end
189
199
  function ____exports.getNewestPlayer(self)
190
200
  local newestPlayer = nil
191
201
  local lowestFrame = math.huge
192
- for ____, player in ipairs(____exports.getPlayers(nil)) do
202
+ for ____, player in ipairs(
203
+ ____exports.getPlayers(nil)
204
+ ) do
193
205
  if player.FrameCount < lowestFrame then
194
206
  newestPlayer = player
195
207
  lowestFrame = player.FrameCount
@@ -205,7 +217,9 @@ function ____exports.getFinalPlayer(self)
205
217
  return players[#players]
206
218
  end
207
219
  function ____exports.getPlayerCloserThan(self, position, distance)
208
- for ____, player in ipairs(____exports.getPlayers(nil)) do
220
+ for ____, player in ipairs(
221
+ ____exports.getPlayers(nil)
222
+ ) do
209
223
  if player.Position:Distance(position) <= distance then
210
224
  return player
211
225
  end
@@ -215,7 +229,9 @@ end
215
229
  function ____exports.getPlayerCollectibleMap(self, player)
216
230
  local collectibleSet = getCollectibleSet(nil)
217
231
  local collectibleMap = __TS__New(Map)
218
- for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
232
+ for ____, collectibleType in __TS__Iterator(
233
+ collectibleSet:values()
234
+ ) do
219
235
  local collectibleNum = player:GetCollectibleNum(collectibleType, true)
220
236
  if collectibleNum > 0 then
221
237
  collectibleMap:set(collectibleType, collectibleNum)
@@ -224,7 +240,9 @@ function ____exports.getPlayerCollectibleMap(self, player)
224
240
  return collectibleMap
225
241
  end
226
242
  function ____exports.getPlayerFromIndex(self, playerIndex)
227
- for ____, player in ipairs(____exports.getPlayers(nil)) do
243
+ for ____, player in ipairs(
244
+ ____exports.getPlayers(nil)
245
+ ) do
228
246
  local existingPlayerIndex = ____exports.getPlayerIndex(nil, player)
229
247
  if existingPlayerIndex == playerIndex then
230
248
  return player
@@ -234,7 +252,9 @@ function ____exports.getPlayerFromIndex(self, playerIndex)
234
252
  end
235
253
  function ____exports.getPlayersOfType(self, playerType)
236
254
  local players = {}
237
- for ____, player in ipairs(____exports.getPlayers(nil)) do
255
+ for ____, player in ipairs(
256
+ ____exports.getPlayers(nil)
257
+ ) do
238
258
  local character = player:GetPlayerType()
239
259
  if character == playerType then
240
260
  __TS__ArrayPush(players, player)
@@ -269,7 +289,7 @@ function ____exports.getPlayerNumAllHearts(self, player)
269
289
  local soulHearts = player:GetSoulHearts()
270
290
  local boneHearts = player:GetBoneHearts()
271
291
  local eternalHearts = player:GetEternalHearts()
272
- return hearts + soulHearts + boneHearts + eternalHearts
292
+ return ((hearts + soulHearts) + boneHearts) + eternalHearts
273
293
  end
274
294
  function ____exports.getTotalCharge(self, player, activeSlot)
275
295
  local activeCharge = player:GetActiveCharge(activeSlot)
@@ -278,7 +298,9 @@ function ____exports.getTotalCharge(self, player, activeSlot)
278
298
  end
279
299
  function ____exports.getTotalPlayerCollectibles(self, collectibleType)
280
300
  local numCollectibles = 0
281
- for ____, player in ipairs(____exports.getPlayers(nil)) do
301
+ for ____, player in ipairs(
302
+ ____exports.getPlayers(nil)
303
+ ) do
282
304
  numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType)
283
305
  end
284
306
  return numCollectibles
@@ -296,32 +318,32 @@ function ____exports.hasOpenActiveItemSlot(self, player)
296
318
  local activeItemSecondary = player:GetActiveItem(ActiveSlot.SLOT_SECONDARY)
297
319
  local hasSchoolbag = player:HasCollectible(CollectibleType.COLLECTIBLE_SCHOOLBAG)
298
320
  if hasSchoolbag then
299
- return activeItemPrimary == CollectibleType.COLLECTIBLE_NULL or activeItemSecondary == CollectibleType.COLLECTIBLE_NULL
321
+ return (activeItemPrimary == CollectibleType.COLLECTIBLE_NULL) or (activeItemSecondary == CollectibleType.COLLECTIBLE_NULL)
300
322
  end
301
323
  return activeItemPrimary == CollectibleType.COLLECTIBLE_NULL
302
324
  end
303
325
  function ____exports.isBethany(self, player)
304
326
  local character = player:GetPlayerType()
305
- return character == PlayerType.PLAYER_BETHANY or character == PlayerType.PLAYER_BETHANY_B
327
+ return (character == PlayerType.PLAYER_BETHANY) or (character == PlayerType.PLAYER_BETHANY_B)
306
328
  end
307
329
  function ____exports.isFirstPlayer(self, player)
308
330
  return ____exports.getPlayerIndexVanilla(nil, player) == 0
309
331
  end
310
332
  function ____exports.isJacobOrEsau(self, player)
311
333
  local character = player:GetPlayerType()
312
- return character == PlayerType.PLAYER_JACOB or character == PlayerType.PLAYER_ESAU
334
+ return (character == PlayerType.PLAYER_JACOB) or (character == PlayerType.PLAYER_ESAU)
313
335
  end
314
336
  function ____exports.isKeeper(self, player)
315
337
  local character = player:GetPlayerType()
316
- return character == PlayerType.PLAYER_KEEPER or character == PlayerType.PLAYER_KEEPER_B
338
+ return (character == PlayerType.PLAYER_KEEPER) or (character == PlayerType.PLAYER_KEEPER_B)
317
339
  end
318
340
  function ____exports.isLost(self, player)
319
341
  local character = player:GetPlayerType()
320
- return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
342
+ return (character == PlayerType.PLAYER_THELOST) or (character == PlayerType.PLAYER_THELOST_B)
321
343
  end
322
344
  function ____exports.isTaintedLazarus(self, player)
323
345
  local character = player:GetPlayerType()
324
- return character == PlayerType.PLAYER_LAZARUS_B or character == PlayerType.PLAYER_LAZARUS2_B
346
+ return (character == PlayerType.PLAYER_LAZARUS_B) or (character == PlayerType.PLAYER_LAZARUS2_B)
325
347
  end
326
348
  function ____exports.removeCollectibleCostume(self, player, collectibleType)
327
349
  local itemConfig = Isaac.GetItemConfig()
@@ -375,7 +397,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
375
397
  break
376
398
  end
377
399
  end
378
- ____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_SECONDARY
400
+ ____cond89 = ____cond89 or (____switch89 == ActiveSlot.SLOT_SECONDARY)
379
401
  if ____cond89 then
380
402
  do
381
403
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
@@ -391,7 +413,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
391
413
  break
392
414
  end
393
415
  end
394
- ____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_POCKET
416
+ ____cond89 = ____cond89 or (____switch89 == ActiveSlot.SLOT_POCKET)
395
417
  if ____cond89 then
396
418
  do
397
419
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
@@ -399,7 +421,7 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
399
421
  break
400
422
  end
401
423
  end
402
- ____cond89 = ____cond89 or ____switch89 == ActiveSlot.SLOT_POCKET2
424
+ ____cond89 = ____cond89 or (____switch89 == ActiveSlot.SLOT_POCKET2)
403
425
  if ____cond89 then
404
426
  do
405
427
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
@@ -27,29 +27,29 @@ function ____exports.getPlayerHealth(self, player)
27
27
  local rottenHearts = player:GetRottenHearts()
28
28
  local brokenHearts = player:GetBrokenHearts()
29
29
  local subPlayer = player:GetSubPlayer()
30
- if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
30
+ if (character == PlayerType.PLAYER_THEFORGOTTEN) and (subPlayer ~= nil) then
31
31
  maxHearts = boneHearts * 2
32
32
  boneHearts = 0
33
33
  soulHearts = subPlayer:GetSoulHearts()
34
- elseif character == PlayerType.PLAYER_THESOUL and subPlayer ~= nil then
34
+ elseif (character == PlayerType.PLAYER_THESOUL) and (subPlayer ~= nil) then
35
35
  maxHearts = subPlayer:GetBoneHearts() * 2
36
36
  hearts = subPlayer:GetHearts()
37
37
  end
38
- hearts = hearts - rottenHearts * 2
38
+ hearts = hearts - (rottenHearts * 2)
39
39
  local extraHearts = math.ceil(soulHearts / 2) + boneHearts
40
40
  local currentSoulHeart = 0
41
41
  do
42
42
  local i = 0
43
43
  while i < extraHearts do
44
44
  local isBoneHeart = player:IsBoneHeart(i)
45
- if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
45
+ if (character == PlayerType.PLAYER_THEFORGOTTEN) and (subPlayer ~= nil) then
46
46
  isBoneHeart = subPlayer:IsBoneHeart(i)
47
47
  end
48
48
  if isBoneHeart then
49
49
  __TS__ArrayPush(soulHeartTypes, HeartSubType.HEART_BONE)
50
50
  else
51
51
  local isBlackHeart = player:IsBlackHeart(currentSoulHeart + 1)
52
- if character == PlayerType.PLAYER_THEFORGOTTEN and subPlayer ~= nil then
52
+ if (character == PlayerType.PLAYER_THEFORGOTTEN) and (subPlayer ~= nil) then
53
53
  isBlackHeart = subPlayer:IsBlackHeart(currentSoulHeart + 1)
54
54
  end
55
55
  if isBlackHeart then
@@ -62,23 +62,13 @@ function ____exports.getPlayerHealth(self, player)
62
62
  i = i + 1
63
63
  end
64
64
  end
65
- return {
66
- soulHeartTypes = soulHeartTypes,
67
- maxHearts = maxHearts,
68
- hearts = hearts,
69
- eternalHearts = eternalHearts,
70
- soulHearts = soulHearts,
71
- boneHearts = boneHearts,
72
- goldenHearts = goldenHearts,
73
- rottenHearts = rottenHearts,
74
- brokenHearts = brokenHearts
75
- }
65
+ return {soulHeartTypes = soulHeartTypes, maxHearts = maxHearts, hearts = hearts, eternalHearts = eternalHearts, soulHearts = soulHearts, boneHearts = boneHearts, goldenHearts = goldenHearts, rottenHearts = rottenHearts, brokenHearts = brokenHearts}
76
66
  end
77
67
  function ____exports.setPlayerHealth(self, player, playerHealth)
78
68
  local character = player:GetPlayerType()
79
69
  local subPlayer = player:GetSubPlayer()
80
70
  ____exports.removeAllPlayerHealth(nil, player)
81
- if character == PlayerType.PLAYER_THESOUL and subPlayer ~= nil then
71
+ if (character == PlayerType.PLAYER_THESOUL) and (subPlayer ~= nil) then
82
72
  subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
83
73
  else
84
74
  player:AddMaxHearts(playerHealth.maxHearts, false)
@@ -89,9 +79,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
89
79
  local i = 0
90
80
  while i < #playerHealth.soulHeartTypes do
91
81
  local heartType = playerHealth.soulHeartTypes[i + 1]
92
- local isHalf = playerHealth.soulHearts + playerHealth.boneHearts * 2 < (i + 1) * 2
82
+ local isHalf = (playerHealth.soulHearts + (playerHealth.boneHearts * 2)) < ((i + 1) * 2)
93
83
  local addAmount = 2
94
- if isHalf or heartType == HeartSubType.HEART_BONE or soulHeartsRemaining < 2 then
84
+ if (isHalf or (heartType == HeartSubType.HEART_BONE)) or (soulHeartsRemaining < 2) then
95
85
  addAmount = 1
96
86
  end
97
87
  if heartType == HeartSubType.HEART_SOUL then
@@ -21,10 +21,10 @@ function ____exports.getPocketItems(self, player)
21
21
  __TS__ArrayPush(pocketItems, {type = PocketItemType.CARD, id = card, slot = slot})
22
22
  elseif pill ~= PillColor.PILL_NULL then
23
23
  __TS__ArrayPush(pocketItems, {type = PocketItemType.PILL, id = pill, slot = slot})
24
- elseif hasPocketItem and not hasPocketItem2 and not pocketItemIdentified then
24
+ elseif (hasPocketItem and (not hasPocketItem2)) and (not pocketItemIdentified) then
25
25
  pocketItemIdentified = true
26
26
  __TS__ArrayPush(pocketItems, {type = PocketItemType.ACTIVE_ITEM, id = pocketItem, slot = slot})
27
- elseif not hasPocketItem and hasPocketItem2 and not pocketItem2Identified then
27
+ elseif ((not hasPocketItem) and hasPocketItem2) and (not pocketItem2Identified) then
28
28
  pocketItem2Identified = true
29
29
  __TS__ArrayPush(pocketItems, {type = PocketItemType.DICE_BAG_DICE, id = pocketItem2, slot = slot})
30
30
  elseif hasPocketItem and hasPocketItem2 then
@@ -32,7 +32,7 @@ function ____exports.getPocketItems(self, player)
32
32
  else
33
33
  __TS__ArrayPush(pocketItems, {type = PocketItemType.EMPTY, id = 0, slot = slot})
34
34
  end
35
- if slot + 1 == maxPocketItems then
35
+ if (slot + 1) == maxPocketItems then
36
36
  break
37
37
  end
38
38
  slot = slot + 1
@@ -43,7 +43,7 @@ end
43
43
  function ____exports.getFirstCardOrPill(self, player)
44
44
  local pocketItems = ____exports.getPocketItems(nil, player)
45
45
  for ____, pocketItem in ipairs(pocketItems) do
46
- if pocketItem.type == PocketItemType.CARD or pocketItem.type == PocketItemType.PILL then
46
+ if (pocketItem.type == PocketItemType.CARD) or (pocketItem.type == PocketItemType.PILL) then
47
47
  return pocketItem
48
48
  end
49
49
  end
@@ -27,14 +27,14 @@ function ____exports.getRandomFloat(self, min, max, seed)
27
27
  if seed == nil then
28
28
  seed = Random()
29
29
  end
30
- return min + ____exports.getRandom(nil, seed) * (max - min)
30
+ return min + (____exports.getRandom(nil, seed) * (max - min))
31
31
  end
32
32
  function ____exports.getRandomInt(self, min, max, seed)
33
33
  if seed == nil then
34
34
  seed = Random()
35
35
  end
36
36
  local rng = ____exports.initRNG(nil, seed)
37
- return rng:RandomInt(max - min + 1) + min
37
+ return rng:RandomInt((max - min) + 1) + min
38
38
  end
39
39
  function ____exports.nextSeed(self, seed)
40
40
  local rng = ____exports.initRNG(nil, seed)
@@ -13,12 +13,12 @@ function ____exports.willMysteriousPaperRevive(self, player)
13
13
  local sprite = player:GetSprite()
14
14
  local animation = getDeathAnimationName(nil, player)
15
15
  local deathAnimationFrames = getFinalFrameOfAnimation(nil, sprite, animation)
16
- local frameOfDeath = gameFrameCount + deathAnimationFrames + 1
17
- return frameOfDeath % 4 == 3
16
+ local frameOfDeath = (gameFrameCount + deathAnimationFrames) + 1
17
+ return (frameOfDeath % 4) == 3
18
18
  end
19
19
  function ____exports.willPlayerRevive(self, player)
20
20
  local trinketSituation = temporarilyRemoveTrinkets(nil, player, TrinketType.TRINKET_MYSTERIOUS_PAPER)
21
- local willRevive = player:WillPlayerRevive() or trinketSituation ~= nil and ____exports.willMysteriousPaperRevive(nil, player)
21
+ local willRevive = player:WillPlayerRevive() or ((trinketSituation ~= nil) and ____exports.willMysteriousPaperRevive(nil, player))
22
22
  giveTrinketsBack(nil, player, trinketSituation)
23
23
  return willRevive
24
24
  end
@@ -29,6 +29,6 @@ function ____exports.willReviveFromSpiritShackles(self, player)
29
29
  local effects = player:GetEffects()
30
30
  local spiritShacklesEnabled = not effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_DISABLED)
31
31
  local playerInSoulForm = effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_SOUL)
32
- return spiritShacklesEnabled and not playerInSoulForm
32
+ return spiritShacklesEnabled and (not playerInSoulForm)
33
33
  end
34
34
  return ____exports