isaacscript-common 41.0.0 → 42.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.
- package/dist/index.rollup.d.ts +7 -9
- package/dist/isaacscript-common.lua +90 -88
- package/dist/lualib_bundle.lua +61 -56
- package/dist/src/core/constants.d.ts +3 -7
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +20 -0
- package/dist/src/functions/array.d.ts +2 -2
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +6 -5
- package/dist/src/functions/pickups.lua +3 -3
- package/package.json +1 -1
- package/src/core/constants.ts +21 -0
- package/src/functions/array.ts +7 -6
- package/src/functions/pickups.ts +2 -2
- package/dist/src/sets/chestPickupVariantsSet.d.ts +0 -3
- package/dist/src/sets/chestPickupVariantsSet.d.ts.map +0 -1
- package/dist/src/sets/chestPickupVariantsSet.lua +0 -22
- package/src/sets/chestPickupVariantsSet.ts +0 -17
package/dist/index.rollup.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ import type { Music } from 'isaac-typescript-definitions';
|
|
|
56
56
|
import type { NPCState } from 'isaac-typescript-definitions';
|
|
57
57
|
import { NullItemID } from 'isaac-typescript-definitions';
|
|
58
58
|
import { PickupPrice } from 'isaac-typescript-definitions';
|
|
59
|
-
import
|
|
59
|
+
import { PickupVariant } from 'isaac-typescript-definitions';
|
|
60
60
|
import { PillColor } from 'isaac-typescript-definitions';
|
|
61
61
|
import { PillEffect } from 'isaac-typescript-definitions';
|
|
62
62
|
import { PitVariant } from 'isaac-typescript-definitions';
|
|
@@ -949,12 +949,6 @@ export declare function addTrinketCostume(player: EntityPlayer, trinketType: Tri
|
|
|
949
949
|
export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
|
|
950
950
|
readonly __bitFlagBrand: symbol;
|
|
951
951
|
} & {
|
|
952
|
-
/**
|
|
953
|
-
* The combination of the following flags:
|
|
954
|
-
* - `DisplayFlag.VISIBLE` (1 << 0)
|
|
955
|
-
* - `DisplayFlag.SHADOW` (1 << 1)
|
|
956
|
-
* - `DisplayFlag.SHOW_ICON` (1 << 2)
|
|
957
|
-
*/
|
|
958
952
|
readonly __displayFlagBrand: symbol;
|
|
959
953
|
}>;
|
|
960
954
|
|
|
@@ -1137,9 +1131,9 @@ export declare function arrayRemoveIndexInPlace<T>(array: T[], ...indexesToRemov
|
|
|
1137
1131
|
* matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
|
|
1138
1132
|
* function instead.
|
|
1139
1133
|
*
|
|
1140
|
-
* @returns
|
|
1134
|
+
* @returns The removed elements. This will be an empty array if no elements were removed.
|
|
1141
1135
|
*/
|
|
1142
|
-
export declare function arrayRemoveInPlace<T>(array: T[], ...elementsToRemove: T[]):
|
|
1136
|
+
export declare function arrayRemoveInPlace<T>(array: T[], ...elementsToRemove: T[]): T[];
|
|
1143
1137
|
|
|
1144
1138
|
/** Helper function to convert a set of flags to a single `BitFlags` object. */
|
|
1145
1139
|
export declare function arrayToBitFlags<T extends BitFlag | BitFlag128>(array: T[] | readonly T[]): BitFlags<T>;
|
|
@@ -1523,6 +1517,10 @@ export declare function checkFamiliar(player: EntityPlayer, collectibleType: Col
|
|
|
1523
1517
|
*/
|
|
1524
1518
|
export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: CollectibleType, familiarVariant: FamiliarVariant, familiarSubType?: int): void;
|
|
1525
1519
|
|
|
1520
|
+
export declare const CHEST_PICKUP_VARIANTS: readonly [PickupVariant.CHEST, PickupVariant.BOMB_CHEST, PickupVariant.SPIKED_CHEST, PickupVariant.ETERNAL_CHEST, PickupVariant.MIMIC_CHEST, PickupVariant.OLD_CHEST, PickupVariant.WOODEN_CHEST, PickupVariant.MEGA_CHEST, PickupVariant.HAUNTED_CHEST, PickupVariant.LOCKED_CHEST, PickupVariant.RED_CHEST, PickupVariant.MOMS_CHEST];
|
|
1521
|
+
|
|
1522
|
+
export declare const CHEST_PICKUP_VARIANTS_SET: ReadonlySet<PickupVariant>;
|
|
1523
|
+
|
|
1526
1524
|
/**
|
|
1527
1525
|
* Helper function to normalize a number, ensuring that it is within a certain range.
|
|
1528
1526
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 42.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -1118,6 +1118,9 @@ end
|
|
|
1118
1118
|
local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
|
|
1119
1119
|
do
|
|
1120
1120
|
local function getErrorStack(self, constructor)
|
|
1121
|
+
if debug == nil then
|
|
1122
|
+
return nil
|
|
1123
|
+
end
|
|
1121
1124
|
local level = 1
|
|
1122
1125
|
while true do
|
|
1123
1126
|
local info = debug.getinfo(level, "f")
|
|
@@ -1499,6 +1502,62 @@ local function __TS__NumberIsNaN(value)
|
|
|
1499
1502
|
return value ~= value
|
|
1500
1503
|
end
|
|
1501
1504
|
|
|
1505
|
+
local function __TS__StringSubstring(self, start, ____end)
|
|
1506
|
+
if ____end ~= ____end then
|
|
1507
|
+
____end = 0
|
|
1508
|
+
end
|
|
1509
|
+
if ____end ~= nil and start > ____end then
|
|
1510
|
+
start, ____end = ____end, start
|
|
1511
|
+
end
|
|
1512
|
+
if start >= 0 then
|
|
1513
|
+
start = start + 1
|
|
1514
|
+
else
|
|
1515
|
+
start = 1
|
|
1516
|
+
end
|
|
1517
|
+
if ____end ~= nil and ____end < 0 then
|
|
1518
|
+
____end = 0
|
|
1519
|
+
end
|
|
1520
|
+
return string.sub(self, start, ____end)
|
|
1521
|
+
end
|
|
1522
|
+
|
|
1523
|
+
local __TS__ParseInt
|
|
1524
|
+
do
|
|
1525
|
+
local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
|
|
1526
|
+
function __TS__ParseInt(numberString, base)
|
|
1527
|
+
if base == nil then
|
|
1528
|
+
base = 10
|
|
1529
|
+
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1530
|
+
if hexMatch ~= nil then
|
|
1531
|
+
base = 16
|
|
1532
|
+
numberString = (__TS__Match(hexMatch, "-")) and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1533
|
+
end
|
|
1534
|
+
end
|
|
1535
|
+
if base < 2 or base > 36 then
|
|
1536
|
+
return 0 / 0
|
|
1537
|
+
end
|
|
1538
|
+
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1539
|
+
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1540
|
+
local number = tonumber((__TS__Match(numberString, pattern)), base)
|
|
1541
|
+
if number == nil then
|
|
1542
|
+
return 0 / 0
|
|
1543
|
+
end
|
|
1544
|
+
if number >= 0 then
|
|
1545
|
+
return math.floor(number)
|
|
1546
|
+
else
|
|
1547
|
+
return math.ceil(number)
|
|
1548
|
+
end
|
|
1549
|
+
end
|
|
1550
|
+
end
|
|
1551
|
+
|
|
1552
|
+
local function __TS__ParseFloat(numberString)
|
|
1553
|
+
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1554
|
+
if infinityMatch ~= nil then
|
|
1555
|
+
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1556
|
+
end
|
|
1557
|
+
local number = tonumber((__TS__Match(numberString, "^%s*(-?%d+%.?%d*)")))
|
|
1558
|
+
return number or 0 / 0
|
|
1559
|
+
end
|
|
1560
|
+
|
|
1502
1561
|
local __TS__NumberToString
|
|
1503
1562
|
do
|
|
1504
1563
|
local radixChars = "0123456789abcdefghijklmnopqrstuvwxyz"
|
|
@@ -1673,62 +1732,6 @@ local function __TS__ObjectValues(obj)
|
|
|
1673
1732
|
return result
|
|
1674
1733
|
end
|
|
1675
1734
|
|
|
1676
|
-
local function __TS__ParseFloat(numberString)
|
|
1677
|
-
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1678
|
-
if infinityMatch ~= nil then
|
|
1679
|
-
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1680
|
-
end
|
|
1681
|
-
local number = tonumber((__TS__Match(numberString, "^%s*(-?%d+%.?%d*)")))
|
|
1682
|
-
return number or 0 / 0
|
|
1683
|
-
end
|
|
1684
|
-
|
|
1685
|
-
local function __TS__StringSubstring(self, start, ____end)
|
|
1686
|
-
if ____end ~= ____end then
|
|
1687
|
-
____end = 0
|
|
1688
|
-
end
|
|
1689
|
-
if ____end ~= nil and start > ____end then
|
|
1690
|
-
start, ____end = ____end, start
|
|
1691
|
-
end
|
|
1692
|
-
if start >= 0 then
|
|
1693
|
-
start = start + 1
|
|
1694
|
-
else
|
|
1695
|
-
start = 1
|
|
1696
|
-
end
|
|
1697
|
-
if ____end ~= nil and ____end < 0 then
|
|
1698
|
-
____end = 0
|
|
1699
|
-
end
|
|
1700
|
-
return string.sub(self, start, ____end)
|
|
1701
|
-
end
|
|
1702
|
-
|
|
1703
|
-
local __TS__ParseInt
|
|
1704
|
-
do
|
|
1705
|
-
local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
|
|
1706
|
-
function __TS__ParseInt(numberString, base)
|
|
1707
|
-
if base == nil then
|
|
1708
|
-
base = 10
|
|
1709
|
-
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1710
|
-
if hexMatch ~= nil then
|
|
1711
|
-
base = 16
|
|
1712
|
-
numberString = (__TS__Match(hexMatch, "-")) and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1713
|
-
end
|
|
1714
|
-
end
|
|
1715
|
-
if base < 2 or base > 36 then
|
|
1716
|
-
return 0 / 0
|
|
1717
|
-
end
|
|
1718
|
-
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1719
|
-
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1720
|
-
local number = tonumber((__TS__Match(numberString, pattern)), base)
|
|
1721
|
-
if number == nil then
|
|
1722
|
-
return 0 / 0
|
|
1723
|
-
end
|
|
1724
|
-
if number >= 0 then
|
|
1725
|
-
return math.floor(number)
|
|
1726
|
-
else
|
|
1727
|
-
return math.ceil(number)
|
|
1728
|
-
end
|
|
1729
|
-
end
|
|
1730
|
-
end
|
|
1731
|
-
|
|
1732
1735
|
local function __TS__PromiseAll(iterable)
|
|
1733
1736
|
local results = {}
|
|
1734
1737
|
local toResolve = {}
|
|
@@ -2596,6 +2599,8 @@ return {
|
|
|
2596
2599
|
__TS__Number = __TS__Number,
|
|
2597
2600
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
2598
2601
|
__TS__NumberIsNaN = __TS__NumberIsNaN,
|
|
2602
|
+
__TS__ParseInt = __TS__ParseInt,
|
|
2603
|
+
__TS__ParseFloat = __TS__ParseFloat,
|
|
2599
2604
|
__TS__NumberToString = __TS__NumberToString,
|
|
2600
2605
|
__TS__NumberToFixed = __TS__NumberToFixed,
|
|
2601
2606
|
__TS__ObjectAssign = __TS__ObjectAssign,
|
|
@@ -16849,6 +16854,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
16849
16854
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
16850
16855
|
local __TS__ArrayIndexOf = ____lualib.__TS__ArrayIndexOf
|
|
16851
16856
|
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
|
|
16857
|
+
local __TS__ArrayPushArray = ____lualib.__TS__ArrayPushArray
|
|
16852
16858
|
local __TS__New = ____lualib.__TS__New
|
|
16853
16859
|
local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
|
|
16854
16860
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
@@ -16898,15 +16904,15 @@ function ____exports.arrayRemoveAllInPlace(self, array, ...)
|
|
|
16898
16904
|
end
|
|
16899
16905
|
function ____exports.arrayRemoveInPlace(self, array, ...)
|
|
16900
16906
|
local elementsToRemove = {...}
|
|
16901
|
-
local
|
|
16907
|
+
local removedElements = {}
|
|
16902
16908
|
for ____, element in ipairs(elementsToRemove) do
|
|
16903
16909
|
local index = __TS__ArrayIndexOf(array, element)
|
|
16904
16910
|
if index > -1 then
|
|
16905
|
-
|
|
16906
|
-
|
|
16911
|
+
local removedElement = __TS__ArraySplice(array, index, 1)
|
|
16912
|
+
__TS__ArrayPushArray(removedElements, removedElement)
|
|
16907
16913
|
end
|
|
16908
16914
|
end
|
|
16909
|
-
return
|
|
16915
|
+
return removedElements
|
|
16910
16916
|
end
|
|
16911
16917
|
function ____exports.copyArray(self, oldArray, numElements)
|
|
16912
16918
|
if numElements == nil then
|
|
@@ -17932,12 +17938,15 @@ ____exports.NUM_VANILLA_CHALLENGES = getEnumLength(nil, Challenge) - 1
|
|
|
17932
17938
|
return ____exports
|
|
17933
17939
|
end,
|
|
17934
17940
|
["src.core.constants"] = function(...)
|
|
17941
|
+
local ____lualib = require("lualib_bundle")
|
|
17942
|
+
local __TS__New = ____lualib.__TS__New
|
|
17935
17943
|
local ____exports = {}
|
|
17936
17944
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
17937
17945
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
17938
17946
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
17939
17947
|
local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
|
|
17940
17948
|
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
17949
|
+
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
17941
17950
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
17942
17951
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
17943
17952
|
local ____enums = require("src.functions.enums")
|
|
@@ -17952,12 +17961,29 @@ local ____types = require("src.functions.types")
|
|
|
17952
17961
|
local asCollectibleType = ____types.asCollectibleType
|
|
17953
17962
|
local ____utils = require("src.functions.utils")
|
|
17954
17963
|
local eRange = ____utils.eRange
|
|
17964
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
17965
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
17955
17966
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
17956
17967
|
local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
|
|
17957
17968
|
____exports.ALL_DISPLAY_FLAGS = addFlag(nil, DisplayFlag.VISIBLE, DisplayFlag.SHADOW, DisplayFlag.SHOW_ICON)
|
|
17958
17969
|
____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
17959
17970
|
____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
17960
17971
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
17972
|
+
____exports.CHEST_PICKUP_VARIANTS = {
|
|
17973
|
+
PickupVariant.CHEST,
|
|
17974
|
+
PickupVariant.BOMB_CHEST,
|
|
17975
|
+
PickupVariant.SPIKED_CHEST,
|
|
17976
|
+
PickupVariant.ETERNAL_CHEST,
|
|
17977
|
+
PickupVariant.MIMIC_CHEST,
|
|
17978
|
+
PickupVariant.OLD_CHEST,
|
|
17979
|
+
PickupVariant.WOODEN_CHEST,
|
|
17980
|
+
PickupVariant.MEGA_CHEST,
|
|
17981
|
+
PickupVariant.HAUNTED_CHEST,
|
|
17982
|
+
PickupVariant.LOCKED_CHEST,
|
|
17983
|
+
PickupVariant.RED_CHEST,
|
|
17984
|
+
PickupVariant.MOMS_CHEST
|
|
17985
|
+
}
|
|
17986
|
+
____exports.CHEST_PICKUP_VARIANTS_SET = __TS__New(ReadonlySet, ____exports.CHEST_PICKUP_VARIANTS)
|
|
17961
17987
|
____exports.COLLECTIBLE_INITIAL_WAIT = 20
|
|
17962
17988
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE
|
|
17963
17989
|
____exports.DISTANCE_OF_GRID_TILE = 40
|
|
@@ -39783,30 +39809,6 @@ ____exports.COIN_SUB_TYPE_TO_VALUE = {
|
|
|
39783
39809
|
[CoinSubType.STICKY_NICKEL] = 5,
|
|
39784
39810
|
[CoinSubType.GOLDEN] = 1
|
|
39785
39811
|
}
|
|
39786
|
-
return ____exports
|
|
39787
|
-
end,
|
|
39788
|
-
["src.sets.chestPickupVariantsSet"] = function(...)
|
|
39789
|
-
local ____lualib = require("lualib_bundle")
|
|
39790
|
-
local __TS__New = ____lualib.__TS__New
|
|
39791
|
-
local ____exports = {}
|
|
39792
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
39793
|
-
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
39794
|
-
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
39795
|
-
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
39796
|
-
____exports.CHEST_PICKUP_VARIANTS = __TS__New(ReadonlySet, {
|
|
39797
|
-
PickupVariant.CHEST,
|
|
39798
|
-
PickupVariant.BOMB_CHEST,
|
|
39799
|
-
PickupVariant.SPIKED_CHEST,
|
|
39800
|
-
PickupVariant.ETERNAL_CHEST,
|
|
39801
|
-
PickupVariant.MIMIC_CHEST,
|
|
39802
|
-
PickupVariant.OLD_CHEST,
|
|
39803
|
-
PickupVariant.WOODEN_CHEST,
|
|
39804
|
-
PickupVariant.MEGA_CHEST,
|
|
39805
|
-
PickupVariant.HAUNTED_CHEST,
|
|
39806
|
-
PickupVariant.LOCKED_CHEST,
|
|
39807
|
-
PickupVariant.RED_CHEST,
|
|
39808
|
-
PickupVariant.MOMS_CHEST
|
|
39809
|
-
})
|
|
39810
39812
|
return ____exports
|
|
39811
39813
|
end,
|
|
39812
39814
|
["src.sets.redHeartSubTypesSet"] = function(...)
|
|
@@ -40178,11 +40180,11 @@ return ____exports
|
|
|
40178
40180
|
local ____lualib = require("lualib_bundle")
|
|
40179
40181
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
40180
40182
|
local ____exports = {}
|
|
40183
|
+
local ____constants = require("src.core.constants")
|
|
40184
|
+
local CHEST_PICKUP_VARIANTS_SET = ____constants.CHEST_PICKUP_VARIANTS_SET
|
|
40181
40185
|
local ____coinSubTypeToValue = require("src.objects.coinSubTypeToValue")
|
|
40182
40186
|
local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
|
|
40183
40187
|
local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
|
|
40184
|
-
local ____chestPickupVariantsSet = require("src.sets.chestPickupVariantsSet")
|
|
40185
|
-
local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
|
|
40186
40188
|
local ____redHeartSubTypesSet = require("src.sets.redHeartSubTypesSet")
|
|
40187
40189
|
local RED_HEART_SUB_TYPES_SET = ____redHeartSubTypesSet.RED_HEART_SUB_TYPES_SET
|
|
40188
40190
|
local ____entities = require("src.functions.entities")
|
|
@@ -40192,7 +40194,7 @@ local isHeart = ____pickupVariants.isHeart
|
|
|
40192
40194
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
40193
40195
|
local getHearts = ____pickupsSpecific.getHearts
|
|
40194
40196
|
function ____exports.isChestVariant(self, pickupVariant)
|
|
40195
|
-
return
|
|
40197
|
+
return CHEST_PICKUP_VARIANTS_SET:has(pickupVariant)
|
|
40196
40198
|
end
|
|
40197
40199
|
function ____exports.getCoinValue(self, coinSubType)
|
|
40198
40200
|
local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
|
package/dist/lualib_bundle.lua
CHANGED
|
@@ -1067,6 +1067,9 @@ end
|
|
|
1067
1067
|
local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
|
|
1068
1068
|
do
|
|
1069
1069
|
local function getErrorStack(self, constructor)
|
|
1070
|
+
if debug == nil then
|
|
1071
|
+
return nil
|
|
1072
|
+
end
|
|
1070
1073
|
local level = 1
|
|
1071
1074
|
while true do
|
|
1072
1075
|
local info = debug.getinfo(level, "f")
|
|
@@ -1448,6 +1451,62 @@ local function __TS__NumberIsNaN(value)
|
|
|
1448
1451
|
return value ~= value
|
|
1449
1452
|
end
|
|
1450
1453
|
|
|
1454
|
+
local function __TS__StringSubstring(self, start, ____end)
|
|
1455
|
+
if ____end ~= ____end then
|
|
1456
|
+
____end = 0
|
|
1457
|
+
end
|
|
1458
|
+
if ____end ~= nil and start > ____end then
|
|
1459
|
+
start, ____end = ____end, start
|
|
1460
|
+
end
|
|
1461
|
+
if start >= 0 then
|
|
1462
|
+
start = start + 1
|
|
1463
|
+
else
|
|
1464
|
+
start = 1
|
|
1465
|
+
end
|
|
1466
|
+
if ____end ~= nil and ____end < 0 then
|
|
1467
|
+
____end = 0
|
|
1468
|
+
end
|
|
1469
|
+
return string.sub(self, start, ____end)
|
|
1470
|
+
end
|
|
1471
|
+
|
|
1472
|
+
local __TS__ParseInt
|
|
1473
|
+
do
|
|
1474
|
+
local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
|
|
1475
|
+
function __TS__ParseInt(numberString, base)
|
|
1476
|
+
if base == nil then
|
|
1477
|
+
base = 10
|
|
1478
|
+
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1479
|
+
if hexMatch ~= nil then
|
|
1480
|
+
base = 16
|
|
1481
|
+
numberString = (__TS__Match(hexMatch, "-")) and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1482
|
+
end
|
|
1483
|
+
end
|
|
1484
|
+
if base < 2 or base > 36 then
|
|
1485
|
+
return 0 / 0
|
|
1486
|
+
end
|
|
1487
|
+
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1488
|
+
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1489
|
+
local number = tonumber((__TS__Match(numberString, pattern)), base)
|
|
1490
|
+
if number == nil then
|
|
1491
|
+
return 0 / 0
|
|
1492
|
+
end
|
|
1493
|
+
if number >= 0 then
|
|
1494
|
+
return math.floor(number)
|
|
1495
|
+
else
|
|
1496
|
+
return math.ceil(number)
|
|
1497
|
+
end
|
|
1498
|
+
end
|
|
1499
|
+
end
|
|
1500
|
+
|
|
1501
|
+
local function __TS__ParseFloat(numberString)
|
|
1502
|
+
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1503
|
+
if infinityMatch ~= nil then
|
|
1504
|
+
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1505
|
+
end
|
|
1506
|
+
local number = tonumber((__TS__Match(numberString, "^%s*(-?%d+%.?%d*)")))
|
|
1507
|
+
return number or 0 / 0
|
|
1508
|
+
end
|
|
1509
|
+
|
|
1451
1510
|
local __TS__NumberToString
|
|
1452
1511
|
do
|
|
1453
1512
|
local radixChars = "0123456789abcdefghijklmnopqrstuvwxyz"
|
|
@@ -1622,62 +1681,6 @@ local function __TS__ObjectValues(obj)
|
|
|
1622
1681
|
return result
|
|
1623
1682
|
end
|
|
1624
1683
|
|
|
1625
|
-
local function __TS__ParseFloat(numberString)
|
|
1626
|
-
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1627
|
-
if infinityMatch ~= nil then
|
|
1628
|
-
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1629
|
-
end
|
|
1630
|
-
local number = tonumber((__TS__Match(numberString, "^%s*(-?%d+%.?%d*)")))
|
|
1631
|
-
return number or 0 / 0
|
|
1632
|
-
end
|
|
1633
|
-
|
|
1634
|
-
local function __TS__StringSubstring(self, start, ____end)
|
|
1635
|
-
if ____end ~= ____end then
|
|
1636
|
-
____end = 0
|
|
1637
|
-
end
|
|
1638
|
-
if ____end ~= nil and start > ____end then
|
|
1639
|
-
start, ____end = ____end, start
|
|
1640
|
-
end
|
|
1641
|
-
if start >= 0 then
|
|
1642
|
-
start = start + 1
|
|
1643
|
-
else
|
|
1644
|
-
start = 1
|
|
1645
|
-
end
|
|
1646
|
-
if ____end ~= nil and ____end < 0 then
|
|
1647
|
-
____end = 0
|
|
1648
|
-
end
|
|
1649
|
-
return string.sub(self, start, ____end)
|
|
1650
|
-
end
|
|
1651
|
-
|
|
1652
|
-
local __TS__ParseInt
|
|
1653
|
-
do
|
|
1654
|
-
local parseIntBasePattern = "0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTvVwWxXyYzZ"
|
|
1655
|
-
function __TS__ParseInt(numberString, base)
|
|
1656
|
-
if base == nil then
|
|
1657
|
-
base = 10
|
|
1658
|
-
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1659
|
-
if hexMatch ~= nil then
|
|
1660
|
-
base = 16
|
|
1661
|
-
numberString = (__TS__Match(hexMatch, "-")) and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1662
|
-
end
|
|
1663
|
-
end
|
|
1664
|
-
if base < 2 or base > 36 then
|
|
1665
|
-
return 0 / 0
|
|
1666
|
-
end
|
|
1667
|
-
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1668
|
-
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1669
|
-
local number = tonumber((__TS__Match(numberString, pattern)), base)
|
|
1670
|
-
if number == nil then
|
|
1671
|
-
return 0 / 0
|
|
1672
|
-
end
|
|
1673
|
-
if number >= 0 then
|
|
1674
|
-
return math.floor(number)
|
|
1675
|
-
else
|
|
1676
|
-
return math.ceil(number)
|
|
1677
|
-
end
|
|
1678
|
-
end
|
|
1679
|
-
end
|
|
1680
|
-
|
|
1681
1684
|
local function __TS__PromiseAll(iterable)
|
|
1682
1685
|
local results = {}
|
|
1683
1686
|
local toResolve = {}
|
|
@@ -2545,6 +2548,8 @@ return {
|
|
|
2545
2548
|
__TS__Number = __TS__Number,
|
|
2546
2549
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
2547
2550
|
__TS__NumberIsNaN = __TS__NumberIsNaN,
|
|
2551
|
+
__TS__ParseInt = __TS__ParseInt,
|
|
2552
|
+
__TS__ParseFloat = __TS__ParseFloat,
|
|
2548
2553
|
__TS__NumberToString = __TS__NumberToString,
|
|
2549
2554
|
__TS__NumberToFixed = __TS__NumberToFixed,
|
|
2550
2555
|
__TS__ObjectAssign = __TS__ObjectAssign,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CollectibleType, Dimension, ItemPoolType, PlayerType } from "isaac-typescript-definitions";
|
|
1
|
+
import { CollectibleType, Dimension, ItemPoolType, PickupVariant, PlayerType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* The combination of the following flags:
|
|
4
4
|
* - `DisplayFlag.VISIBLE` (1 << 0)
|
|
@@ -8,12 +8,6 @@ import { CollectibleType, Dimension, ItemPoolType, PlayerType } from "isaac-type
|
|
|
8
8
|
export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
|
|
9
9
|
readonly __bitFlagBrand: symbol;
|
|
10
10
|
} & {
|
|
11
|
-
/**
|
|
12
|
-
* The combination of the following flags:
|
|
13
|
-
* - `DisplayFlag.VISIBLE` (1 << 0)
|
|
14
|
-
* - `DisplayFlag.SHADOW` (1 << 1)
|
|
15
|
-
* - `DisplayFlag.SHOW_ICON` (1 << 2)
|
|
16
|
-
*/
|
|
17
11
|
readonly __displayFlagBrand: symbol;
|
|
18
12
|
}>;
|
|
19
13
|
/**
|
|
@@ -28,6 +22,8 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
|
|
|
28
22
|
export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
|
|
29
23
|
/** Bombs explode when their frame count is equal to this value. */
|
|
30
24
|
export declare const BOMB_EXPLODE_FRAME = 45;
|
|
25
|
+
export declare const CHEST_PICKUP_VARIANTS: readonly [PickupVariant.CHEST, PickupVariant.BOMB_CHEST, PickupVariant.SPIKED_CHEST, PickupVariant.ETERNAL_CHEST, PickupVariant.MIMIC_CHEST, PickupVariant.OLD_CHEST, PickupVariant.WOODEN_CHEST, PickupVariant.MEGA_CHEST, PickupVariant.HAUNTED_CHEST, PickupVariant.LOCKED_CHEST, PickupVariant.RED_CHEST, PickupVariant.MOMS_CHEST];
|
|
26
|
+
export declare const CHEST_PICKUP_VARIANTS_SET: ReadonlySet<PickupVariant>;
|
|
31
27
|
/** This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned. */
|
|
32
28
|
export declare const COLLECTIBLE_INITIAL_WAIT = 20;
|
|
33
29
|
export declare const DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EAET,YAAY,EACZ,UAAU,EAEX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,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C7F,eAAO,MAAM,gDAAgD,QAAS,CAAC;AAEvE,4CAA4C;AAC5C,eAAO,MAAM,8BAA8B,QAA4B,CAAC;AAExE,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,KAAkB,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,SAAS,kBAA0B,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kBAA0B,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,iBAA4B,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAgC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
1
3
|
local ____exports = {}
|
|
2
4
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
5
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
4
6
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
5
7
|
local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
|
|
6
8
|
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
9
|
+
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
7
10
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
8
11
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
9
12
|
local ____enums = require("src.functions.enums")
|
|
@@ -18,6 +21,8 @@ local ____types = require("src.functions.types")
|
|
|
18
21
|
local asCollectibleType = ____types.asCollectibleType
|
|
19
22
|
local ____utils = require("src.functions.utils")
|
|
20
23
|
local eRange = ____utils.eRange
|
|
24
|
+
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
25
|
+
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
21
26
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
22
27
|
local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
|
|
23
28
|
--- The combination of the following flags:
|
|
@@ -33,6 +38,21 @@ ____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
|
33
38
|
____exports.BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png"
|
|
34
39
|
--- Bombs explode when their frame count is equal to this value.
|
|
35
40
|
____exports.BOMB_EXPLODE_FRAME = 45
|
|
41
|
+
____exports.CHEST_PICKUP_VARIANTS = {
|
|
42
|
+
PickupVariant.CHEST,
|
|
43
|
+
PickupVariant.BOMB_CHEST,
|
|
44
|
+
PickupVariant.SPIKED_CHEST,
|
|
45
|
+
PickupVariant.ETERNAL_CHEST,
|
|
46
|
+
PickupVariant.MIMIC_CHEST,
|
|
47
|
+
PickupVariant.OLD_CHEST,
|
|
48
|
+
PickupVariant.WOODEN_CHEST,
|
|
49
|
+
PickupVariant.MEGA_CHEST,
|
|
50
|
+
PickupVariant.HAUNTED_CHEST,
|
|
51
|
+
PickupVariant.LOCKED_CHEST,
|
|
52
|
+
PickupVariant.RED_CHEST,
|
|
53
|
+
PickupVariant.MOMS_CHEST
|
|
54
|
+
}
|
|
55
|
+
____exports.CHEST_PICKUP_VARIANTS_SET = __TS__New(ReadonlySet, ____exports.CHEST_PICKUP_VARIANTS)
|
|
36
56
|
--- This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned.
|
|
37
57
|
____exports.COLLECTIBLE_INITIAL_WAIT = 20
|
|
38
58
|
____exports.DEFAULT_ITEM_POOL_TYPE = ItemPoolType.TREASURE
|
|
@@ -53,9 +53,9 @@ export declare function arrayRemoveAllInPlace<T>(array: T[], ...elementsToRemove
|
|
|
53
53
|
* matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
|
|
54
54
|
* function instead.
|
|
55
55
|
*
|
|
56
|
-
* @returns
|
|
56
|
+
* @returns The removed elements. This will be an empty array if no elements were removed.
|
|
57
57
|
*/
|
|
58
|
-
export declare function arrayRemoveInPlace<T>(array: T[], ...elementsToRemove: T[]):
|
|
58
|
+
export declare function arrayRemoveInPlace<T>(array: T[], ...elementsToRemove: T[]): T[];
|
|
59
59
|
/**
|
|
60
60
|
* Shallow copies and removes the elements at the specified indexes from the array. Returns the
|
|
61
61
|
* copied array. If the specified indexes are not found in the array, it will simply return a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/functions/array.ts"],"names":[],"mappings":";;;AAMA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EAC1B,MAAM,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,GACzB,OAAO,CAST;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,aAAa,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACjC,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,CAAC,EAAE,CAIL;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,OAAO,CAcT;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,KAAK,EAAE,CAAC,EAAE,EACV,GAAG,gBAAgB,EAAE,CAAC,EAAE,GACvB,
|
|
1
|
+
{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,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,CAAC,EAAE,CAKL;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,IAAI,CAWN;AAED,+DAA+D;AAC/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAM3E"}
|
|
@@ -2,6 +2,7 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
3
3
|
local __TS__ArrayIndexOf = ____lualib.__TS__ArrayIndexOf
|
|
4
4
|
local __TS__ArraySplice = ____lualib.__TS__ArraySplice
|
|
5
|
+
local __TS__ArrayPushArray = ____lualib.__TS__ArrayPushArray
|
|
5
6
|
local __TS__New = ____lualib.__TS__New
|
|
6
7
|
local __TS__ArrayEntries = ____lualib.__TS__ArrayEntries
|
|
7
8
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
@@ -68,18 +69,18 @@ end
|
|
|
68
69
|
-- matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
|
|
69
70
|
-- function instead.
|
|
70
71
|
--
|
|
71
|
-
-- @returns
|
|
72
|
+
-- @returns The removed elements. This will be an empty array if no elements were removed.
|
|
72
73
|
function ____exports.arrayRemoveInPlace(self, array, ...)
|
|
73
74
|
local elementsToRemove = {...}
|
|
74
|
-
local
|
|
75
|
+
local removedElements = {}
|
|
75
76
|
for ____, element in ipairs(elementsToRemove) do
|
|
76
77
|
local index = __TS__ArrayIndexOf(array, element)
|
|
77
78
|
if index > -1 then
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
local removedElement = __TS__ArraySplice(array, index, 1)
|
|
80
|
+
__TS__ArrayPushArray(removedElements, removedElement)
|
|
80
81
|
end
|
|
81
82
|
end
|
|
82
|
-
return
|
|
83
|
+
return removedElements
|
|
83
84
|
end
|
|
84
85
|
--- Helper function to perform a shallow copy.
|
|
85
86
|
--
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____constants = require("src.core.constants")
|
|
5
|
+
local CHEST_PICKUP_VARIANTS_SET = ____constants.CHEST_PICKUP_VARIANTS_SET
|
|
4
6
|
local ____coinSubTypeToValue = require("src.objects.coinSubTypeToValue")
|
|
5
7
|
local COIN_SUB_TYPE_TO_VALUE = ____coinSubTypeToValue.COIN_SUB_TYPE_TO_VALUE
|
|
6
8
|
local DEFAULT_COIN_VALUE = ____coinSubTypeToValue.DEFAULT_COIN_VALUE
|
|
7
|
-
local ____chestPickupVariantsSet = require("src.sets.chestPickupVariantsSet")
|
|
8
|
-
local CHEST_PICKUP_VARIANTS = ____chestPickupVariantsSet.CHEST_PICKUP_VARIANTS
|
|
9
9
|
local ____redHeartSubTypesSet = require("src.sets.redHeartSubTypesSet")
|
|
10
10
|
local RED_HEART_SUB_TYPES_SET = ____redHeartSubTypesSet.RED_HEART_SUB_TYPES_SET
|
|
11
11
|
local ____entities = require("src.functions.entities")
|
|
@@ -16,7 +16,7 @@ local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
|
16
16
|
local getHearts = ____pickupsSpecific.getHearts
|
|
17
17
|
--- Helper function to test if the provided pickup variant matches one of the various chest variants.
|
|
18
18
|
function ____exports.isChestVariant(self, pickupVariant)
|
|
19
|
-
return
|
|
19
|
+
return CHEST_PICKUP_VARIANTS_SET:has(pickupVariant)
|
|
20
20
|
end
|
|
21
21
|
--- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
22
22
|
-- sub-types.
|
package/package.json
CHANGED
package/src/core/constants.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
Dimension,
|
|
4
4
|
DisplayFlag,
|
|
5
5
|
ItemPoolType,
|
|
6
|
+
PickupVariant,
|
|
6
7
|
PlayerType,
|
|
7
8
|
TrinketSlot,
|
|
8
9
|
} from "isaac-typescript-definitions";
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
} from "../functions/readOnly";
|
|
16
17
|
import { asCollectibleType } from "../functions/types";
|
|
17
18
|
import { eRange } from "../functions/utils";
|
|
19
|
+
import { ReadonlySet } from "../types/ReadonlySet";
|
|
18
20
|
import { NUM_NORMAL_PILL_COLORS } from "./constantsFirstLast";
|
|
19
21
|
|
|
20
22
|
/**
|
|
@@ -44,6 +46,25 @@ export const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
|
|
|
44
46
|
/** Bombs explode when their frame count is equal to this value. */
|
|
45
47
|
export const BOMB_EXPLODE_FRAME = 45;
|
|
46
48
|
|
|
49
|
+
export const CHEST_PICKUP_VARIANTS = [
|
|
50
|
+
PickupVariant.CHEST, // 50
|
|
51
|
+
PickupVariant.BOMB_CHEST, // 51
|
|
52
|
+
PickupVariant.SPIKED_CHEST, // 52
|
|
53
|
+
PickupVariant.ETERNAL_CHEST, // 53
|
|
54
|
+
PickupVariant.MIMIC_CHEST, // 54
|
|
55
|
+
PickupVariant.OLD_CHEST, // 55
|
|
56
|
+
PickupVariant.WOODEN_CHEST, // 56
|
|
57
|
+
PickupVariant.MEGA_CHEST, // 57
|
|
58
|
+
PickupVariant.HAUNTED_CHEST, // 58
|
|
59
|
+
PickupVariant.LOCKED_CHEST, // 60
|
|
60
|
+
PickupVariant.RED_CHEST, // 360
|
|
61
|
+
PickupVariant.MOMS_CHEST, // 390
|
|
62
|
+
] as const;
|
|
63
|
+
|
|
64
|
+
export const CHEST_PICKUP_VARIANTS_SET = new ReadonlySet<PickupVariant>(
|
|
65
|
+
CHEST_PICKUP_VARIANTS,
|
|
66
|
+
);
|
|
67
|
+
|
|
47
68
|
/** This is the initial value of the `EntityPickup.Wait` field after a collectible is spawned. */
|
|
48
69
|
export const COLLECTIBLE_INITIAL_WAIT = 20;
|
|
49
70
|
|
package/src/functions/array.ts
CHANGED
|
@@ -103,22 +103,23 @@ export function arrayRemoveAllInPlace<T>(
|
|
|
103
103
|
* matching element. If you want to remove all of the elements, use the `arrayRemoveAllInPlace`
|
|
104
104
|
* function instead.
|
|
105
105
|
*
|
|
106
|
-
* @returns
|
|
106
|
+
* @returns The removed elements. This will be an empty array if no elements were removed.
|
|
107
107
|
*/
|
|
108
108
|
export function arrayRemoveInPlace<T>(
|
|
109
109
|
array: T[],
|
|
110
110
|
...elementsToRemove: T[]
|
|
111
|
-
):
|
|
112
|
-
|
|
111
|
+
): T[] {
|
|
112
|
+
const removedElements: T[] = [];
|
|
113
|
+
|
|
113
114
|
for (const element of elementsToRemove) {
|
|
114
115
|
const index = array.indexOf(element);
|
|
115
116
|
if (index > -1) {
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
const removedElement = array.splice(index, 1);
|
|
118
|
+
removedElements.push(...removedElement);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
|
|
121
|
-
return
|
|
122
|
+
return removedElements;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
/**
|
package/src/functions/pickups.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type {
|
|
|
3
3
|
HeartSubType,
|
|
4
4
|
PickupVariant,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
|
+
import { CHEST_PICKUP_VARIANTS_SET } from "../core/constants";
|
|
6
7
|
import {
|
|
7
8
|
COIN_SUB_TYPE_TO_VALUE,
|
|
8
9
|
DEFAULT_COIN_VALUE,
|
|
9
10
|
} from "../objects/coinSubTypeToValue";
|
|
10
|
-
import { CHEST_PICKUP_VARIANTS } from "../sets/chestPickupVariantsSet";
|
|
11
11
|
import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
|
|
12
12
|
import { removeEntities } from "./entities";
|
|
13
13
|
import { isHeart } from "./pickupVariants";
|
|
@@ -39,7 +39,7 @@ export function isChest(pickup: EntityPickup): boolean {
|
|
|
39
39
|
* Helper function to test if the provided pickup variant matches one of the various chest variants.
|
|
40
40
|
*/
|
|
41
41
|
export function isChestVariant(pickupVariant: PickupVariant): boolean {
|
|
42
|
-
return
|
|
42
|
+
return CHEST_PICKUP_VARIANTS_SET.has(pickupVariant);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chestPickupVariantsSet.d.ts","sourceRoot":"","sources":["../../../src/sets/chestPickupVariantsSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAG7D,eAAO,MAAM,qBAAqB,4BAahC,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
local ____lualib = require("lualib_bundle")
|
|
2
|
-
local __TS__New = ____lualib.__TS__New
|
|
3
|
-
local ____exports = {}
|
|
4
|
-
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
|
-
local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
|
|
6
|
-
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
7
|
-
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
8
|
-
____exports.CHEST_PICKUP_VARIANTS = __TS__New(ReadonlySet, {
|
|
9
|
-
PickupVariant.CHEST,
|
|
10
|
-
PickupVariant.BOMB_CHEST,
|
|
11
|
-
PickupVariant.SPIKED_CHEST,
|
|
12
|
-
PickupVariant.ETERNAL_CHEST,
|
|
13
|
-
PickupVariant.MIMIC_CHEST,
|
|
14
|
-
PickupVariant.OLD_CHEST,
|
|
15
|
-
PickupVariant.WOODEN_CHEST,
|
|
16
|
-
PickupVariant.MEGA_CHEST,
|
|
17
|
-
PickupVariant.HAUNTED_CHEST,
|
|
18
|
-
PickupVariant.LOCKED_CHEST,
|
|
19
|
-
PickupVariant.RED_CHEST,
|
|
20
|
-
PickupVariant.MOMS_CHEST
|
|
21
|
-
})
|
|
22
|
-
return ____exports
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PickupVariant } from "isaac-typescript-definitions";
|
|
2
|
-
import { ReadonlySet } from "../types/ReadonlySet";
|
|
3
|
-
|
|
4
|
-
export const CHEST_PICKUP_VARIANTS = new ReadonlySet<PickupVariant>([
|
|
5
|
-
PickupVariant.CHEST, // 50
|
|
6
|
-
PickupVariant.BOMB_CHEST, // 51
|
|
7
|
-
PickupVariant.SPIKED_CHEST, // 52
|
|
8
|
-
PickupVariant.ETERNAL_CHEST, // 53
|
|
9
|
-
PickupVariant.MIMIC_CHEST, // 54
|
|
10
|
-
PickupVariant.OLD_CHEST, // 55
|
|
11
|
-
PickupVariant.WOODEN_CHEST, // 56
|
|
12
|
-
PickupVariant.MEGA_CHEST, // 57
|
|
13
|
-
PickupVariant.HAUNTED_CHEST, // 58
|
|
14
|
-
PickupVariant.LOCKED_CHEST, // 60
|
|
15
|
-
PickupVariant.RED_CHEST, // 360
|
|
16
|
-
PickupVariant.MOMS_CHEST, // 390
|
|
17
|
-
]);
|