isaacscript-common 1.0.511 → 1.0.515

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/callbacks/itemPickup.lua +6 -2
  2. package/dist/callbacks/postBombInitLate.lua +5 -1
  3. package/dist/callbacks/postCursedTeleport.lua +10 -8
  4. package/dist/callbacks/postEffectInitLate.lua +5 -1
  5. package/dist/callbacks/postEsauJr.lua +4 -2
  6. package/dist/callbacks/postFamiliarInitLate.lua +5 -1
  7. package/dist/callbacks/postFlip.lua +4 -2
  8. package/dist/callbacks/postGridEntity.lua +18 -8
  9. package/dist/callbacks/postKnifeInitLate.lua +5 -1
  10. package/dist/callbacks/postLaserInitLate.lua +5 -1
  11. package/dist/callbacks/postNPCInitLate.lua +5 -1
  12. package/dist/callbacks/postPickupCollect.lua +5 -1
  13. package/dist/callbacks/postPickupInitLate.lua +5 -1
  14. package/dist/callbacks/postPlayerChangeHealth.lua +13 -9
  15. package/dist/callbacks/postPlayerChangeType.lua +5 -1
  16. package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
  17. package/dist/callbacks/postPlayerInitLate.lua +5 -1
  18. package/dist/callbacks/postPlayerReordered.lua +1 -1
  19. package/dist/callbacks/postProjectileInitLate.lua +5 -1
  20. package/dist/callbacks/postPurchase.lua +15 -17
  21. package/dist/callbacks/postSacrifice.lua +3 -3
  22. package/dist/callbacks/postSlotInitUpdate.lua +11 -3
  23. package/dist/callbacks/postSlotRenderBroken.lua +8 -2
  24. package/dist/callbacks/postTearInitLate.lua +5 -1
  25. package/dist/callbacks/postTransformation.lua +5 -1
  26. package/dist/callbacks/reorderedCallbacks.lua +4 -4
  27. package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
  28. package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
  29. package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
  30. package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
  31. package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
  32. package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
  33. package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
  34. package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
  35. package/dist/callbacks/subscriptions/postFlip.lua +1 -1
  36. package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
  37. package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
  38. package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
  39. package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
  40. package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
  41. package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
  42. package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
  43. package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
  44. package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
  45. package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -1
  46. package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
  47. package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
  48. package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
  49. package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
  50. package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
  51. package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
  52. package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
  53. package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
  54. package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
  55. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
  56. package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
  57. package/dist/callbacks/subscriptions/postPurchase.lua +2 -8
  58. package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
  59. package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
  60. package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
  61. package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
  62. package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
  63. package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
  64. package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
  65. package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
  66. package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
  67. package/dist/constants.lua +5 -47
  68. package/dist/features/deployJSONRoom.lua +61 -90
  69. package/dist/features/disableInputs.lua +3 -9
  70. package/dist/features/forgottenSwitch.lua +1 -1
  71. package/dist/features/getCollectibleItemPoolType.lua +10 -4
  72. package/dist/features/preventCollectibleRotate.lua +9 -3
  73. package/dist/features/saveDataManager/load.lua +6 -2
  74. package/dist/features/saveDataManager/main.lua +1 -1
  75. package/dist/features/saveDataManager/merge.lua +4 -2
  76. package/dist/features/sirenHelpers.lua +5 -5
  77. package/dist/functions/array.lua +7 -5
  78. package/dist/functions/bitwise.lua +1 -1
  79. package/dist/functions/charge.lua +12 -10
  80. package/dist/functions/collectibles.lua +23 -18
  81. package/dist/functions/color.lua +1 -9
  82. package/dist/functions/deepCopy.lua +22 -42
  83. package/dist/functions/deepCopyTests.lua +20 -12
  84. package/dist/functions/doors.lua +19 -7
  85. package/dist/functions/entity.lua +2 -8
  86. package/dist/functions/flag.lua +1 -1
  87. package/dist/functions/gridEntity.lua +9 -14
  88. package/dist/functions/input.lua +18 -14
  89. package/dist/functions/jsonRoom.lua +9 -3
  90. package/dist/functions/language.lua +1 -9
  91. package/dist/functions/log.lua +46 -18
  92. package/dist/functions/math.lua +17 -15
  93. package/dist/functions/npc.lua +17 -15
  94. package/dist/functions/pickups.lua +1 -14
  95. package/dist/functions/player.lua +47 -25
  96. package/dist/functions/playerHealth.lua +9 -19
  97. package/dist/functions/pocketItems.lua +4 -4
  98. package/dist/functions/random.lua +2 -2
  99. package/dist/functions/revive.lua +4 -4
  100. package/dist/functions/rooms.d.ts +14 -1
  101. package/dist/functions/rooms.lua +77 -17
  102. package/dist/functions/spawnCollectible.lua +2 -10
  103. package/dist/functions/sprite.lua +2 -2
  104. package/dist/functions/stage.lua +6 -6
  105. package/dist/functions/tears.lua +1 -1
  106. package/dist/functions/transformations.lua +10 -4
  107. package/dist/functions/trinketGive.lua +2 -2
  108. package/dist/functions/trinkets.lua +5 -3
  109. package/dist/functions/ui.lua +3 -3
  110. package/dist/functions/util.lua +8 -4
  111. package/dist/functions/vector.lua +8 -8
  112. package/dist/lualib_bundle.lua +555 -603
  113. package/dist/maps/cardDescriptionMap.lua +1 -99
  114. package/dist/maps/cardNameMap.lua +1 -99
  115. package/dist/maps/collectibleDescriptionMap.lua +1 -722
  116. package/dist/maps/collectibleNameMap.lua +1 -722
  117. package/dist/maps/gridEntityXMLMap.lua +1 -36
  118. package/dist/maps/pillEffectNameMap.lua +1 -52
  119. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -7
  120. package/dist/maps/transformationMap.lua +12 -19
  121. package/dist/maps/trinketDescriptionMap.lua +1 -190
  122. package/dist/maps/trinketNameMap.lua +1 -190
  123. package/dist/sets/cards.lua +2 -98
  124. package/dist/types/ModUpgraded.lua +50 -44
  125. package/package.json +2 -2
@@ -15,7 +15,9 @@ local ____sprite = require("functions.sprite")
15
15
  local clearSprite = ____sprite.clearSprite
16
16
  function ____exports.setCollectibleSprite(self, collectible, pngPath)
17
17
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
18
- error("You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant))
18
+ error(
19
+ "You cannot set a collectible sprite for pickups of variant: " .. tostring(collectible.Variant)
20
+ )
19
21
  end
20
22
  local sprite = collectible:GetSprite()
21
23
  if pngPath == nil then
@@ -66,8 +68,8 @@ function ____exports.getCollectibleDevilHeartPrice(self, collectibleType, player
66
68
  if itemConfigItem == nil then
67
69
  return defaultPickupPrice
68
70
  end
69
- local twoHeartPrice = maxHearts == 2 and PickupPrice.PRICE_ONE_HEART_AND_TWO_SOULHEARTS or PickupPrice.PRICE_TWO_HEARTS
70
- return itemConfigItem.DevilPrice == 2 and twoHeartPrice or PickupPrice.PRICE_ONE_HEART
71
+ local twoHeartPrice = ((maxHearts == 2) and PickupPrice.PRICE_ONE_HEART_AND_TWO_SOULHEARTS) or PickupPrice.PRICE_TWO_HEARTS
72
+ return ((itemConfigItem.DevilPrice == 2) and twoHeartPrice) or PickupPrice.PRICE_ONE_HEART
71
73
  end
72
74
  function ____exports.getCollectibleGfxFilename(self, collectibleType)
73
75
  local itemConfig = Isaac.GetItemConfig()
@@ -136,11 +138,11 @@ function ____exports.getMaxCollectibleID(self)
136
138
  return itemConfig:GetCollectibles().Size - 1
137
139
  end
138
140
  function ____exports.isGlitchedCollectible(self, entity)
139
- return entity.Type == EntityType.ENTITY_PICKUP and entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and entity.SubType > GLITCHED_ITEM_THRESHOLD
141
+ return ((entity.Type == EntityType.ENTITY_PICKUP) and (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE)) and (entity.SubType > GLITCHED_ITEM_THRESHOLD)
140
142
  end
141
143
  function ____exports.isPassiveCollectible(self, collectibleType)
142
144
  local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
143
- return itemType == ItemType.ITEM_PASSIVE or itemType == ItemType.ITEM_FAMILIAR
145
+ return (itemType == ItemType.ITEM_PASSIVE) or (itemType == ItemType.ITEM_FAMILIAR)
144
146
  end
145
147
  function ____exports.isQuestCollectible(self, collectibleType)
146
148
  return ____exports.collectibleHasTag(nil, collectibleType, 32768)
@@ -153,42 +155,45 @@ function ____exports.removeAllCollectibles(self, collectibleType, cap)
153
155
  end
154
156
  function ____exports.removeCollectiblePickupDelay(self, collectible)
155
157
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
156
- error("You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant))
158
+ error(
159
+ "You cannot remove pickup delay for pickups of variant: " .. tostring(collectible.Variant)
160
+ )
157
161
  end
158
162
  collectible.Wait = 0
159
163
  end
160
164
  function ____exports.removeCollectibleFromItemTracker(self, collectibleType)
161
165
  local collectibleName = ____exports.getCollectibleName(nil, collectibleType)
162
- Isaac.DebugString(((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)")
166
+ Isaac.DebugString(
167
+ ((("Removing collectible " .. tostring(collectibleType)) .. " (") .. collectibleName) .. ") on player 0 (Player)"
168
+ )
163
169
  end
164
170
  function ____exports.setCollectibleBlind(self, collectible)
165
171
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
166
- error("You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant))
172
+ error(
173
+ "You cannot set a collectible to be blind for pickups of variant: " .. tostring(collectible.Variant)
174
+ )
167
175
  end
168
176
  ____exports.setCollectibleSprite(nil, collectible, BLIND_ITEM_PNG_PATH)
169
177
  end
170
178
  function ____exports.setCollectibleEmpty(self, collectible)
171
179
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
172
- error("You cannot set a collectible to be empty for pickups of variant: " .. tostring(collectible.Variant))
180
+ error(
181
+ "You cannot set a collectible to be empty for pickups of variant: " .. tostring(collectible.Variant)
182
+ )
173
183
  end
174
184
  collectible.SubType = CollectibleType.COLLECTIBLE_NULL
175
185
  ____exports.setCollectibleSprite(nil, collectible)
176
186
  end
177
187
  function ____exports.setCollectibleSubType(self, collectible, newCollectibleType)
178
188
  if collectible.Variant ~= PickupVariant.PICKUP_COLLECTIBLE then
179
- error("You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant))
189
+ error(
190
+ "You cannot set a collectible sub type for pickups of variant: " .. tostring(collectible.Variant)
191
+ )
180
192
  end
181
193
  if newCollectibleType == CollectibleType.COLLECTIBLE_NULL then
182
194
  ____exports.setCollectibleEmpty(nil, collectible)
183
195
  return
184
196
  end
185
- collectible:Morph(
186
- EntityType.ENTITY_PICKUP,
187
- PickupVariant.PICKUP_COLLECTIBLE,
188
- newCollectibleType,
189
- true,
190
- true,
191
- true
192
- )
197
+ collectible:Morph(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, newCollectibleType, true, true, true)
193
198
  end
194
199
  return ____exports
@@ -7,15 +7,7 @@ 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(
11
- color.R,
12
- color.G,
13
- color.B,
14
- color.A,
15
- color.RO,
16
- color.GO,
17
- color.BO
18
- )
10
+ return Color(color.R, color.G, color.B, color.A, color.RO, color.GO, color.BO)
19
11
  end
20
12
  function ____exports.copyKColor(self, kColor)
21
13
  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 = copyClass(nil, oldObject)
55
55
  else
56
56
  newObject = {}
@@ -66,43 +66,31 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
66
66
  end
67
67
  end
68
68
  if __TS__InstanceOf(oldObject, Map) then
69
- local value
70
- local key
71
- for ____, ____value in __TS__Iterator(oldObject:entries()) do
69
+ for ____, ____value in __TS__Iterator(
70
+ oldObject:entries()
71
+ ) do
72
+ local key
72
73
  key = ____value[1]
74
+ local value
73
75
  value = ____value[2]
74
76
  do
75
77
  if ____exports.isBrand(nil, key) then
76
78
  goto __continue17
77
79
  end
78
- deepCopyValue(
79
- nil,
80
- oldObject,
81
- newObject,
82
- key,
83
- value,
84
- traversalDescription,
85
- serializationType
86
- )
80
+ deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
87
81
  end
88
82
  ::__continue17::
89
83
  end
90
84
  elseif __TS__InstanceOf(oldObject, Set) then
91
- for ____, key in __TS__Iterator(oldObject:values()) do
85
+ for ____, key in __TS__Iterator(
86
+ oldObject:values()
87
+ ) do
92
88
  do
93
89
  if ____exports.isBrand(nil, key) then
94
90
  goto __continue20
95
91
  end
96
92
  local value = ""
97
- deepCopyValue(
98
- nil,
99
- oldObject,
100
- newObject,
101
- key,
102
- value,
103
- traversalDescription,
104
- serializationType
105
- )
93
+ deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
106
94
  end
107
95
  ::__continue20::
108
96
  end
@@ -112,15 +100,7 @@ function ____exports.deepCopy(self, oldObject, serializationType, traversalDescr
112
100
  if ____exports.isBrand(nil, key) then
113
101
  goto __continue23
114
102
  end
115
- deepCopyValue(
116
- nil,
117
- oldObject,
118
- newObject,
119
- key,
120
- value,
121
- traversalDescription,
122
- serializationType
123
- )
103
+ deepCopyValue(nil, oldObject, newObject, key, value, traversalDescription, serializationType)
124
104
  end
125
105
  ::__continue23::
126
106
  end
@@ -159,7 +139,7 @@ function getNewClassFromMetatable(self, metatable)
159
139
  return newClass
160
140
  end
161
141
  function ____exports.isBrand(self, key)
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
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)
163
143
  end
164
144
  function deepCopyValue(self, oldObject, newObject, key, value, traversalDescription, serializationType)
165
145
  local valueType = type(value)
@@ -167,7 +147,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
167
147
  local convertNumberKeysToString = false
168
148
  local isTSTLObject = __TS__InstanceOf(oldObject, Map) or __TS__InstanceOf(oldObject, Set)
169
149
  local keyType = type(key)
170
- if serializationType == ____exports.SerializationType.SERIALIZE and isTSTLObject and keyType == "number" then
150
+ if ((serializationType == ____exports.SerializationType.SERIALIZE) and isTSTLObject) and (keyType == "number") then
171
151
  convertNumberKeysToString = true
172
152
  local newTable = newObject
173
153
  newTable[TSTL_OBJECT_WITH_NUMBER_KEYS_BRAND] = ""
@@ -179,7 +159,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
179
159
  if isVector(nil, value) then
180
160
  local vector = value
181
161
  newValue = copyVector(nil, vector, serializationType)
182
- elseif ____exports.isSerializedVector(nil, value) and serializationType == ____exports.SerializationType.DESERIALIZE then
162
+ elseif ____exports.isSerializedVector(nil, value) and (serializationType == ____exports.SerializationType.DESERIALIZE) then
183
163
  local serializedVector = value
184
164
  newValue = ____exports.deserializeVector(nil, serializedVector)
185
165
  elseif valueType == "table" then
@@ -194,7 +174,7 @@ function deepCopyValue(self, oldObject, newObject, key, value, traversalDescript
194
174
  elseif __TS__InstanceOf(newObject, Set) then
195
175
  newObject:add(key)
196
176
  else
197
- local keyToUse = convertNumberKeysToString and tostring(key) or key
177
+ local keyToUse = (convertNumberKeysToString and tostring(key)) or key
198
178
  newObject[keyToUse] = newValue
199
179
  end
200
180
  end
@@ -227,14 +207,14 @@ function checkMetatable(self, ____table, traversalDescription)
227
207
  if metatable == nil then
228
208
  return
229
209
  end
230
- local tableDescription = traversalDescription == "" and "the table to copy" or ("\"" .. traversalDescription) .. "\""
210
+ local tableDescription = ((traversalDescription == "") and "the table to copy") or (("\"" .. traversalDescription) .. "\"")
231
211
  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).")
232
212
  end
233
213
  function validateValue(self, value, valueType, traversalDescription)
234
214
  if isVector(nil, value) then
235
215
  return
236
216
  end
237
- if valueType == "function" or valueType == "nil" or valueType == "thread" or valueType == "userdata" then
217
+ if (((valueType == "function") or (valueType == "nil")) or (valueType == "thread")) or (valueType == "userdata") then
238
218
  error(((("The deepCopy function detected that \"" .. traversalDescription) .. "\" is type ") .. valueType) .. ", which is not supported.")
239
219
  end
240
220
  end
@@ -251,7 +231,7 @@ function ____exports.isSerializedVector(self, object)
251
231
  return false
252
232
  end
253
233
  local ____table = object
254
- return ____table[VECTOR_BRAND] ~= nil and ____table.X ~= nil and ____table.Y ~= nil
234
+ return ((____table[VECTOR_BRAND] ~= nil) and (____table.X ~= nil)) and (____table.Y ~= nil)
255
235
  end
256
236
  ____exports.SerializationType = SerializationType or ({})
257
237
  ____exports.SerializationType.NONE = 0
@@ -43,14 +43,18 @@ function copiedTableHasKeyAndValueNumber(self)
43
43
  local newTable = newObject
44
44
  local value = newTable[keyToLookFor]
45
45
  if value == nil then
46
- error("The copied object did not have a key of: " .. tostring(keyToLookFor))
46
+ error(
47
+ "The copied object did not have a key of: " .. tostring(keyToLookFor)
48
+ )
47
49
  end
48
50
  local valueType = type(value)
49
51
  if valueType ~= "number" then
50
52
  error("The copied object had a value type of: " .. valueType)
51
53
  end
52
54
  if value ~= valueToLookFor then
53
- error("The copied object had a value of: " .. tostring(value))
55
+ error(
56
+ "The copied object had a value of: " .. tostring(value)
57
+ )
54
58
  end
55
59
  end
56
60
  function copiedTableDoesNotCoerceTypes(self)
@@ -111,20 +115,20 @@ function copiedObjectHasNoReferencesForArray(self)
111
115
  if not arrayEquals(nil, oldObject.abc, newObject.abc) then
112
116
  error("The copied object does not have an equal array.")
113
117
  end
114
- local ____oldObject_abc_0, ____1_1 = oldObject.abc, 1
115
- ____oldObject_abc_0[____1_1] = ____oldObject_abc_0[____1_1] + 1
118
+ local ____obj, ____index = oldObject.abc, 0 + 1
119
+ ____obj[____index] = ____obj[____index] + 1
116
120
  if arrayEquals(nil, oldObject.abc, newObject.abc) then
117
121
  error("The copied object has an equal array after a modification to the old array.")
118
122
  end
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
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
123
127
  if arrayEquals(nil, oldObject.abc, newObject.abc) then
124
128
  error("The copied object has an equal array after a modification to the new array.")
125
129
  end
126
- local ____newObject_abc_6, ____1_7 = newObject.abc, 1
127
- ____newObject_abc_6[____1_7] = ____newObject_abc_6[____1_7] - 1
130
+ local ____obj, ____index = newObject.abc, 0 + 1
131
+ ____obj[____index] = ____obj[____index] - 1
128
132
  end
129
133
  function copiedObjectHasChildObject(self)
130
134
  local childObjectIndex = "abc"
@@ -231,10 +235,14 @@ function copiedMapHasChildMap(self)
231
235
  end
232
236
  local value = newChildMap:get(childMapKey)
233
237
  if value == nil then
234
- error("The copied child Map did not have a key of: " .. tostring(childMapKey))
238
+ error(
239
+ "The copied child Map did not have a key of: " .. tostring(childMapKey)
240
+ )
235
241
  end
236
242
  if value ~= childMapValue then
237
- error("The copied child Map did not have a value of: " .. tostring(childMapValue))
243
+ error(
244
+ "The copied child Map did not have a value of: " .. tostring(childMapValue)
245
+ )
238
246
  end
239
247
  end
240
248
  function ____exports.deepCopyTests(self)
@@ -42,14 +42,18 @@ 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(____exports.getDoors(nil)) do
45
+ for ____, door in ipairs(
46
+ ____exports.getDoors(nil)
47
+ ) do
46
48
  door.State = DoorState.STATE_CLOSED
47
49
  local sprite = door:GetSprite()
48
50
  sprite:Play("Close", true)
49
51
  end
50
52
  end
51
53
  function ____exports.getAngelRoomDoor(self)
52
- for ____, door in ipairs(____exports.getDoors(nil)) do
54
+ for ____, door in ipairs(
55
+ ____exports.getDoors(nil)
56
+ ) do
53
57
  if ____exports.isAngelRoomDoor(nil, door) then
54
58
  return door
55
59
  end
@@ -57,7 +61,9 @@ function ____exports.getAngelRoomDoor(self)
57
61
  return nil
58
62
  end
59
63
  function ____exports.getDevilRoomDoor(self)
60
- for ____, door in ipairs(____exports.getDoors(nil)) do
64
+ for ____, door in ipairs(
65
+ ____exports.getDoors(nil)
66
+ ) do
61
67
  if ____exports.isDevilRoomDoor(nil, door) then
62
68
  return door
63
69
  end
@@ -65,7 +71,9 @@ function ____exports.getDevilRoomDoor(self)
65
71
  return nil
66
72
  end
67
73
  function ____exports.getDevilRoomOrAngelRoomDoor(self)
68
- for ____, door in ipairs(____exports.getDoors(nil)) do
74
+ for ____, door in ipairs(
75
+ ____exports.getDoors(nil)
76
+ ) do
69
77
  if ____exports.isDevilRoomDoor(nil, door) or ____exports.isAngelRoomDoor(nil, door) then
70
78
  return door
71
79
  end
@@ -73,7 +81,9 @@ function ____exports.getDevilRoomOrAngelRoomDoor(self)
73
81
  return nil
74
82
  end
75
83
  function ____exports.getRepentanceDoor(self)
76
- for ____, door in ipairs(____exports.getDoors(nil)) do
84
+ for ____, door in ipairs(
85
+ ____exports.getDoors(nil)
86
+ ) do
77
87
  if ____exports.isRepentanceDoor(nil, door) then
78
88
  return door
79
89
  end
@@ -83,7 +93,7 @@ end
83
93
  function ____exports.isHiddenSecretRoomDoor(self, door)
84
94
  local sprite = door:GetSprite()
85
95
  local animation = sprite:GetAnimation()
86
- return ____exports.isSecretRoomDoor(nil, door) and animation == "Hidden"
96
+ return ____exports.isSecretRoomDoor(nil, door) and (animation == "Hidden")
87
97
  end
88
98
  function ____exports.isDoorToDownpour(self, door)
89
99
  if not ____exports.isRepentanceDoor(nil, door) then
@@ -135,7 +145,9 @@ function ____exports.lockDoor(self, door)
135
145
  door:Close(true)
136
146
  end
137
147
  function ____exports.openAllDoors(self)
138
- for ____, door in ipairs(____exports.getDoors(nil)) do
148
+ for ____, door in ipairs(
149
+ ____exports.getDoors(nil)
150
+ ) do
139
151
  door:Open()
140
152
  end
141
153
  end
@@ -218,7 +218,7 @@ function ____exports.removeEntities(self, entities, cap)
218
218
  local entity = entities[i + 1]
219
219
  entity:Remove()
220
220
  numEntitiesRemoved = numEntitiesRemoved + 1
221
- if cap ~= nil and numEntitiesRemoved >= cap then
221
+ if (cap ~= nil) and (numEntitiesRemoved >= cap) then
222
222
  return
223
223
  end
224
224
  i = i + 1
@@ -295,13 +295,7 @@ function ____exports.setEntityRandomColor(self, entity)
295
295
  end
296
296
  end
297
297
  local color = Color(colorValues[1], colorValues[2], colorValues[3])
298
- entity:SetColor(
299
- color,
300
- 100000,
301
- 100000,
302
- false,
303
- false
304
- )
298
+ entity:SetColor(color, 100000, 100000, false, false)
305
299
  end
306
300
  function ____exports.setEntityVelocities(self, entityVelocities, entities)
307
301
  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
@@ -15,7 +15,7 @@ function ____exports.getTopLeftWallGridIndex(self)
15
15
  local room = game:GetRoom()
16
16
  local roomShape = room:GetRoomShape()
17
17
  local topLeftWallGridIndex = ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP:get(roomShape)
18
- return topLeftWallGridIndex == nil and DEFAULT_TOP_LEFT_WALL_GRID_INDEX or topLeftWallGridIndex
18
+ return ((topLeftWallGridIndex == nil) and DEFAULT_TOP_LEFT_WALL_GRID_INDEX) or topLeftWallGridIndex
19
19
  end
20
20
  function ____exports.removeGridEntity(self, gridEntity, updateRoom)
21
21
  if updateRoom == nil then
@@ -48,11 +48,13 @@ function ____exports.convertXMLGridEntityType(self, gridEntityXMLType, gridEntit
48
48
  end
49
49
  local gridEntityArray = GRID_ENTITY_XML_MAP:get(gridEntityXMLType)
50
50
  if gridEntityArray == nil then
51
- error("Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType))
51
+ error(
52
+ "Failed to find an entry in the grid entity map for XML entity type: " .. tostring(gridEntityXMLType)
53
+ )
52
54
  end
53
55
  local gridEntityType = gridEntityArray[1]
54
56
  local gridEntityVariant = gridEntityArray[2]
55
- if gridEntityType == GridEntityType.GRID_SPIKES_ONOFF or gridEntityType == GridEntityType.GRID_PRESSURE_PLATE or gridEntityType == GridEntityType.GRID_TELEPORTER then
57
+ if ((gridEntityType == GridEntityType.GRID_SPIKES_ONOFF) or (gridEntityType == GridEntityType.GRID_PRESSURE_PLATE)) or (gridEntityType == GridEntityType.GRID_TELEPORTER) then
56
58
  gridEntityVariant = gridEntityXMLVariant
57
59
  end
58
60
  return {gridEntityType, gridEntityVariant}
@@ -98,16 +100,7 @@ function ____exports.getSurroundingGridEntities(self, gridEntity)
98
100
  local room = game:GetRoom()
99
101
  local gridWidth = room:GetGridWidth()
100
102
  local gridIndex = gridEntity:GetGridIndex()
101
- local surroundingGridIndexes = {
102
- gridIndex - 1,
103
- gridIndex + 1,
104
- gridIndex - gridWidth - 1,
105
- gridIndex - gridWidth,
106
- gridIndex - gridWidth + 1,
107
- gridIndex + gridWidth - 1,
108
- gridIndex + gridWidth,
109
- gridIndex + gridWidth + 1
110
- }
103
+ local surroundingGridIndexes = {gridIndex - 1, gridIndex + 1, (gridIndex - gridWidth) - 1, gridIndex - gridWidth, (gridIndex - gridWidth) + 1, (gridIndex + gridWidth) - 1, gridIndex + gridWidth, (gridIndex + gridWidth) + 1}
111
104
  local surroundingGridEntities = {}
112
105
  for ____, surroundingGridIndex in ipairs(surroundingGridIndexes) do
113
106
  local surroundingGridEntity = room:GetGridEntity(surroundingGridIndex)
@@ -124,7 +117,9 @@ function ____exports.isAllPressurePlatesPushed(self)
124
117
  if not hasPressurePlates then
125
118
  return true
126
119
  end
127
- for ____, gridEntity in ipairs(____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)) do
120
+ for ____, gridEntity in ipairs(
121
+ ____exports.getGridEntities(nil, GridEntityType.GRID_PRESSURE_PLATE)
122
+ ) do
128
123
  local gridEntityDesc = gridEntity:GetSaveState()
129
124
  if gridEntityDesc.State ~= 3 then
130
125
  return false
@@ -39,10 +39,12 @@ 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
- local controllerLiteralCode
43
- local key
44
- for ____, ____value in ipairs(__TS__ObjectEntries(ControllerLiteral)) do
42
+ for ____, ____value in ipairs(
43
+ __TS__ObjectEntries(ControllerLiteral)
44
+ ) do
45
+ local key
45
46
  key = ____value[1]
47
+ local controllerLiteralCode
46
48
  controllerLiteralCode = ____value[2]
47
49
  do
48
50
  if type(key) ~= "string" then
@@ -53,13 +55,7 @@ function ____exports.controllerToString(self, controller)
53
55
  goto __continue3
54
56
  end
55
57
  local controllerName = key
56
- for ____, prefix in ipairs({
57
- "DPAD_",
58
- "BUTTON_",
59
- "BUMPER_",
60
- "TRIGGER_",
61
- "STICK_"
62
- }) do
58
+ for ____, prefix in ipairs({"DPAD_", "BUTTON_", "BUMPER_", "TRIGGER_", "STICK_"}) do
63
59
  controllerName = __TS__StringReplace(controllerName, prefix, "")
64
60
  end
65
61
  return controllerName
@@ -96,7 +92,9 @@ function ____exports.isKeyboardPressed(self, key)
96
92
  return Input.IsButtonPressed(key, 0)
97
93
  end
98
94
  function ____exports.isMoveActionPressedOnAnyInput(self)
99
- for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
95
+ for ____, buttonAction in __TS__Iterator(
96
+ MOVEMENT_ACTIONS:values()
97
+ ) do
100
98
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
101
99
  return true
102
100
  end
@@ -104,7 +102,9 @@ function ____exports.isMoveActionPressedOnAnyInput(self)
104
102
  return false
105
103
  end
106
104
  function ____exports.isMoveActionTriggeredOnAnyInput(self)
107
- for ____, buttonAction in __TS__Iterator(MOVEMENT_ACTIONS:values()) do
105
+ for ____, buttonAction in __TS__Iterator(
106
+ MOVEMENT_ACTIONS:values()
107
+ ) do
108
108
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
109
109
  return true
110
110
  end
@@ -112,7 +112,9 @@ function ____exports.isMoveActionTriggeredOnAnyInput(self)
112
112
  return false
113
113
  end
114
114
  function ____exports.isShootActionPressedOnAnyInput(self)
115
- for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
115
+ for ____, buttonAction in __TS__Iterator(
116
+ SHOOTING_ACTIONS:values()
117
+ ) do
116
118
  if ____exports.isActionPressedOnAnyInput(nil, buttonAction) then
117
119
  return true
118
120
  end
@@ -120,7 +122,9 @@ function ____exports.isShootActionPressedOnAnyInput(self)
120
122
  return false
121
123
  end
122
124
  function ____exports.isShootActionTriggeredOnAnyInput(self)
123
- for ____, buttonAction in __TS__Iterator(SHOOTING_ACTIONS:values()) do
125
+ for ____, buttonAction in __TS__Iterator(
126
+ SHOOTING_ACTIONS:values()
127
+ ) do
124
128
  if ____exports.isActionTriggeredOnAnyInput(nil, buttonAction) then
125
129
  return true
126
130
  end
@@ -30,7 +30,9 @@ function getJSONRoomWithChosenWeight(self, jsonRooms, chosenWeight)
30
30
  end
31
31
  chosenWeight = chosenWeight - roomWeight
32
32
  end
33
- error("Failed to get a room with chosen weight: " .. tostring(chosenWeight))
33
+ error(
34
+ "Failed to get a room with chosen weight: " .. tostring(chosenWeight)
35
+ )
34
36
  return jsonRooms[1]
35
37
  end
36
38
  function ____exports.getJSONRoomOfVariant(self, jsonRooms, variant)
@@ -63,11 +65,15 @@ function ____exports.getRandomJSONRoom(self, jsonRooms, seed, verbose)
63
65
  end
64
66
  local totalWeight = getTotalWeightOfJSONRooms(nil, jsonRooms)
65
67
  if verbose then
66
- log("Total weight of the JSON rooms provided: " .. tostring(totalWeight))
68
+ log(
69
+ "Total weight of the JSON rooms provided: " .. tostring(totalWeight)
70
+ )
67
71
  end
68
72
  local chosenWeight = getRandomFloat(nil, 0, totalWeight, seed)
69
73
  if verbose then
70
- log("Randomly chose weight: " .. tostring(chosenWeight))
74
+ log(
75
+ "Randomly chose weight: " .. tostring(chosenWeight)
76
+ )
71
77
  end
72
78
  return getJSONRoomWithChosenWeight(nil, jsonRooms, chosenWeight)
73
79
  end
@@ -1,14 +1,6 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local LANGUAGE_NAMES = {
4
- en = "English",
5
- jp = "Japanese",
6
- kr = "Korean",
7
- zh = "Chinese (Simple)",
8
- ru = "Russian",
9
- de = "German",
10
- es = "Spanish"
11
- }
3
+ local LANGUAGE_NAMES = {en = "English", jp = "Japanese", kr = "Korean", zh = "Chinese (Simple)", ru = "Russian", de = "German", es = "Spanish"}
12
4
  function ____exports.getLanguageName(self)
13
5
  local languageAbbreviation = Options.Language
14
6
  return LANGUAGE_NAMES[languageAbbreviation]