isaacscript-common 21.8.4 → 22.0.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.
@@ -1292,6 +1292,16 @@ export declare function clearCollectibleSprite(collectible: EntityPickup): void;
1292
1292
  */
1293
1293
  export declare function clearFloorDisplayFlags(): void;
1294
1294
 
1295
+ /**
1296
+ * Helper function to set the value of `DisplayFlag` for a room 0.
1297
+ *
1298
+ * This function automatically accounts for whether or not MinimapAPI is being used.
1299
+ *
1300
+ * This function automatically calls the `Level.UpdateVisibility` after setting the flags so that
1301
+ * the changes will be immediately visible.
1302
+ */
1303
+ export declare function clearRoomDisplayFlags(roomGridIndex: int): void;
1304
+
1295
1305
  /**
1296
1306
  * Helper function to clear all layers or specific layers from a sprite without unloading the
1297
1307
  * attached anm2 file.
@@ -3866,7 +3876,7 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
3866
3876
  * @param minimumDistance Optional. If specified, will ensure that the randomly generated position
3867
3877
  * is equal to or greater than the distance provided.
3868
3878
  */
3869
- export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
3879
+ export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Readonly<Vector>;
3870
3880
 
3871
3881
  declare type FireArgs<T extends ModCallbackCustom> = Parameters<AddCallbackParametersCustom[T][0]>;
3872
3882
 
@@ -5101,7 +5111,7 @@ export declare function getHorsePillColors(): PillColor[];
5101
5111
  * - If the user does not have a HUD offset configured, this function will return `Vector(0, 0)`.
5102
5112
  * - If the user has a HUD offset of 1.0 configured, this function will return `Vector(20, 12)`.
5103
5113
  */
5104
- export declare function getHUDOffsetVector(): Vector;
5114
+ export declare function getHUDOffsetVector(): Readonly<Vector>;
5105
5115
 
5106
5116
  /**
5107
5117
  * Helper function to get the name of a class from the Isaac API. This is contained within the
@@ -5861,7 +5871,7 @@ export declare function getRandomArrayIndex<T>(array: T[] | readonly T[], seedOr
5861
5871
  * `RNG.Next` method will be called. Default is `getRandomSeed()`.
5862
5872
  * @param alpha Optional. The alpha value to use. Default is 1.
5863
5873
  */
5864
- export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Color;
5874
+ export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<Color>;
5865
5875
 
5866
5876
  /**
5867
5877
  * Helper function to get a random value from the provided enum.
@@ -5975,7 +5985,7 @@ export declare function getRandomJSONRoom(jsonRooms: JSONRoom[], seedOrRNG?: See
5975
5985
  * `RNG.Next` method will be called. Default is `getRandomSeed()`.
5976
5986
  * @param alpha Optional. The alpha value to use. Default is 1.
5977
5987
  */
5978
- export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): KColor;
5988
+ export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<KColor>;
5979
5989
 
5980
5990
  /**
5981
5991
  * Helper function to get a random `Seed` value to be used in spawning entities and so on. Use this
@@ -6004,7 +6014,7 @@ export declare function getRandomSetElement<T>(set: Set<T> | ReadonlySet<T>, see
6004
6014
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
6005
6015
  * `RNG.Next` method will be called. Default is `getRandomSeed()`.
6006
6016
  */
6007
- export declare function getRandomVector(seedOrRNG?: Seed | RNG): Vector;
6017
+ export declare function getRandomVector(seedOrRNG?: Seed | RNG): Readonly<Vector>;
6008
6018
 
6009
6019
  /**
6010
6020
  * Helper function to get a read-only copy of the room descriptor for every room on the level. This
@@ -6433,19 +6443,19 @@ export declare function getRoomVisitedCount(roomGridIndex?: int): int;
6433
6443
  */
6434
6444
  export declare function getSacks(sackSubType?: SackSubType): EntityPickupSack[];
6435
6445
 
6436
- export declare function getScreenBottomCenterPos(): Vector;
6446
+ export declare function getScreenBottomCenterPos(): Readonly<Vector>;
6437
6447
 
6438
- export declare function getScreenBottomLeftPos(): Vector;
6448
+ export declare function getScreenBottomLeftPos(): Readonly<Vector>;
6439
6449
 
6440
- export declare function getScreenBottomRightPos(): Vector;
6450
+ export declare function getScreenBottomRightPos(): Readonly<Vector>;
6441
6451
 
6442
- export declare function getScreenCenterPos(): Vector;
6452
+ export declare function getScreenCenterPos(): Readonly<Vector>;
6443
6453
 
6444
- export declare function getScreenTopCenterPos(): Vector;
6454
+ export declare function getScreenTopCenterPos(): Readonly<Vector>;
6445
6455
 
6446
- export declare function getScreenTopLeftPos(): Vector;
6456
+ export declare function getScreenTopLeftPos(): Readonly<Vector>;
6447
6457
 
6448
- export declare function getScreenTopRightPos(): Vector;
6458
+ export declare function getScreenTopRightPos(): Readonly<Vector>;
6449
6459
 
6450
6460
  /**
6451
6461
  * Helper function to get all possible combinations of the given set. This includes the combination
@@ -6807,7 +6817,7 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
6807
6817
  *
6808
6818
  * For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
6809
6819
  */
6810
- export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector;
6820
+ export declare function gridCoordinatesToWorldPosition(x: int, y: int): Readonly<Vector>;
6811
6821
 
6812
6822
  declare class GridEntityCollisionDetection extends Feature {
6813
6823
  v: {
@@ -6899,14 +6909,14 @@ declare class GridEntityUpdateDetection extends Feature {
6899
6909
  * For example, in a 1x1 room, grid index 0 is equal to "Vector(-1, -1) and grid index 16 is equal
6900
6910
  * to "Vector(0, 0)".
6901
6911
  */
6902
- export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Vector;
6912
+ export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Readonly<Vector>;
6903
6913
 
6904
6914
  /**
6905
6915
  * Helper function to convert a grid position `Vector` to a world position `Vector`.
6906
6916
  *
6907
6917
  * For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
6908
6918
  */
6909
- export declare function gridPositionToWorldPosition(gridPosition: Vector): Vector;
6919
+ export declare function gridPositionToWorldPosition(gridPosition: Vector): Readonly<Vector>;
6910
6920
 
6911
6921
  /**
6912
6922
  * Helper function to see if a particular entity has armor. In this context, armor refers to the
@@ -7005,7 +7015,7 @@ export declare enum HealthType {
7005
7015
  * @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
7006
7016
  * @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
7007
7017
  */
7008
- export declare function hexToColor(hexString: string, alpha?: number): Color;
7018
+ export declare function hexToColor(hexString: string, alpha?: number): Readonly<Color>;
7009
7019
 
7010
7020
  /**
7011
7021
  * Converts a hex string like "#33aa33" to a Color object.
@@ -7013,7 +7023,7 @@ export declare function hexToColor(hexString: string, alpha?: number): Color;
7013
7023
  * @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
7014
7024
  * @param alpha Range is from 0 to 1. Default is 1.
7015
7025
  */
7016
- export declare function hexToKColor(hexString: string, alpha?: number): KColor;
7026
+ export declare function hexToKColor(hexString: string, alpha?: number): Readonly<KColor>;
7017
7027
 
7018
7028
  /**
7019
7029
  * Helper type to make the given array/map/set/object recursively read-only.
@@ -8607,7 +8617,7 @@ export declare function lockDoor(door: GridEntityDoor): void;
8607
8617
  * @param includeParentFunction Optional. Whether to prefix the message with the function name and
8608
8618
  * line number, as shown in the above example. Default is true.
8609
8619
  */
8610
- export declare function log(this: void, msg: string, includeParentFunction?: boolean): void;
8620
+ export declare function log(this: void, msg: string | number, includeParentFunction?: boolean): void;
8611
8621
 
8612
8622
  /** Helper function for printing out every entity (or filtered entity) in the current room. */
8613
8623
  export declare function logAllEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void;
@@ -14377,16 +14387,6 @@ export declare function setRoomDisplayFlags(roomGridIndex: int | undefined, disp
14377
14387
  */
14378
14388
  export declare function setRoomUncleared(): void;
14379
14389
 
14380
- /**
14381
- * Helper function to make a single room visible in a similar way to how the Compass makes a Boss
14382
- * Room visible (e.g. by adding `DisplayFlag.SHOW_ICON`).
14383
- *
14384
- * @param roomGridIndex Set to undefined to use the current room index.
14385
- * @param updateVisibility Optional. Whether to call the `Level.UpdateVisibility` method in order to
14386
- * make the changes immediately visible. Default is true.
14387
- */
14388
- export declare function setRoomVisible(roomGridIndex: int | undefined, updateVisibility?: boolean): void;
14389
-
14390
14390
  /** Helper function to set a seed to an RNG object using Blade's recommended shift index. */
14391
14391
  export declare function setSeed(rng: RNG, seed: Seed): void;
14392
14392
 
@@ -15651,7 +15651,7 @@ export declare function willReviveFromSpiritShackles(player: EntityPlayer): bool
15651
15651
  *
15652
15652
  * In this context, the grid position of the top-left wall is "Vector(-1, -1)".
15653
15653
  */
15654
- export declare function worldPositionToGridPosition(worldPos: Vector): Vector;
15654
+ export declare function worldPositionToGridPosition(worldPos: Vector): Readonly<Vector>;
15655
15655
 
15656
15656
  /**
15657
15657
  * Helper function to convert a world position `Vector` to a grid position `Vector`.
@@ -15660,7 +15660,7 @@ export declare function worldPositionToGridPosition(worldPos: Vector): Vector;
15660
15660
  *
15661
15661
  * This is similar to the `worldPositionToGridPosition` function, but the values are not rounded.
15662
15662
  */
15663
- export declare function worldPositionToGridPositionFast(worldPos: Vector): Vector;
15663
+ export declare function worldPositionToGridPositionFast(worldPos: Vector): Readonly<Vector>;
15664
15664
 
15665
15665
  /**
15666
15666
  * Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 21.8.4
3
+ isaacscript-common 22.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -813,13 +813,7 @@ local function __TS__AsyncAwaiter(generator)
813
813
  function(____, resolve, reject)
814
814
  local adopt, fulfilled, step, resolved, asyncCoroutine
815
815
  function adopt(self, value)
816
- local ____temp_0
817
- if __TS__InstanceOf(value, __TS__Promise) then
818
- ____temp_0 = value
819
- else
820
- ____temp_0 = __TS__Promise.resolve(value)
821
- end
822
- return ____temp_0
816
+ return __TS__InstanceOf(value, __TS__Promise) and value or __TS__Promise.resolve(value)
823
817
  end
824
818
  function fulfilled(self, value)
825
819
  local success, resultOrError = coroutine.resume(asyncCoroutine, value)
@@ -836,8 +830,8 @@ local function __TS__AsyncAwaiter(generator)
836
830
  if coroutine.status(asyncCoroutine) == "dead" then
837
831
  resolve(nil, result)
838
832
  else
839
- local ____self_1 = adopt(nil, result)
840
- ____self_1["then"](____self_1, fulfilled, reject)
833
+ local ____self_0 = adopt(nil, result)
834
+ ____self_0["then"](____self_0, fulfilled, reject)
841
835
  end
842
836
  end
843
837
  resolved = false
@@ -846,8 +840,8 @@ local function __TS__AsyncAwaiter(generator)
846
840
  asyncCoroutine,
847
841
  function(____, v)
848
842
  resolved = true
849
- local ____self_2 = adopt(nil, v)
850
- ____self_2["then"](____self_2, resolve, reject)
843
+ local ____self_1 = adopt(nil, v)
844
+ ____self_1["then"](____self_1, resolve, reject)
851
845
  end
852
846
  )
853
847
  if success then
@@ -954,7 +948,7 @@ do
954
948
  local descriptors = rawget(metatable, "_descriptors")
955
949
  if descriptors then
956
950
  local descriptor = descriptors[key]
957
- if descriptor then
951
+ if descriptor ~= nil then
958
952
  if descriptor.get then
959
953
  return descriptor.get(self)
960
954
  end
@@ -970,7 +964,7 @@ do
970
964
  local descriptors = rawget(metatable, "_descriptors")
971
965
  if descriptors then
972
966
  local descriptor = descriptors[key]
973
- if descriptor then
967
+ if descriptor ~= nil then
974
968
  if descriptor.set then
975
969
  descriptor.set(self, value)
976
970
  else
@@ -1023,7 +1017,7 @@ local function __TS__Decorate(decorators, target, key, desc)
1023
1017
  local i = #decorators
1024
1018
  while i >= 0 do
1025
1019
  local decorator = decorators[i + 1]
1026
- if decorator then
1020
+ if decorator ~= nil then
1027
1021
  local oldResult = result
1028
1022
  if key == nil then
1029
1023
  result = decorator(nil, result)
@@ -1096,7 +1090,7 @@ do
1096
1090
  if isClassicLua or caller and caller.func ~= error then
1097
1091
  return description
1098
1092
  else
1099
- return (tostring(description) .. "\n") .. self.stack
1093
+ return (description .. "\n") .. tostring(self.stack)
1100
1094
  end
1101
1095
  end
1102
1096
  end
@@ -1107,7 +1101,7 @@ do
1107
1101
  {__call = function(____, _self, message) return __TS__New(Type, message) end}
1108
1102
  )
1109
1103
  end
1110
- local ____initErrorClass_2 = initErrorClass
1104
+ local ____initErrorClass_1 = initErrorClass
1111
1105
  local ____class_0 = __TS__Class()
1112
1106
  ____class_0.name = ""
1113
1107
  function ____class_0.prototype.____constructor(self, message)
@@ -1118,31 +1112,25 @@ do
1118
1112
  self.name = "Error"
1119
1113
  self.stack = getErrorStack(nil, self.constructor.new)
1120
1114
  local metatable = getmetatable(self)
1121
- if not metatable.__errorToStringPatched then
1115
+ if metatable and not metatable.__errorToStringPatched then
1122
1116
  metatable.__errorToStringPatched = true
1123
1117
  metatable.__tostring = wrapErrorToString(nil, metatable.__tostring)
1124
1118
  end
1125
1119
  end
1126
1120
  function ____class_0.prototype.__tostring(self)
1127
- local ____temp_1
1128
- if self.message ~= "" then
1129
- ____temp_1 = (self.name .. ": ") .. self.message
1130
- else
1131
- ____temp_1 = self.name
1132
- end
1133
- return ____temp_1
1121
+ return self.message ~= "" and (self.name .. ": ") .. self.message or self.name
1134
1122
  end
1135
- Error = ____initErrorClass_2(nil, ____class_0, "Error")
1123
+ Error = ____initErrorClass_1(nil, ____class_0, "Error")
1136
1124
  local function createErrorClass(self, name)
1137
- local ____initErrorClass_4 = initErrorClass
1138
- local ____class_3 = __TS__Class()
1139
- ____class_3.name = ____class_3.name
1140
- __TS__ClassExtends(____class_3, Error)
1141
- function ____class_3.prototype.____constructor(self, ...)
1142
- ____class_3.____super.prototype.____constructor(self, ...)
1125
+ local ____initErrorClass_3 = initErrorClass
1126
+ local ____class_2 = __TS__Class()
1127
+ ____class_2.name = ____class_2.name
1128
+ __TS__ClassExtends(____class_2, Error)
1129
+ function ____class_2.prototype.____constructor(self, ...)
1130
+ ____class_2.____super.prototype.____constructor(self, ...)
1143
1131
  self.name = name
1144
1132
  end
1145
- return ____initErrorClass_4(nil, ____class_3, name)
1133
+ return ____initErrorClass_3(nil, ____class_2, name)
1146
1134
  end
1147
1135
  RangeError = createErrorClass(nil, "RangeError")
1148
1136
  ReferenceError = createErrorClass(nil, "ReferenceError")
@@ -1312,13 +1300,13 @@ do
1312
1300
  self.size = self.size - 1
1313
1301
  local next = self.nextKey[key]
1314
1302
  local previous = self.previousKey[key]
1315
- if next and previous then
1303
+ if next ~= nil and previous ~= nil then
1316
1304
  self.nextKey[previous] = next
1317
1305
  self.previousKey[next] = previous
1318
- elseif next then
1306
+ elseif next ~= nil then
1319
1307
  self.firstKey = next
1320
1308
  self.previousKey[next] = nil
1321
- elseif previous then
1309
+ elseif previous ~= nil then
1322
1310
  self.lastKey = previous
1323
1311
  self.nextKey[previous] = nil
1324
1312
  else
@@ -1504,13 +1492,7 @@ do
1504
1492
  end
1505
1493
 
1506
1494
  local function __TS__ObjectDefineProperty(target, key, desc)
1507
- local ____temp_0
1508
- if type(key) == "number" then
1509
- ____temp_0 = key + 1
1510
- else
1511
- ____temp_0 = key
1512
- end
1513
- local luaKey = ____temp_0
1495
+ local luaKey = type(key) == "number" and key + 1 or key
1514
1496
  local value = rawget(target, luaKey)
1515
1497
  local hasGetterOrSetter = desc.get ~= nil or desc.set ~= nil
1516
1498
  local descriptor
@@ -1524,39 +1506,39 @@ local function __TS__ObjectDefineProperty(target, key, desc)
1524
1506
  descriptor = desc
1525
1507
  else
1526
1508
  local valueExists = value ~= nil
1527
- local ____desc_set_5 = desc.set
1528
- local ____desc_get_6 = desc.get
1529
- local ____temp_1
1509
+ local ____desc_set_4 = desc.set
1510
+ local ____desc_get_5 = desc.get
1511
+ local ____temp_0
1530
1512
  if desc.configurable ~= nil then
1531
- ____temp_1 = desc.configurable
1513
+ ____temp_0 = desc.configurable
1532
1514
  else
1533
- ____temp_1 = valueExists
1515
+ ____temp_0 = valueExists
1534
1516
  end
1535
- local ____temp_2
1517
+ local ____temp_1
1536
1518
  if desc.enumerable ~= nil then
1537
- ____temp_2 = desc.enumerable
1519
+ ____temp_1 = desc.enumerable
1538
1520
  else
1539
- ____temp_2 = valueExists
1521
+ ____temp_1 = valueExists
1540
1522
  end
1541
- local ____temp_3
1523
+ local ____temp_2
1542
1524
  if desc.writable ~= nil then
1543
- ____temp_3 = desc.writable
1525
+ ____temp_2 = desc.writable
1544
1526
  else
1545
- ____temp_3 = valueExists
1527
+ ____temp_2 = valueExists
1546
1528
  end
1547
- local ____temp_4
1529
+ local ____temp_3
1548
1530
  if desc.value ~= nil then
1549
- ____temp_4 = desc.value
1531
+ ____temp_3 = desc.value
1550
1532
  else
1551
- ____temp_4 = value
1533
+ ____temp_3 = value
1552
1534
  end
1553
1535
  descriptor = {
1554
- set = ____desc_set_5,
1555
- get = ____desc_get_6,
1556
- configurable = ____temp_1,
1557
- enumerable = ____temp_2,
1558
- writable = ____temp_3,
1559
- value = ____temp_4
1536
+ set = ____desc_set_4,
1537
+ get = ____desc_get_5,
1538
+ configurable = ____temp_0,
1539
+ enumerable = ____temp_1,
1540
+ writable = ____temp_2,
1541
+ value = ____temp_3
1560
1542
  }
1561
1543
  end
1562
1544
  __TS__SetDescriptor(target, luaKey, descriptor)
@@ -1626,14 +1608,8 @@ end
1626
1608
 
1627
1609
  local function __TS__ParseFloat(numberString)
1628
1610
  local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
1629
- if infinityMatch then
1630
- local ____temp_0
1631
- if __TS__StringAccess(infinityMatch, 0) == "-" then
1632
- ____temp_0 = -math.huge
1633
- else
1634
- ____temp_0 = math.huge
1635
- end
1636
- return ____temp_0
1611
+ if infinityMatch ~= nil then
1612
+ return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
1637
1613
  end
1638
1614
  local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
1639
1615
  return number or 0 / 0
@@ -1664,27 +1640,15 @@ do
1664
1640
  if base == nil then
1665
1641
  base = 10
1666
1642
  local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
1667
- if hexMatch then
1643
+ if hexMatch ~= nil then
1668
1644
  base = 16
1669
- local ____TS__Match_result__0_0
1670
- if __TS__Match(hexMatch, "-") then
1671
- ____TS__Match_result__0_0 = "-" .. __TS__StringSubstring(numberString, #hexMatch)
1672
- else
1673
- ____TS__Match_result__0_0 = __TS__StringSubstring(numberString, #hexMatch)
1674
- end
1675
- numberString = ____TS__Match_result__0_0
1645
+ numberString = __TS__Match(hexMatch, "-") and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
1676
1646
  end
1677
1647
  end
1678
1648
  if base < 2 or base > 36 then
1679
1649
  return 0 / 0
1680
1650
  end
1681
- local ____temp_1
1682
- if base <= 10 then
1683
- ____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, base)
1684
- else
1685
- ____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
1686
- end
1687
- local allowedDigits = ____temp_1
1651
+ local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
1688
1652
  local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
1689
1653
  local number = tonumber(
1690
1654
  __TS__Match(numberString, pattern),
@@ -1923,13 +1887,13 @@ do
1923
1887
  self.size = self.size - 1
1924
1888
  local next = self.nextKey[value]
1925
1889
  local previous = self.previousKey[value]
1926
- if next and previous then
1890
+ if next ~= nil and previous ~= nil then
1927
1891
  self.nextKey[previous] = next
1928
1892
  self.previousKey[next] = previous
1929
- elseif next then
1893
+ elseif next ~= nil then
1930
1894
  self.firstKey = next
1931
1895
  self.previousKey[next] = nil
1932
- elseif previous then
1896
+ elseif previous ~= nil then
1933
1897
  self.lastKey = previous
1934
1898
  self.nextKey[previous] = nil
1935
1899
  else
@@ -2117,7 +2081,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
2117
2081
  if thread == nil and message == nil and level == nil then
2118
2082
  trace = originalTraceback()
2119
2083
  elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
2120
- trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
2084
+ trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. tostring(message))
2121
2085
  else
2122
2086
  trace = originalTraceback(thread, message, level)
2123
2087
  end
@@ -2126,12 +2090,12 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
2126
2090
  end
2127
2091
  local function replacer(____, file, srcFile, line)
2128
2092
  local fileSourceMap = _G.__TS__sourcemap[file]
2129
- if fileSourceMap and fileSourceMap[line] then
2093
+ if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
2130
2094
  local data = fileSourceMap[line]
2131
2095
  if type(data) == "number" then
2132
2096
  return (srcFile .. ":") .. tostring(data)
2133
2097
  end
2134
- return (tostring(data.file) .. ":") .. tostring(data.line)
2098
+ return (data.file .. ":") .. tostring(data.line)
2135
2099
  end
2136
2100
  return (file .. ":") .. line
2137
2101
  end
@@ -2142,14 +2106,14 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
2142
2106
  )
2143
2107
  local function stringReplacer(____, file, line)
2144
2108
  local fileSourceMap = _G.__TS__sourcemap[file]
2145
- if fileSourceMap and fileSourceMap[line] then
2109
+ if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
2146
2110
  local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
2147
2111
  local sourceName = string.gsub(chunkName, ".lua$", ".ts")
2148
2112
  local data = fileSourceMap[line]
2149
2113
  if type(data) == "number" then
2150
2114
  return (sourceName .. ":") .. tostring(data)
2151
2115
  end
2152
- return (tostring(data.file) .. ":") .. tostring(data.line)
2116
+ return (data.file .. ":") .. tostring(data.line)
2153
2117
  end
2154
2118
  return (file .. ":") .. line
2155
2119
  end
@@ -2269,13 +2233,7 @@ do
2269
2233
  return source
2270
2234
  end
2271
2235
  local before = sub(source, 1, startPos - 1)
2272
- local ____temp_0
2273
- if type(replaceValue) == "string" then
2274
- ____temp_0 = replaceValue
2275
- else
2276
- ____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
2277
- end
2278
- local replacement = ____temp_0
2236
+ local replacement = type(replaceValue) == "string" and replaceValue or replaceValue(nil, searchValue, startPos - 1, source)
2279
2237
  local after = sub(source, endPos + 1)
2280
2238
  return (before .. replacement) .. after
2281
2239
  end
@@ -2430,6 +2388,7 @@ do
2430
2388
  return key
2431
2389
  end
2432
2390
  end
2391
+ return nil
2433
2392
  end
2434
2393
  end
2435
2394
 
@@ -15469,43 +15428,6 @@ function ____exports.shouldFireTrinketType(self, fireArgs, optionalArgs)
15469
15428
  local callbackTrinketType = table.unpack(optionalArgs)
15470
15429
  return callbackTrinketType == nil or callbackTrinketType == trinketType
15471
15430
  end
15472
- return ____exports
15473
- end,
15474
- ["src.functions.log"] = function(...)
15475
- local ____exports = {}
15476
- function ____exports.getParentFunctionDescription(levels)
15477
- if levels == nil then
15478
- levels = 3
15479
- end
15480
- if debug ~= nil then
15481
- local debugTable = debug.getinfo(levels)
15482
- if debugTable ~= nil then
15483
- return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
15484
- end
15485
- end
15486
- if SandboxGetParentFunctionDescription ~= nil then
15487
- return SandboxGetParentFunctionDescription(levels)
15488
- end
15489
- return nil
15490
- end
15491
- function ____exports.log(msg, includeParentFunction)
15492
- if includeParentFunction == nil then
15493
- includeParentFunction = true
15494
- end
15495
- local ____includeParentFunction_0
15496
- if includeParentFunction then
15497
- ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
15498
- else
15499
- ____includeParentFunction_0 = nil
15500
- end
15501
- local parentFunctionDescription = ____includeParentFunction_0
15502
- local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
15503
- Isaac.DebugString(debugMsg)
15504
- end
15505
- function ____exports.logAndPrint(self, msg)
15506
- ____exports.log(msg)
15507
- print(msg)
15508
- end
15509
15431
  return ____exports
15510
15432
  end,
15511
15433
  ["src.functions.types"] = function(...)
@@ -15562,6 +15484,48 @@ end
15562
15484
  function ____exports.isUserdata(self, variable)
15563
15485
  return type(variable) == "userdata"
15564
15486
  end
15487
+ return ____exports
15488
+ end,
15489
+ ["src.functions.log"] = function(...)
15490
+ local ____exports = {}
15491
+ local ____types = require("src.functions.types")
15492
+ local isNumber = ____types.isNumber
15493
+ function ____exports.getParentFunctionDescription(levels)
15494
+ if levels == nil then
15495
+ levels = 3
15496
+ end
15497
+ if debug ~= nil then
15498
+ local debugTable = debug.getinfo(levels)
15499
+ if debugTable ~= nil then
15500
+ return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
15501
+ end
15502
+ end
15503
+ if SandboxGetParentFunctionDescription ~= nil then
15504
+ return SandboxGetParentFunctionDescription(levels)
15505
+ end
15506
+ return nil
15507
+ end
15508
+ function ____exports.log(msg, includeParentFunction)
15509
+ if includeParentFunction == nil then
15510
+ includeParentFunction = true
15511
+ end
15512
+ if isNumber(nil, msg) then
15513
+ msg = tostring(msg)
15514
+ end
15515
+ local ____includeParentFunction_0
15516
+ if includeParentFunction then
15517
+ ____includeParentFunction_0 = ____exports.getParentFunctionDescription()
15518
+ else
15519
+ ____includeParentFunction_0 = nil
15520
+ end
15521
+ local parentFunctionDescription = ____includeParentFunction_0
15522
+ local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
15523
+ Isaac.DebugString(debugMsg)
15524
+ end
15525
+ function ____exports.logAndPrint(self, msg)
15526
+ ____exports.log(msg)
15527
+ print(msg)
15528
+ end
15565
15529
  return ____exports
15566
15530
  end,
15567
15531
  ["src.functions.sort"] = function(...)
@@ -51536,7 +51500,6 @@ local __TS__New = ____lualib.__TS__New
51536
51500
  local __TS__Iterator = ____lualib.__TS__Iterator
51537
51501
  local ____exports = {}
51538
51502
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
51539
- local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
51540
51503
  local DisplayFlagZero = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlagZero
51541
51504
  local ____cachedClasses = require("src.core.cachedClasses")
51542
51505
  local game = ____cachedClasses.game
@@ -51587,9 +51550,15 @@ function ____exports.setRoomDisplayFlags(self, roomGridIndex, displayFlags, upda
51587
51550
  else
51588
51551
  local minimapAPIRoomDescriptor = MinimapAPI:GetRoomByIdx(roomGridIndex)
51589
51552
  if minimapAPIRoomDescriptor == nil then
51553
+ if displayFlags == DisplayFlagZero then
51554
+ return
51555
+ end
51590
51556
  error("Failed to get the MinimapAPI room descriptor for the room at index: " .. tostring(roomGridIndex))
51591
51557
  end
51592
51558
  minimapAPIRoomDescriptor:SetDisplayFlags(displayFlags)
51559
+ if displayFlags == DisplayFlagZero then
51560
+ minimapAPIRoomDescriptor:Remove()
51561
+ end
51593
51562
  end
51594
51563
  end
51595
51564
  function ____exports.addRoomDisplayFlag(self, roomGridIndex, displayFlag, updateVisibility)
@@ -51603,6 +51572,9 @@ end
51603
51572
  function ____exports.clearFloorDisplayFlags(self)
51604
51573
  ____exports.setAllDisplayFlags(nil, DisplayFlagZero)
51605
51574
  end
51575
+ function ____exports.clearRoomDisplayFlags(self, roomGridIndex)
51576
+ ____exports.setRoomDisplayFlags(nil, roomGridIndex, DisplayFlagZero)
51577
+ end
51606
51578
  function ____exports.getFloorDisplayFlags(self)
51607
51579
  local displayFlagsMap = __TS__New(Map)
51608
51580
  for ____, roomDescriptor in ipairs(getRoomsInsideGrid(nil)) do
@@ -51623,12 +51595,6 @@ function ____exports.setFloorDisplayFlags(self, displayFlagsMap)
51623
51595
  level:UpdateVisibility()
51624
51596
  end
51625
51597
  end
51626
- function ____exports.setRoomVisible(self, roomGridIndex, updateVisibility)
51627
- if updateVisibility == nil then
51628
- updateVisibility = true
51629
- end
51630
- ____exports.addRoomDisplayFlag(nil, roomGridIndex, DisplayFlag.SHOW_ICON, updateVisibility)
51631
- end
51632
51598
  return ____exports
51633
51599
  end,
51634
51600
  ["src.functions.modFeatures"] = function(...)