isaacscript-common 40.0.0 → 41.1.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 +363 -335
- package/dist/isaacscript-common.lua +463 -461
- package/dist/lualib_bundle.lua +61 -56
- package/dist/src/classes/features/other/FlyingDetection.lua +2 -2
- package/dist/src/classes/features/other/ItemPoolDetection.lua +2 -2
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts +0 -86
- package/dist/src/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementDetection.lua +1 -57
- package/dist/src/classes/features/other/ModdedElementSets.d.ts +250 -210
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +285 -284
- package/dist/src/core/constants.d.ts +13 -2
- package/dist/src/core/constants.d.ts.map +1 -1
- package/dist/src/core/constants.lua +28 -1
- package/dist/src/core/constantsFirstLast.d.ts +5 -0
- package/dist/src/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/src/core/constantsVanilla.d.ts +93 -0
- package/dist/src/core/constantsVanilla.d.ts.map +1 -0
- package/dist/src/core/constantsVanilla.lua +115 -0
- package/dist/src/core/upgradeMod.lua +3 -0
- package/dist/src/functions/cards.d.ts +0 -7
- package/dist/src/functions/cards.d.ts.map +1 -1
- package/dist/src/functions/cards.lua +0 -10
- package/dist/src/functions/collectibles.d.ts +0 -10
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +0 -13
- package/dist/src/functions/dimensions.d.ts +0 -4
- package/dist/src/functions/dimensions.d.ts.map +1 -1
- package/dist/src/functions/dimensions.lua +2 -8
- package/dist/src/functions/pickups.lua +3 -3
- package/dist/src/functions/pills.d.ts +0 -2
- package/dist/src/functions/pills.d.ts.map +1 -1
- package/dist/src/functions/pills.lua +0 -5
- package/dist/src/functions/rooms.lua +2 -2
- package/dist/src/functions/trinkets.d.ts +0 -9
- package/dist/src/functions/trinkets.d.ts.map +1 -1
- package/dist/src/functions/trinkets.lua +0 -12
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +8 -0
- package/package.json +1 -1
- package/src/classes/features/other/FlyingDetection.ts +2 -2
- package/src/classes/features/other/ItemPoolDetection.ts +2 -2
- package/src/classes/features/other/ModdedElementDetection.ts +4 -156
- package/src/classes/features/other/ModdedElementSets.ts +552 -486
- package/src/core/constants.ts +36 -2
- package/src/core/constantsFirstLast.ts +5 -1
- package/src/core/constantsVanilla.ts +183 -0
- package/src/core/upgradeMod.ts +6 -1
- package/src/functions/cards.ts +1 -15
- package/src/functions/collectibles.ts +1 -18
- package/src/functions/dimensions.ts +2 -10
- package/src/functions/pickups.ts +2 -2
- package/src/functions/pills.ts +0 -6
- package/src/functions/rooms.ts +3 -3
- package/src/functions/trinkets.ts +1 -17
- package/src/index.ts +1 -0
- 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/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,
|
|
@@ -24,13 +24,13 @@ function FlyingDetection.prototype.____constructor(self, moddedElementSets)
|
|
|
24
24
|
end
|
|
25
25
|
function FlyingDetection.prototype.hasFlyingTemporaryEffect(self, player)
|
|
26
26
|
local effects = player:GetEffects()
|
|
27
|
-
local flyingCollectibles = self.moddedElementSets:
|
|
27
|
+
local flyingCollectibles = self.moddedElementSets:getFlyingCollectibleTypes(true)
|
|
28
28
|
for ____, collectibleType in __TS__Iterator(flyingCollectibles) do
|
|
29
29
|
if effects:HasCollectibleEffect(collectibleType) then
|
|
30
30
|
return true
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
-
local flyingTrinkets = self.moddedElementSets:
|
|
33
|
+
local flyingTrinkets = self.moddedElementSets:getFlyingTrinketTypes()
|
|
34
34
|
for ____, trinketType in __TS__Iterator(flyingTrinkets) do
|
|
35
35
|
if effects:HasTrinketEffect(trinketType) then
|
|
36
36
|
return true
|
|
@@ -96,7 +96,7 @@ function ItemPoolDetection.prototype.____constructor(self, moddedElementSets)
|
|
|
96
96
|
self.moddedElementSets = moddedElementSets
|
|
97
97
|
end
|
|
98
98
|
function ItemPoolDetection.prototype.getCollectiblesInItemPool(self, itemPoolType)
|
|
99
|
-
local collectibleArray = self.moddedElementSets:
|
|
99
|
+
local collectibleArray = self.moddedElementSets:getCollectibleTypes()
|
|
100
100
|
return __TS__ArrayFilter(
|
|
101
101
|
collectibleArray,
|
|
102
102
|
function(____, collectibleType) return self:isCollectibleInItemPool(collectibleType, itemPoolType) end
|
|
@@ -121,7 +121,7 @@ function ItemPoolDetection.prototype.isCollectibleInItemPool(self, collectibleTy
|
|
|
121
121
|
local removedTrinketsMap = ____removeItemsAndTrinketsThatAffectItemPools_result_0.removedTrinketsMap
|
|
122
122
|
local itemPool = game:GetItemPool()
|
|
123
123
|
itemPool:ResetRoomBlacklist()
|
|
124
|
-
for ____, collectibleTypeInSet in ipairs(self.moddedElementSets:
|
|
124
|
+
for ____, collectibleTypeInSet in ipairs(self.moddedElementSets:getCollectibleTypes()) do
|
|
125
125
|
if collectibleTypeInSet ~= collectibleType then
|
|
126
126
|
itemPool:AddRoomBlacklist(collectibleTypeInSet)
|
|
127
127
|
end
|
|
@@ -42,27 +42,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
42
42
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
43
43
|
*/
|
|
44
44
|
getLastCollectibleType(): CollectibleType;
|
|
45
|
-
/**
|
|
46
|
-
* Helper function to get an array that represents every modded collectible type.
|
|
47
|
-
*
|
|
48
|
-
* Returns an empty array if there are no modded collectible types.
|
|
49
|
-
*
|
|
50
|
-
* This function is only useful when building collectible type objects. For most purposes, you
|
|
51
|
-
* should use the `getModdedCollectibleArray` or `getModdedCollectibleSet` helper function
|
|
52
|
-
* instead.
|
|
53
|
-
*
|
|
54
|
-
* (This function is named differently from the `getVanillaCollectibleTypeRange` function because
|
|
55
|
-
* all modded collectible types are contiguous. Thus, each value represents a real
|
|
56
|
-
* `CollectibleType`.)
|
|
57
|
-
*
|
|
58
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
59
|
-
* not all collectibles will necessarily be present when a mod first loads (due to mod load
|
|
60
|
-
* order).
|
|
61
|
-
*
|
|
62
|
-
* In order to use this function, you must upgrade your mod with
|
|
63
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
64
|
-
*/
|
|
65
|
-
getModdedCollectibleTypes(): CollectibleType[];
|
|
66
45
|
/**
|
|
67
46
|
* Returns the total number of collectibles in the item config, including both vanilla and modded
|
|
68
47
|
* items. If you just need the number of vanilla collectible types, use the
|
|
@@ -113,24 +92,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
113
92
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
114
93
|
*/
|
|
115
94
|
getLastTrinketType(): TrinketType;
|
|
116
|
-
/**
|
|
117
|
-
* Helper function to get an array that represents every modded trinket type.
|
|
118
|
-
*
|
|
119
|
-
* Returns an empty array if there are no modded trinket types.
|
|
120
|
-
*
|
|
121
|
-
* This function is only useful when building trinket type objects. For most purposes, you should
|
|
122
|
-
* use the `getModdedTrinketArray` or `getModdedTrinketSet` helper function instead.
|
|
123
|
-
*
|
|
124
|
-
* (This function is named differently from the `getVanillaTrinketTypeRange` function because all
|
|
125
|
-
* modded trinket types are contiguous. Thus, each value represents a real `TrinketType`.)
|
|
126
|
-
*
|
|
127
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
128
|
-
* not all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
129
|
-
*
|
|
130
|
-
* In order to use this function, you must upgrade your mod with
|
|
131
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
132
|
-
*/
|
|
133
|
-
getModdedTrinketTypes(): TrinketType[];
|
|
134
95
|
/**
|
|
135
96
|
* Returns the total number of trinkets in the item config, including both vanilla and modded
|
|
136
97
|
* items. If you just need the number of vanilla trinket types, use the
|
|
@@ -153,16 +114,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
153
114
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
154
115
|
*/
|
|
155
116
|
getNumModdedTrinketTypes(): int;
|
|
156
|
-
/**
|
|
157
|
-
* Helper function to get an array with every valid card sub-type. This includes modded cards.
|
|
158
|
-
*
|
|
159
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
160
|
-
* not all cards will necessarily be present when a mod first loads (due to mod load order).
|
|
161
|
-
*
|
|
162
|
-
* In order to use this function, you must upgrade your mod with
|
|
163
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
164
|
-
*/
|
|
165
|
-
getAllCardTypes(): CardType[];
|
|
166
117
|
/**
|
|
167
118
|
* Returns the first modded card sub-type, or undefined if there are no modded cards.
|
|
168
119
|
*
|
|
@@ -186,18 +137,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
186
137
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
187
138
|
*/
|
|
188
139
|
getLastCardType(): CardType;
|
|
189
|
-
/**
|
|
190
|
-
* Helper function to get an array with every modded card sub-type.
|
|
191
|
-
*
|
|
192
|
-
* Returns an empty array if there are no modded cards.
|
|
193
|
-
*
|
|
194
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
195
|
-
* not all cards will necessarily be present when a mod first loads (due to mod load order).
|
|
196
|
-
*
|
|
197
|
-
* In order to use this function, you must upgrade your mod with
|
|
198
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
199
|
-
*/
|
|
200
|
-
getModdedCardTypes(): CardType[];
|
|
201
140
|
/**
|
|
202
141
|
* Will change depending on how many modded cards there are.
|
|
203
142
|
*
|
|
@@ -218,18 +157,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
218
157
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
219
158
|
*/
|
|
220
159
|
getNumModdedCardTypes(): int;
|
|
221
|
-
/**
|
|
222
|
-
* Helper function to get an array with every valid pill effect. This includes modded pill
|
|
223
|
-
* effects.
|
|
224
|
-
*
|
|
225
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
226
|
-
* not all pill effects will necessarily be present when a mod first loads (due to mod load
|
|
227
|
-
* order).
|
|
228
|
-
*
|
|
229
|
-
* In order to use this function, you must upgrade your mod with
|
|
230
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
231
|
-
*/
|
|
232
|
-
getAllPillEffects(): PillEffect[];
|
|
233
160
|
/**
|
|
234
161
|
* Returns the first modded pill effect, or undefined if there are no modded pill effects.
|
|
235
162
|
*
|
|
@@ -255,19 +182,6 @@ export declare class ModdedElementDetection extends Feature {
|
|
|
255
182
|
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
256
183
|
*/
|
|
257
184
|
getLastPillEffect(): PillEffect;
|
|
258
|
-
/**
|
|
259
|
-
* Helper function to get an array with every modded pill effect.
|
|
260
|
-
*
|
|
261
|
-
* Returns an empty array if there are no modded pill effects.
|
|
262
|
-
*
|
|
263
|
-
* This function can only be called if at least one callback has been executed. This is because
|
|
264
|
-
* not all pill effects will necessarily be present when a mod first loads (due to mod load
|
|
265
|
-
* order).
|
|
266
|
-
*
|
|
267
|
-
* In order to use this function, you must upgrade your mod with
|
|
268
|
-
* `ISCFeature.MODDED_ELEMENT_DETECTION`.
|
|
269
|
-
*/
|
|
270
|
-
getModdedPillEffects(): PillEffect[];
|
|
271
185
|
/**
|
|
272
186
|
* Will change depending on how many modded pill effects there are.
|
|
273
187
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ModdedElementDetection.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementDetection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAqBtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,SAAQ,OAAO;IACjD,OAAO,CAAC,uBAAuB,CAAS;IAaxC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;IAEF,OAAO,CAAC,uBAAuB;IAY/B;;;;;;;;;OASG;IAEI,6BAA6B,IAAI,eAAe,GAAG,SAAS;IAenE;;;;;;;;;;;;;;;OAeG;IAEI,sBAAsB,IAAI,eAAe;IAKhD;;;;;;;;;;;OAWG;IAEI,sBAAsB,IAAI,GAAG;IAOpC;;;;;;;;;OASG;IAEI,4BAA4B,IAAI,GAAG;IAW1C;;;;;;;;OAQG;IAEI,yBAAyB,IAAI,WAAW,GAAG,SAAS;IAU3D;;;;;;;;;;;;;;OAcG;IAEI,kBAAkB,IAAI,WAAW;IAKxC;;;;;;;;;;OAUG;IAEI,kBAAkB,IAAI,GAAG;IAOhC;;;;;;;;OAQG;IAEI,wBAAwB,IAAI,GAAG;IAWtC;;;;;;;;OAQG;IAEI,sBAAsB,IAAI,QAAQ,GAAG,SAAS;IAWrD;;;;;;;;;;;OAWG;IAEI,eAAe,IAAI,QAAQ;IAOlC;;;;;;;;;;OAUG;IAEI,eAAe,IAAI,GAAG;IAK7B;;;;;;OAMG;IAEI,qBAAqB,IAAI,GAAG;IAWnC;;;;;;;;;OASG;IAEI,wBAAwB,IAAI,UAAU,GAAG,SAAS;IAezD;;;;;;;;;;;;OAYG;IAEI,iBAAiB,IAAI,UAAU;IAOtC;;;;;;;;;;;;OAYG;IAEI,iBAAiB,IAAI,GAAG;IAK/B;;;;;;;OAOG;IAEI,uBAAuB,IAAI,GAAG;CAMtC"}
|
|
@@ -8,8 +8,6 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
|
|
|
8
8
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
9
9
|
local itemConfig = ____cachedClasses.itemConfig
|
|
10
10
|
local ____constantsFirstLast = require("src.core.constantsFirstLast")
|
|
11
|
-
local FIRST_CARD_TYPE = ____constantsFirstLast.FIRST_CARD_TYPE
|
|
12
|
-
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
13
11
|
local LAST_VANILLA_CARD_TYPE = ____constantsFirstLast.LAST_VANILLA_CARD_TYPE
|
|
14
12
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
15
13
|
local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
|
|
@@ -26,8 +24,6 @@ local asCollectibleType = ____types.asCollectibleType
|
|
|
26
24
|
local asNumber = ____types.asNumber
|
|
27
25
|
local asPillEffect = ____types.asPillEffect
|
|
28
26
|
local asTrinketType = ____types.asTrinketType
|
|
29
|
-
local ____utils = require("src.functions.utils")
|
|
30
|
-
local iRange = ____utils.iRange
|
|
31
27
|
local ____Feature = require("src.classes.private.Feature")
|
|
32
28
|
local Feature = ____Feature.Feature
|
|
33
29
|
--- Mods can add extra things to the game (e.g. collectibles, trinkets, and so on). Since mods load
|
|
@@ -45,7 +41,7 @@ __TS__ClassExtends(ModdedElementDetection, Feature)
|
|
|
45
41
|
function ModdedElementDetection.prototype.____constructor(self)
|
|
46
42
|
Feature.prototype.____constructor(self)
|
|
47
43
|
self.atLeastOneCallbackFired = false
|
|
48
|
-
self.postPlayerInit = function(
|
|
44
|
+
self.postPlayerInit = function()
|
|
49
45
|
self.atLeastOneCallbackFired = true
|
|
50
46
|
end
|
|
51
47
|
self.callbacksUsed = {{ModCallback.POST_PLAYER_INIT, self.postPlayerInit}}
|
|
@@ -76,16 +72,6 @@ function ModdedElementDetection.prototype.getLastCollectibleType(self)
|
|
|
76
72
|
return itemConfig:GetCollectibles().Size - 1
|
|
77
73
|
end
|
|
78
74
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCollectibleType", true)
|
|
79
|
-
function ModdedElementDetection.prototype.getModdedCollectibleTypes(self)
|
|
80
|
-
self:errorIfNoCallbacksFired("collectible")
|
|
81
|
-
local firstModdedCollectibleType = self:getFirstModdedCollectibleType()
|
|
82
|
-
if firstModdedCollectibleType == nil then
|
|
83
|
-
return {}
|
|
84
|
-
end
|
|
85
|
-
local lastCollectibleType = self:getLastCollectibleType()
|
|
86
|
-
return iRange(nil, firstModdedCollectibleType, lastCollectibleType)
|
|
87
|
-
end
|
|
88
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedCollectibleTypes", true)
|
|
89
75
|
function ModdedElementDetection.prototype.getNumCollectibleTypes(self)
|
|
90
76
|
self:errorIfNoCallbacksFired("collectible")
|
|
91
77
|
local numModdedCollectibleTypes = self:getNumModdedCollectibleTypes()
|
|
@@ -119,16 +105,6 @@ function ModdedElementDetection.prototype.getLastTrinketType(self)
|
|
|
119
105
|
return itemConfig:GetTrinkets().Size - 1
|
|
120
106
|
end
|
|
121
107
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
|
|
122
|
-
function ModdedElementDetection.prototype.getModdedTrinketTypes(self)
|
|
123
|
-
self:errorIfNoCallbacksFired("trinket")
|
|
124
|
-
local firstModdedTrinketType = self:getFirstModdedTrinketType()
|
|
125
|
-
if firstModdedTrinketType == nil then
|
|
126
|
-
return {}
|
|
127
|
-
end
|
|
128
|
-
local lastTrinketType = self:getLastTrinketType()
|
|
129
|
-
return iRange(nil, firstModdedTrinketType, lastTrinketType)
|
|
130
|
-
end
|
|
131
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedTrinketTypes", true)
|
|
132
108
|
function ModdedElementDetection.prototype.getNumTrinketTypes(self)
|
|
133
109
|
self:errorIfNoCallbacksFired("trinket")
|
|
134
110
|
local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
|
|
@@ -141,12 +117,6 @@ function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
|
|
|
141
117
|
return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
|
|
142
118
|
end
|
|
143
119
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
|
|
144
|
-
function ModdedElementDetection.prototype.getAllCardTypes(self)
|
|
145
|
-
self:errorIfNoCallbacksFired("card")
|
|
146
|
-
local lastCardType = self:getLastCardType()
|
|
147
|
-
return iRange(nil, FIRST_CARD_TYPE, lastCardType)
|
|
148
|
-
end
|
|
149
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getAllCardTypes", true)
|
|
150
120
|
function ModdedElementDetection.prototype.getFirstModdedCardType(self)
|
|
151
121
|
self:errorIfNoCallbacksFired("card")
|
|
152
122
|
local firstModdedCardType = asCardType(
|
|
@@ -169,16 +139,6 @@ function ModdedElementDetection.prototype.getLastCardType(self)
|
|
|
169
139
|
return asCardType(nil, numCards)
|
|
170
140
|
end
|
|
171
141
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCardType", true)
|
|
172
|
-
function ModdedElementDetection.prototype.getModdedCardTypes(self)
|
|
173
|
-
self:errorIfNoCallbacksFired("card")
|
|
174
|
-
local firstModdedCardType = self:getFirstModdedCardType()
|
|
175
|
-
if firstModdedCardType == nil then
|
|
176
|
-
return {}
|
|
177
|
-
end
|
|
178
|
-
local lastCardType = self:getLastCardType()
|
|
179
|
-
return iRange(nil, firstModdedCardType, lastCardType)
|
|
180
|
-
end
|
|
181
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedCardTypes", true)
|
|
182
142
|
function ModdedElementDetection.prototype.getNumCardTypes(self)
|
|
183
143
|
self:errorIfNoCallbacksFired("card")
|
|
184
144
|
return itemConfig:GetCards().Size - 1
|
|
@@ -190,12 +150,6 @@ function ModdedElementDetection.prototype.getNumModdedCardTypes(self)
|
|
|
190
150
|
return numCardTypes - NUM_VANILLA_CARD_TYPES
|
|
191
151
|
end
|
|
192
152
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedCardTypes", true)
|
|
193
|
-
function ModdedElementDetection.prototype.getAllPillEffects(self)
|
|
194
|
-
self:errorIfNoCallbacksFired("pill")
|
|
195
|
-
local lastPillEffect = self:getLastPillEffect()
|
|
196
|
-
return iRange(nil, FIRST_PILL_EFFECT, lastPillEffect)
|
|
197
|
-
end
|
|
198
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getAllPillEffects", true)
|
|
199
153
|
function ModdedElementDetection.prototype.getFirstModdedPillEffect(self)
|
|
200
154
|
self:errorIfNoCallbacksFired("pill")
|
|
201
155
|
local firstModdedPillEffect = asPillEffect(
|
|
@@ -218,16 +172,6 @@ function ModdedElementDetection.prototype.getLastPillEffect(self)
|
|
|
218
172
|
return asPillEffect(nil, numPillEffects)
|
|
219
173
|
end
|
|
220
174
|
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastPillEffect", true)
|
|
221
|
-
function ModdedElementDetection.prototype.getModdedPillEffects(self)
|
|
222
|
-
self:errorIfNoCallbacksFired("pill")
|
|
223
|
-
local firstModdedPillEffect = self:getFirstModdedPillEffect()
|
|
224
|
-
if firstModdedPillEffect == nil then
|
|
225
|
-
return {}
|
|
226
|
-
end
|
|
227
|
-
local lastPillEffect = self:getLastPillEffect()
|
|
228
|
-
return iRange(nil, firstModdedPillEffect, lastPillEffect)
|
|
229
|
-
end
|
|
230
|
-
__TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getModdedPillEffects", true)
|
|
231
175
|
function ModdedElementDetection.prototype.getNumPillEffects(self)
|
|
232
176
|
self:errorIfNoCallbacksFired("pill")
|
|
233
177
|
return itemConfig:GetPillEffects().Size
|