isaacscript-common 30.4.1 → 30.4.3

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 (36) hide show
  1. package/dist/index.rollup.d.ts +35 -23
  2. package/dist/isaacscript-common.lua +57 -52
  3. package/dist/lualib_bundle.lua +15 -0
  4. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +4 -4
  5. package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts.map +1 -1
  6. package/dist/src/classes/features/callbackLogic/CustomGridEntities.lua +1 -1
  7. package/dist/src/classes/features/other/PressInput.d.ts.map +1 -1
  8. package/dist/src/classes/features/other/PressInput.lua +7 -8
  9. package/dist/src/classes/features/other/StageHistory.d.ts +2 -4
  10. package/dist/src/classes/features/other/StageHistory.d.ts.map +1 -1
  11. package/dist/src/classes/features/other/StageHistory.lua +3 -13
  12. package/dist/src/functions/levelGrid.d.ts +20 -13
  13. package/dist/src/functions/levelGrid.d.ts.map +1 -1
  14. package/dist/src/functions/levelGrid.lua +7 -5
  15. package/dist/src/functions/playerHealth.d.ts.map +1 -1
  16. package/dist/src/functions/playerHealth.lua +18 -23
  17. package/dist/src/functions/spawnCollectible.d.ts +4 -2
  18. package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
  19. package/dist/src/functions/spawnCollectible.lua +5 -3
  20. package/dist/src/index.d.ts +1 -0
  21. package/dist/src/index.d.ts.map +1 -1
  22. package/dist/src/interfaces/StageHistoryEntry.d.ts +7 -0
  23. package/dist/src/interfaces/StageHistoryEntry.d.ts.map +1 -0
  24. package/dist/src/interfaces/StageHistoryEntry.lua +2 -0
  25. package/package.json +1 -1
  26. package/src/classes/features/callbackLogic/CustomGridEntities.ts +9 -5
  27. package/src/classes/features/other/PressInput.ts +10 -8
  28. package/src/classes/features/other/StageHistory.ts +8 -8
  29. package/src/functions/levelGrid.ts +45 -20
  30. package/src/functions/playerHealth.ts +23 -16
  31. package/src/functions/spawnCollectible.ts +5 -3
  32. package/src/index.ts +1 -0
  33. package/src/interfaces/StageHistoryEntry.ts +7 -0
  34. package/dist/src/indexLua.d.ts +0 -185
  35. package/dist/src/indexLua.d.ts.map +0 -1
  36. package/dist/src/indexLua.lua +0 -1114
@@ -1844,10 +1844,10 @@ declare class CustomGridEntities extends Feature {
1844
1844
  * In order to use this function, you must upgrade your mod with
1845
1845
  * `ISCFeature.CUSTOM_GRID_ENTITIES`.
1846
1846
  */
1847
- getCustomGridEntities(): Array<[
1848
- gridEntity: GridEntity,
1849
- data: GridEntityCustomData
1850
- ]>;
1847
+ getCustomGridEntities(): Array<{
1848
+ gridEntity: GridEntity;
1849
+ data: GridEntityCustomData;
1850
+ }>;
1851
1851
  /**
1852
1852
  * Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
1853
1853
  * undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
@@ -4279,7 +4279,7 @@ export declare function getActivePocketItemSlot(player: EntityPlayer): PocketIte
4279
4279
  * This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
4280
4280
  * that function for more information.
4281
4281
  */
4282
- export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): int[];
4282
+ export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
4283
4283
 
4284
4284
  /**
4285
4285
  * Helper function to get only the adjacent room grid indexes that do not exist (i.e. do not have
@@ -4288,7 +4288,7 @@ export declare function getAdjacentExistingRoomGridIndexes(roomGridIndex?: int):
4288
4288
  * This is just a filtering of the results of the `getAdjacentExistingRoomGridIndexes` function. See
4289
4289
  * that function for more information.
4290
4290
  */
4291
- export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): int[];
4291
+ export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: int): readonly int[];
4292
4292
 
4293
4293
  /**
4294
4294
  * Helper function to get all of the room grid indexes that are adjacent to a given room grid index
@@ -4305,7 +4305,7 @@ export declare function getAdjacentNonExistingRoomGridIndexes(roomGridIndex?: in
4305
4305
  *
4306
4306
  * @param roomGridIndex Optional. Default is the current room index.
4307
4307
  */
4308
- export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[];
4308
+ export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): readonly int[];
4309
4309
 
4310
4310
  /**
4311
4311
  * Helper function to get all of the non-dead bosses in the room.
@@ -4382,7 +4382,7 @@ export declare function getAllPillColors(): PillColor[];
4382
4382
  export declare function getAllPlayers(): EntityPlayer[];
4383
4383
 
4384
4384
  /** Helper function to get the room safe grid index for every room on the entire floor. */
4385
- export declare function getAllRoomGridIndexes(): int[];
4385
+ export declare function getAllRoomGridIndexes(): readonly int[];
4386
4386
 
4387
4387
  /**
4388
4388
  * Helper function to get the corresponding ambush type for the current room. Returns undefined if
@@ -5488,7 +5488,11 @@ export declare function getNewGlobals(): ReadonlyArray<[AnyNotNil, unknown]>;
5488
5488
  * @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
5489
5489
  * undefined.
5490
5490
  */
5491
- export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): [adjacentRoomGridIndex: int, doorSlot: DoorSlot, newRoomGridIndex: int] | undefined;
5491
+ export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): {
5492
+ readonly adjacentRoomGridIndex: int;
5493
+ readonly doorSlot: DoorSlot;
5494
+ readonly newRoomGridIndex: int;
5495
+ } | undefined;
5492
5496
 
5493
5497
  /**
5494
5498
  * Helper function to iterate through the possible doors for a room and see if any of them would be
@@ -5498,7 +5502,10 @@ export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): [adjacentRo
5498
5502
  * @param roomGridIndex Optional. Default is the current room index.
5499
5503
  * @returns A array of tuples of `DoorSlot` and room grid index.
5500
5504
  */
5501
- export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): Array<[doorSlot: DoorSlot, roomGridIndex: int]>;
5505
+ export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): ReadonlyArray<{
5506
+ readonly doorSlot: DoorSlot;
5507
+ readonly roomGridIndex: int;
5508
+ }>;
5502
5509
 
5503
5510
  /**
5504
5511
  * Helper function to search through all of the rooms on the floor for a spot to insert a brand new
@@ -5507,11 +5514,11 @@ export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): Arr
5507
5514
  * @returns A array of tuples containing the adjacent room grid index, the `DoorSlot`, and the new
5508
5515
  * room grid index.
5509
5516
  */
5510
- export declare function getNewRoomCandidatesForLevel(): Array<[
5511
- adjacentRoomGridIndex: int,
5512
- doorSlot: DoorSlot,
5513
- newRoomGridIndex: int
5514
- ]>;
5517
+ export declare function getNewRoomCandidatesForLevel(): ReadonlyArray<{
5518
+ readonly adjacentRoomGridIndex: int;
5519
+ readonly doorSlot: DoorSlot;
5520
+ readonly newRoomGridIndex: int;
5521
+ }>;
5515
5522
 
5516
5523
  /**
5517
5524
  * Helper function to get the stage that a trapdoor or heaven door would take the player to, based
@@ -6356,7 +6363,7 @@ export declare function getRoomGridIndex(): int;
6356
6363
  * This function is variadic, meaning that you can specify N arguments to get the combined grid
6357
6364
  * indexes for N room types.
6358
6365
  */
6359
- export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[];
6366
+ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): readonly int[];
6360
6367
 
6361
6368
  /**
6362
6369
  * Helper function to get the item pool type for the current room. For example, this returns
@@ -14483,7 +14490,7 @@ export declare function roomExists(roomGridIndex: int): boolean;
14483
14490
  * - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
14484
14491
  * - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
14485
14492
  */
14486
- export declare function roomGridIndexToVector(roomGridIndex: int): Vector;
14493
+ export declare function roomGridIndexToVector(roomGridIndex: int): Readonly<Vector>;
14487
14494
 
14488
14495
  declare class RoomHistory extends Feature {
14489
14496
  private postNewRoomEarly;
@@ -15836,8 +15843,10 @@ export declare function spawnEffectWithSeed(effectVariant: EffectVariant, subTyp
15836
15843
  * with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
15837
15844
  * current room's item pool.
15838
15845
  *
15839
- * Instead, this function arbitrarily spawns a collectible with `CollectibleType.SAD_ONION`, and
15840
- * then converts it to an empty pedestal afterward.
15846
+ * Instead, this function arbitrarily spawns a collectible with `CollectibleType.BROKEN_SHOVEL_1`,
15847
+ * and then converts it to an empty pedestal afterward. (Broken Shovel is used instead of e.g. Sad
15848
+ * Onion because it is a quest collectible and quest collectibles will prevent Damocles from
15849
+ * duplicating the pedestal.)
15841
15850
  *
15842
15851
  * @param positionOrGridIndex The position or grid index to spawn the empty collectible at.
15843
15852
  * @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
@@ -16200,10 +16209,7 @@ declare class StageHistory extends Feature {
16200
16209
  *
16201
16210
  * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
16202
16211
  */
16203
- getStageHistory(): ReadonlyArray<[
16204
- stage: LevelStage,
16205
- stageType: StageType
16206
- ]>;
16212
+ getStageHistory(): readonly StageHistoryEntry[];
16207
16213
  /**
16208
16214
  * Helper function to check if a player has previous visited a particular stage (or stage + stage
16209
16215
  * type combination) on this run.
@@ -16217,6 +16223,12 @@ declare class StageHistory extends Feature {
16217
16223
  hasVisitedStage(stage: LevelStage, stageType?: StageType): boolean;
16218
16224
  }
16219
16225
 
16226
+ /** This is used by the `StageHistory` feature. */
16227
+ export declare interface StageHistoryEntry {
16228
+ readonly stage: LevelStage;
16229
+ readonly stageType: StageType;
16230
+ }
16231
+
16220
16232
  /**
16221
16233
  * Helper function to convert a numerical `StageType` into the letter suffix supplied to the "stage"
16222
16234
  * console command. For example, `StageType.REPENTANCE` is the stage type for Downpour, and the
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 30.4.1
3
+ isaacscript-common 30.4.3
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -1491,6 +1491,20 @@ do
1491
1491
  end
1492
1492
  end
1493
1493
 
1494
+ local function __TS__NumberToFixed(self, fractionDigits)
1495
+ if math.abs(self) >= 1e+21 or self ~= self then
1496
+ return tostring(self)
1497
+ end
1498
+ local f = math.floor(fractionDigits or 0)
1499
+ if f < 0 or f > 99 then
1500
+ error("toFixed() digits argument must be between 0 and 99", 0)
1501
+ end
1502
+ return string.format(
1503
+ ("%." .. tostring(f)) .. "f",
1504
+ self
1505
+ )
1506
+ end
1507
+
1494
1508
  local function __TS__ObjectDefineProperty(target, key, desc)
1495
1509
  local luaKey = type(key) == "number" and key + 1 or key
1496
1510
  local value = rawget(target, luaKey)
@@ -2463,6 +2477,7 @@ return {
2463
2477
  __TS__NumberIsFinite = __TS__NumberIsFinite,
2464
2478
  __TS__NumberIsNaN = __TS__NumberIsNaN,
2465
2479
  __TS__NumberToString = __TS__NumberToString,
2480
+ __TS__NumberToFixed = __TS__NumberToFixed,
2466
2481
  __TS__ObjectAssign = __TS__ObjectAssign,
2467
2482
  __TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
2468
2483
  __TS__ObjectEntries = __TS__ObjectEntries,
@@ -27924,8 +27939,6 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
27924
27939
  local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
27925
27940
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
27926
27941
  local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
27927
- local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
27928
- local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
27929
27942
  local ____constants = require("src.core.constants")
27930
27943
  local MAX_PLAYER_HEART_CONTAINERS = ____constants.MAX_PLAYER_HEART_CONTAINERS
27931
27944
  local ____HealthType = require("src.enums.HealthType")
@@ -27939,6 +27952,7 @@ local getCharacterMaxHeartContainers = ____characters.getCharacterMaxHeartContai
27939
27952
  local ____charge = require("src.functions.charge")
27940
27953
  local getTotalCharge = ____charge.getTotalCharge
27941
27954
  local ____players = require("src.functions.players")
27955
+ local getActiveItemSlots = ____players.getActiveItemSlots
27942
27956
  local isCharacter = ____players.isCharacter
27943
27957
  local isKeeper = ____players.isKeeper
27944
27958
  local setActiveItem = ____players.setActiveItem
@@ -27997,18 +28011,14 @@ end
27997
28011
  function ____exports.setPlayerHealth(self, player, playerHealth)
27998
28012
  local character = player:GetPlayerType()
27999
28013
  local subPlayer = player:GetSubPlayer()
28000
- ____exports.removeAllPlayerHealth(nil, player)
28001
- local alabasterBoxes = {}
28002
- if player:HasCollectible(CollectibleType.ALABASTER_BOX) then
28003
- for ____, activeSlot in ipairs(ACTIVE_SLOT_VALUES) do
28004
- local activeItem = player:GetActiveItem()
28005
- if activeItem == CollectibleType.ALABASTER_BOX then
28006
- local totalCharge = getTotalCharge(nil, player, activeSlot)
28007
- setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
28008
- alabasterBoxes[#alabasterBoxes + 1] = {activeSlot, totalCharge}
28009
- end
28010
- end
28014
+ local alabasterBoxDescriptions = {}
28015
+ local alabasterBoxActiveSlots = getActiveItemSlots(nil, player, CollectibleType.ALABASTER_BOX)
28016
+ for ____, activeSlot in ipairs(alabasterBoxActiveSlots) do
28017
+ local totalCharge = getTotalCharge(nil, player, activeSlot)
28018
+ setActiveItem(nil, player, CollectibleType.NULL, activeSlot)
28019
+ alabasterBoxDescriptions[#alabasterBoxDescriptions + 1] = {activeSlot = activeSlot, totalCharge = totalCharge}
28011
28020
  end
28021
+ ____exports.removeAllPlayerHealth(nil, player)
28012
28022
  if character == PlayerType.SOUL and subPlayer ~= nil then
28013
28023
  subPlayer:AddMaxHearts(playerHealth.maxHearts, false)
28014
28024
  else
@@ -28025,25 +28035,25 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
28025
28035
  addAmount = 1
28026
28036
  end
28027
28037
  repeat
28028
- local ____switch72 = soulHeartType
28029
- local ____cond72 = ____switch72 == HeartSubType.SOUL
28030
- if ____cond72 then
28038
+ local ____switch70 = soulHeartType
28039
+ local ____cond70 = ____switch70 == HeartSubType.SOUL
28040
+ if ____cond70 then
28031
28041
  do
28032
28042
  player:AddSoulHearts(addAmount)
28033
28043
  soulHeartsRemaining = soulHeartsRemaining - addAmount
28034
28044
  break
28035
28045
  end
28036
28046
  end
28037
- ____cond72 = ____cond72 or ____switch72 == HeartSubType.BLACK
28038
- if ____cond72 then
28047
+ ____cond70 = ____cond70 or ____switch70 == HeartSubType.BLACK
28048
+ if ____cond70 then
28039
28049
  do
28040
28050
  player:AddBlackHearts(addAmount)
28041
28051
  soulHeartsRemaining = soulHeartsRemaining - addAmount
28042
28052
  break
28043
28053
  end
28044
28054
  end
28045
- ____cond72 = ____cond72 or ____switch72 == HeartSubType.BONE
28046
- if ____cond72 then
28055
+ ____cond70 = ____cond70 or ____switch70 == HeartSubType.BONE
28056
+ if ____cond70 then
28047
28057
  do
28048
28058
  player:AddBoneHearts(addAmount)
28049
28059
  break
@@ -28081,9 +28091,9 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
28081
28091
  elseif character == PlayerType.BETHANY_B then
28082
28092
  player:SetBloodCharge(playerHealth.bloodCharges)
28083
28093
  end
28084
- for ____, ____value in ipairs(alabasterBoxes) do
28085
- local activeSlot = ____value[1]
28086
- local totalCharge = ____value[2]
28094
+ for ____, ____value in ipairs(alabasterBoxDescriptions) do
28095
+ local activeSlot = ____value.activeSlot
28096
+ local totalCharge = ____value.totalCharge
28087
28097
  setActiveItem(
28088
28098
  nil,
28089
28099
  player,
@@ -34182,7 +34192,7 @@ function CustomGridEntities.prototype.getCustomGridEntities(self)
34182
34192
  local data = ____value[2]
34183
34193
  local gridEntity = room:GetGridEntity(gridIndex)
34184
34194
  if gridEntity ~= nil then
34185
- customGridEntities[#customGridEntities + 1] = {gridEntity, data}
34195
+ customGridEntities[#customGridEntities + 1] = {gridEntity = gridEntity, data = data}
34186
34196
  end
34187
34197
  end
34188
34198
  return customGridEntities
@@ -41062,6 +41072,10 @@ function ____exports.getNextStageType(self, upwards)
41062
41072
  end
41063
41073
  return calculateStageType(nil, nextStage)
41064
41074
  end
41075
+ return ____exports
41076
+ end,
41077
+ ["src.interfaces.StageHistoryEntry"] = function(...)
41078
+ local ____exports = {}
41065
41079
  return ____exports
41066
41080
  end,
41067
41081
  ["src.classes.features.other.StageHistory"] = function(...)
@@ -41104,7 +41118,7 @@ function StageHistory.prototype.____constructor(self)
41104
41118
  local stage = level:GetStage()
41105
41119
  local stageType = level:GetStageType()
41106
41120
  local ____v_run_stageHistory_0 = v.run.stageHistory
41107
- ____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage, stageType}
41121
+ ____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage = stage, stageType = stageType}
41108
41122
  end
41109
41123
  self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
41110
41124
  end
@@ -41243,22 +41257,12 @@ function StageHistory.prototype.hasVisitedStage(self, stage, stageType)
41243
41257
  if stageType == nil then
41244
41258
  return __TS__ArraySome(
41245
41259
  v.run.stageHistory,
41246
- function(____, ____bindingPattern0)
41247
- local previousStage
41248
- previousStage = ____bindingPattern0[1]
41249
- return previousStage == stage
41250
- end
41260
+ function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage end
41251
41261
  )
41252
41262
  end
41253
41263
  return __TS__ArraySome(
41254
41264
  v.run.stageHistory,
41255
- function(____, ____bindingPattern0)
41256
- local previousStageType
41257
- local previousStage
41258
- previousStage = ____bindingPattern0[1]
41259
- previousStageType = ____bindingPattern0[2]
41260
- return previousStage == stage and previousStageType == stageType
41261
- end
41265
+ function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage and stageHistoryEntry.stageType == stageType end
41262
41266
  )
41263
41267
  end
41264
41268
  __TS__Decorate({Exported}, StageHistory.prototype, "getNextStageTypeWithHistory", true)
@@ -46252,7 +46256,7 @@ function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
46252
46256
  end
46253
46257
  local collectible = ____exports.spawnCollectibleUnsafe(
46254
46258
  nil,
46255
- CollectibleType.SAD_ONION,
46259
+ CollectibleType.BROKEN_SHOVEL_1,
46256
46260
  positionOrGridIndex,
46257
46261
  seedOrRNG,
46258
46262
  false,
@@ -47236,7 +47240,7 @@ function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
47236
47240
  if not ____exports.isDeadEnd(nil, adjacentRoomGridIndex) then
47237
47241
  goto __continue17
47238
47242
  end
47239
- roomCandidates[#roomCandidates + 1] = {doorSlot, adjacentRoomGridIndex}
47243
+ roomCandidates[#roomCandidates + 1] = {doorSlot = doorSlot, roomGridIndex = adjacentRoomGridIndex}
47240
47244
  end
47241
47245
  ::__continue17::
47242
47246
  end
@@ -47252,9 +47256,9 @@ function ____exports.getNewRoomCandidatesForLevel(self)
47252
47256
  for ____, room in ipairs(normalRooms) do
47253
47257
  local newRoomCandidatesBesideRoom = ____exports.getNewRoomCandidatesBesideRoom(nil, room.SafeGridIndex)
47254
47258
  for ____, ____value in ipairs(newRoomCandidatesBesideRoom) do
47255
- local doorSlot = ____value[1]
47256
- local newRoomGridIndex = ____value[2]
47257
- newRoomCandidates[#newRoomCandidates + 1] = {room.SafeGridIndex, doorSlot, newRoomGridIndex}
47259
+ local doorSlot = ____value.doorSlot
47260
+ local roomGridIndex = ____value.roomGridIndex
47261
+ newRoomCandidates[#newRoomCandidates + 1] = {adjacentRoomGridIndex = room.SafeGridIndex, doorSlot = doorSlot, newRoomGridIndex = roomGridIndex}
47258
47262
  end
47259
47263
  end
47260
47264
  return newRoomCandidates
@@ -47408,7 +47412,9 @@ function ____exports.newRoom(self, seedOrRNG)
47408
47412
  if newRoomCandidate == nil then
47409
47413
  return nil
47410
47414
  end
47411
- local adjacentRoomGridIndex, doorSlot, newRoomGridIndex = table.unpack(newRoomCandidate)
47415
+ local adjacentRoomGridIndex = newRoomCandidate.adjacentRoomGridIndex
47416
+ local doorSlot = newRoomCandidate.doorSlot
47417
+ local newRoomGridIndex = newRoomCandidate.newRoomGridIndex
47412
47418
  level:MakeRedRoomDoor(adjacentRoomGridIndex, doorSlot)
47413
47419
  local roomDescriptor = getRoomDescriptor(nil, newRoomGridIndex)
47414
47420
  roomDescriptor.Flags = removeFlag(nil, roomDescriptor.Flags, RoomDescriptorFlag.RED_ROOM)
@@ -50369,7 +50375,7 @@ local ____playerIndex = require("src.functions.playerIndex")
50369
50375
  local getPlayerIndex = ____playerIndex.getPlayerIndex
50370
50376
  local ____Feature = require("src.classes.private.Feature")
50371
50377
  local Feature = ____Feature.Feature
50372
- local v = {run = {buttonActionTuples = {}}}
50378
+ local v = {run = {buttonActionPairs = {}}}
50373
50379
  ____exports.PressInput = __TS__Class()
50374
50380
  local PressInput = ____exports.PressInput
50375
50381
  PressInput.name = "PressInput"
@@ -50387,12 +50393,11 @@ function PressInput.prototype.____constructor(self)
50387
50393
  end
50388
50394
  local playerIndex = getPlayerIndex(nil, player)
50389
50395
  do
50390
- local i = #v.run.buttonActionTuples - 1
50396
+ local i = #v.run.buttonActionPairs - 1
50391
50397
  while i >= 0 do
50392
- local tuple = v.run.buttonActionTuples[i + 1]
50393
- local tuplePlayerIndex, tupleButtonAction = table.unpack(tuple)
50394
- if tuplePlayerIndex == playerIndex and tupleButtonAction == buttonAction then
50395
- __TS__ArraySplice(v.run.buttonActionTuples, i)
50398
+ local pair = v.run.buttonActionPairs[i + 1]
50399
+ if pair.playerIndex == playerIndex and pair.buttonAction == buttonAction then
50400
+ __TS__ArraySplice(v.run.buttonActionPairs, i)
50396
50401
  return true
50397
50402
  end
50398
50403
  i = i - 1
@@ -50404,8 +50409,8 @@ function PressInput.prototype.____constructor(self)
50404
50409
  end
50405
50410
  function PressInput.prototype.pressInput(self, player, buttonAction)
50406
50411
  local playerIndex = getPlayerIndex(nil, player)
50407
- local ____v_run_buttonActionTuples_0 = v.run.buttonActionTuples
50408
- ____v_run_buttonActionTuples_0[#____v_run_buttonActionTuples_0 + 1] = {playerIndex, buttonAction}
50412
+ local ____v_run_buttonActionPairs_0 = v.run.buttonActionPairs
50413
+ ____v_run_buttonActionPairs_0[#____v_run_buttonActionPairs_0 + 1] = {playerIndex = playerIndex, buttonAction = buttonAction}
50409
50414
  end
50410
50415
  __TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
50411
50416
  return ____exports
@@ -1440,6 +1440,20 @@ do
1440
1440
  end
1441
1441
  end
1442
1442
 
1443
+ local function __TS__NumberToFixed(self, fractionDigits)
1444
+ if math.abs(self) >= 1e+21 or self ~= self then
1445
+ return tostring(self)
1446
+ end
1447
+ local f = math.floor(fractionDigits or 0)
1448
+ if f < 0 or f > 99 then
1449
+ error("toFixed() digits argument must be between 0 and 99", 0)
1450
+ end
1451
+ return string.format(
1452
+ ("%." .. tostring(f)) .. "f",
1453
+ self
1454
+ )
1455
+ end
1456
+
1443
1457
  local function __TS__ObjectDefineProperty(target, key, desc)
1444
1458
  local luaKey = type(key) == "number" and key + 1 or key
1445
1459
  local value = rawget(target, luaKey)
@@ -2412,6 +2426,7 @@ return {
2412
2426
  __TS__NumberIsFinite = __TS__NumberIsFinite,
2413
2427
  __TS__NumberIsNaN = __TS__NumberIsNaN,
2414
2428
  __TS__NumberToString = __TS__NumberToString,
2429
+ __TS__NumberToFixed = __TS__NumberToFixed,
2415
2430
  __TS__ObjectAssign = __TS__ObjectAssign,
2416
2431
  __TS__ObjectDefineProperty = __TS__ObjectDefineProperty,
2417
2432
  __TS__ObjectEntries = __TS__ObjectEntries,
@@ -112,10 +112,10 @@ export declare class CustomGridEntities extends Feature {
112
112
  * In order to use this function, you must upgrade your mod with
113
113
  * `ISCFeature.CUSTOM_GRID_ENTITIES`.
114
114
  */
115
- getCustomGridEntities(): Array<[
116
- gridEntity: GridEntity,
117
- data: GridEntityCustomData
118
- ]>;
115
+ getCustomGridEntities(): Array<{
116
+ gridEntity: GridEntity;
117
+ data: GridEntityCustomData;
118
+ }>;
119
119
  /**
120
120
  * Helper function to get the custom `GridEntityType` from a `GridEntity` or grid index. Returns
121
121
  * undefined if the provided `GridEntity` is not a custom grid entity, or if there was not a grid
@@ -1 +1 @@
1
- {"version":3,"file":"CustomGridEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/CustomGridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiBhD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,YAAY,CAAe;IA0BnC,OAAO,CAAC,0BAA0B,CA+ChC;IAGF,OAAO,CAAC,oBAAoB,CA4B1B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IAEI,qBAAqB,CAC1B,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU;IA8Cb;;;;;;;;;;;;;;;;;OAiBG;IAEI,sBAAsB,CAC3B,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS;IAuCzB;;;;;;OAMG;IAEI,qBAAqB,IAAI,KAAK,CACnC;QAAC,UAAU,EAAE,UAAU;QAAE,IAAI,EAAE,oBAAoB;KAAC,CACrD;IAoBD;;;;;;;OAOG;IAEI,uBAAuB,CAC5B,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS;IAyB7B;;;;;;OAMG;IAEI,kBAAkB,CAAC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO;CAM5E"}
1
+ {"version":3,"file":"CustomGridEntities.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/callbackLogic/CustomGridEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAatC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAiBhD,qBAAa,kBAAmB,SAAQ,OAAO;IAI7C,OAAO,CAAC,YAAY,CAAe;IA0BnC,OAAO,CAAC,0BAA0B,CA+ChC;IAGF,OAAO,CAAC,oBAAoB,CA4B1B;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IAEI,qBAAqB,CAC1B,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,CAAC,EAAE,kBAAkB,EACvC,QAAQ,CAAC,EAAE,MAAM,EACjB,gBAAgB,CAAC,EAAE,MAAM,EACzB,kBAAkB,iBAA4B,EAC9C,qBAAqB,SAAI,GACxB,UAAU;IA8Cb;;;;;;;;;;;;;;;;;OAiBG;IAEI,sBAAsB,CAC3B,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS;IAuCzB;;;;;;OAMG;IAEI,qBAAqB,IAAI,KAAK,CAAC;QACpC,UAAU,EAAE,UAAU,CAAC;QACvB,IAAI,EAAE,oBAAoB,CAAC;KAC5B,CAAC;IAuBF;;;;;;;OAOG;IAEI,uBAAuB,CAC5B,qBAAqB,EAAE,UAAU,GAAG,GAAG,GACtC,cAAc,GAAG,SAAS;IAyB7B;;;;;;OAMG;IAEI,kBAAkB,CAAC,qBAAqB,EAAE,UAAU,GAAG,GAAG,GAAG,OAAO;CAM5E"}
@@ -193,7 +193,7 @@ function CustomGridEntities.prototype.getCustomGridEntities(self)
193
193
  local data = ____value[2]
194
194
  local gridEntity = room:GetGridEntity(gridIndex)
195
195
  if gridEntity ~= nil then
196
- customGridEntities[#customGridEntities + 1] = {gridEntity, data}
196
+ customGridEntities[#customGridEntities + 1] = {gridEntity = gridEntity, data = data}
197
197
  end
198
198
  end
199
199
  return customGridEntities
@@ -1 +1 @@
1
- {"version":3,"file":"PressInput.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PressInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,UAAW,SAAQ,OAAO;IAoBrC,OAAO,CAAC,iBAAiB,CA+BvB;IAEF;;;;;;OAMG;IAEI,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CAI1E"}
1
+ {"version":3,"file":"PressInput.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/PressInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAWhD,qBAAa,UAAW,SAAQ,OAAO;IAoBrC,OAAO,CAAC,iBAAiB,CA8BvB;IAEF;;;;;;OAMG;IAEI,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;CAI1E"}
@@ -13,7 +13,7 @@ local ____playerIndex = require("src.functions.playerIndex")
13
13
  local getPlayerIndex = ____playerIndex.getPlayerIndex
14
14
  local ____Feature = require("src.classes.private.Feature")
15
15
  local Feature = ____Feature.Feature
16
- local v = {run = {buttonActionTuples = {}}}
16
+ local v = {run = {buttonActionPairs = {}}}
17
17
  ____exports.PressInput = __TS__Class()
18
18
  local PressInput = ____exports.PressInput
19
19
  PressInput.name = "PressInput"
@@ -31,12 +31,11 @@ function PressInput.prototype.____constructor(self)
31
31
  end
32
32
  local playerIndex = getPlayerIndex(nil, player)
33
33
  do
34
- local i = #v.run.buttonActionTuples - 1
34
+ local i = #v.run.buttonActionPairs - 1
35
35
  while i >= 0 do
36
- local tuple = v.run.buttonActionTuples[i + 1]
37
- local tuplePlayerIndex, tupleButtonAction = table.unpack(tuple)
38
- if tuplePlayerIndex == playerIndex and tupleButtonAction == buttonAction then
39
- __TS__ArraySplice(v.run.buttonActionTuples, i)
36
+ local pair = v.run.buttonActionPairs[i + 1]
37
+ if pair.playerIndex == playerIndex and pair.buttonAction == buttonAction then
38
+ __TS__ArraySplice(v.run.buttonActionPairs, i)
40
39
  return true
41
40
  end
42
41
  i = i - 1
@@ -48,8 +47,8 @@ function PressInput.prototype.____constructor(self)
48
47
  end
49
48
  function PressInput.prototype.pressInput(self, player, buttonAction)
50
49
  local playerIndex = getPlayerIndex(nil, player)
51
- local ____v_run_buttonActionTuples_0 = v.run.buttonActionTuples
52
- ____v_run_buttonActionTuples_0[#____v_run_buttonActionTuples_0 + 1] = {playerIndex, buttonAction}
50
+ local ____v_run_buttonActionPairs_0 = v.run.buttonActionPairs
51
+ ____v_run_buttonActionPairs_0[#____v_run_buttonActionPairs_0 + 1] = {playerIndex = playerIndex, buttonAction = buttonAction}
53
52
  end
54
53
  __TS__Decorate({Exported}, PressInput.prototype, "pressInput", true)
55
54
  return ____exports
@@ -1,4 +1,5 @@
1
1
  import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ import { StageHistoryEntry } from "../../../interfaces/StageHistoryEntry";
2
3
  import { Feature } from "../../private/Feature";
3
4
  export declare class StageHistory extends Feature {
4
5
  private postNewLevelReordered;
@@ -32,10 +33,7 @@ export declare class StageHistory extends Feature {
32
33
  *
33
34
  * In order to use this function, you must upgrade your mod with `ISCFeature.STAGE_HISTORY`.
34
35
  */
35
- getStageHistory(): ReadonlyArray<[
36
- stage: LevelStage,
37
- stageType: StageType
38
- ]>;
36
+ getStageHistory(): readonly StageHistoryEntry[];
39
37
  /**
40
38
  * Helper function to check if a player has previous visited a particular stage (or stage + stage
41
39
  * type combination) on this run.
@@ -1 +1 @@
1
- {"version":3,"file":"StageHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/StageHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,YAAa,SAAQ,OAAO;IAcvC,OAAO,CAAC,qBAAqB,CAM3B;IAEF;;;;;;;;;;;;OAYG;IAEI,2BAA2B,CAAC,OAAO,UAAQ,GAAG,SAAS;IAiG9D;;;;;;;;;OASG;IAEI,uBAAuB,IAAI,UAAU;IA8H5C;;;;OAIG;IAEI,eAAe,IAAI,aAAa,CACrC;QAAC,KAAK,EAAE,UAAU;QAAE,SAAS,EAAE,SAAS;KAAC,CAC1C;IAID;;;;;;;;;OASG;IAEI,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;CAY1E"}
1
+ {"version":3,"file":"StageHistory.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/StageHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAUtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,YAAa,SAAQ,OAAO;IAcvC,OAAO,CAAC,qBAAqB,CAM3B;IAEF;;;;;;;;;;;;OAYG;IAEI,2BAA2B,CAAC,OAAO,UAAQ,GAAG,SAAS;IAiG9D;;;;;;;;;OASG;IAEI,uBAAuB,IAAI,UAAU;IA8H5C;;;;OAIG;IAEI,eAAe,IAAI,SAAS,iBAAiB,EAAE;IAItD;;;;;;;;;OASG;IAEI,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;CAa1E"}
@@ -37,7 +37,7 @@ function StageHistory.prototype.____constructor(self)
37
37
  local stage = level:GetStage()
38
38
  local stageType = level:GetStageType()
39
39
  local ____v_run_stageHistory_0 = v.run.stageHistory
40
- ____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage, stageType}
40
+ ____v_run_stageHistory_0[#____v_run_stageHistory_0 + 1] = {stage = stage, stageType = stageType}
41
41
  end
42
42
  self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_LEVEL_REORDERED, self.postNewLevelReordered}}
43
43
  end
@@ -176,22 +176,12 @@ function StageHistory.prototype.hasVisitedStage(self, stage, stageType)
176
176
  if stageType == nil then
177
177
  return __TS__ArraySome(
178
178
  v.run.stageHistory,
179
- function(____, ____bindingPattern0)
180
- local previousStage
181
- previousStage = ____bindingPattern0[1]
182
- return previousStage == stage
183
- end
179
+ function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage end
184
180
  )
185
181
  end
186
182
  return __TS__ArraySome(
187
183
  v.run.stageHistory,
188
- function(____, ____bindingPattern0)
189
- local previousStageType
190
- local previousStage
191
- previousStage = ____bindingPattern0[1]
192
- previousStageType = ____bindingPattern0[2]
193
- return previousStage == stage and previousStageType == stageType
194
- end
184
+ function(____, stageHistoryEntry) return stageHistoryEntry.stage == stage and stageHistoryEntry.stageType == stageType end
195
185
  )
196
186
  end
197
187
  __TS__Decorate({Exported}, StageHistory.prototype, "getNextStageTypeWithHistory", true)