isaacscript-common 1.0.488 → 1.0.489

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/README.md +2 -0
  2. package/dist/callbacks/itemPickup.lua +2 -6
  3. package/dist/callbacks/postBombInitLate.lua +6 -8
  4. package/dist/callbacks/postCursedTeleport.lua +8 -10
  5. package/dist/callbacks/postEffectInitLate.lua +6 -8
  6. package/dist/callbacks/postEsauJr.lua +2 -4
  7. package/dist/callbacks/postFamiliarInitLate.lua +6 -8
  8. package/dist/callbacks/postFlip.lua +2 -4
  9. package/dist/callbacks/postGridEntity.lua +8 -18
  10. package/dist/callbacks/postKnifeInitLate.lua +6 -8
  11. package/dist/callbacks/postLaserInitLate.lua +6 -8
  12. package/dist/callbacks/postNPCInitLate.lua +6 -8
  13. package/dist/callbacks/postPickupCollect.lua +1 -5
  14. package/dist/callbacks/postPickupInitLate.lua +6 -8
  15. package/dist/callbacks/postPlayerChangeHealth.lua +9 -13
  16. package/dist/callbacks/postPlayerChangeType.lua +1 -5
  17. package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
  18. package/dist/callbacks/postPlayerInitLate.lua +1 -5
  19. package/dist/callbacks/postPlayerReordered.lua +1 -1
  20. package/dist/callbacks/postProjectileInitLate.lua +6 -8
  21. package/dist/callbacks/postPurchase.lua +10 -14
  22. package/dist/callbacks/postSacrifice.lua +3 -3
  23. package/dist/callbacks/postSlotInitUpdate.lua +3 -11
  24. package/dist/callbacks/postSlotRenderBroken.lua +2 -8
  25. package/dist/callbacks/postTearInitLate.lua +6 -8
  26. package/dist/callbacks/postTransformation.lua +1 -5
  27. package/dist/callbacks/reorderedCallbacks.lua +4 -4
  28. package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
  29. package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
  30. package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
  31. package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
  32. package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
  33. package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
  34. package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
  35. package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
  36. package/dist/callbacks/subscriptions/postFlip.lua +1 -1
  37. package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
  38. package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  39. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
  40. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  41. package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
  42. package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
  43. package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
  44. package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
  45. package/dist/callbacks/subscriptions/postNewLevelReordered.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 +8 -2
  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 +38 -4
  68. package/dist/features/deployJSONRoom.lua +90 -61
  69. package/dist/features/disableInputs.lua +9 -3
  70. package/dist/features/forgottenSwitch.lua +1 -1
  71. package/dist/features/getCollectibleItemPoolType.lua +10 -14
  72. package/dist/features/preventCollectibleRotate.lua +3 -9
  73. package/dist/features/saveDataManager/load.lua +2 -6
  74. package/dist/features/saveDataManager/main.lua +1 -1
  75. package/dist/features/saveDataManager/merge.lua +2 -4
  76. package/dist/features/sirenHelpers.lua +5 -5
  77. package/dist/functions/array.lua +5 -7
  78. package/dist/functions/bitwise.lua +1 -1
  79. package/dist/functions/charge.lua +10 -12
  80. package/dist/functions/collectibles.d.ts +1 -0
  81. package/dist/functions/collectibles.lua +26 -21
  82. package/dist/functions/color.lua +9 -1
  83. package/dist/functions/deepCopy.lua +42 -22
  84. package/dist/functions/deepCopyTests.lua +12 -20
  85. package/dist/functions/doors.lua +7 -19
  86. package/dist/functions/entity.lua +7 -1
  87. package/dist/functions/flag.lua +1 -1
  88. package/dist/functions/gridEntity.lua +13 -8
  89. package/dist/functions/input.lua +14 -18
  90. package/dist/functions/jsonRoom.lua +3 -9
  91. package/dist/functions/language.lua +9 -1
  92. package/dist/functions/log.lua +18 -46
  93. package/dist/functions/math.lua +15 -17
  94. package/dist/functions/npc.lua +15 -17
  95. package/dist/functions/pickups.lua +14 -1
  96. package/dist/functions/player.lua +25 -47
  97. package/dist/functions/playerHealth.lua +19 -9
  98. package/dist/functions/pocketItems.lua +4 -4
  99. package/dist/functions/random.lua +2 -2
  100. package/dist/functions/revive.lua +4 -4
  101. package/dist/functions/rooms.lua +13 -17
  102. package/dist/functions/spawnCollectible.lua +10 -2
  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 +4 -10
  107. package/dist/functions/trinketGive.lua +2 -2
  108. package/dist/functions/trinkets.lua +3 -5
  109. package/dist/functions/ui.lua +3 -3
  110. package/dist/functions/util.lua +4 -8
  111. package/dist/functions/vector.lua +8 -8
  112. package/dist/lualib_bundle.lua +603 -555
  113. package/dist/maps/cardDescriptionMap.lua +99 -1
  114. package/dist/maps/cardNameMap.lua +99 -1
  115. package/dist/maps/collectibleDescriptionMap.lua +722 -1
  116. package/dist/maps/collectibleNameMap.lua +722 -1
  117. package/dist/maps/gridEntityXMLMap.lua +36 -1
  118. package/dist/maps/pillEffectNameMap.lua +52 -1
  119. package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
  120. package/dist/maps/transformationMap.lua +19 -12
  121. package/dist/maps/trinketDescriptionMap.lua +190 -1
  122. package/dist/maps/trinketNameMap.lua +190 -1
  123. package/dist/sets/cards.lua +98 -2
  124. package/dist/types/ModUpgraded.lua +82 -166
  125. package/package.json +5 -5
@@ -24,14 +24,14 @@ function ____exports.getRandomFloat(self, min, max, seed)
24
24
  if seed == nil then
25
25
  seed = Random()
26
26
  end
27
- return min + (____exports.getRandom(nil, seed) * (max - min))
27
+ return min + ____exports.getRandom(nil, seed) * (max - min)
28
28
  end
29
29
  function ____exports.getRandomInt(self, min, max, seed)
30
30
  if seed == nil then
31
31
  seed = Random()
32
32
  end
33
33
  local rng = ____exports.initRNG(nil, seed)
34
- return rng:RandomInt((max - min) + 1) + min
34
+ return rng:RandomInt(max - min + 1) + min
35
35
  end
36
36
  function ____exports.nextSeed(self, seed)
37
37
  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
@@ -53,9 +53,7 @@ function ____exports.getCurrentDimension(self)
53
53
  dimension = dimension + 1
54
54
  end
55
55
  end
56
- error(
57
- "Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomIndex)
58
- )
56
+ error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomIndex))
59
57
  return 0
60
58
  end
61
59
  function ____exports.getRoomData(self)
@@ -80,7 +78,7 @@ function ____exports.getRoomIndexesForType(self, roomType)
80
78
  local i = 0
81
79
  while i <= MAX_ROOM_INDEX do
82
80
  local room = level:GetRoomByIdx(i)
83
- if ((room ~= nil) and (room.Data ~= nil)) and (room.Data.Type == roomType) then
81
+ if room ~= nil and room.Data ~= nil and room.Data.Type == roomType then
84
82
  roomIndexes:add(room.SafeGridIndex)
85
83
  end
86
84
  i = i + 1
@@ -93,7 +91,7 @@ function ____exports.getRoomItemPoolType(self)
93
91
  local room = game:GetRoom()
94
92
  local roomType = room:GetType()
95
93
  local itemPoolType = ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP:get(roomType)
96
- return ((itemPoolType == nil) and DEFAULT_ITEM_POOL_TYPE) or itemPoolType
94
+ return itemPoolType == nil and DEFAULT_ITEM_POOL_TYPE or itemPoolType
97
95
  end
98
96
  function ____exports.getRoomName(self)
99
97
  local roomData = ____exports.getRoomData(nil)
@@ -134,26 +132,26 @@ function ____exports.gridToPos(self, x, y)
134
132
  local room = game:GetRoom()
135
133
  x = x + 1
136
134
  y = y + 1
137
- local gridIndex = (y * room:GetGridWidth()) + x
135
+ local gridIndex = y * room:GetGridWidth() + x
138
136
  return room:GetGridPosition(gridIndex)
139
137
  end
140
138
  function ____exports.in2x1Room(self)
141
139
  local game = Game()
142
140
  local room = game:GetRoom()
143
141
  local roomShape = room:GetRoomShape()
144
- return (roomShape == RoomShape.ROOMSHAPE_1x2) or (roomShape == RoomShape.ROOMSHAPE_2x1)
142
+ return roomShape == RoomShape.ROOMSHAPE_1x2 or roomShape == RoomShape.ROOMSHAPE_2x1
145
143
  end
146
144
  function ____exports.inAngelShop(self)
147
145
  local game = Game()
148
146
  local room = game:GetRoom()
149
147
  local roomType = room:GetType()
150
148
  local roomSubType = ____exports.getRoomSubType(nil)
151
- return (roomType == RoomType.ROOM_ANGEL) and (roomSubType == 1)
149
+ return roomType == RoomType.ROOM_ANGEL and roomSubType == 1
152
150
  end
153
151
  function ____exports.inBeastRoom(self)
154
152
  local roomIndex = ____exports.getRoomIndex(nil)
155
153
  local roomSubType = ____exports.getRoomSubType(nil)
156
- return (roomIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType == 4)
154
+ return roomIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType == 4
157
155
  end
158
156
  function ____exports.inBossRoomOf(self, bossID)
159
157
  local game = Game()
@@ -161,17 +159,17 @@ function ____exports.inBossRoomOf(self, bossID)
161
159
  local roomType = room:GetType()
162
160
  local roomStageID = ____exports.getRoomStageID(nil)
163
161
  local roomSubType = ____exports.getRoomSubType(nil)
164
- return ((roomType == RoomType.ROOM_BOSS) and (roomStageID == 0)) and (roomSubType == bossID)
162
+ return roomType == RoomType.ROOM_BOSS and roomStageID == 0 and roomSubType == bossID
165
163
  end
166
164
  function ____exports.inCrawlspace(self)
167
165
  local roomIndex = ____exports.getRoomIndex(nil)
168
166
  local roomSubType = ____exports.getRoomSubType(nil)
169
- return (roomIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType ~= 4)
167
+ return roomIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType ~= 4
170
168
  end
171
169
  function ____exports.inDeathCertificateArea(self)
172
170
  local roomStageID = ____exports.getRoomStageID(nil)
173
171
  local roomSubType = ____exports.getRoomSubType(nil)
174
- return (roomStageID == 35) and ((roomSubType == 33) or (roomSubType == 33))
172
+ return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
175
173
  end
176
174
  function ____exports.isDevilsCrownTreasureRoom(self)
177
175
  local game = Game()
@@ -186,7 +184,7 @@ function ____exports.inLRoom(self)
186
184
  local game = Game()
187
185
  local room = game:GetRoom()
188
186
  local roomShape = room:GetRoomShape()
189
- return (((roomShape == RoomShape.ROOMSHAPE_LTL) or (roomShape == RoomShape.ROOMSHAPE_LTR)) or (roomShape == RoomShape.ROOMSHAPE_LBL)) or (roomShape == RoomShape.ROOMSHAPE_LBR)
187
+ return roomShape == RoomShape.ROOMSHAPE_LTL or roomShape == RoomShape.ROOMSHAPE_LTR or roomShape == RoomShape.ROOMSHAPE_LBL or roomShape == RoomShape.ROOMSHAPE_LBR
190
188
  end
191
189
  function ____exports.inGenesisRoom(self)
192
190
  local game = Game()
@@ -194,7 +192,7 @@ function ____exports.inGenesisRoom(self)
194
192
  local roomType = room:GetType()
195
193
  local roomVariant = ____exports.getRoomVariant(nil)
196
194
  local roomSubType = ____exports.getRoomSubType(nil)
197
- return ((roomType == RoomType.ROOM_ISAACS) and (roomVariant == GENESIS_ROOM_VARIANT)) and (roomSubType == GENESIS_ROOM_SUBTYPE)
195
+ return roomType == RoomType.ROOM_ISAACS and roomVariant == GENESIS_ROOM_VARIANT and roomSubType == GENESIS_ROOM_SUBTYPE
198
196
  end
199
197
  function ____exports.inStartingRoom(self)
200
198
  local game = Game()
@@ -222,9 +220,7 @@ function ____exports.setRoomCleared(self)
222
220
  return
223
221
  end
224
222
  room:SetClear(true)
225
- for ____, door in ipairs(
226
- getDoors(nil)
227
- ) do
223
+ for ____, door in ipairs(getDoors(nil)) do
228
224
  do
229
225
  if isHiddenSecretRoomDoor(nil, door) then
230
226
  goto __continue39
@@ -22,14 +22,22 @@ function ____exports.spawnCollectible(self, collectibleType, position, seed, opt
22
22
  error("Failed to spawn a collectible since the provided seed was 0, which is not allowed. (It will cause the game to crash.)")
23
23
  end
24
24
  local game = Game()
25
- local collectible = game:Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, position, Vector.Zero, nil, collectibleType, seed):ToPickup()
25
+ local collectible = game:Spawn(
26
+ EntityType.ENTITY_PICKUP,
27
+ PickupVariant.PICKUP_COLLECTIBLE,
28
+ position,
29
+ Vector.Zero,
30
+ nil,
31
+ collectibleType,
32
+ seed
33
+ ):ToPickup()
26
34
  if collectible == nil then
27
35
  error("Failed to spawn a collectible.")
28
36
  end
29
37
  if options then
30
38
  collectible.OptionsPickupIndex = 1
31
39
  end
32
- if (anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and (not isQuestCollectible(nil, collectibleType))) and (not forceFreeItem) then
40
+ if anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and not isQuestCollectible(nil, collectibleType) and not forceFreeItem then
33
41
  collectible.ShopItemId = -1
34
42
  collectible.Price = 15
35
43
  end
@@ -3,12 +3,12 @@ local ____exports = {}
3
3
  function ____exports.getFinalFrameOfAnimation(self, sprite, animation)
4
4
  local currentAnimation = sprite:GetAnimation()
5
5
  local currentFrame = sprite:GetFrame()
6
- if (animation ~= nil) and (animation ~= currentAnimation) then
6
+ if animation ~= nil and animation ~= currentAnimation then
7
7
  sprite:SetAnimation(animation)
8
8
  end
9
9
  sprite:SetLastFrame()
10
10
  local finalFrame = sprite:GetFrame()
11
- if (animation ~= nil) and (animation ~= currentAnimation) then
11
+ if animation ~= nil and animation ~= currentAnimation then
12
12
  sprite:Play(currentAnimation, true)
13
13
  end
14
14
  sprite:SetFrame(currentFrame)
@@ -4,7 +4,7 @@ function ____exports.onRepentanceStage(self)
4
4
  local game = Game()
5
5
  local level = game:GetLevel()
6
6
  local stageType = level:GetStageType()
7
- return (stageType == StageType.STAGETYPE_REPENTANCE) or (stageType == StageType.STAGETYPE_REPENTANCE_B)
7
+ return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
8
8
  end
9
9
  function ____exports.getEffectiveStage(self)
10
10
  local game = Game()
@@ -20,33 +20,33 @@ function ____exports.onCathedral(self)
20
20
  local level = game:GetLevel()
21
21
  local stage = level:GetStage()
22
22
  local stageType = level:GetStageType()
23
- return (stage == 10) and (stageType == 1)
23
+ return stage == 10 and stageType == 1
24
24
  end
25
25
  function ____exports.onChest(self)
26
26
  local game = Game()
27
27
  local level = game:GetLevel()
28
28
  local stage = level:GetStage()
29
29
  local stageType = level:GetStageType()
30
- return (stage == 11) and (stageType == 1)
30
+ return stage == 11 and stageType == 1
31
31
  end
32
32
  function ____exports.onDarkRoom(self)
33
33
  local game = Game()
34
34
  local level = game:GetLevel()
35
35
  local stage = level:GetStage()
36
36
  local stageType = level:GetStageType()
37
- return (stage == 11) and (stageType == 0)
37
+ return stage == 11 and stageType == 0
38
38
  end
39
39
  function ____exports.onFinalFloor(self)
40
40
  local game = Game()
41
41
  local level = game:GetLevel()
42
42
  local stage = level:GetStage()
43
- return (((stage == 11) or (stage == 12)) or (stage == 13)) or ((stage == 8) and ____exports.onRepentanceStage(nil))
43
+ return stage == 11 or stage == 12 or stage == 13 or stage == 8 and ____exports.onRepentanceStage(nil)
44
44
  end
45
45
  function ____exports.onSheol(self)
46
46
  local game = Game()
47
47
  local level = game:GetLevel()
48
48
  local stage = level:GetStage()
49
49
  local stageType = level:GetStageType()
50
- return (stage == 10) and (stageType == 0)
50
+ return stage == 10 and stageType == 0
51
51
  end
52
52
  return ____exports
@@ -1,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
3
  function ____exports.getFireDelay(self, tearsStat)
4
- return math.max((30 / tearsStat) - 1, -0.9999)
4
+ return math.max(30 / tearsStat - 1, -0.9999)
5
5
  end
6
6
  function ____exports.getTearsStat(self, fireDelay)
7
7
  return 30 / (fireDelay + 1)
@@ -9,26 +9,20 @@ local ____util = require("functions.util")
9
9
  local copySet = ____util.copySet
10
10
  function ____exports.getPlayerNumTransformationCollectibles(self, player, playerForm)
11
11
  if TRANSFORMATIONS_NOT_BASED_ON_ITEMS:has(playerForm) then
12
- error(
13
- ("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function."
14
- )
12
+ error(("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function.")
15
13
  end
16
14
  local itemsForTransformation = TRANSFORMATION_TO_ITEMS_MAP:get(playerForm)
17
15
  if itemsForTransformation == nil then
18
- error(
19
- ("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum."
20
- )
16
+ error(("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum.")
21
17
  end
22
18
  local numCollectibles = 0
23
- for ____, collectibleType in __TS__Iterator(
24
- itemsForTransformation:values()
25
- ) do
19
+ for ____, collectibleType in __TS__Iterator(itemsForTransformation:values()) do
26
20
  numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType)
27
21
  end
28
22
  return numCollectibles
29
23
  end
30
24
  function ____exports.getTransformationsForItem(self, collectibleType)
31
25
  local transformations = ITEM_TO_TRANSFORMATION_MAP:get(collectibleType)
32
- return ((transformations == nil) and __TS__New(Set)) or copySet(nil, transformations)
26
+ return transformations == nil and __TS__New(Set) or copySet(nil, transformations)
33
27
  end
34
28
  return ____exports
@@ -14,11 +14,11 @@ function ____exports.temporarilyRemoveTrinkets(self, player, trinketType)
14
14
  numTrinkets = numTrinkets + 1
15
15
  end
16
16
  local numSmeltedTrinkets = numTrinkets
17
- local trinketWasInSlot1 = (trinket1 == trinketType) or ((trinket1 + GOLDEN_TRINKET_SHIFT) == trinketType)
17
+ local trinketWasInSlot1 = trinket1 == trinketType or trinket1 + GOLDEN_TRINKET_SHIFT == trinketType
18
18
  if trinketWasInSlot1 then
19
19
  numSmeltedTrinkets = numSmeltedTrinkets - 1
20
20
  end
21
- local trinketWasInSlot2 = (trinket2 == trinketType) or ((trinket2 + GOLDEN_TRINKET_SHIFT) == trinketType)
21
+ local trinketWasInSlot2 = trinket2 == trinketType or trinket2 + GOLDEN_TRINKET_SHIFT == trinketType
22
22
  if trinketWasInSlot2 then
23
23
  numSmeltedTrinkets = numSmeltedTrinkets - 1
24
24
  end
@@ -16,17 +16,15 @@ function ____exports.getOpenTrinketSlot(self, player)
16
16
  local trinket0 = player:GetTrinket(0)
17
17
  local trinket1 = player:GetTrinket(1)
18
18
  if maxTrinkets == 1 then
19
- return ((trinket0 == TrinketType.TRINKET_NULL) and 0) or nil
19
+ return trinket0 == TrinketType.TRINKET_NULL and 0 or nil
20
20
  end
21
21
  if maxTrinkets == 2 then
22
22
  if trinket0 == TrinketType.TRINKET_NULL then
23
23
  return 0
24
24
  end
25
- return ((trinket1 == TrinketType.TRINKET_NULL) and 1) or nil
25
+ return trinket1 == TrinketType.TRINKET_NULL and 1 or nil
26
26
  end
27
- error(
28
- "The player has an unknown number of trinket slots: " .. tostring(maxTrinkets)
29
- )
27
+ error("The player has an unknown number of trinket slots: " .. tostring(maxTrinkets))
30
28
  return nil
31
29
  end
32
30
  function ____exports.getTrinkets(self, matchingSubType)
@@ -16,14 +16,14 @@ function ____exports.getHeartsUIWidth(self)
16
16
  local soulHearts = player:GetSoulHearts()
17
17
  local boneHearts = player:GetBoneHearts()
18
18
  local extraLives = player:GetExtraLives()
19
- local combinedHearts = (maxHearts + soulHearts) + (boneHearts * 2)
19
+ local combinedHearts = maxHearts + soulHearts + boneHearts * 2
20
20
  if combinedHearts > 12 then
21
21
  combinedHearts = 12
22
22
  end
23
23
  if curses == LevelCurse.CURSE_OF_THE_UNKNOWN then
24
24
  combinedHearts = 2
25
25
  end
26
- local width = (combinedHearts / 2) * UI_HEART_WIDTH
26
+ local width = combinedHearts / 2 * UI_HEART_WIDTH
27
27
  if extraLives > 9 then
28
28
  width = width + 20
29
29
  if player:HasCollectible(CollectibleType.COLLECTIBLE_GUPPYS_COLLAR) then
@@ -40,7 +40,7 @@ end
40
40
  function ____exports.getHUDOffsetVector(self)
41
41
  local defaultVector = Vector.Zero
42
42
  local hudOffset = math.floor(Options.HUDOffset * 10)
43
- if (hudOffset < 1) or (hudOffset > 10) then
43
+ if hudOffset < 1 or hudOffset > 10 then
44
44
  return defaultVector
45
45
  end
46
46
  local x = hudOffset * 2
@@ -4,9 +4,7 @@ local ____exports = {}
4
4
  local HEX_STRING_LENGTH = 6
5
5
  function ____exports.copySet(self, oldSet)
6
6
  local newSet = __TS__New(Set)
7
- for ____, value in __TS__Iterator(
8
- oldSet:values()
9
- ) do
7
+ for ____, value in __TS__Iterator(oldSet:values()) do
10
8
  newSet:add(value)
11
9
  end
12
10
  return newSet
@@ -25,9 +23,7 @@ end
25
23
  function ____exports.hexToKColor(self, hexString, alpha)
26
24
  hexString = __TS__StringReplace(hexString, "#", "")
27
25
  if #hexString ~= HEX_STRING_LENGTH then
28
- error(
29
- ("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. "."
30
- )
26
+ error(("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. ".")
31
27
  end
32
28
  local rString = __TS__StringSubstr(hexString, 0, 2)
33
29
  local R = tonumber("0x" .. rString)
@@ -49,14 +45,14 @@ function ____exports.hexToKColor(self, hexString, alpha)
49
45
  end
50
46
  function ____exports.isGreedMode(self)
51
47
  local game = Game()
52
- return (game.Difficulty == Difficulty.DIFFICULTY_GREED) or (game.Difficulty == Difficulty.DIFFICULTY_GREEDIER)
48
+ return game.Difficulty == Difficulty.DIFFICULTY_GREED or game.Difficulty == Difficulty.DIFFICULTY_GREEDIER
53
49
  end
54
50
  function ____exports.onSetSeed(self)
55
51
  local game = Game()
56
52
  local seeds = game:GetSeeds()
57
53
  local customRun = seeds:IsCustomRun()
58
54
  local challenge = Isaac.GetChallenge()
59
- return (challenge == Challenge.CHALLENGE_NULL) and customRun
55
+ return challenge == Challenge.CHALLENGE_NULL and customRun
60
56
  end
61
57
  function ____exports.printConsole(self, msg)
62
58
  Isaac.ConsoleOutput(msg .. "\n")
@@ -14,25 +14,25 @@ function ____exports.directionToVector(self, direction)
14
14
  return Vector(0, 1)
15
15
  end
16
16
  end
17
- ____cond4 = ____cond4 or (____switch4 == Direction.LEFT)
17
+ ____cond4 = ____cond4 or ____switch4 == Direction.LEFT
18
18
  if ____cond4 then
19
19
  do
20
20
  return Vector(-1, 0)
21
21
  end
22
22
  end
23
- ____cond4 = ____cond4 or (____switch4 == Direction.RIGHT)
23
+ ____cond4 = ____cond4 or ____switch4 == Direction.RIGHT
24
24
  if ____cond4 then
25
25
  do
26
26
  return Vector(1, 0)
27
27
  end
28
28
  end
29
- ____cond4 = ____cond4 or (____switch4 == Direction.UP)
29
+ ____cond4 = ____cond4 or ____switch4 == Direction.UP
30
30
  if ____cond4 then
31
31
  do
32
32
  return Vector(0, -1)
33
33
  end
34
34
  end
35
- ____cond4 = ____cond4 or (____switch4 == Direction.NO_DIRECTION)
35
+ ____cond4 = ____cond4 or ____switch4 == Direction.NO_DIRECTION
36
36
  if ____cond4 then
37
37
  do
38
38
  return Vector.Zero
@@ -66,16 +66,16 @@ function ____exports.isVector(self, object)
66
66
  end
67
67
  function ____exports.vectorToDirection(self, vector)
68
68
  local degrees = vector:GetAngleDegrees()
69
- if (degrees > -45) and (degrees < 45) then
69
+ if degrees > -45 and degrees < 45 then
70
70
  return Direction.RIGHT
71
71
  end
72
- if (degrees >= 45) and (degrees <= 135) then
72
+ if degrees >= 45 and degrees <= 135 then
73
73
  return Direction.DOWN
74
74
  end
75
- if (degrees <= -45) and (degrees >= -135) then
75
+ if degrees <= -45 and degrees >= -135 then
76
76
  return Direction.UP
77
77
  end
78
- if (degrees > 135) or (degrees < -135) then
78
+ if degrees > 135 or degrees < -135 then
79
79
  return Direction.LEFT
80
80
  end
81
81
  return Direction.NO_DIRECTION