isaacscript-common 87.7.0 → 87.8.0

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 (45) hide show
  1. package/dist/classes/ModUpgraded.lua +4 -4
  2. package/dist/classes/callbacks/InputActionFilter.lua +2 -2
  3. package/dist/classes/callbacks/InputActionPlayer.lua +2 -2
  4. package/dist/classes/callbacks/PostCollectibleEmpty.lua +2 -2
  5. package/dist/classes/callbacks/PostCursedTeleport.lua +2 -2
  6. package/dist/classes/callbacks/PostCustomRevive.lua +2 -2
  7. package/dist/classes/callbacks/PostDiceRoomActivated.lua +2 -2
  8. package/dist/classes/callbacks/PostGridEntityCollision.lua +2 -2
  9. package/dist/classes/callbacks/PostGridEntityCustomCollision.lua +2 -2
  10. package/dist/classes/callbacks/PostGridEntityCustomRemove.lua +2 -2
  11. package/dist/classes/callbacks/PostGridEntityRemove.lua +2 -2
  12. package/dist/classes/callbacks/PostItemDischarge.lua +2 -2
  13. package/dist/classes/callbacks/PostKeyboardChanged.lua +2 -2
  14. package/dist/classes/callbacks/PostPickupSelectionFilter.lua +2 -2
  15. package/dist/classes/callbacks/PostPurchase.lua +2 -2
  16. package/dist/classes/callbacks/PostRoomClearChanged.lua +2 -2
  17. package/dist/classes/callbacks/PostTransformation.lua +2 -2
  18. package/dist/classes/callbacks/PreEntitySpawnFilter.lua +2 -2
  19. package/dist/classes/callbacks/PreRoomEntitySpawnFilter.lua +2 -2
  20. package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.lua +2 -2
  21. package/dist/classes/features/other/DeployJSONRoom.lua +1 -1
  22. package/dist/classes/features/other/ExtraConsoleCommands.lua +1 -1
  23. package/dist/classes/features/other/NoSirenSteal.lua +1 -1
  24. package/dist/classes/features/other/PersistentEntities.lua +1 -1
  25. package/dist/classes/features/other/extraConsoleCommands/commands.lua +5 -5
  26. package/dist/functions/array.js +1 -1
  27. package/dist/functions/array.lua +2 -2
  28. package/dist/functions/bitSet128.lua +10 -6
  29. package/dist/functions/color.lua +10 -6
  30. package/dist/functions/doors.lua +1 -1
  31. package/dist/functions/entities.lua +8 -4
  32. package/dist/functions/globals.lua +1 -1
  33. package/dist/functions/gridEntities.lua +1 -1
  34. package/dist/functions/input.lua +1 -1
  35. package/dist/functions/kColor.lua +10 -6
  36. package/dist/functions/rng.lua +10 -6
  37. package/dist/functions/roomShapeWalls.lua +5 -5
  38. package/dist/functions/vector.lua +10 -6
  39. package/dist/functions/weighted.lua +1 -1
  40. package/dist/isaacscript-common.lua +179 -155
  41. package/dist/maps/entityTypeVariantToBossIDMap.lua +1 -1
  42. package/dist/shouldFire.lua +56 -56
  43. package/dist/tsdoc-metadata.json +1 -1
  44. package/package.json +7 -10
  45. package/src/functions/array.ts +1 -1
@@ -199,7 +199,7 @@ function ModUpgraded.prototype.initFeature(self, feature)
199
199
  end
200
200
  if feature.callbacksUsed ~= nil then
201
201
  for ____, callbackTuple in ipairs(feature.callbacksUsed) do
202
- local modCallback, callbackFunc, optionalArgs = table.unpack(callbackTuple)
202
+ local modCallback, callbackFunc, optionalArgs = table.unpack(callbackTuple, 1, 3)
203
203
  self:AddPriorityCallback(
204
204
  modCallback,
205
205
  CallbackPriority.IMPORTANT,
@@ -210,7 +210,7 @@ function ModUpgraded.prototype.initFeature(self, feature)
210
210
  end
211
211
  if feature.customCallbacksUsed ~= nil then
212
212
  for ____, callbackTuple in ipairs(feature.customCallbacksUsed) do
213
- local modCallback, callbackFunc, optionalArgs = table.unpack(callbackTuple)
213
+ local modCallback, callbackFunc, optionalArgs = table.unpack(callbackTuple, 1, 3)
214
214
  self:AddPriorityCallbackCustom(
215
215
  modCallback,
216
216
  CallbackPriority.IMPORTANT,
@@ -248,13 +248,13 @@ function ModUpgraded.prototype.uninitFeature(self, feature)
248
248
  end
249
249
  if feature.callbacksUsed ~= nil then
250
250
  for ____, callbackTuple in ipairs(feature.callbacksUsed) do
251
- local modCallback, callbackFunc = table.unpack(callbackTuple)
251
+ local modCallback, callbackFunc = table.unpack(callbackTuple, 1, 2)
252
252
  self:RemoveCallback(modCallback, callbackFunc)
253
253
  end
254
254
  end
255
255
  if feature.customCallbacksUsed ~= nil then
256
256
  for ____, callbackTuple in ipairs(feature.customCallbacksUsed) do
257
- local modCallback, callbackFunc = table.unpack(callbackTuple)
257
+ local modCallback, callbackFunc = table.unpack(callbackTuple, 1, 2)
258
258
  self:RemoveCallbackCustom(modCallback, callbackFunc)
259
259
  end
260
260
  end
@@ -13,8 +13,8 @@ __TS__ClassExtends(InputActionFilter, CustomCallback)
13
13
  function InputActionFilter.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _entity, inputHook, buttonAction = table.unpack(fireArgs)
17
- local callbackInputHook, callbackButtonAction = table.unpack(optionalArgs)
16
+ local _entity, inputHook, buttonAction = table.unpack(fireArgs, 1, 3)
17
+ local callbackInputHook, callbackButtonAction = table.unpack(optionalArgs, 1, 2)
18
18
  return (callbackInputHook == nil or callbackInputHook == inputHook) and (callbackButtonAction == nil or callbackButtonAction == buttonAction)
19
19
  end
20
20
  self.inputAction = function(____, entity, inputHook, buttonAction) return self:fire(entity, inputHook, buttonAction) end
@@ -13,8 +13,8 @@ __TS__ClassExtends(InputActionPlayer, CustomCallback)
13
13
  function InputActionPlayer.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local player, inputHook, buttonAction = table.unpack(fireArgs)
17
- local callbackPlayerVariant, callbackCharacter, callbackInputHook, callbackButtonAction = table.unpack(optionalArgs)
16
+ local player, inputHook, buttonAction = table.unpack(fireArgs, 1, 3)
17
+ local callbackPlayerVariant, callbackCharacter, callbackInputHook, callbackButtonAction = table.unpack(optionalArgs, 1, 4)
18
18
  local character = player:GetPlayerType()
19
19
  return (callbackPlayerVariant == nil or callbackPlayerVariant == player.Variant) and (callbackCharacter == nil or callbackCharacter == character) and (callbackInputHook == nil or callbackInputHook == inputHook) and (callbackButtonAction == nil or callbackButtonAction == buttonAction)
20
20
  end
@@ -19,8 +19,8 @@ function PostCollectibleEmpty.prototype.____constructor(self)
19
19
  CustomCallback.prototype.____constructor(self)
20
20
  self.v = v
21
21
  self.shouldFire = function(____, fireArgs, optionalArgs)
22
- local _collectible, oldCollectibleType = table.unpack(fireArgs)
23
- local callbackCollectibleType = table.unpack(optionalArgs)
22
+ local _collectible, oldCollectibleType = table.unpack(fireArgs, 1, 2)
23
+ local callbackCollectibleType = table.unpack(optionalArgs, 1, 1)
24
24
  return callbackCollectibleType == nil or callbackCollectibleType == oldCollectibleType
25
25
  end
26
26
  self.postPickupUpdateCollectible = function(____, pickup)
@@ -49,7 +49,7 @@ function PostCursedTeleport.prototype.____constructor(self)
49
49
  if trackingArray == nil then
50
50
  return
51
51
  end
52
- local lastDamageFrame, callbackActivatedOnThisFrame = table.unpack(trackingArray)
52
+ local lastDamageFrame, callbackActivatedOnThisFrame = table.unpack(trackingArray, 1, 2)
53
53
  if not self:playerIsTeleportingFromCursedTeleport(player, lastDamageFrame) then
54
54
  return
55
55
  end
@@ -76,7 +76,7 @@ function PostCursedTeleport.prototype.setDamageFrame(self, player, damageFlags)
76
76
  local gameFrameCount = game:GetFrameCount()
77
77
  local trackingArray = mapGetPlayer(nil, v.run.playersDamageFrameMap, player)
78
78
  if trackingArray ~= nil then
79
- local lastDamageFrame, callbackFiredOnThisFrame = table.unpack(trackingArray)
79
+ local lastDamageFrame, callbackFiredOnThisFrame = table.unpack(trackingArray, 1, 2)
80
80
  if lastDamageFrame == gameFrameCount and callbackFiredOnThisFrame then
81
81
  return
82
82
  end
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostCustomRevive, CustomCallback)
13
13
  function PostCustomRevive.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _player, revivalType = table.unpack(fireArgs)
17
- local callbackRevivalType = table.unpack(optionalArgs)
16
+ local _player, revivalType = table.unpack(fireArgs, 1, 2)
17
+ local callbackRevivalType = table.unpack(optionalArgs, 1, 1)
18
18
  return callbackRevivalType == nil or revivalType == callbackRevivalType
19
19
  end
20
20
  self.featuresUsed = {ISCFeature.CUSTOM_REVIVE}
@@ -20,8 +20,8 @@ function PostDiceRoomActivated.prototype.____constructor(self)
20
20
  CustomCallback.prototype.____constructor(self)
21
21
  self.v = v
22
22
  self.shouldFire = function(____, fireArgs, optionalArgs)
23
- local _player, diceFloorSubType = table.unpack(fireArgs)
24
- local callbackDiceFloorSubType = table.unpack(optionalArgs)
23
+ local _player, diceFloorSubType = table.unpack(fireArgs, 1, 2)
24
+ local callbackDiceFloorSubType = table.unpack(optionalArgs, 1, 1)
25
25
  return callbackDiceFloorSubType == nil or diceFloorSubType == callbackDiceFloorSubType
26
26
  end
27
27
  self.postEffectUpdateDiceFloor = function(____, effect)
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostGridEntityCollision, CustomCallback)
13
13
  function PostGridEntityCollision.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local gridEntity, entity = table.unpack(fireArgs)
17
- local callbackGridEntityType, callbackGridEntityVariant, callbackEntityType, callbackEntityVariant, callbackEntitySubType = table.unpack(optionalArgs)
16
+ local gridEntity, entity = table.unpack(fireArgs, 1, 2)
17
+ local callbackGridEntityType, callbackGridEntityVariant, callbackEntityType, callbackEntityVariant, callbackEntitySubType = table.unpack(optionalArgs, 1, 5)
18
18
  local gridEntityType = gridEntity:GetType()
19
19
  local gridEntityVariant = gridEntity:GetVariant()
20
20
  return (callbackGridEntityType == nil or callbackGridEntityType == gridEntityType) and (callbackGridEntityVariant == nil or callbackGridEntityVariant == gridEntityVariant) and (callbackEntityType == nil or callbackEntityType == entity.Type) and (callbackEntityVariant == nil or callbackEntityVariant == entity.Variant) and (callbackEntitySubType == nil or callbackEntitySubType == entity.SubType)
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostGridEntityCustomCollision, CustomCallback)
13
13
  function PostGridEntityCustomCollision.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _gridEntity, gridEntityTypeCustom, entity = table.unpack(fireArgs)
17
- local callbackGridEntityTypeCustom, callbackEntityType, callbackEntityVariant, callbackEntitySubType = table.unpack(optionalArgs)
16
+ local _gridEntity, gridEntityTypeCustom, entity = table.unpack(fireArgs, 1, 3)
17
+ local callbackGridEntityTypeCustom, callbackEntityType, callbackEntityVariant, callbackEntitySubType = table.unpack(optionalArgs, 1, 4)
18
18
  return (callbackGridEntityTypeCustom == nil or callbackGridEntityTypeCustom == gridEntityTypeCustom) and (callbackEntityType == nil or callbackEntityType == entity.Type) and (callbackEntityVariant == nil or callbackEntityVariant == entity.Variant) and (callbackEntitySubType == nil or callbackEntitySubType == entity.SubType)
19
19
  end
20
20
  self.featuresUsed = {ISCFeature.GRID_ENTITY_COLLISION_DETECTION}
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostGridEntityCustomRemove, CustomCallback)
13
13
  function PostGridEntityCustomRemove.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _gridIndex, gridEntityTypeCustom = table.unpack(fireArgs)
17
- local callbackGridEntityTypeCustom = table.unpack(optionalArgs)
16
+ local _gridIndex, gridEntityTypeCustom = table.unpack(fireArgs, 1, 2)
17
+ local callbackGridEntityTypeCustom = table.unpack(optionalArgs, 1, 1)
18
18
  return callbackGridEntityTypeCustom == nil or callbackGridEntityTypeCustom == gridEntityTypeCustom
19
19
  end
20
20
  self.featuresUsed = {ISCFeature.GRID_ENTITY_UPDATE_DETECTION}
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostGridEntityRemove, CustomCallback)
13
13
  function PostGridEntityRemove.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _gridIndex, gridEntityType, variant = table.unpack(fireArgs)
17
- local callbackGridEntityType, callbackVariant = table.unpack(optionalArgs)
16
+ local _gridIndex, gridEntityType, variant = table.unpack(fireArgs, 1, 3)
17
+ local callbackGridEntityType, callbackVariant = table.unpack(optionalArgs, 1, 2)
18
18
  return (callbackGridEntityType == nil or callbackGridEntityType == gridEntityType) and (callbackVariant == nil or callbackVariant == variant)
19
19
  end
20
20
  self.featuresUsed = {ISCFeature.GRID_ENTITY_UPDATE_DETECTION}
@@ -45,8 +45,8 @@ function PostItemDischarge.prototype.____constructor(self)
45
45
  CustomCallback.prototype.____constructor(self)
46
46
  self.v = v
47
47
  self.shouldFire = function(____, fireArgs, optionalArgs)
48
- local _player, collectibleType = table.unpack(fireArgs)
49
- local callbackCollectibleType = table.unpack(optionalArgs)
48
+ local _player, collectibleType = table.unpack(fireArgs, 1, 2)
49
+ local callbackCollectibleType = table.unpack(optionalArgs, 1, 1)
50
50
  return callbackCollectibleType == nil or callbackCollectibleType == collectibleType
51
51
  end
52
52
  self.preNPCCollisionSucker = function(____, npc, collider)
@@ -22,8 +22,8 @@ function PostKeyboardChanged.prototype.____constructor(self)
22
22
  CustomCallback.prototype.____constructor(self)
23
23
  self.v = v
24
24
  self.shouldFire = function(____, fireArgs, optionalArgs)
25
- local keyboard, pressed = table.unpack(fireArgs)
26
- local callbackKeyboard, callbackPressed = table.unpack(optionalArgs)
25
+ local keyboard, pressed = table.unpack(fireArgs, 1, 2)
26
+ local callbackKeyboard, callbackPressed = table.unpack(optionalArgs, 1, 2)
27
27
  return (callbackKeyboard == nil or callbackKeyboard == keyboard) and (callbackPressed == nil or callbackPressed == pressed)
28
28
  end
29
29
  self.postRender = function()
@@ -13,8 +13,8 @@ __TS__ClassExtends(PostPickupSelectionFilter, CustomCallback)
13
13
  function PostPickupSelectionFilter.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local _pickup, pickupVariant, subType = table.unpack(fireArgs)
17
- local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs)
16
+ local _pickup, pickupVariant, subType = table.unpack(fireArgs, 1, 3)
17
+ local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs, 1, 2)
18
18
  return (callbackPickupVariant == nil or callbackPickupVariant == pickupVariant) and (callbackPickupSubType == nil or callbackPickupSubType == subType)
19
19
  end
20
20
  self.postPickupSelection = function(____, pickup, variant, subType) return self:fire(pickup, variant, subType) end
@@ -36,8 +36,8 @@ function PostPurchase.prototype.____constructor(self)
36
36
  CustomCallback.prototype.____constructor(self)
37
37
  self.v = v
38
38
  self.shouldFire = function(____, fireArgs, optionalArgs)
39
- local _player, pickup = table.unpack(fireArgs)
40
- local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs)
39
+ local _player, pickup = table.unpack(fireArgs, 1, 2)
40
+ local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs, 1, 2)
41
41
  return (callbackPickupVariant == nil or callbackPickupVariant == pickup.Variant) and (callbackPickupSubType == nil or callbackPickupSubType == pickup.SubType)
42
42
  end
43
43
  self.postUseItem = function(____, _collectibleType, _rng, player)
@@ -19,8 +19,8 @@ function PostRoomClearChanged.prototype.____constructor(self)
19
19
  CustomCallback.prototype.____constructor(self)
20
20
  self.v = v
21
21
  self.shouldFire = function(____, fireArgs, optionalArgs)
22
- local roomClear = table.unpack(fireArgs)
23
- local callbackRoomClear = table.unpack(optionalArgs)
22
+ local roomClear = table.unpack(fireArgs, 1, 1)
23
+ local callbackRoomClear = table.unpack(optionalArgs, 1, 1)
24
24
  return callbackRoomClear == nil or callbackRoomClear == roomClear
25
25
  end
26
26
  self.postUpdate = function()
@@ -26,8 +26,8 @@ function PostTransformation.prototype.____constructor(self)
26
26
  CustomCallback.prototype.____constructor(self)
27
27
  self.v = v
28
28
  self.shouldFire = function(____, fireArgs, optionalArgs)
29
- local _player, playerForm = table.unpack(fireArgs)
30
- local callbackPlayerForm = table.unpack(optionalArgs)
29
+ local _player, playerForm = table.unpack(fireArgs, 1, 2)
30
+ local callbackPlayerForm = table.unpack(optionalArgs, 1, 1)
31
31
  return callbackPlayerForm == nil or callbackPlayerForm == playerForm
32
32
  end
33
33
  self.postPEffectUpdateReordered = function(____, player)
@@ -13,8 +13,8 @@ __TS__ClassExtends(PreEntitySpawnFilter, CustomCallback)
13
13
  function PreEntitySpawnFilter.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local entityType, variant, subType = table.unpack(fireArgs)
17
- local callbackEntityType, callbackVariant, callbackSubType = table.unpack(optionalArgs)
16
+ local entityType, variant, subType = table.unpack(fireArgs, 1, 3)
17
+ local callbackEntityType, callbackVariant, callbackSubType = table.unpack(optionalArgs, 1, 3)
18
18
  return (callbackEntityType == nil or callbackEntityType == entityType) and (callbackVariant == nil or callbackVariant == variant) and (callbackSubType == nil or callbackSubType == subType)
19
19
  end
20
20
  self.preEntitySpawn = function(____, entityType, variant, subType, position, velocity, spawner, initSeed) return self:fire(
@@ -13,8 +13,8 @@ __TS__ClassExtends(PreRoomEntitySpawnFilter, CustomCallback)
13
13
  function PreRoomEntitySpawnFilter.prototype.____constructor(self)
14
14
  CustomCallback.prototype.____constructor(self)
15
15
  self.shouldFire = function(____, fireArgs, optionalArgs)
16
- local entityTypeOrGridEntityXMLType, variant, subType = table.unpack(fireArgs)
17
- local callbackEntityTypeOrGridEntityXMLType, callbackVariant, callbackSubType = table.unpack(optionalArgs)
16
+ local entityTypeOrGridEntityXMLType, variant, subType = table.unpack(fireArgs, 1, 3)
17
+ local callbackEntityTypeOrGridEntityXMLType, callbackVariant, callbackSubType = table.unpack(optionalArgs, 1, 3)
18
18
  return (callbackEntityTypeOrGridEntityXMLType == nil or callbackEntityTypeOrGridEntityXMLType == entityTypeOrGridEntityXMLType) and (callbackVariant == nil or callbackVariant == variant) and (callbackSubType == nil or callbackSubType == subType)
19
19
  end
20
20
  self.preRoomEntitySpawn = function(____, entityTypeOrGridEntityXMLType, variant, subType, gridIndex, initSeed) return self:fire(
@@ -67,7 +67,7 @@ function GridEntityUpdateDetection.prototype.checkGridEntitiesRemoved(self, grid
67
67
  for ____, ____value in __TS__Iterator(v.room.initializedGridEntities) do
68
68
  local gridIndex = ____value[1]
69
69
  local gridEntityTuple = ____value[2]
70
- local storedGridEntityType, storedGridEntityVariant = table.unpack(gridEntityTuple)
70
+ local storedGridEntityType, storedGridEntityVariant = table.unpack(gridEntityTuple, 1, 2)
71
71
  local gridEntity = gridEntitiesMap:get(gridIndex)
72
72
  if gridEntity == nil or gridEntity:GetType() ~= storedGridEntityType then
73
73
  v.room.initializedGridEntities:delete(gridIndex)
@@ -85,7 +85,7 @@ function GridEntityUpdateDetection.prototype.checkGridEntityStateChanged(self, g
85
85
  if gridEntityTuple == nil then
86
86
  return
87
87
  end
88
- local _gridEntityType, _gridEntityVariant, oldState = table.unpack(gridEntityTuple)
88
+ local _gridEntityType, _gridEntityVariant, oldState = table.unpack(gridEntityTuple, 1, 3)
89
89
  local newState = gridEntity.State
90
90
  if oldState ~= newState then
91
91
  self:updateTupleInMap(gridEntity)
@@ -61,7 +61,7 @@ function spawnGridEntityForJSONRoom(self, gridEntityXMLType, gridEntityXMLVarian
61
61
  if gridEntityTuple == nil then
62
62
  return nil
63
63
  end
64
- local gridEntityType, variant = table.unpack(gridEntityTuple)
64
+ local gridEntityType, variant = table.unpack(gridEntityTuple, 1, 2)
65
65
  local position = gridCoordinatesToWorldPosition(nil, x, y)
66
66
  local gridIndex = room:GetGridIndex(position)
67
67
  local gridEntity = spawnGridEntityWithVariant(nil, gridEntityType, variant, gridIndex)
@@ -118,7 +118,7 @@ function ExtraConsoleCommands.prototype.____constructor(self)
118
118
  if resultTuple == nil then
119
119
  return
120
120
  end
121
- local commandName, commandFunction = table.unpack(resultTuple)
121
+ local commandName, commandFunction = table.unpack(resultTuple, 1, 2)
122
122
  print("Command: " .. commandName)
123
123
  commandFunction(nil, params)
124
124
  end
@@ -38,7 +38,7 @@ function NoSirenSteal.prototype.checkReturnFamiliarToPlayer(self, npc)
38
38
  end
39
39
  function NoSirenSteal.prototype.blacklistEntryExists(self, incomingFamiliarVariant, incomingFamiliarSubType)
40
40
  for ____, familiarTuple in ipairs(v.run.familiarBlacklist) do
41
- local familiarVariant, familiarSubType = table.unpack(familiarTuple)
41
+ local familiarVariant, familiarSubType = table.unpack(familiarTuple, 1, 2)
42
42
  if familiarVariant == incomingFamiliarVariant and familiarSubType == incomingFamiliarSubType then
43
43
  return true
44
44
  end
@@ -125,7 +125,7 @@ function PersistentEntities.prototype.removePersistentEntity(self, persistentEnt
125
125
  local ptrHash = ____value[1]
126
126
  local tuple = ____value[2]
127
127
  do
128
- local index, entityPtr = table.unpack(tuple)
128
+ local index, entityPtr = table.unpack(tuple, 1, 2)
129
129
  if index ~= persistentEntityIndex then
130
130
  goto __continue16
131
131
  end
@@ -382,7 +382,7 @@ function ____exports.spawnTrinketAt(self, params, golden)
382
382
  print("You must specify the number corresponding to the trinket type and the number corresponding to the grid tile location.")
383
383
  return
384
384
  end
385
- local trinketTypeString, gridIndexString = table.unpack(args)
385
+ local trinketTypeString, gridIndexString = table.unpack(args, 1, 2)
386
386
  if trinketTypeString == nil or gridIndexString == nil then
387
387
  return
388
388
  end
@@ -419,7 +419,7 @@ function ____exports.addCharges(self, params)
419
419
  print("Invalid amount of arguments: " .. tostring(#args))
420
420
  return
421
421
  end
422
- local activeSlotString, numChargeString = table.unpack(args)
422
+ local activeSlotString, numChargeString = table.unpack(args, 1, 2)
423
423
  if activeSlotString == nil then
424
424
  return
425
425
  end
@@ -1210,7 +1210,7 @@ function ____exports.setCharges(self, params)
1210
1210
  print("Invalid amount of arguments: " .. tostring(#args))
1211
1211
  return
1212
1212
  end
1213
- local activeSlotString, chargeString = table.unpack(args)
1213
+ local activeSlotString, chargeString = table.unpack(args, 1, 2)
1214
1214
  if activeSlotString == nil or chargeString == nil then
1215
1215
  return
1216
1216
  end
@@ -1245,7 +1245,7 @@ function ____exports.setPosition(self, params)
1245
1245
  print("You must specify a position. (e.g. \"setPosition 100 50\")")
1246
1246
  return
1247
1247
  end
1248
- local xString, yString = table.unpack(args)
1248
+ local xString, yString = table.unpack(args, 1, 2)
1249
1249
  if xString == nil or yString == nil then
1250
1250
  return
1251
1251
  end
@@ -1324,7 +1324,7 @@ function ____exports.spawnCollectibleAt(self, params)
1324
1324
  print("You must specify the number corresponding to the collectible type and the number corresponding to the grid tile location.")
1325
1325
  return
1326
1326
  end
1327
- local collectibleTypeString, gridIndexString = table.unpack(args)
1327
+ local collectibleTypeString, gridIndexString = table.unpack(args, 1, 2)
1328
1328
  if collectibleTypeString == nil or gridIndexString == nil then
1329
1329
  return
1330
1330
  end
@@ -314,7 +314,7 @@ function getArrayDuplicateElements(array) {
314
314
  set.add(element);
315
315
  }
316
316
  const values = [...duplicateElements];
317
- return values.sort(sort_1.sortNormal);
317
+ return values.toSorted(sort_1.sortNormal);
318
318
  }
319
319
  /**
320
320
  * Helper function to get an array containing the indexes of an array.
@@ -15,7 +15,7 @@ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
15
15
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
16
16
  local Set = ____lualib.Set
17
17
  local __TS__Spread = ____lualib.__TS__Spread
18
- local __TS__ArraySort = ____lualib.__TS__ArraySort
18
+ local __TS__ArrayToSorted = ____lualib.__TS__ArrayToSorted
19
19
  local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
20
20
  local __TS__ObjectKeys = ____lualib.__TS__ObjectKeys
21
21
  local __TS__ArraySome = ____lualib.__TS__ArraySome
@@ -373,7 +373,7 @@ function ____exports.getArrayDuplicateElements(self, array)
373
373
  set:add(element)
374
374
  end
375
375
  local values = {__TS__Spread(duplicateElements)}
376
- return __TS__ArraySort(values, sortNormal)
376
+ return __TS__ArrayToSorted(values, sortNormal)
377
377
  end
378
378
  --- Helper function to get an array containing the indexes of an array.
379
379
  --
@@ -33,12 +33,16 @@ function ____exports.deserializeBitSet128(self, bitSet128)
33
33
  if not isTable(nil, bitSet128) then
34
34
  error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object was not a Lua table.")
35
35
  end
36
- local l, h = table.unpack(getNumbersFromTable(
37
- nil,
38
- bitSet128,
39
- OBJECT_NAME,
40
- table.unpack(KEYS)
41
- ))
36
+ local l, h = table.unpack(
37
+ getNumbersFromTable(
38
+ nil,
39
+ bitSet128,
40
+ OBJECT_NAME,
41
+ table.unpack(KEYS)
42
+ ),
43
+ 1,
44
+ 2
45
+ )
42
46
  assertDefined(nil, l, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: l")
43
47
  assertDefined(nil, h, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: h")
44
48
  return BitSet128(l, h)
@@ -56,12 +56,16 @@ function ____exports.deserializeColor(self, color)
56
56
  if not isTable(nil, color) then
57
57
  error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object was not a Lua table.")
58
58
  end
59
- local r, g, b, a, ro, go, bo = table.unpack(getNumbersFromTable(
60
- nil,
61
- color,
62
- OBJECT_NAME,
63
- table.unpack(KEYS)
64
- ))
59
+ local r, g, b, a, ro, go, bo = table.unpack(
60
+ getNumbersFromTable(
61
+ nil,
62
+ color,
63
+ OBJECT_NAME,
64
+ table.unpack(KEYS)
65
+ ),
66
+ 1,
67
+ 7
68
+ )
65
69
  assertDefined(nil, r, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: R")
66
70
  assertDefined(nil, g, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: G")
67
71
  assertDefined(nil, b, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: B")
@@ -314,7 +314,7 @@ function ____exports.getRoomShapeDoorSlot(self, roomShape, x, y)
314
314
  if doorSlot == nil or not isEnumValue(nil, doorSlot, DoorSlot) then
315
315
  goto __continue40
316
316
  end
317
- local doorX, doorY = table.unpack(coordinates)
317
+ local doorX, doorY = table.unpack(coordinates, 1, 2)
318
318
  if x == doorX and y == doorY then
319
319
  return doorSlot
320
320
  end
@@ -219,7 +219,7 @@ function ____exports.getConstituentsFromEntityID(self, entityID)
219
219
  if #parts ~= 3 then
220
220
  error("Failed to get the constituents from entity ID: " .. entityID)
221
221
  end
222
- local entityTypeString, variantString, subTypeString = table.unpack(parts)
222
+ local entityTypeString, variantString, subTypeString = table.unpack(parts, 1, 3)
223
223
  assertDefined(nil, entityTypeString, "Failed to get the first constituent from an entity ID: " .. entityID)
224
224
  assertDefined(nil, variantString, "Failed to get the second constituent from an entity ID: " .. entityID)
225
225
  assertDefined(nil, subTypeString, "Failed to get the third constituent from an entity ID: " .. entityID)
@@ -436,7 +436,7 @@ function ____exports.parseEntityID(self, entityID)
436
436
  if #entityIDArray ~= 3 then
437
437
  return nil
438
438
  end
439
- local entityTypeString, variantString, subTypeString = table.unpack(entityIDArray)
439
+ local entityTypeString, variantString, subTypeString = table.unpack(entityIDArray, 1, 3)
440
440
  if entityTypeString == nil or variantString == nil or subTypeString == nil then
441
441
  return nil
442
442
  end
@@ -459,7 +459,7 @@ function ____exports.parseEntityTypeVariantString(self, entityTypeVariantString)
459
459
  if #entityTypeVariantArray ~= 2 then
460
460
  return nil
461
461
  end
462
- local entityTypeString, variantString = table.unpack(entityTypeVariantArray)
462
+ local entityTypeString, variantString = table.unpack(entityTypeVariantArray, 1, 2)
463
463
  if entityTypeString == nil or variantString == nil then
464
464
  return nil
465
465
  end
@@ -588,7 +588,11 @@ function ____exports.spawnEntityID(self, entityID, positionOrGridIndex, velocity
588
588
  if velocity == nil then
589
589
  velocity = VectorZero
590
590
  end
591
- local entityType, variant, subType = table.unpack(____exports.getConstituentsFromEntityID(nil, entityID))
591
+ local entityType, variant, subType = table.unpack(
592
+ ____exports.getConstituentsFromEntityID(nil, entityID),
593
+ 1,
594
+ 3
595
+ )
592
596
  return ____exports.spawn(
593
597
  nil,
594
598
  entityType,
@@ -237,7 +237,7 @@ function ____exports.logNewGlobals(self)
237
237
  for ____, ____value in __TS__Iterator(__TS__ArrayEntries(newGlobals)) do
238
238
  local i = ____value[1]
239
239
  local tuple = ____value[2]
240
- local key, value = table.unpack(tuple)
240
+ local key, value = table.unpack(tuple, 1, 2)
241
241
  log((((tostring(i + 1) .. ") ") .. tostring(key)) .. " - ") .. tostring(value))
242
242
  end
243
243
  end
@@ -559,7 +559,7 @@ function ____exports.getConstituentsFromGridEntityID(self, gridEntityID)
559
559
  if #parts ~= 2 then
560
560
  error("Failed to get the constituents from a grid entity ID: " .. gridEntityID)
561
561
  end
562
- local gridEntityTypeString, variantString = table.unpack(parts)
562
+ local gridEntityTypeString, variantString = table.unpack(parts, 1, 2)
563
563
  assertDefined(nil, gridEntityTypeString, "Failed to get the first constituent from a grid entity ID: " .. gridEntityID)
564
564
  assertDefined(nil, variantString, "Failed to get the second constituent from a grid entity ID: " .. gridEntityID)
565
565
  local gridEntityType = parseIntSafe(nil, gridEntityTypeString)
@@ -204,7 +204,7 @@ function ____exports.keyboardToString(self, keyboard, uppercase)
204
204
  if tuple == nil then
205
205
  return nil
206
206
  end
207
- local lowercaseCharacter, uppercaseCharacter = table.unpack(tuple)
207
+ local lowercaseCharacter, uppercaseCharacter = table.unpack(tuple, 1, 2)
208
208
  return uppercase and uppercaseCharacter or lowercaseCharacter
209
209
  end
210
210
  return ____exports
@@ -37,12 +37,16 @@ function ____exports.deserializeKColor(self, kColor)
37
37
  if not isTable(nil, kColor) then
38
38
  error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object was not a Lua table.")
39
39
  end
40
- local r, g, b, a = table.unpack(getNumbersFromTable(
41
- nil,
42
- kColor,
43
- OBJECT_NAME,
44
- table.unpack(KEYS)
45
- ))
40
+ local r, g, b, a = table.unpack(
41
+ getNumbersFromTable(
42
+ nil,
43
+ kColor,
44
+ OBJECT_NAME,
45
+ table.unpack(KEYS)
46
+ ),
47
+ 1,
48
+ 4
49
+ )
46
50
  assertDefined(nil, r, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: Red")
47
51
  assertDefined(nil, g, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: Green")
48
52
  assertDefined(nil, b, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: Blue")
@@ -69,12 +69,16 @@ function ____exports.deserializeRNG(self, rng)
69
69
  if not isTable(nil, rng) then
70
70
  error(("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object was not a Lua table.")
71
71
  end
72
- local seed = table.unpack(getNumbersFromTable(
73
- nil,
74
- rng,
75
- OBJECT_NAME,
76
- table.unpack(KEYS)
77
- ))
72
+ local seed = table.unpack(
73
+ getNumbersFromTable(
74
+ nil,
75
+ rng,
76
+ OBJECT_NAME,
77
+ table.unpack(KEYS)
78
+ ),
79
+ 1,
80
+ 1
81
+ )
78
82
  assertDefined(nil, seed, ("Failed to deserialize a " .. OBJECT_NAME) .. " object since the provided object did not have a value for: seed")
79
83
  return ____exports.newRNG(nil, seed)
80
84
  end
@@ -45,7 +45,7 @@ function ____exports.getVanillaWallGridIndexSetForRoomShape(self, roomShape)
45
45
  local ____cond5 = ____switch5 == RoomShape.LTL
46
46
  if ____cond5 then
47
47
  do
48
- local topMiddle, topRight, middleLeft, middle, bottomLeft, bottomRight = table.unpack(corners)
48
+ local topMiddle, topRight, middleLeft, middle, bottomLeft, bottomRight = table.unpack(corners, 1, 6)
49
49
  local ____ReadonlySet_1 = ReadonlySet
50
50
  local ____array_0 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topMiddle.gridIndex, topRight.gridIndex, roomShape)))
51
51
  __TS__SparseArrayPush(
@@ -77,7 +77,7 @@ function ____exports.getVanillaWallGridIndexSetForRoomShape(self, roomShape)
77
77
  ____cond5 = ____cond5 or ____switch5 == RoomShape.LTR
78
78
  if ____cond5 then
79
79
  do
80
- local topLeft, topMiddle, middle, middleRight, bottomLeft, bottomRight = table.unpack(corners)
80
+ local topLeft, topMiddle, middle, middleRight, bottomLeft, bottomRight = table.unpack(corners, 1, 6)
81
81
  local ____ReadonlySet_3 = ReadonlySet
82
82
  local ____array_2 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topMiddle.gridIndex, roomShape)))
83
83
  __TS__SparseArrayPush(
@@ -109,7 +109,7 @@ function ____exports.getVanillaWallGridIndexSetForRoomShape(self, roomShape)
109
109
  ____cond5 = ____cond5 or ____switch5 == RoomShape.LBL
110
110
  if ____cond5 then
111
111
  do
112
- local topLeft, topRight, middleLeft, middle, bottomMiddle, bottomRight = table.unpack(corners)
112
+ local topLeft, topRight, middleLeft, middle, bottomMiddle, bottomRight = table.unpack(corners, 1, 6)
113
113
  local ____ReadonlySet_5 = ReadonlySet
114
114
  local ____array_4 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
115
115
  __TS__SparseArrayPush(
@@ -141,7 +141,7 @@ function ____exports.getVanillaWallGridIndexSetForRoomShape(self, roomShape)
141
141
  ____cond5 = ____cond5 or ____switch5 == RoomShape.LBR
142
142
  if ____cond5 then
143
143
  do
144
- local topLeft, topRight, middle, middleRight, bottomLeft, bottomMiddle = table.unpack(corners)
144
+ local topLeft, topRight, middle, middleRight, bottomLeft, bottomMiddle = table.unpack(corners, 1, 6)
145
145
  local ____ReadonlySet_7 = ReadonlySet
146
146
  local ____array_6 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
147
147
  __TS__SparseArrayPush(
@@ -181,7 +181,7 @@ function getVanillaWallGridIndexSetForRectangleRoomShape(self, roomShape, corner
181
181
  if #corners ~= 4 then
182
182
  error("Failed to get the correct amount of corners for rectangular room shape.")
183
183
  end
184
- local topLeft, topRight, bottomLeft, bottomRight = table.unpack(corners)
184
+ local topLeft, topRight, bottomLeft, bottomRight = table.unpack(corners, 1, 4)
185
185
  local ____ReadonlySet_9 = ReadonlySet
186
186
  local ____array_8 = __TS__SparseArrayNew(table.unpack(getGridIndexesBetween(nil, topLeft.gridIndex, topRight.gridIndex, roomShape)))
187
187
  __TS__SparseArrayPush(