isaacscript-common 1.0.488 → 1.0.492

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 (130) 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.d.ts +9 -0
  68. package/dist/constants.lua +41 -4
  69. package/dist/features/deployJSONRoom.lua +90 -61
  70. package/dist/features/disableInputs.lua +9 -3
  71. package/dist/features/forgottenSwitch.lua +1 -1
  72. package/dist/features/getCollectibleItemPoolType.lua +10 -14
  73. package/dist/features/preventCollectibleRotate.lua +3 -9
  74. package/dist/features/saveDataManager/load.lua +2 -6
  75. package/dist/features/saveDataManager/main.lua +1 -1
  76. package/dist/features/saveDataManager/merge.lua +2 -4
  77. package/dist/features/sirenHelpers.lua +5 -5
  78. package/dist/functions/array.lua +5 -7
  79. package/dist/functions/bitwise.lua +1 -1
  80. package/dist/functions/cards.d.ts +2 -2
  81. package/dist/functions/charge.lua +10 -12
  82. package/dist/functions/collectibles.d.ts +23 -2
  83. package/dist/functions/collectibles.lua +26 -21
  84. package/dist/functions/color.lua +9 -1
  85. package/dist/functions/deepCopy.lua +45 -25
  86. package/dist/functions/deepCopyTests.lua +12 -20
  87. package/dist/functions/doors.lua +7 -19
  88. package/dist/functions/entity.lua +7 -1
  89. package/dist/functions/flag.lua +1 -1
  90. package/dist/functions/gridEntity.lua +13 -8
  91. package/dist/functions/input.lua +14 -18
  92. package/dist/functions/jsonRoom.lua +3 -9
  93. package/dist/functions/language.lua +9 -1
  94. package/dist/functions/log.lua +18 -46
  95. package/dist/functions/math.lua +15 -17
  96. package/dist/functions/npc.lua +15 -17
  97. package/dist/functions/pickups.lua +14 -1
  98. package/dist/functions/pills.d.ts +1 -1
  99. package/dist/functions/player.d.ts +12 -0
  100. package/dist/functions/player.lua +45 -59
  101. package/dist/functions/playerHealth.lua +19 -9
  102. package/dist/functions/pocketItems.lua +4 -4
  103. package/dist/functions/random.lua +2 -2
  104. package/dist/functions/revive.lua +4 -4
  105. package/dist/functions/rooms.lua +13 -17
  106. package/dist/functions/spawnCollectible.lua +10 -2
  107. package/dist/functions/sprite.lua +2 -2
  108. package/dist/functions/stage.lua +6 -6
  109. package/dist/functions/tears.lua +1 -1
  110. package/dist/functions/transformations.lua +4 -10
  111. package/dist/functions/trinketGive.lua +2 -2
  112. package/dist/functions/trinkets.d.ts +6 -2
  113. package/dist/functions/trinkets.lua +3 -5
  114. package/dist/functions/ui.lua +3 -3
  115. package/dist/functions/util.lua +4 -8
  116. package/dist/functions/vector.lua +8 -8
  117. package/dist/lualib_bundle.lua +603 -555
  118. package/dist/maps/cardDescriptionMap.lua +99 -1
  119. package/dist/maps/cardNameMap.lua +99 -1
  120. package/dist/maps/collectibleDescriptionMap.lua +722 -1
  121. package/dist/maps/collectibleNameMap.lua +722 -1
  122. package/dist/maps/gridEntityXMLMap.lua +36 -1
  123. package/dist/maps/pillEffectNameMap.lua +52 -1
  124. package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
  125. package/dist/maps/transformationMap.lua +19 -12
  126. package/dist/maps/trinketDescriptionMap.lua +190 -1
  127. package/dist/maps/trinketNameMap.lua +190 -1
  128. package/dist/sets/cards.lua +98 -2
  129. package/dist/types/ModUpgraded.lua +82 -166
  130. package/package.json +5 -5
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
9
9
  __TS__ArrayPush(subscriptions, {callback, slotVariant})
10
10
  end
11
11
  function ____exports.fire(self, slot)
12
+ local slotVariant
13
+ local callback
12
14
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
15
  callback = ____value[1]
15
- local slotVariant
16
16
  slotVariant = ____value[2]
17
17
  do
18
- if (slotVariant ~= nil) and (slotVariant ~= slot.Variant) then
18
+ if slotVariant ~= nil and slotVariant ~= slot.Variant then
19
19
  goto __continue5
20
20
  end
21
21
  callback(nil, slot)
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
9
9
  __TS__ArrayPush(subscriptions, {callback, slotVariant})
10
10
  end
11
11
  function ____exports.fire(self, slot)
12
+ local slotVariant
13
+ local callback
12
14
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
15
  callback = ____value[1]
15
- local slotVariant
16
16
  slotVariant = ____value[2]
17
17
  do
18
- if (slotVariant ~= nil) and (slotVariant ~= slot.Variant) then
18
+ if slotVariant ~= nil and slotVariant ~= slot.Variant then
19
19
  goto __continue5
20
20
  end
21
21
  callback(nil, slot)
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, slotVariant)
9
9
  __TS__ArrayPush(subscriptions, {callback, slotVariant})
10
10
  end
11
11
  function ____exports.fire(self, slot)
12
+ local slotVariant
13
+ local callback
12
14
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
15
  callback = ____value[1]
15
- local slotVariant
16
16
  slotVariant = ____value[2]
17
17
  do
18
- if (slotVariant ~= nil) and (slotVariant ~= slot.Variant) then
18
+ if slotVariant ~= nil and slotVariant ~= slot.Variant then
19
19
  goto __continue5
20
20
  end
21
21
  callback(nil, slot)
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, tearVariant)
9
9
  __TS__ArrayPush(subscriptions, {callback, tearVariant})
10
10
  end
11
11
  function ____exports.fire(self, tear)
12
+ local tearVariant
13
+ local callback
12
14
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
15
  callback = ____value[1]
15
- local tearVariant
16
16
  tearVariant = ____value[2]
17
17
  do
18
- if (tearVariant ~= nil) and (tearVariant ~= tear.Variant) then
18
+ if tearVariant ~= nil and tearVariant ~= tear.Variant then
19
19
  goto __continue5
20
20
  end
21
21
  callback(nil, tear)
@@ -9,13 +9,13 @@ function ____exports.register(self, callback, playerForm)
9
9
  __TS__ArrayPush(subscriptions, {callback, playerForm})
10
10
  end
11
11
  function ____exports.fire(self, player, playerForm, hasForm)
12
+ local callbackPlayerForm
13
+ local callback
12
14
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
15
  callback = ____value[1]
15
- local callbackPlayerForm
16
16
  callbackPlayerForm = ____value[2]
17
17
  do
18
- if (callbackPlayerForm ~= nil) and (callbackPlayerForm ~= playerForm) then
18
+ if callbackPlayerForm ~= nil and callbackPlayerForm ~= playerForm then
19
19
  goto __continue5
20
20
  end
21
21
  callback(nil, player, playerForm, hasForm)
@@ -9,8 +9,8 @@ function ____exports.register(self, callback)
9
9
  __TS__ArrayPush(subscriptions, {callback})
10
10
  end
11
11
  function ____exports.fire(self, player)
12
+ local callback
12
13
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
14
  callback = ____value[1]
15
15
  local revivalType = callback(nil, player)
16
16
  if revivalType ~= nil then
@@ -9,18 +9,18 @@ function ____exports.register(self, callback, itemType, itemID)
9
9
  __TS__ArrayPush(subscriptions, {callback, itemType, itemID})
10
10
  end
11
11
  function ____exports.fire(self, player, pickingUpItem)
12
+ local itemID
13
+ local itemType
14
+ local callback
12
15
  for ____, ____value in ipairs(subscriptions) do
13
- local callback
14
16
  callback = ____value[1]
15
- local itemType
16
17
  itemType = ____value[2]
17
- local itemID
18
18
  itemID = ____value[3]
19
19
  do
20
- if (itemType ~= nil) and (itemType ~= pickingUpItem.type) then
20
+ if itemType ~= nil and itemType ~= pickingUpItem.type then
21
21
  goto __continue5
22
22
  end
23
- if (itemID ~= nil) and (itemID ~= pickingUpItem.id) then
23
+ if itemID ~= nil and itemID ~= pickingUpItem.id then
24
24
  goto __continue5
25
25
  end
26
26
  callback(nil, player, pickingUpItem)
@@ -7,7 +7,16 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
7
7
  /** Bombs explode when their frame count is equal to this value. */
8
8
  export declare const BOMB_EXPLODE_FRAME = 45;
9
9
  export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
10
+ /**
11
+ * The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
12
+ * Baby). This set includes The Lost and Tainted Lost.
13
+ */
10
14
  export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
15
+ /**
16
+ * The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
17
+ * set includes The Lost and Tainted Lost.
18
+ */
19
+ export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
11
20
  export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE;
12
21
  /** This is also the distance that a player spawns from the door that they enter a room from. */
13
22
  export declare const DISTANCE_OF_GRID_TILE = 40;
@@ -3,8 +3,30 @@ require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
5
5
  ____exports.BOMB_EXPLODE_FRAME = 45
6
- ____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})
7
- ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {PlayerType.PLAYER_BLUEBABY, PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B, PlayerType.PLAYER_BLUEBABY_B, PlayerType.PLAYER_THEFORGOTTEN_B, PlayerType.PLAYER_BETHANY_B})
6
+ ____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
7
+ PlayerType.PLAYER_ISAAC,
8
+ PlayerType.PLAYER_MAGDALENE,
9
+ PlayerType.PLAYER_JUDAS,
10
+ PlayerType.PLAYER_BLUEBABY,
11
+ PlayerType.PLAYER_EVE,
12
+ PlayerType.PLAYER_EDEN,
13
+ PlayerType.PLAYER_THELOST,
14
+ PlayerType.PLAYER_LILITH,
15
+ PlayerType.PLAYER_KEEPER,
16
+ PlayerType.PLAYER_APOLLYON,
17
+ PlayerType.PLAYER_EDEN_B
18
+ })
19
+ ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
20
+ PlayerType.PLAYER_BLUEBABY,
21
+ PlayerType.PLAYER_THELOST,
22
+ PlayerType.PLAYER_BLACKJUDAS,
23
+ PlayerType.PLAYER_JUDAS_B,
24
+ PlayerType.PLAYER_BLUEBABY_B,
25
+ PlayerType.PLAYER_THELOST_B,
26
+ PlayerType.PLAYER_THEFORGOTTEN_B,
27
+ PlayerType.PLAYER_BETHANY_B
28
+ })
29
+ ____exports.CHARACTERS_WITH_NO_SOUL_HEARTS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_BETHANY, PlayerType.PLAYER_THELOST_B})
8
30
  ____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.POOL_TREASURE
9
31
  ____exports.DISTANCE_OF_GRID_TILE = 40
10
32
  ____exports.DOOR_HITBOX_DISTANCE = 11
@@ -16,7 +38,13 @@ ____exports.GOLDEN_TRINKET_SHIFT = 1 << 15
16
38
  ____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
17
39
  ____exports.GAME_FRAMES_PER_SECOND = 30
18
40
  ____exports.ISAAC_FRAMES_PER_SECOND = 60
19
- ____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})
41
+ ____exports.LOST_STYLE_PLAYER_TYPES = __TS__New(Set, {
42
+ PlayerType.PLAYER_THELOST,
43
+ PlayerType.PLAYER_THESOUL,
44
+ PlayerType.PLAYER_THELOST_B,
45
+ PlayerType.PLAYER_JACOB2_B,
46
+ PlayerType.PLAYER_THESOUL_B
47
+ })
20
48
  ____exports.MAX_NUM_DOORS = 8
21
49
  ____exports.MAX_NUM_FAMILIARS = 64
22
50
  ____exports.MAX_NUM_INPUTS = 4
@@ -28,7 +56,16 @@ ____exports.MAX_ROOM_INDEX = 168
28
56
  ____exports.MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING
29
57
  ____exports.MOVEMENT_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_LEFT, ButtonAction.ACTION_RIGHT, ButtonAction.ACTION_UP, ButtonAction.ACTION_DOWN})
30
58
  ____exports.ONE_BY_ONE_ROOM_GRID_SIZE = 135
31
- ____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})
59
+ ____exports.SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES = __TS__New(Set, {
60
+ CollectibleType.COLLECTIBLE_FORGET_ME_NOW,
61
+ CollectibleType.COLLECTIBLE_EDENS_SOUL,
62
+ CollectibleType.COLLECTIBLE_ALABASTER_BOX,
63
+ CollectibleType.COLLECTIBLE_PLAN_C,
64
+ CollectibleType.COLLECTIBLE_MAMA_MEGA,
65
+ CollectibleType.COLLECTIBLE_SACRIFICIAL_ALTAR,
66
+ CollectibleType.COLLECTIBLE_DEATH_CERTIFICATE,
67
+ CollectibleType.COLLECTIBLE_R_KEY
68
+ })
32
69
  ____exports.SHOOTING_ACTIONS = __TS__New(Set, {ButtonAction.ACTION_SHOOTLEFT, ButtonAction.ACTION_SHOOTRIGHT, ButtonAction.ACTION_SHOOTUP, ButtonAction.ACTION_SHOOTDOWN})
33
70
  ____exports.UI_HEART_WIDTH = 12
34
71
  return ____exports
@@ -63,7 +63,14 @@ 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(persistentEntity.type, persistentEntity.variant, persistentEntity.subType, position, Vector.Zero, nil)
66
+ Isaac.Spawn(
67
+ persistentEntity.type,
68
+ persistentEntity.variant,
69
+ persistentEntity.subType,
70
+ position,
71
+ Vector.Zero,
72
+ nil
73
+ )
67
74
  end
68
75
  end
69
76
  function ____exports.emptyRoom(self, fillWithDecorations)
@@ -88,14 +95,12 @@ end
88
95
  function removeSpecificNPCs(self)
89
96
  local game = Game()
90
97
  local room = game:GetRoom()
91
- for ____, npc in ipairs(
92
- getNPCs(nil)
93
- ) do
98
+ for ____, npc in ipairs(getNPCs(nil)) do
94
99
  do
95
100
  if NPC_TYPES_TO_NOT_REMOVE:has(npc.Type) then
96
101
  goto __continue25
97
102
  end
98
- if (npc:HasEntityFlags(EntityFlag.FLAG_CHARM) or npc:HasEntityFlags(EntityFlag.FLAG_FRIENDLY)) or npc:HasEntityFlags(EntityFlag.FLAG_PERSISTENT) then
103
+ if npc:HasEntityFlags(EntityFlag.FLAG_CHARM) or npc:HasEntityFlags(EntityFlag.FLAG_FRIENDLY) or npc:HasEntityFlags(EntityFlag.FLAG_PERSISTENT) then
99
104
  goto __continue25
100
105
  end
101
106
  npc:ClearEntityFlags(EntityFlag.FLAG_APPEAR)
@@ -164,34 +169,40 @@ function spawnAllEntities(self, jsonRoom, seed, verbose)
164
169
  local variantString = xmlEntity["$"].variant
165
170
  local variant = tonumber(variantString)
166
171
  if variant == nil then
167
- error(
168
- "Failed to convert the entity variant to a number: " .. tostring(variant)
169
- )
172
+ error("Failed to convert the entity variant to a number: " .. tostring(variant))
170
173
  end
171
174
  local subTypeString = xmlEntity["$"].subtype
172
175
  local subType = tonumber(subTypeString)
173
176
  if subType == nil then
174
- error(
175
- "Failed to convert the entity sub-type to a number: " .. tostring(subType)
176
- )
177
+ error("Failed to convert the entity sub-type to a number: " .. tostring(subType))
177
178
  end
178
179
  if entityType >= 1000 then
179
180
  if verbose then
180
- log(
181
- ((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
182
- )
181
+ log(((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
183
182
  end
184
- spawnGridEntity(nil, entityType, variant, x, y)
183
+ spawnGridEntity(
184
+ nil,
185
+ entityType,
186
+ variant,
187
+ x,
188
+ y
189
+ )
185
190
  else
186
191
  seed = nextSeed(nil, seed)
187
192
  if verbose then
188
- log(
189
- ((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")"
190
- )
193
+ log(((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
191
194
  end
192
- local entity = spawnNormalEntity(nil, entityType, variant, subType, x, y, seed)
195
+ local entity = spawnNormalEntity(
196
+ nil,
197
+ entityType,
198
+ variant,
199
+ subType,
200
+ x,
201
+ y,
202
+ seed
203
+ )
193
204
  local npc = entity:ToNPC()
194
- if (npc ~= nil) and npc.CanShutDoors then
205
+ if npc ~= nil and npc.CanShutDoors then
195
206
  shouldUnclearRoom = true
196
207
  end
197
208
  end
@@ -233,13 +244,27 @@ function spawnNormalEntity(self, entityType, variant, subType, x, y, seed)
233
244
  local roomType = room:GetType()
234
245
  local position = gridToPos(nil, x, y)
235
246
  local entity
236
- if (entityType == EntityType.ENTITY_PICKUP) and (variant == PickupVariant.PICKUP_COLLECTIBLE) then
247
+ if entityType == EntityType.ENTITY_PICKUP and variant == PickupVariant.PICKUP_COLLECTIBLE then
237
248
  local options = roomType == RoomType.ROOM_ANGEL
238
- entity = spawnCollectible(nil, subType, position, seed, options)
249
+ entity = spawnCollectible(
250
+ nil,
251
+ subType,
252
+ position,
253
+ seed,
254
+ options
255
+ )
239
256
  else
240
- entity = game:Spawn(entityType, variant, position, Vector.Zero, nil, subType, seed)
241
- end
242
- if (entityType == EntityType.ENTITY_PITFALL) and (variant == 0) then
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
243
268
  entity.EntityCollisionClass = EntityCollisionClass.ENTCOLL_ENEMIES
244
269
  entity.GridCollisionClass = EntityGridCollisionClass.GRIDCOLL_WALLS
245
270
  end
@@ -267,12 +292,10 @@ function fixPitGraphics(self)
267
292
  local room = game:GetRoom()
268
293
  local gridWidth = room:GetGridWidth()
269
294
  local pitMap = getPitMap(nil)
270
- for ____, ____value in __TS__Iterator(
271
- pitMap:entries()
272
- ) do
273
- local gridIndex
295
+ local gridEntity
296
+ local gridIndex
297
+ for ____, ____value in __TS__Iterator(pitMap:entries()) do
274
298
  gridIndex = ____value[1]
275
- local gridEntity
276
299
  gridEntity = ____value[2]
277
300
  local gridIndexLeft = gridIndex - 1
278
301
  local L = pitMap:has(gridIndexLeft)
@@ -282,24 +305,32 @@ function fixPitGraphics(self)
282
305
  local U = pitMap:has(gridIndexUp)
283
306
  local gridIndexDown = gridIndex + gridWidth
284
307
  local D = pitMap:has(gridIndexDown)
285
- local gridIndexUpLeft = (gridIndex - gridWidth) - 1
308
+ local gridIndexUpLeft = gridIndex - gridWidth - 1
286
309
  local UL = pitMap:has(gridIndexUpLeft)
287
- local gridIndexUpRight = (gridIndex - gridWidth) + 1
310
+ local gridIndexUpRight = gridIndex - gridWidth + 1
288
311
  local UR = pitMap:has(gridIndexUpRight)
289
- local gridIndexDownLeft = (gridIndex + gridWidth) - 1
312
+ local gridIndexDownLeft = gridIndex + gridWidth - 1
290
313
  local DL = pitMap:has(gridIndexDownLeft)
291
- local gridIndexDownRight = (gridIndex + gridWidth) + 1
314
+ local gridIndexDownRight = gridIndex + gridWidth + 1
292
315
  local DR = pitMap:has(gridIndexDownRight)
293
- local pitFrame = getPitFrame(nil, L, R, U, D, UL, UR, DL, DR)
316
+ local pitFrame = getPitFrame(
317
+ nil,
318
+ L,
319
+ R,
320
+ U,
321
+ D,
322
+ UL,
323
+ UR,
324
+ DL,
325
+ DR
326
+ )
294
327
  local sprite = gridEntity:GetSprite()
295
328
  sprite:SetFrame(pitFrame)
296
329
  end
297
330
  end
298
331
  function getPitMap(self)
299
332
  local pitMap = __TS__New(Map)
300
- for ____, gridEntity in ipairs(
301
- getGridEntities(nil, GridEntityType.GRID_PIT)
302
- ) do
333
+ for ____, gridEntity in ipairs(getGridEntities(nil, GridEntityType.GRID_PIT)) do
303
334
  local gridIndex = gridEntity:GetGridIndex()
304
335
  pitMap:set(gridIndex, gridEntity)
305
336
  end
@@ -319,52 +350,52 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
319
350
  if D then
320
351
  F = F | 8
321
352
  end
322
- if (((U and L) and (not UL)) and (not R)) and (not D) then
353
+ if U and L and not UL and not R and not D then
323
354
  F = 17
324
355
  end
325
- if (((U and R) and (not UR)) and (not L)) and (not D) then
356
+ if U and R and not UR and not L and not D then
326
357
  F = 18
327
358
  end
328
- if (((L and D) and (not DL)) and (not U)) and (not R) then
359
+ if L and D and not DL and not U and not R then
329
360
  F = 19
330
361
  end
331
- if (((R and D) and (not DR)) and (not L)) and (not U) then
362
+ if R and D and not DR and not L and not U then
332
363
  F = 20
333
364
  end
334
- if (((L and U) and R) and D) and (not UL) then
365
+ if L and U and R and D and not UL then
335
366
  F = 21
336
367
  end
337
- if (((L and U) and R) and D) and (not UR) then
368
+ if L and U and R and D and not UR then
338
369
  F = 22
339
370
  end
340
- if (((U and R) and D) and (not L)) and (not UR) then
371
+ if U and R and D and not L and not UR then
341
372
  F = 25
342
373
  end
343
- if (((L and U) and D) and (not R)) and (not UL) then
374
+ if L and U and D and not R and not UL then
344
375
  F = 26
345
376
  end
346
- if ((((L and U) and R) and D) and (not DL)) and (not DR) then
377
+ if L and U and R and D and not DL and not DR then
347
378
  F = 24
348
379
  end
349
- if ((((L and U) and R) and D) and (not UR)) and (not UL) then
380
+ if L and U and R and D and not UR and not UL then
350
381
  F = 23
351
382
  end
352
- if ((((L and U) and R) and UL) and (not UR)) and (not D) then
383
+ if L and U and R and UL and not UR and not D then
353
384
  F = 27
354
385
  end
355
- if ((((L and U) and R) and UR) and (not UL)) and (not D) then
386
+ if L and U and R and UR and not UL and not D then
356
387
  F = 28
357
388
  end
358
- if ((((L and U) and R) and (not D)) and (not UR)) and (not UL) then
389
+ if L and U and R and not D and not UR and not UL then
359
390
  F = 29
360
391
  end
361
- if ((((L and R) and D) and DL) and (not U)) and (not DR) then
392
+ if L and R and D and DL and not U and not DR then
362
393
  F = 30
363
394
  end
364
- if ((((L and R) and D) and DR) and (not U)) and (not DL) then
395
+ if L and R and D and DR and not U and not DL then
365
396
  F = 31
366
397
  end
367
- if ((((L and R) and D) and (not U)) and (not DL)) and (not DR) then
398
+ if L and R and D and not U and not DL and not DR then
368
399
  F = 32
369
400
  end
370
401
  return F
@@ -373,13 +404,11 @@ FEATURE_NAME = "JSON room deployer"
373
404
  NPC_TYPES_TO_NOT_REMOVE = __TS__New(Set, {EntityType.ENTITY_DARK_ESAU})
374
405
  PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.ENTITY_WALL_HUGGER})
375
406
  initialized = false
376
- v = {
377
- level = {
378
- deployedRoomIndexes = __TS__New(Set),
379
- persistentEntities = __TS__New(Map),
380
- decorationGridIndexes = __TS__New(Map)
381
- }
382
- }
407
+ v = {level = {
408
+ deployedRoomIndexes = __TS__New(Set),
409
+ persistentEntities = __TS__New(Map),
410
+ decorationGridIndexes = __TS__New(Map)
411
+ }}
383
412
  function ____exports.deployJSONRoomInit(self, mod)
384
413
  initialized = true
385
414
  saveDataManager(nil, "deployJSONRoom", v)
@@ -18,14 +18,20 @@ 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 disableValue = ((booleanCallback and (function() return false end)) or (function() return 0 end))()
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
22
28
  if not v.run.enableSomeInputs then
23
29
  return disableValue
24
30
  end
25
- if (v.run.whitelist ~= nil) and (not v.run.whitelist:has(buttonAction)) then
31
+ if v.run.whitelist ~= nil and not v.run.whitelist:has(buttonAction) then
26
32
  return disableValue
27
33
  end
28
- if (v.run.blacklist ~= nil) and v.run.blacklist:has(buttonAction) then
34
+ if v.run.blacklist ~= nil and v.run.blacklist:has(buttonAction) then
29
35
  return disableValue
30
36
  end
31
37
  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
@@ -23,7 +23,7 @@ end
23
23
  function preGetCollectible(self, itemPoolType, _decrease, _seed)
24
24
  local roomIndex = getRoomIndex(nil)
25
25
  local roomVisitedCount = getRoomVisitedCount(nil)
26
- if (roomIndex ~= v.run.currentRoomIndex) or (roomVisitedCount ~= v.run.currentRoomVisitedCount) then
26
+ if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
27
27
  v.run.currentRoomIndex = roomIndex
28
28
  v.run.currentRoomVisitedCount = roomVisitedCount
29
29
  arrayEmpty(nil, v.run.collectibleQueue)
@@ -33,14 +33,12 @@ function preGetCollectible(self, itemPoolType, _decrease, _seed)
33
33
  end
34
34
  local FEATURE_NAME = "get collectible item pool type"
35
35
  local initialized = false
36
- v = {
37
- run = {
38
- collectibleQueue = {},
39
- collectibleItemPoolTypeMap = __TS__New(Map),
40
- currentRoomIndex = nil,
41
- currentRoomVisitedCount = nil
42
- }
43
- }
36
+ v = {run = {
37
+ collectibleQueue = {},
38
+ collectibleItemPoolTypeMap = __TS__New(Map),
39
+ currentRoomIndex = nil,
40
+ currentRoomVisitedCount = nil
41
+ }}
44
42
  function ____exports.getCollectibleItemPoolTypeInit(self, mod)
45
43
  initialized = true
46
44
  saveDataManager(nil, "getCollectibleItemPoolType", v)
@@ -52,13 +50,11 @@ function ____exports.getCollectibleItemPoolType(self, collectible)
52
50
  local msg = getUpgradeErrorMsg(nil, FEATURE_NAME)
53
51
  error(msg)
54
52
  end
55
- if (collectible.Type ~= EntityType.ENTITY_PICKUP) or (collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE) then
56
- error(
57
- (((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType)
58
- )
53
+ if collectible.Type ~= EntityType.ENTITY_PICKUP or collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
54
+ error((((("The \"getCollectibleItemPoolType()\" function was given a non-collectible: " .. tostring(collectible.Type)) .. ".") .. tostring(collectible.Variant)) .. ".") .. tostring(collectible.SubType))
59
55
  end
60
56
  local ptrHash = GetPtrHash(collectible)
61
57
  local itemPoolType = v.run.collectibleItemPoolTypeMap:get(ptrHash)
62
- return ((itemPoolType == nil) and getRoomItemPoolType(nil)) or itemPoolType
58
+ return itemPoolType == nil and getRoomItemPoolType(nil) or itemPoolType
63
59
  end
64
60
  return ____exports
@@ -16,17 +16,13 @@ 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 = {
26
- room = {
27
- trackedItems = __TS__New(Map)
28
- }
29
- }
25
+ v = {room = {trackedItems = __TS__New(Map)}}
30
26
  function ____exports.preventCollectibleRotateInit(self, mod)
31
27
  initialized = true
32
28
  saveDataManager(nil, "preventCollectibleRotate", v)
@@ -39,9 +35,7 @@ function ____exports.preventCollectibleRotate(self, collectible, collectibleType
39
35
  error(msg)
40
36
  end
41
37
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
42
- error(
43
- "You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant)
44
- )
38
+ error("You cannot prevent the rotation for pickups of variant: " .. tostring(collectible.Variant))
45
39
  end
46
40
  v.room.trackedItems:set(collectible.InitSeed, collectibleType)
47
41
  postPickupUpdateCollectible(nil, collectible)
@@ -14,9 +14,7 @@ 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(
18
- (("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg
19
- )
17
+ log((("Failed to read from the \"save#.dat\" file on Isaac frame " .. tostring(isaacFrameCount)) .. ": ") .. jsonStringOrErrMsg)
20
18
  return DEFAULT_MOD_DATA
21
19
  end
22
20
  if jsonStringOrErrMsg == nil then
@@ -56,9 +54,7 @@ function ____exports.loadFromDisk(self, mod, oldSaveData)
56
54
  goto __continue5
57
55
  end
58
56
  if DEBUG then
59
- log(
60
- "Merging in stored data for feature: " .. tostring(key)
61
- )
57
+ log("Merging in stored data for feature: " .. tostring(key))
62
58
  end
63
59
  merge(nil, oldSaveDataForSubscriber, value, key)
64
60
  end
@@ -56,7 +56,7 @@ function restoreDefaultsAll(self)
56
56
  restoreDefaults(nil, SaveDataKeys.Room)
57
57
  end
58
58
  function restoreDefaults(self, childTableName)
59
- if ((childTableName ~= SaveDataKeys.Run) and (childTableName ~= SaveDataKeys.Level)) and (childTableName ~= SaveDataKeys.Room) then
59
+ if childTableName ~= SaveDataKeys.Run and childTableName ~= SaveDataKeys.Level and childTableName ~= SaveDataKeys.Room then
60
60
  error("Unknown child table name of: " .. childTableName)
61
61
  end
62
62
  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,9 +102,7 @@ function mergeTable(self, oldTable, newTable, traversalDescription)
102
102
  end
103
103
  else
104
104
  if DEBUG then
105
- log(
106
- (("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value)
107
- )
105
+ log((("Merging key \"" .. tostring(key)) .. "\" with value: ") .. tostring(value))
108
106
  end
109
107
  oldTable[key] = value
110
108
  end