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
@@ -14,7 +14,9 @@ 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
- array[currentIndex + 1], array[randomIndex + 1] = array[randomIndex + 1], array[currentIndex + 1]
17
+ local ____temp_0 = {array[randomIndex + 1], array[currentIndex + 1]}
18
+ array[currentIndex + 1] = ____temp_0[1]
19
+ array[randomIndex + 1] = ____temp_0[2]
18
20
  end
19
21
  end
20
22
  function ____exports.getRandomArrayIndex(self, array, seed)
@@ -68,9 +70,7 @@ function ____exports.arrayShuffle(self, originalArray, seed)
68
70
  if seed == nil then
69
71
  seed = Random()
70
72
  end
71
- local array = {
72
- table.unpack(originalArray)
73
- }
73
+ local array = {table.unpack(originalArray)}
74
74
  ____exports.arrayShuffleInPlace(nil, array, seed)
75
75
  return array
76
76
  end
@@ -93,9 +93,7 @@ function ____exports.arrayToString(self, array)
93
93
  end
94
94
  function ____exports.arrayRemove(self, originalArray, ...)
95
95
  local elements = {...}
96
- local array = {
97
- table.unpack(originalArray)
98
- }
96
+ local array = {table.unpack(originalArray)}
99
97
  for ____, element in ipairs(elements) do
100
98
  local index = __TS__ArrayIndexOf(array, element)
101
99
  __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,15 +95,13 @@ 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(
105
- getPlayers(nil)
106
- ) do
104
+ for ____, player in ipairs(getPlayers(nil)) do
107
105
  ____exports.addRoomClearCharge(nil, player, ignoreBigRoomDoubleCharge)
108
106
  end
109
107
  end
@@ -7,6 +7,7 @@ export declare function getCollectibleDescription(collectibleType: CollectibleTy
7
7
  * in a Devil Room deal. Returns 0 if passed CollectibleType.COLLECTIBLE_NULL.
8
8
  */
9
9
  export declare function getCollectibleDevilHeartPrice(collectibleType: CollectibleType | int, player: EntityPlayer): PickupPrice;
10
+ export declare function getCollectibleGfxFilename(collectibleType: CollectibleType | int): string;
10
11
  export declare function getCollectibleInitCharges(collectibleType: CollectibleType | int): int;
11
12
  export declare function getCollectibleItemType(collectibleType: CollectibleType | int): ItemType;
12
13
  export declare function getCollectibleMaxCharges(collectibleType: CollectibleType | int): int;
@@ -10,9 +10,7 @@ local ____entity = require("functions.entity")
10
10
  local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
11
11
  function ____exports.setCollectibleSprite(self, collectible, pngPath)
12
12
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
13
- error(
14
- "You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant)
15
- )
13
+ error("You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant))
16
14
  end
17
15
  local sprite = collectible:GetSprite()
18
16
  sprite:ReplaceSpritesheet(COLLECTIBLE_SPRITE_LAYER, pngPath)
@@ -59,8 +57,16 @@ function ____exports.getCollectibleDevilHeartPrice(self, collectibleType, player
59
57
  if itemConfigItem == nil then
60
58
  return defaultPickupPrice
61
59
  end
62
- local twoHeartPrice = ((maxHearts == 2) and PickupPrice.PRICE_ONE_HEART_AND_TWO_SOULHEARTS) or PickupPrice.PRICE_TWO_HEARTS
63
- return ((itemConfigItem.DevilPrice == 2) and twoHeartPrice) or PickupPrice.PRICE_ONE_HEART
60
+ local twoHeartPrice = maxHearts == 2 and PickupPrice.PRICE_ONE_HEART_AND_TWO_SOULHEARTS or PickupPrice.PRICE_TWO_HEARTS
61
+ return itemConfigItem.DevilPrice == 2 and twoHeartPrice or PickupPrice.PRICE_ONE_HEART
62
+ end
63
+ function ____exports.getCollectibleGfxFilename(self, collectibleType)
64
+ local itemConfig = Isaac.GetItemConfig()
65
+ local itemConfigItem = itemConfig:GetCollectible(collectibleType)
66
+ if itemConfigItem == nil then
67
+ return "unknown.png"
68
+ end
69
+ return itemConfigItem.GfxFileName
64
70
  end
65
71
  function ____exports.getCollectibleInitCharges(self, collectibleType)
66
72
  local itemConfig = Isaac.GetItemConfig()
@@ -121,11 +127,11 @@ function ____exports.getMaxCollectibleID(self)
121
127
  return itemConfig:GetCollectibles().Size - 1
122
128
  end
123
129
  function ____exports.isGlitchedCollectible(self, entity)
124
- return ((entity.Type == EntityType.ENTITY_PICKUP) and (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE)) and (entity.SubType > GLITCHED_ITEM_THRESHOLD)
130
+ return entity.Type == EntityType.ENTITY_PICKUP and entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and entity.SubType > GLITCHED_ITEM_THRESHOLD
125
131
  end
126
132
  function ____exports.isPassiveCollectible(self, collectibleType)
127
133
  local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
128
- return (itemType == ItemType.ITEM_PASSIVE) or (itemType == ItemType.ITEM_FAMILIAR)
134
+ return itemType == ItemType.ITEM_PASSIVE or itemType == ItemType.ITEM_FAMILIAR
129
135
  end
130
136
  function ____exports.isQuestCollectible(self, collectibleType)
131
137
  return ____exports.collectibleHasTag(nil, collectibleType, 32768)
@@ -135,32 +141,31 @@ function ____exports.removeAllCollectibles(self)
135
141
  end
136
142
  function ____exports.removeCollectiblePickupDelay(self, collectible)
137
143
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
138
- error(
139
- "You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant)
140
- )
144
+ error("You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant))
141
145
  end
142
146
  collectible.Wait = 0
143
147
  end
144
148
  function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
145
149
  local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
146
- Isaac.DebugString(
147
- ((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)"
148
- )
150
+ Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
149
151
  end
150
152
  function ____exports.setCollectibleBlind(self, collectible)
151
153
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
152
- error(
153
- "You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant)
154
- )
154
+ error("You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant))
155
155
  end
156
156
  ____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
157
157
  end
158
158
  function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
159
159
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
160
- error(
161
- "You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant)
162
- )
163
- end
164
- collectible:Morph(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, newCollectibleType, true, true, true)
160
+ error("You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant))
161
+ end
162
+ collectible:Morph(
163
+ EntityType.ENTITY_PICKUP,
164
+ PickupVariant.PICKUP_COLLECTIBLE,
165
+ newCollectibleType,
166
+ true,
167
+ true,
168
+ true
169
+ )
165
170
  end
166
171
  return ____exports
@@ -7,7 +7,15 @@ function ____exports.getDefaultKColor(self)
7
7
  return KColor(1, 1, 1, 1)
8
8
  end
9
9
  function ____exports.copyColor(self, color)
10
- return Color(color.R, color.G, color.B, color.A, color.RO, color.GO, color.BO)
10
+ return Color(
11
+ color.R,
12
+ color.G,
13
+ color.B,
14
+ color.A,
15
+ color.RO,
16
+ color.GO,
17
+ color.BO
18
+ )
11
19
  end
12
20
  function ____exports.copyKColor(self, kColor)
13
21
  return KColor(kColor.Red, kColor.Green, kColor.Blue, kColor.Alpha)
@@ -39,18 +39,18 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
39
39
  local hasTSTLMapBrand = false
40
40
  local hasTSTLSetBrand = false
41
41
  local hasTSTLClassBrand = false
42
- if ((not __TS__InstanceOf(oldObject, Map)) and (not __TS__InstanceOf(oldObject, Set))) and (not isClass) then
42
+ if not __TS__InstanceOf(oldObject, Map) and not __TS__InstanceOf(oldObject, Set) and not isClass then
43
43
  checkMetatable(nil, oldTable, traversalDescription)
44
44
  hasTSTLMapBrand = oldTable[TSTL_MAP_BRAND] ~= nil
45
45
  hasTSTLSetBrand = oldTable[TSTL_SET_BRAND] ~= nil
46
46
  hasTSTLClassBrand = oldTable[TSTL_CLASS_BRAND] ~= nil
47
47
  end
48
48
  local newObject
49
- if ((serializationType == ____exports.SerializationType.NONE) and __TS__InstanceOf(oldObject, Map)) or ((serializationType == ____exports.SerializationType.DESERIALIZE) and hasTSTLMapBrand) then
49
+ if serializationType == ____exports.SerializationType.NONE and __TS__InstanceOf(oldObject, Map) or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLMapBrand then
50
50
  newObject = __TS__New(Map)
51
- elseif ((serializationType == ____exports.SerializationType.NONE) and __TS__InstanceOf(oldObject, Set)) or ((serializationType == ____exports.SerializationType.DESERIALIZE) and hasTSTLSetBrand) then
51
+ elseif serializationType == ____exports.SerializationType.NONE and __TS__InstanceOf(oldObject, Set) or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLSetBrand then
52
52
  newObject = __TS__New(Set)
53
- elseif ((serializationType == ____exports.SerializationType.NONE) and isClass) or ((serializationType == ____exports.SerializationType.DESERIALIZE) and hasTSTLClassBrand) then
53
+ elseif serializationType == ____exports.SerializationType.NONE and isClass or serializationType == ____exports.SerializationType.DESERIALIZE and hasTSTLClassBrand then
54
54
  newObject = cloneClass(nil, oldObject)
55
55
  else
56
56
  newObject = {}
@@ -66,31 +66,43 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
66
66
  end
67
67
  end
68
68
  if __TS__InstanceOf(oldObject, Map) then
69
- for ____, ____value in __TS__Iterator(
70
- oldObject:entries()
71
- ) do
72
- local key
69
+ local value
70
+ local key
71
+ for ____, ____value in __TS__Iterator(oldObject:entries()) do
73
72
  key = ____value[1]
74
- local value
75
73
  value = ____value[2]
76
74
  do
77
75
  if ____exports.isBrand(nil, key) then
78
76
  goto __continue17
79
77
  end
80
- deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
78
+ deepCopyValue(
79
+ nil,
80
+ oldObject,
81
+ newObject,
82
+ key,
83
+ value,
84
+ traversalDescription,
85
+ serializationType
86
+ )
81
87
  end
82
88
  ::__continue17::
83
89
  end
84
90
  elseif __TS__InstanceOf(oldObject, Set) then
85
- for ____, key in __TS__Iterator(
86
- oldObject:values()
87
- ) do
91
+ for ____, key in __TS__Iterator(oldObject:values()) do
88
92
  do
89
93
  if ____exports.isBrand(nil, key) then
90
94
  goto __continue20
91
95
  end
92
96
  local value = ""
93
- deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
97
+ deepCopyValue(
98
+ nil,
99
+ oldObject,
100
+ newObject,
101
+ key,
102
+ value,
103
+ traversalDescription,
104
+ serializationType
105
+ )
94
106
  end
95
107
  ::__continue20::
96
108
  end
@@ -100,7 +112,15 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
100
112
  if ____exports.isBrand(nil, key) then
101
113
  goto __continue23
102
114
  end
103
- deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
115
+ deepCopyValue(
116
+ nil,
117
+ oldObject,
118
+ newObject,
119
+ key,
120
+ value,
121
+ traversalDescription,
122
+ serializationType
123
+ )
104
124
  end
105
125
  ::__continue23::
106
126
  end
@@ -139,7 +159,7 @@ function getNewClassFromMetatable(self, metatable)
139
159
  return newClass
140
160
  end
141
161
  function ____exports.isBrand(self, key)
142
- return ((((key == TSTL_MAP_BRAND) or (key == TSTL_SET_BRAND)) or (key == TSTL_CLASS_BRAND)) or (key == TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND)) or (key == VECTOR_BRAND)
162
+ return key == TSTL_MAP_BRAND or key == TSTL_SET_BRAND or key == TSTL_CLASS_BRAND or key == TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND or key == VECTOR_BRAND
143
163
  end
144
164
  function deepCopyValue(self, oldObject, newObject, key, value, traversalDescription, serializationType)
145
165
  local valueType = type(value)
@@ -147,7 +167,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
147
167
  local convertNumberKeysToString = false
148
168
  local isTSTLObject = __TS__InstanceOf(oldObject, Map) or __TS__InstanceOf(oldObject, Set)
149
169
  local keyType = type(key)
150
- if ((serializationType == ____exports.SerializationType.SERIALIZE) and isTSTLObject) and (keyType == "number") then
170
+ if serializationType == ____exports.SerializationType.SERIALIZE and isTSTLObject and keyType == "number" then
151
171
  convertNumberKeysToString = true
152
172
  local newTable = newObject
153
173
  newTable[TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND] = ""
@@ -159,7 +179,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
159
179
  if isVector(nil, value) then
160
180
  local vector = value
161
181
  newValue = copyVector(nil, vector, serializationType)
162
- elseif ____exports.isSerializedVector(nil, value) and (serializationType == ____exports.SerializationType.DESERIALIZE) then
182
+ elseif ____exports.isSerializedVector(nil, value) and serializationType == ____exports.SerializationType.DESERIALIZE then
163
183
  local serializedVector = value
164
184
  newValue = ____exports.deserializeVector(nil, serializedVector)
165
185
  elseif valueType == "table" then
@@ -174,7 +194,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
174
194
  elseif __TS__InstanceOf(newObject, Set) then
175
195
  newObject:add(key)
176
196
  else
177
- local keyToUse = (convertNumberKeysToString and tostring(key)) or key
197
+ local keyToUse = convertNumberKeysToString and tostring(key) or key
178
198
  newObject[keyToUse] = newValue
179
199
  end
180
200
  end
@@ -207,14 +227,14 @@ function checkMetatable(self, ____table, traversalDescription)
207
227
  if metatable == nil then
208
228
  return
209
229
  end
210
- local tableDescription = ((traversalDescription == "") and "the table to copy") or (("\"" .. traversalDescription) .. "\"")
230
+ local tableDescription = traversalDescription == "" and "the table to copy" or ("\"" .. traversalDescription) .. "\""
211
231
  error(("The deepCopy function detected that " .. tableDescription) .. " has a metatable. Copying tables with metatables is not supported (unless they are TypeScriptToLua Maps, Sets, or Classes).")
212
232
  end
213
233
  function validateValue(self, value, valueType, traversalDescription)
214
234
  if isVector(nil, value) then
215
235
  return
216
236
  end
217
- if (((valueType == "function") or (valueType == "nil")) or (valueType == "thread")) or (valueType == "userdata") then
237
+ if valueType == "function" or valueType == "nil" or valueType == "thread" or valueType == "userdata" then
218
238
  error(((("The deepCopy function detected that \"" .. traversalDescription) .. "\" is type ") .. valueType) .. ", which is not supported.")
219
239
  end
220
240
  end
@@ -231,7 +251,7 @@ function ____exports.isSerializedVector(self, object)
231
251
  return false
232
252
  end
233
253
  local ____table = object
234
- return ((____table[VECTOR_BRAND] ~= nil) and (____table.X ~= nil)) and (____table.Y ~= nil)
254
+ return ____table[VECTOR_BRAND] ~= nil and ____table.X ~= nil and ____table.Y ~= nil
235
255
  end
236
256
  ____exports.SerializationType = SerializationType or ({})
237
257
  ____exports.SerializationType.NONE = 0
@@ -43,18 +43,14 @@ function copiedTableHasKeyAndValueNumber(self)
43
43
  local newTable = newObject
44
44
  local value = newTable[keyToLookFor]
45
45
  if value == nil then
46
- error(
47
- "The copied object did not have a key of: " .. tostring(keyToLookFor)
48
- )
46
+ error("The copied object did not have a key of: " .. tostring(keyToLookFor))
49
47
  end
50
48
  local valueType = type(value)
51
49
  if valueType ~= "number" then
52
50
  error("The copied object had a value type of: " .. valueType)
53
51
  end
54
52
  if value ~= valueToLookFor then
55
- error(
56
- "The copied object had a value of: " .. tostring(value)
57
- )
53
+ error("The copied object had a value of: " .. tostring(value))
58
54
  end
59
55
  end
60
56
  function copiedTableDoesNotCoerceTypes(self)
@@ -115,20 +111,20 @@ function copiedObjectHasNoReferencesForArray(self)
115
111
  if not arrayEquals(nil, oldObject.abc, newObject.abc) then
116
112
  error("The copied object does not have an equal array.")
117
113
  end
118
- local ____obj, ____index = oldObject.abc, 0 + 1
119
- ____obj[____index] = ____obj[____index] + 1
114
+ local ____oldObject_abc_0, ____1_1 = oldObject.abc, 1
115
+ ____oldObject_abc_0[____1_1] = ____oldObject_abc_0[____1_1] + 1
120
116
  if arrayEquals(nil, oldObject.abc, newObject.abc) then
121
117
  error("The copied object has an equal array after a modification to the old array.")
122
118
  end
123
- local ____obj, ____index = oldObject.abc, 0 + 1
124
- ____obj[____index] = ____obj[____index] - 1
125
- local ____obj, ____index = newObject.abc, 0 + 1
126
- ____obj[____index] = ____obj[____index] + 1
119
+ local ____oldObject_abc_2, ____1_3 = oldObject.abc, 1
120
+ ____oldObject_abc_2[____1_3] = ____oldObject_abc_2[____1_3] - 1
121
+ local ____newObject_abc_4, ____1_5 = newObject.abc, 1
122
+ ____newObject_abc_4[____1_5] = ____newObject_abc_4[____1_5] + 1
127
123
  if arrayEquals(nil, oldObject.abc, newObject.abc) then
128
124
  error("The copied object has an equal array after a modification to the new array.")
129
125
  end
130
- local ____obj, ____index = newObject.abc, 0 + 1
131
- ____obj[____index] = ____obj[____index] - 1
126
+ local ____newObject_abc_6, ____1_7 = newObject.abc, 1
127
+ ____newObject_abc_6[____1_7] = ____newObject_abc_6[____1_7] - 1
132
128
  end
133
129
  function copiedObjectHasChildObject(self)
134
130
  local childObjectIndex = "abc"
@@ -235,14 +231,10 @@ function copiedMapHasChildMap(self)
235
231
  end
236
232
  local value = newChildMap:get(childMapKey)
237
233
  if value == nil then
238
- error(
239
- "The copied child Map did not have a key of: " .. tostring(childMapKey)
240
- )
234
+ error("The copied child Map did not have a key of: " .. tostring(childMapKey))
241
235
  end
242
236
  if value ~= childMapValue then
243
- error(
244
- "The copied child Map did not have a value of: " .. tostring(childMapValue)
245
- )
237
+ error("The copied child Map did not have a value of: " .. tostring(childMapValue))
246
238
  end
247
239
  end
248
240
  function ____exports.deepCopyTests(self)
@@ -42,18 +42,14 @@ function ____exports.isSecretRoomDoor(self, door)
42
42
  return filename == "gfx/grid/Door_08_HoleInWall.anm2"
43
43
  end
44
44
  function ____exports.closeAllDoors(self)
45
- for ____, door in ipairs(
46
- ____exports.getDoors(nil)
47
- ) do
45
+ for ____, door in ipairs(____exports.getDoors(nil)) do
48
46
  door.State = DoorState.STATE_CLOSED
49
47
  local sprite = door:GetSprite()
50
48
  sprite:Play("Close", true)
51
49
  end
52
50
  end
53
51
  function ____exports.getAngelRoomDoor(self)
54
- for ____, door in ipairs(
55
- ____exports.getDoors(nil)
56
- ) do
52
+ for ____, door in ipairs(____exports.getDoors(nil)) do
57
53
  if ____exports.isAngelRoomDoor(nil, door) then
58
54
  return door
59
55
  end
@@ -61,9 +57,7 @@ function ____exports.getAngelRoomDoor(self)
61
57
  return nil
62
58
  end
63
59
  function ____exports.getDevilRoomDoor(self)
64
- for ____, door in ipairs(
65
- ____exports.getDoors(nil)
66
- ) do
60
+ for ____, door in ipairs(____exports.getDoors(nil)) do
67
61
  if ____exports.isDevilRoomDoor(nil, door) then
68
62
  return door
69
63
  end
@@ -71,9 +65,7 @@ function ____exports.getDevilRoomDoor(self)
71
65
  return nil
72
66
  end
73
67
  function ____exports.getDevilRoomOrAngelRoomDoor(self)
74
- for ____, door in ipairs(
75
- ____exports.getDoors(nil)
76
- ) do
68
+ for ____, door in ipairs(____exports.getDoors(nil)) do
77
69
  if ____exports.isDevilRoomDoor(nil, door) or ____exports.isAngelRoomDoor(nil, door) then
78
70
  return door
79
71
  end
@@ -81,9 +73,7 @@ function ____exports.getDevilRoomOrAngelRoomDoor(self)
81
73
  return nil
82
74
  end
83
75
  function ____exports.getRepentanceDoor(self)
84
- for ____, door in ipairs(
85
- ____exports.getDoors(nil)
86
- ) do
76
+ for ____, door in ipairs(____exports.getDoors(nil)) do
87
77
  if ____exports.isRepentanceDoor(nil, door) then
88
78
  return door
89
79
  end
@@ -93,7 +83,7 @@ end
93
83
  function ____exports.isHiddenSecretRoomDoor(self, door)
94
84
  local sprite = door:GetSprite()
95
85
  local animation = sprite:GetAnimation()
96
- return ____exports.isSecretRoomDoor(nil, door) and (animation == "Hidden")
86
+ return ____exports.isSecretRoomDoor(nil, door) and animation == "Hidden"
97
87
  end
98
88
  function ____exports.isDoorToDownpour(self, door)
99
89
  if not ____exports.isRepentanceDoor(nil, door) then
@@ -136,9 +126,7 @@ function ____exports.isDoorToMomsHeart(self, door)
136
126
  return filename == "gfx/grid/Door_MomsHeart.anm2"
137
127
  end
138
128
  function ____exports.openAllDoors(self)
139
- for ____, door in ipairs(
140
- ____exports.getDoors(nil)
141
- ) do
129
+ for ____, door in ipairs(____exports.getDoors(nil)) do
142
130
  door:Open()
143
131
  end
144
132
  end
@@ -298,7 +298,13 @@ function ____exports.setEntityRandomColor(self, entity)
298
298
  end
299
299
  end
300
300
  local color = Color(colorValues[1], colorValues[2], colorValues[3])
301
- entity:SetColor(color, 100000, 100000, false, false)
301
+ entity:SetColor(
302
+ color,
303
+ 100000,
304
+ 100000,
305
+ false,
306
+ false
307
+ )
302
308
  end
303
309
  function ____exports.setEntityVelocities(self, entityVelocities, entities)
304
310
  if entities == nil then
@@ -10,7 +10,7 @@ end
10
10
  function ____exports.hasFlag(self, flags, ...)
11
11
  local flag = {...}
12
12
  for ____, f in ipairs(flag) do
13
- if not ((flags & f) == f) then
13
+ if not (flags & f == f) then
14
14
  return false
15
15
  end
16
16
  end
@@ -36,13 +36,11 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
36
36
  end
37
37
  local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
38
38
  if gridEntityArray == nil then
39
- error(
40
- "Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
41
- )
39
+ error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
42
40
  end
43
41
  local gridEntityType = gridEntityArray[1]
44
42
  local gridEntityVariant = gridEntityArray[2]
45
- if ((gridEntityType == GridEntityType.GRID_SPIKES_ONOFF) or (gridEntityType == GridEntityType.GRID_PRESSURE_PLATE)) or (gridEntityType == GridEntityType.GRID_TELEPORTER) then
43
+ if gridEntityType == GridEntityType.GRID_SPIKES_ONOFF or gridEntityType == GridEntityType.GRID_PRESSURE_PLATE or gridEntityType == GridEntityType.GRID_TELEPORTER then
46
44
  gridEntityVariant = gridEntityXMLVariant
47
45
  end
48
46
  return {gridEntityType, gridEntityVariant}
@@ -82,7 +80,16 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
82
80
  local room = game:GetRoom()
83
81
  local gridWidth = room:GetGridWidth()
84
82
  local gridIndex = gridEntity:GetGridIndex()
85
- local surroundingGridIndexes = {gridIndex - 1, gridIndex + 1, (gridIndex - gridWidth) - 1, gridIndex - gridWidth, (gridIndex - gridWidth) + 1, (gridIndex + gridWidth) - 1, gridIndex + gridWidth, (gridIndex + gridWidth) + 1}
83
+ local surroundingGridIndexes = {
84
+ gridIndex - 1,
85
+ gridIndex + 1,
86
+ gridIndex - gridWidth - 1,
87
+ gridIndex - gridWidth,
88
+ gridIndex - gridWidth + 1,
89
+ gridIndex + gridWidth - 1,
90
+ gridIndex + gridWidth,
91
+ gridIndex + gridWidth + 1
92
+ }
86
93
  local surroundingGridEntities = {}
87
94
  for ____, surroundingGridIndex in ipairs(surroundingGridIndexes) do
88
95
  local surroundingGridEntity = room:GetGridEntity(surroundingGridIndex)
@@ -99,9 +106,7 @@ function ____exports.isAllPressurePlatesPushed(self)
99
106
  if not hasPressurePlates then
100
107
  return true
101
108
  end
102
- for ____, gridEntity in ipairs(
103
- ____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)
104
- ) do
109
+ for ____, gridEntity in ipairs(____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)) do
105
110
  local gridEntityDesc = gridEntity:GetSaveState()
106
111
  if gridEntityDesc.State ~= 3 then
107
112
  return false
@@ -39,12 +39,10 @@ ControllerLiteral[ControllerLiteral.BUTTON_BACK] = "BUTTON_BACK"
39
39
  ControllerLiteral.BUTTON_START = 15
40
40
  ControllerLiteral[ControllerLiteral.BUTTON_START] = "BUTTON_START"
41
41
  function ____exports.controllerToString(self, controller)
42
- for ____, ____value in ipairs(
43
- __TS__ObjectEntries(ControllerLiteral)
44
- ) do
45
- local key
42
+ local controllerLiteralCode
43
+ local key
44
+ for ____, ____value in ipairs(__TS__ObjectEntries(ControllerLiteral)) do
46
45
  key = ____value[1]
47
- local controllerLiteralCode
48
46
  controllerLiteralCode = ____value[2]
49
47
  do
50
48
  if type(key) ~= "string" then
@@ -55,7 +53,13 @@ function ____exports.controllerToString(self, controller)
55
53
  goto __continue3
56
54
  end
57
55
  local controllerName = key
58
- for ____, prefix in ipairs({"DPAD_", "BUTTON_", "BUMPER_", "TRIGGER_", "STICK_"}) do
56
+ for ____, prefix in ipairs({
57
+ "DPAD_",
58
+ "BUTTON_",
59
+ "BUMPER_",
60
+ "TRIGGER_",
61
+ "STICK_"
62
+ }) do
59
63
  controllerName = __TS__StringReplace(controllerName, prefix, "")
60
64
  end
61
65
  return controllerName
@@ -92,9 +96,7 @@ function ____exports.isKeyboardPressed(self, key)
92
96
  return Input.IsButtonPressed(key, 0)
93
97
  end
94
98
  function ____exports.isMoveActionPressedOnAnyInput(self)
95
- for ____, buttonAction in __TS__Iterator(
96
- MOVEMENT_ACTIONS:values()
97
- ) do
99
+ for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
98
100
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
99
101
  return true
100
102
  end
@@ -102,9 +104,7 @@ function ____exports.isMoveActionPressedOnAnyInput(self)
102
104
  return false
103
105
  end
104
106
  function ____exports.isMoveActionTriggeredOnAnyInput(self)
105
- for ____, buttonAction in __TS__Iterator(
106
- MOVEMENT_ACTIONS:values()
107
- ) do
107
+ for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
108
108
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
109
109
  return true
110
110
  end
@@ -112,9 +112,7 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
112
112
  return false
113
113
  end
114
114
  function ____exports.isShootActionPressedOnAnyInput(self)
115
- for ____, buttonAction in __TS__Iterator(
116
- SHOOTING_ACTIONS:values()
117
- ) do
115
+ for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
118
116
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
119
117
  return true
120
118
  end
@@ -122,9 +120,7 @@ function ____exports.isShootActionPressedOnAnyInput(self)
122
120
  return false
123
121
  end
124
122
  function ____exports.isShootActionTriggeredOnAnyInput(self)
125
- for ____, buttonAction in __TS__Iterator(
126
- SHOOTING_ACTIONS:values()
127
- ) do
123
+ for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
128
124
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
129
125
  return true
130
126
  end