isaacscript-common 1.0.512 → 1.0.516

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 (133) 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/debug.d.ts +6 -2
  83. package/dist/functions/debug.lua +7 -2
  84. package/dist/functions/deepCopy.lua +22 -42
  85. package/dist/functions/deepCopyTests.lua +20 -12
  86. package/dist/functions/doors.lua +19 -7
  87. package/dist/functions/entity.lua +2 -8
  88. package/dist/functions/flag.lua +1 -1
  89. package/dist/functions/gridEntity.lua +9 -14
  90. package/dist/functions/input.lua +18 -14
  91. package/dist/functions/jsonRoom.lua +9 -3
  92. package/dist/functions/language.lua +1 -9
  93. package/dist/functions/log.lua +46 -18
  94. package/dist/functions/math.lua +17 -15
  95. package/dist/functions/npc.lua +17 -15
  96. package/dist/functions/pickups.lua +1 -14
  97. package/dist/functions/player.lua +47 -25
  98. package/dist/functions/playerHealth.lua +9 -19
  99. package/dist/functions/pocketItems.lua +4 -4
  100. package/dist/functions/random.lua +2 -5
  101. package/dist/functions/revive.lua +4 -4
  102. package/dist/functions/rooms.d.ts +14 -0
  103. package/dist/functions/rooms.lua +75 -15
  104. package/dist/functions/spawnCollectible.lua +2 -10
  105. package/dist/functions/sprite.lua +2 -2
  106. package/dist/functions/stage.lua +6 -6
  107. package/dist/functions/tears.lua +1 -1
  108. package/dist/functions/transformations.lua +10 -4
  109. package/dist/functions/trinketGive.lua +2 -2
  110. package/dist/functions/trinkets.lua +5 -3
  111. package/dist/functions/ui.lua +3 -3
  112. package/dist/functions/util.d.ts +12 -0
  113. package/dist/functions/util.lua +11 -4
  114. package/dist/functions/vector.lua +8 -8
  115. package/dist/lualib_bundle.lua +555 -603
  116. package/dist/maps/cardDescriptionMap.lua +1 -99
  117. package/dist/maps/cardNameMap.lua +1 -99
  118. package/dist/maps/collectibleDescriptionMap.lua +1 -722
  119. package/dist/maps/collectibleNameMap.lua +1 -722
  120. package/dist/maps/gridEntityXMLMap.lua +1 -36
  121. package/dist/maps/pillEffectNameMap.lua +1 -52
  122. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -7
  123. package/dist/maps/transformationMap.lua +12 -19
  124. package/dist/maps/trinketDescriptionMap.lua +1 -190
  125. package/dist/maps/trinketNameMap.lua +1 -190
  126. package/dist/patchErrorFunctions.d.ts +9 -0
  127. package/dist/patchErrorFunctions.lua +26 -0
  128. package/dist/patchPrintFunction.d.ts +8 -0
  129. package/dist/patchPrintFunction.lua +45 -0
  130. package/dist/sets/cards.lua +2 -98
  131. package/dist/types/ModUpgraded.lua +50 -44
  132. package/dist/upgradeMod.lua +6 -0
  133. package/package.json +2 -2
@@ -4,36 +4,9 @@ local ____exports = {}
4
4
  ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
5
5
  ____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
6
6
  ____exports.BOMB_EXPLODE_FRAME = 45
7
- ____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
8
- PlayerType.PLAYER_ISAAC,
9
- PlayerType.PLAYER_MAGDALENE,
10
- PlayerType.PLAYER_JUDAS,
11
- PlayerType.PLAYER_BLUEBABY,
12
- PlayerType.PLAYER_EVE,
13
- PlayerType.PLAYER_EDEN,
14
- PlayerType.PLAYER_THELOST,
15
- PlayerType.PLAYER_LILITH,
16
- PlayerType.PLAYER_KEEPER,
17
- PlayerType.PLAYER_APOLLYON,
18
- PlayerType.PLAYER_EDEN_B
19
- })
20
- ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
21
- PlayerType.PLAYER_BLUEBABY,
22
- PlayerType.PLAYER_THELOST,
23
- PlayerType.PLAYER_BLACKJUDAS,
24
- PlayerType.PLAYER_JUDAS_B,
25
- PlayerType.PLAYER_BLUEBABY_B,
26
- PlayerType.PLAYER_THELOST_B,
27
- PlayerType.PLAYER_THEFORGOTTEN_B,
28
- PlayerType.PLAYER_BETHANY_B
29
- })
30
- ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {
31
- PlayerType.PLAYER_THELOST,
32
- PlayerType.PLAYER_KEEPER,
33
- PlayerType.PLAYER_BETHANY,
34
- PlayerType.PLAYER_THELOST_B,
35
- PlayerType.PLAYER_KEEPER_B
36
- })
7
+ ____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {PlayerType.PLAYER_ISAAC, PlayerType.PLAYER_MAGDALENE, PlayerType.PLAYER_JUDAS, PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_EVE, PlayerType.PLAYER_EDEN, PlayerType.PLAYER_THELOST, PlayerType.PLAYER_LILITH, PlayerType.PLAYER_KEEPER, PlayerType.PLAYER_APOLLYON, PlayerType.PLAYER_EDEN_B})
8
+ ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
9
+ ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_KEEPER, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_KEEPER_B})
37
10
  ____exports.COLORS = {
38
11
  Black = Color(1, 1, 1),
39
12
  Red = Color(1, 0, 0),
@@ -57,13 +30,7 @@ ____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
57
30
  ____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
58
31
  ____exports.GAME_FRAMES_PER_SECOND = 30
59
32
  ____exports.ISAAC_FRAMES_PER_SECOND = 60
60
- ____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {
61
- PlayerType.PLAYER_THELOST,
62
- PlayerType.PLAYER_THESOUL,
63
- PlayerType.PLAYER_THELOST_B,
64
- PlayerType.PLAYER_JACOB2_B,
65
- PlayerType.PLAYER_THESOUL_B
66
- })
33
+ ____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_THESOUL, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_JACOB2_B, PlayerType.PLAYER_THESOUL_B})
67
34
  ____exports.MAX_NUM_DOORS = 8
68
35
  ____exports.MAX_NUM_FAMILIARS = 64
69
36
  ____exports.MAX_NUM_INPUTS = 4
@@ -75,16 +42,7 @@ ____exports.MAX_ROOM_INDEX = 168
75
42
  ____exports.MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING
76
43
  ____exports.MOVEMENT_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_LEFT, ButtonAction.ACTION_RIGHT, ButtonAction.ACTION_UP, ButtonAction.ACTION_DOWN})
77
44
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
78
- ____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {
79
- CollectibleType.COLLECTIBLE_FORGET_ME_NOW,
80
- CollectibleType.COLLECTIBLE_EDENS_SOUL,
81
- CollectibleType.COLLECTIBLE_ALABASTER_BOX,
82
- CollectibleType.COLLECTIBLE_PLAN_C,
83
- CollectibleType.COLLECTIBLE_MAMA_MEGA,
84
- CollectibleType.COLLECTIBLE_SACRIFICIAL_ALTAR,
85
- CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE,
86
- CollectibleType.COLLECTIBLE_R_KEY
87
- })
45
+ ____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {CollectibleType.COLLECTIBLE_FORGET_ME_NOW, CollectibleType.COLLECTIBLE_EDENS_SOUL, CollectibleType.COLLECTIBLE_ALABASTER_BOX, CollectibleType.COLLECTIBLE_PLAN_C, CollectibleType.COLLECTIBLE_MAMA_MEGA, CollectibleType.COLLECTIBLE_SACRIFICIAL_ALTAR, CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE, CollectibleType.COLLECTIBLE_R_KEY})
88
46
  ____exports.SHOOTING_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_SHOOTLEFT, ButtonAction.ACTION_SHOOTRIGHT, ButtonAction.ACTION_SHOOTUP, ButtonAction.ACTION_SHOOTDOWN})
89
47
  ____exports.UI_HEART_WIDTH = 12
90
48
  return ____exports
@@ -63,14 +63,7 @@ function respawnPersistentEntities(self)
63
63
  end
64
64
  for ____, persistentEntity in ipairs(persistentEntities) do
65
65
  local position = room:GetGridPosition(persistentEntity.gridIndex)
66
- Isaac.Spawn(
67
- persistentEntity.type,
68
- persistentEntity.variant,
69
- persistentEntity.subType,
70
- position,
71
- Vector.Zero,
72
- nil
73
- )
66
+ Isaac.Spawn(persistentEntity.type, persistentEntity.variant, persistentEntity.subType, position, Vector.Zero, nil)
74
67
  end
75
68
  end
76
69
  function ____exports.emptyRoom(self, fillWithDecorations)
@@ -95,12 +88,14 @@ end
95
88
  function removeSpecificNPCs(self)
96
89
  local game = Game()
97
90
  local room = game:GetRoom()
98
- for ____, npc in ipairs(getNPCs(nil)) do
91
+ for ____, npc in ipairs(
92
+ getNPCs(nil)
93
+ ) do
99
94
  do
100
95
  if NPC_TYPES_TO_NOT_REMOVE:has(npc.Type) then
101
96
  goto __continue25
102
97
  end
103
- if npc:HasEntityFlags(EntityFlag.FLAG_CHARM) or npc:HasEntityFlags(EntityFlag.FLAG_FRIENDLY) or npc:HasEntityFlags(EntityFlag.FLAG_PERSISTENT) then
98
+ if (npc:HasEntityFlags(EntityFlag.FLAG_CHARM) or npc:HasEntityFlags(EntityFlag.FLAG_FRIENDLY)) or npc:HasEntityFlags(EntityFlag.FLAG_PERSISTENT) then
104
99
  goto __continue25
105
100
  end
106
101
  npc:ClearEntityFlags(EntityFlag.FLAG_APPEAR)
@@ -169,40 +164,34 @@ function spawnAllEntities(self, jsonRoom, seed, verbose)
169
164
  local variantString = xmlEntity["$"].variant
170
165
  local variant = tonumber(variantString)
171
166
  if variant == nil then
172
- error("Failed to convert the entity variant to a number: " .. tostring(variant))
167
+ error(
168
+ "Failed to convert the entity variant to a number: " .. tostring(variant)
169
+ )
173
170
  end
174
171
  local subTypeString = xmlEntity["$"].subtype
175
172
  local subType = tonumber(subTypeString)
176
173
  if subType == nil then
177
- error("Failed to convert the entity sub-type to a number: " .. tostring(subType))
174
+ error(
175
+ "Failed to convert the entity sub-type to a number: " .. tostring(subType)
176
+ )
178
177
  end
179
178
  if entityType >= 1000 then
180
179
  if verbose then
181
- log(((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
180
+ log(
181
+ ((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
182
+ )
182
183
  end
183
- spawnGridEntity(
184
- nil,
185
- entityType,
186
- variant,
187
- x,
188
- y
189
- )
184
+ spawnGridEntity(nil, entityType, variant, x, y)
190
185
  else
191
186
  seed = nextSeed(nil, seed)
192
187
  if verbose then
193
- log(((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
188
+ log(
189
+ ((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
190
+ )
194
191
  end
195
- local entity = spawnNormalEntity(
196
- nil,
197
- entityType,
198
- variant,
199
- subType,
200
- x,
201
- y,
202
- seed
203
- )
192
+ local entity = spawnNormalEntity(nil, entityType, variant, subType, x, y, seed)
204
193
  local npc = entity:ToNPC()
205
- if npc ~= nil and npc.CanShutDoors then
194
+ if (npc ~= nil) and npc.CanShutDoors then
206
195
  shouldUnclearRoom = true
207
196
  end
208
197
  end
@@ -244,27 +233,13 @@ function spawnNormalEntity(self, entityType, variant, subType, x, y, seed)
244
233
  local roomType = room:GetType()
245
234
  local position = gridToPos(nil, x, y)
246
235
  local entity
247
- if entityType == EntityType.ENTITY_PICKUP and variant == PickupVariant.PICKUP_COLLECTIBLE then
236
+ if (entityType == EntityType.ENTITY_PICKUP) and (variant == PickupVariant.PICKUP_COLLECTIBLE) then
248
237
  local options = roomType == RoomType.ROOM_ANGEL
249
- entity = spawnCollectible(
250
- nil,
251
- subType,
252
- position,
253
- seed,
254
- options
255
- )
238
+ entity = spawnCollectible(nil, subType, position, seed, options)
256
239
  else
257
- entity = game:Spawn(
258
- entityType,
259
- variant,
260
- position,
261
- Vector.Zero,
262
- nil,
263
- subType,
264
- seed
265
- )
266
- end
267
- if entityType == EntityType.ENTITY_PITFALL and variant == 0 then
240
+ entity = game:Spawn(entityType, variant, position, Vector.Zero, nil, subType, seed)
241
+ end
242
+ if (entityType == EntityType.ENTITY_PITFALL) and (variant == 0) then
268
243
  entity.EntityCollisionClass = EntityCollisionClass.ENTCOLL_ENEMIES
269
244
  entity.GridCollisionClass = EntityGridCollisionClass.GRIDCOLL_WALLS
270
245
  end
@@ -292,10 +267,12 @@ function fixPitGraphics(self)
292
267
  local room = game:GetRoom()
293
268
  local gridWidth = room:GetGridWidth()
294
269
  local pitMap = getPitMap(nil)
295
- local gridEntity
296
- local gridIndex
297
- for ____, ____value in __TS__Iterator(pitMap:entries()) do
270
+ for ____, ____value in __TS__Iterator(
271
+ pitMap:entries()
272
+ ) do
273
+ local gridIndex
298
274
  gridIndex = ____value[1]
275
+ local gridEntity
299
276
  gridEntity = ____value[2]
300
277
  local gridIndexLeft = gridIndex - 1
301
278
  local L = pitMap:has(gridIndexLeft)
@@ -305,32 +282,24 @@ function fixPitGraphics(self)
305
282
  local U = pitMap:has(gridIndexUp)
306
283
  local gridIndexDown = gridIndex + gridWidth
307
284
  local D = pitMap:has(gridIndexDown)
308
- local gridIndexUpLeft = gridIndex - gridWidth - 1
285
+ local gridIndexUpLeft = (gridIndex - gridWidth) - 1
309
286
  local UL = pitMap:has(gridIndexUpLeft)
310
- local gridIndexUpRight = gridIndex - gridWidth + 1
287
+ local gridIndexUpRight = (gridIndex - gridWidth) + 1
311
288
  local UR = pitMap:has(gridIndexUpRight)
312
- local gridIndexDownLeft = gridIndex + gridWidth - 1
289
+ local gridIndexDownLeft = (gridIndex + gridWidth) - 1
313
290
  local DL = pitMap:has(gridIndexDownLeft)
314
- local gridIndexDownRight = gridIndex + gridWidth + 1
291
+ local gridIndexDownRight = (gridIndex + gridWidth) + 1
315
292
  local DR = pitMap:has(gridIndexDownRight)
316
- local pitFrame = getPitFrame(
317
- nil,
318
- L,
319
- R,
320
- U,
321
- D,
322
- UL,
323
- UR,
324
- DL,
325
- DR
326
- )
293
+ local pitFrame = getPitFrame(nil, L, R, U, D, UL, UR, DL, DR)
327
294
  local sprite = gridEntity:GetSprite()
328
295
  sprite:SetFrame(pitFrame)
329
296
  end
330
297
  end
331
298
  function getPitMap(self)
332
299
  local pitMap = __TS__New(Map)
333
- for ____, gridEntity in ipairs(getGridEntities(nil, GridEntityType.GRID_PIT)) do
300
+ for ____, gridEntity in ipairs(
301
+ getGridEntities(nil, GridEntityType.GRID_PIT)
302
+ ) do
334
303
  local gridIndex = gridEntity:GetGridIndex()
335
304
  pitMap:set(gridIndex, gridEntity)
336
305
  end
@@ -350,52 +319,52 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
350
319
  if D then
351
320
  F = F | 8
352
321
  end
353
- if U and L and not UL and not R and not D then
322
+ if (((U and L) and (not UL)) and (not R)) and (not D) then
354
323
  F = 17
355
324
  end
356
- if U and R and not UR and not L and not D then
325
+ if (((U and R) and (not UR)) and (not L)) and (not D) then
357
326
  F = 18
358
327
  end
359
- if L and D and not DL and not U and not R then
328
+ if (((L and D) and (not DL)) and (not U)) and (not R) then
360
329
  F = 19
361
330
  end
362
- if R and D and not DR and not L and not U then
331
+ if (((R and D) and (not DR)) and (not L)) and (not U) then
363
332
  F = 20
364
333
  end
365
- if L and U and R and D and not UL then
334
+ if (((L and U) and R) and D) and (not UL) then
366
335
  F = 21
367
336
  end
368
- if L and U and R and D and not UR then
337
+ if (((L and U) and R) and D) and (not UR) then
369
338
  F = 22
370
339
  end
371
- if U and R and D and not L and not UR then
340
+ if (((U and R) and D) and (not L)) and (not UR) then
372
341
  F = 25
373
342
  end
374
- if L and U and D and not R and not UL then
343
+ if (((L and U) and D) and (not R)) and (not UL) then
375
344
  F = 26
376
345
  end
377
- if L and U and R and D and not DL and not DR then
346
+ if ((((L and U) and R) and D) and (not DL)) and (not DR) then
378
347
  F = 24
379
348
  end
380
- if L and U and R and D and not UR and not UL then
349
+ if ((((L and U) and R) and D) and (not UR)) and (not UL) then
381
350
  F = 23
382
351
  end
383
- if L and U and R and UL and not UR and not D then
352
+ if ((((L and U) and R) and UL) and (not UR)) and (not D) then
384
353
  F = 27
385
354
  end
386
- if L and U and R and UR and not UL and not D then
355
+ if ((((L and U) and R) and UR) and (not UL)) and (not D) then
387
356
  F = 28
388
357
  end
389
- if L and U and R and not D and not UR and not UL then
358
+ if ((((L and U) and R) and (not D)) and (not UR)) and (not UL) then
390
359
  F = 29
391
360
  end
392
- if L and R and D and DL and not U and not DR then
361
+ if ((((L and R) and D) and DL) and (not U)) and (not DR) then
393
362
  F = 30
394
363
  end
395
- if L and R and D and DR and not U and not DL then
364
+ if ((((L and R) and D) and DR) and (not U)) and (not DL) then
396
365
  F = 31
397
366
  end
398
- if L and R and D and not U and not DL and not DR then
367
+ if ((((L and R) and D) and (not U)) and (not DL)) and (not DR) then
399
368
  F = 32
400
369
  end
401
370
  return F
@@ -404,11 +373,13 @@ FEATURE_NAME = "JSON room deployer"
404
373
  NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.ENTITY_DARK_ESAU})
405
374
  PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.ENTITY_WALL_HUGGER})
406
375
  initialized = false
407
- v = {level = {
408
- deployedRoomListIndexes = __TS__New(Set),
409
- persistentEntities = __TS__New(Map),
410
- decorationGridIndexes = __TS__New(Map)
411
- }}
376
+ v = {
377
+ level = {
378
+ deployedRoomListIndexes = __TS__New(Set),
379
+ persistentEntities = __TS__New(Map),
380
+ decorationGridIndexes = __TS__New(Map)
381
+ }
382
+ }
412
383
  function ____exports.deployJSONRoomInit(self, mod)
413
384
  initialized = true
414
385
  saveDataManager(nil, "deployJSONRoom", v)
@@ -18,20 +18,14 @@ function getActionValue(self, _entity, _inputHook, buttonAction)
18
18
  return getReturnValue(nil, buttonAction, false)
19
19
  end
20
20
  function getReturnValue(self, buttonAction, booleanCallback)
21
- local ____booleanCallback_0
22
- if booleanCallback then
23
- ____booleanCallback_0 = false
24
- else
25
- ____booleanCallback_0 = 0
26
- end
27
- local disableValue = ____booleanCallback_0
21
+ local disableValue = ((booleanCallback and (function() return false end)) or (function() return 0 end))()
28
22
  if not v.run.enableSomeInputs then
29
23
  return disableValue
30
24
  end
31
- if v.run.whitelist ~= nil and not v.run.whitelist:has(buttonAction) then
25
+ if (v.run.whitelist ~= nil) and (not v.run.whitelist:has(buttonAction)) then
32
26
  return disableValue
33
27
  end
34
- if v.run.blacklist ~= nil and v.run.blacklist:has(buttonAction) then
28
+ if (v.run.blacklist ~= nil) and v.run.blacklist:has(buttonAction) then
35
29
  return disableValue
36
30
  end
37
31
  return nil
@@ -6,7 +6,7 @@ local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
6
6
  local ____exports = require("features.saveDataManager.exports")
7
7
  local saveDataManager = ____exports.saveDataManager
8
8
  function isActionTriggered(self, _entity, _inputHook, buttonAction)
9
- if buttonAction == ButtonAction.ACTION_DROP and v.run.shouldSwitch then
9
+ if (buttonAction == ButtonAction.ACTION_DROP) and v.run.shouldSwitch then
10
10
  v.run.shouldSwitch = false
11
11
  return true
12
12
  end
@@ -17,7 +17,11 @@ function postPickupInitCollectible(self, pickup)
17
17
  end
18
18
  local FEATURE_NAME = "get collectible item pool type"
19
19
  local initialized = false
20
- v = {run = {collectibleItemPoolTypeMap = __TS__New(Map)}}
20
+ v = {
21
+ run = {
22
+ collectibleItemPoolTypeMap = __TS__New(Map)
23
+ }
24
+ }
21
25
  function ____exports.getCollectibleItemPoolTypeInit(self, mod)
22
26
  initialized = true
23
27
  saveDataManager(nil, "getCollectibleItemPoolType", v)
@@ -28,11 +32,13 @@ function ____exports.getCollectibleItemPoolType(self, collectible)
28
32
  local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
29
33
  error(msg)
30
34
  end
31
- if collectible.Type ~= EntityType.ENTITY_PICKUP or collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
32
- error((((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType))
35
+ if (collectible.Type ~= EntityType.ENTITY_PICKUP) or (collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE) then
36
+ error(
37
+ (((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType)
38
+ )
33
39
  end
34
40
  local ptrHash = GetPtrHash(collectible)
35
41
  local itemPoolType = v.run.collectibleItemPoolTypeMap:get(ptrHash)
36
- return itemPoolType == nil and getRoomItemPoolType(nil) or itemPoolType
42
+ return ((itemPoolType == nil) and getRoomItemPoolType(nil)) or itemPoolType
37
43
  end
38
44
  return ____exports
@@ -16,13 +16,17 @@ function postPickupUpdateCollectible(self, pickup)
16
16
  return
17
17
  end
18
18
  local trackedCollectibleType = v.room.trackedItems:get(pickup.InitSeed)
19
- if trackedCollectibleType ~= nil and pickup.SubType ~= trackedCollectibleType then
19
+ if (trackedCollectibleType ~= nil) and (pickup.SubType ~= trackedCollectibleType) then
20
20
  setCollectibleSubType(nil, pickup, trackedCollectibleType)
21
21
  end
22
22
  end
23
23
  local FEATURE_NAME = "prevent collectible rotation"
24
24
  local initialized = false
25
- v = {room = {trackedItems = __TS__New(Map)}}
25
+ v = {
26
+ room = {
27
+ trackedItems = __TS__New(Map)
28
+ }
29
+ }
26
30
  function ____exports.preventCollectibleRotateInit(self, mod)
27
31
  initialized = true
28
32
  saveDataManager(nil, "preventCollectibleRotate", v)
@@ -35,7 +39,9 @@ function ____exports.preventCollectibleRotate(self, collectible, collectibleType
35
39
  error(msg)
36
40
  end
37
41
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
38
- error("You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant))
42
+ error(
43
+ "You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant)
44
+ )
39
45
  end
40
46
  v.room.trackedItems:set(collectible.InitSeed, collectibleType)
41
47
  postPickupUpdateCollectible(nil, collectible)
@@ -14,7 +14,9 @@ function readSaveDatFile(self, mod)
14
14
  local isaacFrameCount = Isaac.GetFrameCount()
15
15
  local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
16
16
  if not ok then
17
- log((("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg)
17
+ log(
18
+ (("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg
19
+ )
18
20
  return DEFAULT_MOD_DATA
19
21
  end
20
22
  if jsonStringOrErrMsg == nil then
@@ -54,7 +56,9 @@ function ____exports.loadFromDisk(self, mod, oldSaveData)
54
56
  goto __continue5
55
57
  end
56
58
  if DEBUG then
57
- log("Merging in stored data for feature: " .. tostring(key))
59
+ log(
60
+ "Merging in stored data for feature: " .. tostring(key)
61
+ )
58
62
  end
59
63
  merge(nil, oldSaveDataForSubscriber, value, key)
60
64
  end
@@ -58,7 +58,7 @@ function restoreDefaultsAll(self)
58
58
  restoreDefaults(nil, SaveDataKeys.Room)
59
59
  end
60
60
  function restoreDefaults(self, childTableName)
61
- if childTableName ~= SaveDataKeys.Run and childTableName ~= SaveDataKeys.Level and childTableName ~= SaveDataKeys.Room then
61
+ if ((childTableName ~= SaveDataKeys.Run) and (childTableName ~= SaveDataKeys.Level)) and (childTableName ~= SaveDataKeys.Room) then
62
62
  error("Unknown child table name of: " .. childTableName)
63
63
  end
64
64
  for subscriberName, saveData in pairs(saveDataMap) do
@@ -42,7 +42,7 @@ function ____exports.merge(self, oldObject, newTable, traversalDescription)
42
42
  end
43
43
  function mergeArray(self, oldObject, newTable)
44
44
  local oldArray = oldObject
45
- if not isArray(nil, oldArray) or not isArray(nil, newTable) then
45
+ if (not isArray(nil, oldArray)) or (not isArray(nil, newTable)) then
46
46
  return false
47
47
  end
48
48
  tableClear(nil, oldArray)
@@ -102,7 +102,9 @@ function mergeTable(self, oldTable, newTable, traversalDescription)
102
102
  end
103
103
  else
104
104
  if DEBUG then
105
- log((("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value))
105
+ log(
106
+ (("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value)
107
+ )
106
108
  end
107
109
  oldTable[key] = value
108
110
  end
@@ -23,15 +23,15 @@ function checkReturnFamiliarToPlayer(self, npc)
23
23
  end
24
24
  end
25
25
  function blacklistEntryExists(self, incomingFamiliarVariant, incomingFamiliarSubType)
26
- local familiarSubType
27
- local familiarVariant
28
26
  for ____, ____value in ipairs(v.run.familiarBlacklist) do
27
+ local familiarVariant
29
28
  familiarVariant = ____value[1]
29
+ local familiarSubType
30
30
  familiarSubType = ____value[2]
31
- if incomingFamiliarVariant == familiarVariant and familiarSubType == incomingFamiliarSubType then
31
+ if (incomingFamiliarVariant == familiarVariant) and (familiarSubType == incomingFamiliarSubType) then
32
32
  return true
33
33
  end
34
- if incomingFamiliarVariant == familiarVariant and familiarSubType == nil then
34
+ if (incomingFamiliarVariant == familiarVariant) and (familiarSubType == nil) then
35
35
  return true
36
36
  end
37
37
  end
@@ -59,7 +59,7 @@ local function getSirenHelper(self, familiar)
59
59
  local familiarHash = GetPtrHash(familiar)
60
60
  local sirenHelpers = Isaac.FindByType(EntityType.ENTITY_SIREN_HELPER)
61
61
  for ____, sirenHelper in ipairs(sirenHelpers) do
62
- if sirenHelper.Target ~= nil and GetPtrHash(sirenHelper.Target) == familiarHash then
62
+ if (sirenHelper.Target ~= nil) and (GetPtrHash(sirenHelper.Target) == familiarHash) then
63
63
  return sirenHelper
64
64
  end
65
65
  end
@@ -14,9 +14,7 @@ function ____exports.arrayShuffleInPlace(self, array, seed)
14
14
  currentIndex = currentIndex - 1
15
15
  seed = nextSeed(nil, seed)
16
16
  randomIndex = ____exports.getRandomArrayIndex(nil, array, seed)
17
- local ____temp_0 = {array[randomIndex + 1], array[currentIndex + 1]}
18
- array[currentIndex + 1] = ____temp_0[1]
19
- array[randomIndex + 1] = ____temp_0[2]
17
+ array[currentIndex + 1], array[randomIndex + 1] = array[randomIndex + 1], array[currentIndex + 1]
20
18
  end
21
19
  end
22
20
  function ____exports.getRandomArrayIndex(self, array, seed)
@@ -70,7 +68,9 @@ function ____exports.arrayShuffle(self, originalArray, seed)
70
68
  if seed == nil then
71
69
  seed = Random()
72
70
  end
73
- local array = {table.unpack(originalArray)}
71
+ local array = {
72
+ table.unpack(originalArray)
73
+ }
74
74
  ____exports.arrayShuffleInPlace(nil, array, seed)
75
75
  return array
76
76
  end
@@ -93,7 +93,9 @@ function ____exports.arrayToString(self, array)
93
93
  end
94
94
  function ____exports.arrayRemove(self, originalArray, ...)
95
95
  local elements = {...}
96
- local array = {table.unpack(originalArray)}
96
+ local array = {
97
+ table.unpack(originalArray)
98
+ }
97
99
  for ____, element in ipairs(elements) do
98
100
  local index = __TS__ArrayIndexOf(array, element)
99
101
  __TS__ArraySplice(array, index, 1)
@@ -1,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
3
  function ____exports.getKBitOfN(self, k, n)
4
- return n >> k & 1
4
+ return (n >> k) & 1
5
5
  end
6
6
  function ____exports.getNumBitsOfN(self, n)
7
7
  local numBits = 0
@@ -43,19 +43,19 @@ function getNumChargesToAdd(self, player, activeSlot, ignoreBigRoomDoubleCharge)
43
43
  local batteryCharge = player:GetBatteryCharge(activeSlot)
44
44
  local hasBattery = player:HasCollectible(CollectibleType.COLLECTIBLE_BATTERY)
45
45
  local maxCharges = getCollectibleMaxCharges(nil, activeItem)
46
- if not hasBattery and activeCharge == maxCharges then
46
+ if (not hasBattery) and (activeCharge == maxCharges) then
47
47
  return 0
48
48
  end
49
- if hasBattery and batteryCharge == maxCharges then
49
+ if hasBattery and (batteryCharge == maxCharges) then
50
50
  return 0
51
51
  end
52
- if not hasBattery and activeCharge + 1 == maxCharges then
52
+ if (not hasBattery) and ((activeCharge + 1) == maxCharges) then
53
53
  return 1
54
54
  end
55
- if hasBattery and batteryCharge + 1 == maxCharges then
55
+ if hasBattery and ((batteryCharge + 1) == maxCharges) then
56
56
  return 1
57
57
  end
58
- if roomShape >= RoomShape.ROOMSHAPE_2x2 and not ignoreBigRoomDoubleCharge then
58
+ if (roomShape >= RoomShape.ROOMSHAPE_2x2) and (not ignoreBigRoomDoubleCharge) then
59
59
  return 2
60
60
  end
61
61
  return 1
@@ -70,10 +70,10 @@ function getNumChargesWithAAAModifier(self, player, activeSlot, chargesToAdd)
70
70
  if not hasAAABattery then
71
71
  return chargesToAdd
72
72
  end
73
- if not hasBattery and activeCharge + chargesToAdd == maxCharges - 1 then
73
+ if (not hasBattery) and ((activeCharge + chargesToAdd) == (maxCharges - 1)) then
74
74
  return maxCharges + 1
75
75
  end
76
- if hasBattery and batteryCharge + chargesToAdd == maxCharges - 1 then
76
+ if hasBattery and ((batteryCharge + chargesToAdd) == (maxCharges - 1)) then
77
77
  return maxCharges + 1
78
78
  end
79
79
  return chargesToAdd
@@ -83,7 +83,7 @@ function ____exports.playChargeSoundEffect(self, player, activeSlot)
83
83
  for ____, soundEffect in ipairs({SoundEffect.SOUND_BATTERYCHARGE, SoundEffect.SOUND_BEEP}) do
84
84
  sfx:Stop(soundEffect)
85
85
  end
86
- local chargeSoundEffect = shouldPlayFullRechargeSound(nil, player, activeSlot) and SoundEffect.SOUND_BATTERYCHARGE or SoundEffect.SOUND_BEEP
86
+ local chargeSoundEffect = (shouldPlayFullRechargeSound(nil, player, activeSlot) and SoundEffect.SOUND_BATTERYCHARGE) or SoundEffect.SOUND_BEEP
87
87
  sfx:Play(chargeSoundEffect)
88
88
  end
89
89
  function shouldPlayFullRechargeSound(self, player, activeSlot)
@@ -95,13 +95,15 @@ function shouldPlayFullRechargeSound(self, player, activeSlot)
95
95
  if not hasBattery then
96
96
  return not player:NeedsCharge(activeSlot)
97
97
  end
98
- return not player:NeedsCharge(activeSlot) or activeCharge == maxCharges and batteryCharge == 0
98
+ return (not player:NeedsCharge(activeSlot)) or ((activeCharge == maxCharges) and (batteryCharge == 0))
99
99
  end
100
100
  function ____exports.addRoomClearCharges(self, ignoreBigRoomDoubleCharge)
101
101
  if ignoreBigRoomDoubleCharge == nil then
102
102
  ignoreBigRoomDoubleCharge = false
103
103
  end
104
- for ____, player in ipairs(getPlayers(nil)) do
104
+ for ____, player in ipairs(
105
+ getPlayers(nil)
106
+ ) do
105
107
  ____exports.addRoomClearCharge(nil, player, ignoreBigRoomDoubleCharge)
106
108
  end
107
109
  end