isaacscript-common 7.18.0 → 8.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/core/constantsFirstLast.d.ts +10 -85
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +10 -90
- package/dist/enums/ModCallbackCustom.d.ts +21 -0
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/features/characterStats.lua +2 -2
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +9 -5
- package/dist/features/firstLast.d.ts +190 -0
- package/dist/features/firstLast.d.ts.map +1 -0
- package/dist/features/firstLast.lua +341 -0
- package/dist/functions/array.d.ts +1 -9
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/array.lua +0 -6
- package/dist/functions/cards.d.ts +0 -8
- package/dist/functions/cards.d.ts.map +1 -1
- package/dist/functions/cards.lua +9 -24
- package/dist/functions/{cacheFlag.d.ts → collectibleCacheFlag.d.ts} +8 -8
- package/dist/functions/collectibleCacheFlag.d.ts.map +1 -0
- package/dist/functions/{cacheFlag.lua → collectibleCacheFlag.lua} +12 -13
- package/dist/functions/collectibleSet.d.ts +18 -0
- package/dist/functions/collectibleSet.d.ts.map +1 -1
- package/dist/functions/collectibleSet.lua +29 -9
- package/dist/functions/collectibles.d.ts +0 -13
- package/dist/functions/collectibles.d.ts.map +1 -1
- package/dist/functions/collectibles.lua +0 -18
- package/dist/functions/flying.lua +2 -2
- package/dist/functions/pills.d.ts +0 -10
- package/dist/functions/pills.d.ts.map +1 -1
- package/dist/functions/pills.lua +0 -15
- package/dist/functions/players.d.ts +12 -0
- package/dist/functions/players.d.ts.map +1 -1
- package/dist/functions/players.lua +52 -9
- package/dist/functions/random.d.ts.map +1 -1
- package/dist/functions/random.lua +2 -0
- package/dist/functions/stats.d.ts +9 -0
- package/dist/functions/stats.d.ts.map +1 -0
- package/dist/functions/stats.lua +11 -0
- package/dist/functions/trinketCacheFlag.d.ts +9 -1
- package/dist/functions/trinketCacheFlag.d.ts.map +1 -1
- package/dist/functions/trinketCacheFlag.lua +28 -10
- package/dist/functions/trinketSet.d.ts +18 -0
- package/dist/functions/trinketSet.d.ts.map +1 -1
- package/dist/functions/trinketSet.lua +29 -9
- package/dist/functions/trinkets.d.ts +1 -10
- package/dist/functions/trinkets.d.ts.map +1 -1
- package/dist/functions/trinkets.lua +0 -24
- package/dist/index.d.ts +259 -117
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +14 -6
- package/dist/initFeatures.d.ts.map +1 -1
- package/dist/initFeatures.lua +3 -0
- package/package.json +1 -1
- package/src/core/constantsFirstLast.ts +12 -125
- package/src/enums/ModCallbackCustom.ts +21 -0
- package/src/features/characterStats.ts +1 -1
- package/src/features/extraConsoleCommands/listCommands.ts +8 -5
- package/src/features/firstLast.ts +429 -0
- package/src/functions/array.ts +1 -9
- package/src/functions/cards.ts +5 -28
- package/src/functions/{cacheFlag.ts → collectibleCacheFlag.ts} +13 -16
- package/src/functions/collectibleSet.ts +28 -21
- package/src/functions/collectibles.ts +0 -22
- package/src/functions/flying.ts +1 -1
- package/src/functions/pills.ts +0 -22
- package/src/functions/players.ts +41 -0
- package/src/functions/random.ts +3 -0
- package/src/functions/stats.ts +12 -0
- package/src/functions/trinketCacheFlag.ts +29 -7
- package/src/functions/trinketSet.ts +28 -21
- package/src/functions/trinkets.ts +0 -34
- package/src/index.ts +2 -1
- package/src/initFeatures.ts +2 -0
- package/dist/functions/cacheFlag.d.ts.map +0 -1
|
@@ -5,6 +5,9 @@ import { CollectibleType } from "isaac-typescript-definitions";
|
|
|
5
5
|
*
|
|
6
6
|
* Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
7
7
|
* then use the `getCollectibleSet` helper function instead.
|
|
8
|
+
*
|
|
9
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
10
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
8
11
|
*/
|
|
9
12
|
export declare function getCollectibleArray(): readonly CollectibleType[];
|
|
10
13
|
/**
|
|
@@ -12,6 +15,9 @@ export declare function getCollectibleArray(): readonly CollectibleType[];
|
|
|
12
15
|
*
|
|
13
16
|
* Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
14
17
|
* then use the `getCollectibleArray` helper function instead.
|
|
18
|
+
*
|
|
19
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
20
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
15
21
|
*/
|
|
16
22
|
export declare function getCollectibleSet(): ReadonlySet<CollectibleType>;
|
|
17
23
|
/**
|
|
@@ -19,6 +25,9 @@ export declare function getCollectibleSet(): ReadonlySet<CollectibleType>;
|
|
|
19
25
|
*
|
|
20
26
|
* Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
21
27
|
* then use the `getModdedCollectibleSet` helper function instead.
|
|
28
|
+
*
|
|
29
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
30
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
22
31
|
*/
|
|
23
32
|
export declare function getModdedCollectibleArray(): readonly CollectibleType[];
|
|
24
33
|
/**
|
|
@@ -26,6 +35,9 @@ export declare function getModdedCollectibleArray(): readonly CollectibleType[];
|
|
|
26
35
|
*
|
|
27
36
|
* Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
28
37
|
* then use the `getModdedCollectibleArray` helper function instead.
|
|
38
|
+
*
|
|
39
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
40
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
29
41
|
*/
|
|
30
42
|
export declare function getModdedCollectibleSet(): ReadonlySet<CollectibleType>;
|
|
31
43
|
/**
|
|
@@ -33,6 +45,9 @@ export declare function getModdedCollectibleSet(): ReadonlySet<CollectibleType>;
|
|
|
33
45
|
*
|
|
34
46
|
* Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
35
47
|
* then use the `getVanillaCollectibleSet` helper function instead.
|
|
48
|
+
*
|
|
49
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
50
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
36
51
|
*/
|
|
37
52
|
export declare function getVanillaCollectibleArray(): readonly CollectibleType[];
|
|
38
53
|
/**
|
|
@@ -40,6 +55,9 @@ export declare function getVanillaCollectibleArray(): readonly CollectibleType[]
|
|
|
40
55
|
*
|
|
41
56
|
* Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
42
57
|
* then use the `getVanillaCollectibleArray` helper function instead.
|
|
58
|
+
*
|
|
59
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
60
|
+
* all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
43
61
|
*/
|
|
44
62
|
export declare function getVanillaCollectibleSet(): ReadonlySet<CollectibleType>;
|
|
45
63
|
//# sourceMappingURL=collectibleSet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibleSet.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"collectibleSet.d.ts","sourceRoot":"","sources":["../../src/functions/collectibleSet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAyD/D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,eAAe,EAAE,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAAC,eAAe,CAAC,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,IAAI,SAAS,eAAe,EAAE,CAGtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,IAAI,WAAW,CAAC,eAAe,CAAC,CAGtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,IAAI,SAAS,eAAe,EAAE,CAGvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC,CAGvE"}
|
|
@@ -7,8 +7,9 @@ local ____cachedClasses = require("core.cachedClasses")
|
|
|
7
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
8
|
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
9
9
|
local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
|
|
10
|
-
local LAST_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_COLLECTIBLE_TYPE
|
|
11
10
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
11
|
+
local ____firstLast = require("features.firstLast")
|
|
12
|
+
local getLastCollectibleType = ____firstLast.getLastCollectibleType
|
|
12
13
|
local ____utils = require("functions.utils")
|
|
13
14
|
local irange = ____utils.irange
|
|
14
15
|
local ALL_COLLECTIBLES_ARRAY = {}
|
|
@@ -17,11 +18,12 @@ local MODDED_COLLECTIBLES_ARRAY = {}
|
|
|
17
18
|
local ALL_COLLECTIBLES_SET = __TS__New(Set)
|
|
18
19
|
local VANILLA_COLLECTIBLES_SET = __TS__New(Set)
|
|
19
20
|
local MODDED_COLLECTIBLES_SET = __TS__New(Set)
|
|
20
|
-
local function
|
|
21
|
+
local function lazyInitCollectibleArraysAndSets(self)
|
|
21
22
|
if #ALL_COLLECTIBLES_ARRAY ~= 0 then
|
|
22
23
|
return
|
|
23
24
|
end
|
|
24
|
-
local
|
|
25
|
+
local lastCollectibleType = getLastCollectibleType(nil)
|
|
26
|
+
local collectibleTypeRange = irange(nil, FIRST_COLLECTIBLE_TYPE, lastCollectibleType)
|
|
25
27
|
for ____, collectibleType in ipairs(collectibleTypeRange) do
|
|
26
28
|
do
|
|
27
29
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
@@ -55,48 +57,66 @@ end
|
|
|
55
57
|
--
|
|
56
58
|
-- Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
57
59
|
-- then use the `getCollectibleSet` helper function instead.
|
|
60
|
+
--
|
|
61
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
62
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
58
63
|
function ____exports.getCollectibleArray(self)
|
|
59
|
-
|
|
64
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
60
65
|
return ALL_COLLECTIBLES_ARRAY
|
|
61
66
|
end
|
|
62
67
|
--- Returns a set containing every valid collectible type in the game, including modded collectibles.
|
|
63
68
|
--
|
|
64
69
|
-- Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
65
70
|
-- then use the `getCollectibleArray` helper function instead.
|
|
71
|
+
--
|
|
72
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
73
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
66
74
|
function ____exports.getCollectibleSet(self)
|
|
67
|
-
|
|
75
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
68
76
|
return ALL_COLLECTIBLES_SET
|
|
69
77
|
end
|
|
70
78
|
--- Returns an array containing every modded collectible type in the game.
|
|
71
79
|
--
|
|
72
80
|
-- Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
73
81
|
-- then use the `getModdedCollectibleSet` helper function instead.
|
|
82
|
+
--
|
|
83
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
84
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
74
85
|
function ____exports.getModdedCollectibleArray(self)
|
|
75
|
-
|
|
86
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
76
87
|
return MODDED_COLLECTIBLES_ARRAY
|
|
77
88
|
end
|
|
78
89
|
--- Returns a set containing every modded collectible type in the game.
|
|
79
90
|
--
|
|
80
91
|
-- Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
81
92
|
-- then use the `getModdedCollectibleArray` helper function instead.
|
|
93
|
+
--
|
|
94
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
95
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
82
96
|
function ____exports.getModdedCollectibleSet(self)
|
|
83
|
-
|
|
97
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
84
98
|
return MODDED_COLLECTIBLES_SET
|
|
85
99
|
end
|
|
86
100
|
--- Returns an array containing every valid vanilla collectible type in the game.
|
|
87
101
|
--
|
|
88
102
|
-- Use this if you need to iterate over the collectibles in order. If you need to do O(1) lookups,
|
|
89
103
|
-- then use the `getVanillaCollectibleSet` helper function instead.
|
|
104
|
+
--
|
|
105
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
106
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
90
107
|
function ____exports.getVanillaCollectibleArray(self)
|
|
91
|
-
|
|
108
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
92
109
|
return VANILLA_COLLECTIBLES_ARRAY
|
|
93
110
|
end
|
|
94
111
|
--- Returns a set containing every valid vanilla collectible type in the game.
|
|
95
112
|
--
|
|
96
113
|
-- Use this if you need to do O(1) lookups. If you need to iterate over the collectibles in order,
|
|
97
114
|
-- then use the `getVanillaCollectibleArray` helper function instead.
|
|
115
|
+
--
|
|
116
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
117
|
+
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
98
118
|
function ____exports.getVanillaCollectibleSet(self)
|
|
99
|
-
|
|
119
|
+
lazyInitCollectibleArraysAndSets(nil)
|
|
100
120
|
return VANILLA_COLLECTIBLES_SET
|
|
101
121
|
end
|
|
102
122
|
return ____exports
|
|
@@ -123,19 +123,6 @@ export declare function getCollectibleQuality(collectibleType: CollectibleType):
|
|
|
123
123
|
* ```
|
|
124
124
|
*/
|
|
125
125
|
export declare function getCollectibleTags(collectibleType: CollectibleType): BitFlags<ItemConfigTag>;
|
|
126
|
-
/**
|
|
127
|
-
* Helper function to get an array that represents the all modded collectible types.
|
|
128
|
-
*
|
|
129
|
-
* This function is only useful when building collectible type objects. For most purposes, you
|
|
130
|
-
* should use the `getModdedCollectibleSet` helper function instead.
|
|
131
|
-
*
|
|
132
|
-
* Returns an empty array if there are no modded collectible types.
|
|
133
|
-
*
|
|
134
|
-
* (This function is named differently from the `getVanillaCollectibleTypeRange` function because
|
|
135
|
-
* all modded collectible types are contiguous. Thus, each value represents a real
|
|
136
|
-
* `CollectibleType`.)
|
|
137
|
-
*/
|
|
138
|
-
export declare function getModdedCollectibleTypes(): CollectibleType[];
|
|
139
126
|
/**
|
|
140
127
|
* Helper function to get an array that represents the range from the first collectible type to the
|
|
141
128
|
* last vanilla collectible type. This will include integers that do not represent any valid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgBtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAyB7D,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAEtE;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;A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FAULT_ITEM_POOL_TYPE
|
|
17
17
|
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
18
18
|
local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
|
|
19
|
-
local FIRST_MODDED_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_MODDED_COLLECTIBLE_TYPE
|
|
20
|
-
local LAST_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_COLLECTIBLE_TYPE
|
|
21
19
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
22
20
|
local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
|
|
23
21
|
local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
|
|
@@ -326,22 +324,6 @@ function ____exports.getCollectibleTags(self, collectibleType)
|
|
|
326
324
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
327
325
|
return itemConfigItem == nil and ItemConfigTagZero or itemConfigItem.Tags
|
|
328
326
|
end
|
|
329
|
-
--- Helper function to get an array that represents the all modded collectible types.
|
|
330
|
-
--
|
|
331
|
-
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
332
|
-
-- should use the `getModdedCollectibleSet` helper function instead.
|
|
333
|
-
--
|
|
334
|
-
-- Returns an empty array if there are no modded collectible types.
|
|
335
|
-
--
|
|
336
|
-
-- (This function is named differently from the `getVanillaCollectibleTypeRange` function because
|
|
337
|
-
-- all modded collectible types are contiguous. Thus, each value represents a real
|
|
338
|
-
-- `CollectibleType`.)
|
|
339
|
-
function ____exports.getModdedCollectibleTypes(self)
|
|
340
|
-
if LAST_VANILLA_COLLECTIBLE_TYPE == LAST_COLLECTIBLE_TYPE then
|
|
341
|
-
return {}
|
|
342
|
-
end
|
|
343
|
-
return irange(nil, FIRST_MODDED_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE)
|
|
344
|
-
end
|
|
345
327
|
--- Helper function to get an array that represents the range from the first collectible type to the
|
|
346
328
|
-- last vanilla collectible type. This will include integers that do not represent any valid
|
|
347
329
|
-- collectible types.
|
|
@@ -9,8 +9,8 @@ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
|
9
9
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
10
10
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
11
11
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
12
|
-
local
|
|
13
|
-
local getCollectiblesForCacheFlag =
|
|
12
|
+
local ____collectibleCacheFlag = require("functions.collectibleCacheFlag")
|
|
13
|
+
local getCollectiblesForCacheFlag = ____collectibleCacheFlag.getCollectiblesForCacheFlag
|
|
14
14
|
local ____set = require("functions.set")
|
|
15
15
|
local copySet = ____set.copySet
|
|
16
16
|
local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
@@ -4,10 +4,6 @@ import { ItemConfigPillEffectClass, ItemConfigPillEffectType, PillColor, PillEff
|
|
|
4
4
|
* all horse colors.
|
|
5
5
|
*/
|
|
6
6
|
export declare function getAllPillColors(): PillColor[];
|
|
7
|
-
/**
|
|
8
|
-
* Helper function to get an array with every valid pill effect. This includes modded pill effects.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getAllPillEffects(): PillEffect[];
|
|
11
7
|
/**
|
|
12
8
|
* Helper function to get the associated pill effect after False PHD is acquired. If a pill effect
|
|
13
9
|
* is not altered by False PHD, then the same pill effect will be returned.
|
|
@@ -22,12 +18,6 @@ export declare function getFalsePHDPillEffect(pillEffect: PillEffect): PillEffec
|
|
|
22
18
|
export declare function getHorsePillColor(pillColor: PillColor): PillColor;
|
|
23
19
|
/** Helper function to get an array with every non-gold horse pill color. */
|
|
24
20
|
export declare function getHorsePillColors(): PillColor[];
|
|
25
|
-
/**
|
|
26
|
-
* Helper function to get an array with every modded pill effect.
|
|
27
|
-
*
|
|
28
|
-
* Returns an empty array if there are no modded pill effects.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getModdedPillEffects(): PillEffect[];
|
|
31
21
|
/**
|
|
32
22
|
* Helper function to get the corresponding normal pill color from a horse pill color.
|
|
33
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,SAAS,EACT,UAAU,EACX,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,SAAS,EACT,UAAU,EACX,MAAM,8BAA8B,CAAC;AAqCtC;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAI9C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGxE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAEjE;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,IAAI,SAAS,EAAE,CAEhD;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAM3E;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,IAAI,SAAS,EAAE,CAEjD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,GACrB,yBAAyB,CAS3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,CAgBhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,UAAU,GACrB,wBAAwB,CAS1B;AAED,sEAAsE;AACtE,wBAAgB,qBAAqB,IAAI,UAAU,EAAE,CAEpD;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD"}
|
package/dist/functions/pills.lua
CHANGED
|
@@ -7,12 +7,10 @@ local ____cachedClasses = require("core.cachedClasses")
|
|
|
7
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
8
|
local ____constantsFirstLast = require("core.constantsFirstLast")
|
|
9
9
|
local FIRST_HORSE_PILL_COLOR = ____constantsFirstLast.FIRST_HORSE_PILL_COLOR
|
|
10
|
-
local FIRST_MODDED_PILL_EFFECT = ____constantsFirstLast.FIRST_MODDED_PILL_EFFECT
|
|
11
10
|
local FIRST_PILL_COLOR = ____constantsFirstLast.FIRST_PILL_COLOR
|
|
12
11
|
local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
|
|
13
12
|
local LAST_HORSE_PILL_COLOR = ____constantsFirstLast.LAST_HORSE_PILL_COLOR
|
|
14
13
|
local LAST_NORMAL_PILL_COLOR = ____constantsFirstLast.LAST_NORMAL_PILL_COLOR
|
|
15
|
-
local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
|
|
16
14
|
local LAST_VANILLA_PILL_EFFECT = ____constantsFirstLast.LAST_VANILLA_PILL_EFFECT
|
|
17
15
|
local ____falsePHDPillConversions = require("maps.falsePHDPillConversions")
|
|
18
16
|
local FALSE_PHD_PILL_CONVERSIONS = ____falsePHDPillConversions.FALSE_PHD_PILL_CONVERSIONS
|
|
@@ -47,10 +45,6 @@ function ____exports.getAllPillColors(self)
|
|
|
47
45
|
__TS__ArraySlice(pillColors)
|
|
48
46
|
return pillColors
|
|
49
47
|
end
|
|
50
|
-
--- Helper function to get an array with every valid pill effect. This includes modded pill effects.
|
|
51
|
-
function ____exports.getAllPillEffects(self)
|
|
52
|
-
return irange(nil, FIRST_PILL_EFFECT, LAST_PILL_EFFECT)
|
|
53
|
-
end
|
|
54
48
|
--- Helper function to get the associated pill effect after False PHD is acquired. If a pill effect
|
|
55
49
|
-- is not altered by False PHD, then the same pill effect will be returned.
|
|
56
50
|
function ____exports.getFalsePHDPillEffect(self, pillEffect)
|
|
@@ -68,15 +62,6 @@ end
|
|
|
68
62
|
function ____exports.getHorsePillColors(self)
|
|
69
63
|
return irange(nil, FIRST_HORSE_PILL_COLOR, LAST_HORSE_PILL_COLOR)
|
|
70
64
|
end
|
|
71
|
-
--- Helper function to get an array with every modded pill effect.
|
|
72
|
-
--
|
|
73
|
-
-- Returns an empty array if there are no modded pill effects.
|
|
74
|
-
function ____exports.getModdedPillEffects(self)
|
|
75
|
-
if LAST_VANILLA_PILL_EFFECT == LAST_PILL_EFFECT then
|
|
76
|
-
return {}
|
|
77
|
-
end
|
|
78
|
-
return irange(nil, FIRST_MODDED_PILL_EFFECT, LAST_PILL_EFFECT)
|
|
79
|
-
end
|
|
80
65
|
--- Helper function to get the corresponding normal pill color from a horse pill color.
|
|
81
66
|
--
|
|
82
67
|
-- For example, passing 2049 would result in `PillColor.BLUE_BLUE`.
|
|
@@ -279,6 +279,18 @@ export declare function playerAddCollectible(player: EntityPlayer, ...collectibl
|
|
|
279
279
|
* check for. Returns true if the player has any of the supplied collectible types.
|
|
280
280
|
*/
|
|
281
281
|
export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Helper function to remove all of the active items from a player. This includes the Schoolbag item
|
|
284
|
+
* and any pocket actives.
|
|
285
|
+
*/
|
|
286
|
+
export declare function removeAllActiveItems(player: EntityPlayer): void;
|
|
287
|
+
/**
|
|
288
|
+
* Helper function to remove all of the held trinkets from a player.
|
|
289
|
+
*
|
|
290
|
+
* This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
|
|
291
|
+
* they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
292
|
+
*/
|
|
293
|
+
export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
|
|
282
294
|
/**
|
|
283
295
|
* Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
284
296
|
* having to request the collectible from the item config.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,eAAe,EAIf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA6BjD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,GACb,IAAI,CA4CN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EA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uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,UAAU,EACtB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -18,6 +18,7 @@ local FamiliarVariant = ____isaac_2Dtypescript_2Ddefinitions.FamiliarVariant
|
|
|
18
18
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
19
19
|
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
20
20
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
21
|
+
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
21
22
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
22
23
|
local ____cachedClasses = require("core.cachedClasses")
|
|
23
24
|
local game = ____cachedClasses.game
|
|
@@ -682,6 +683,48 @@ function ____exports.playerHasCollectible(self, player, ...)
|
|
|
682
683
|
function(____, collectibleType) return player:HasCollectible(collectibleType) end
|
|
683
684
|
)
|
|
684
685
|
end
|
|
686
|
+
--- Helper function to remove all of the active items from a player. This includes the Schoolbag item
|
|
687
|
+
-- and any pocket actives.
|
|
688
|
+
function ____exports.removeAllActiveItems(self, player)
|
|
689
|
+
for ____, activeSlot in ipairs(getEnumValues(nil, ActiveSlot)) do
|
|
690
|
+
do
|
|
691
|
+
local collectibleType = player:GetActiveItem(activeSlot)
|
|
692
|
+
if collectibleType == CollectibleType.NULL then
|
|
693
|
+
goto __continue114
|
|
694
|
+
end
|
|
695
|
+
local hasCollectible
|
|
696
|
+
repeat
|
|
697
|
+
do
|
|
698
|
+
player:RemoveCollectible(collectibleType)
|
|
699
|
+
hasCollectible = player:HasCollectible(collectibleType)
|
|
700
|
+
end
|
|
701
|
+
until not hasCollectible
|
|
702
|
+
end
|
|
703
|
+
::__continue114::
|
|
704
|
+
end
|
|
705
|
+
end
|
|
706
|
+
--- Helper function to remove all of the held trinkets from a player.
|
|
707
|
+
--
|
|
708
|
+
-- This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
|
|
709
|
+
-- they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
710
|
+
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
711
|
+
for ____, trinketSlot in ipairs(getEnumValues(nil, TrinketSlot)) do
|
|
712
|
+
do
|
|
713
|
+
local trinketType = player:GetTrinket(trinketSlot)
|
|
714
|
+
if trinketType == TrinketType.NULL then
|
|
715
|
+
goto __continue119
|
|
716
|
+
end
|
|
717
|
+
local hasTrinket
|
|
718
|
+
repeat
|
|
719
|
+
do
|
|
720
|
+
player:TryRemoveTrinket(trinketType)
|
|
721
|
+
hasTrinket = player:HasTrinket(trinketType)
|
|
722
|
+
end
|
|
723
|
+
until not hasTrinket
|
|
724
|
+
end
|
|
725
|
+
::__continue119::
|
|
726
|
+
end
|
|
727
|
+
end
|
|
685
728
|
--- Helper function to remove a collectible costume from a player. Use this helper function to avoid
|
|
686
729
|
-- having to request the collectible from the item config.
|
|
687
730
|
function ____exports.removeCollectibleCostume(self, player, collectibleType)
|
|
@@ -742,9 +785,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
742
785
|
itemPool:RemoveCollectible(collectibleType)
|
|
743
786
|
end
|
|
744
787
|
repeat
|
|
745
|
-
local
|
|
746
|
-
local
|
|
747
|
-
if
|
|
788
|
+
local ____switch132 = activeSlot
|
|
789
|
+
local ____cond132 = ____switch132 == ActiveSlot.PRIMARY
|
|
790
|
+
if ____cond132 then
|
|
748
791
|
do
|
|
749
792
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
750
793
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -753,8 +796,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
753
796
|
break
|
|
754
797
|
end
|
|
755
798
|
end
|
|
756
|
-
|
|
757
|
-
if
|
|
799
|
+
____cond132 = ____cond132 or ____switch132 == ActiveSlot.SECONDARY
|
|
800
|
+
if ____cond132 then
|
|
758
801
|
do
|
|
759
802
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
760
803
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -769,16 +812,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
769
812
|
break
|
|
770
813
|
end
|
|
771
814
|
end
|
|
772
|
-
|
|
773
|
-
if
|
|
815
|
+
____cond132 = ____cond132 or ____switch132 == ActiveSlot.POCKET
|
|
816
|
+
if ____cond132 then
|
|
774
817
|
do
|
|
775
818
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
776
819
|
player:SetActiveCharge(charge, activeSlot)
|
|
777
820
|
break
|
|
778
821
|
end
|
|
779
822
|
end
|
|
780
|
-
|
|
781
|
-
if
|
|
823
|
+
____cond132 = ____cond132 or ____switch132 == ActiveSlot.POCKET_SINGLE_USE
|
|
824
|
+
if ____cond132 then
|
|
782
825
|
do
|
|
783
826
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
784
827
|
break
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/functions/random.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAAG,KAAK,CAGxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,KAAK,CAUP;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,GAAG,EAAE,GAAG,SAAS,GAAG,EAAO,GACtC,GAAG,
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/functions/random.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAAG,KAAK,CAGxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,KAAK,CAUP;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,GAAG,EAAE,GAAG,SAAS,GAAG,EAAO,GACtC,GAAG,CAqBL"}
|
|
@@ -69,6 +69,8 @@ function ____exports.getRandomInt(self, min, max, seedOrRNG, exceptions)
|
|
|
69
69
|
exceptions = {}
|
|
70
70
|
end
|
|
71
71
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
72
|
+
min = math.ceil(min)
|
|
73
|
+
max = math.floor(max)
|
|
72
74
|
if min > max then
|
|
73
75
|
local oldMin = min
|
|
74
76
|
local oldMax = max
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CacheFlag } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Returns the starting stat that Isaac (the default character) starts with. For example, if you
|
|
4
|
+
* pass this function `CacheFlag.DAMAGE`, it will return 3.5.
|
|
5
|
+
*
|
|
6
|
+
* Note that the default fire delay is represented in the tear stat, not the `MaxFireDelay` value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getDefaultPlayerStat(cacheFlag: CacheFlag): number | undefined;
|
|
9
|
+
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../src/functions/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____defaultPlayerStatMap = require("maps.defaultPlayerStatMap")
|
|
3
|
+
local DEFAULT_PLAYER_STAT_MAP = ____defaultPlayerStatMap.DEFAULT_PLAYER_STAT_MAP
|
|
4
|
+
--- Returns the starting stat that Isaac (the default character) starts with. For example, if you
|
|
5
|
+
-- pass this function `CacheFlag.DAMAGE`, it will return 3.5.
|
|
6
|
+
--
|
|
7
|
+
-- Note that the default fire delay is represented in the tear stat, not the `MaxFireDelay` value.
|
|
8
|
+
function ____exports.getDefaultPlayerStat(self, cacheFlag)
|
|
9
|
+
return DEFAULT_PLAYER_STAT_MAP:get(cacheFlag)
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { CacheFlag, TrinketType } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Returns a map containing every trinket type that the player has that matches the provided
|
|
4
|
-
* CacheFlag
|
|
4
|
+
* `CacheFlag`. The values of the map correspond to the multiplier for that trinket.
|
|
5
|
+
*
|
|
6
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
7
|
+
* all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
5
8
|
*/
|
|
6
9
|
export declare function getPlayerTrinketsForCacheFlag(player: EntityPlayer, cacheFlag: CacheFlag): Map<TrinketType, int>;
|
|
7
10
|
/**
|
|
8
11
|
* Returns a set containing every trinket type with the given cache flag, including modded trinkets.
|
|
12
|
+
*
|
|
13
|
+
* This function can only be called if at least one callback has been executed. This is because not
|
|
14
|
+
* all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
9
15
|
*/
|
|
10
16
|
export declare function getTrinketsForCacheFlag(cacheFlag: CacheFlag): Set<TrinketType>;
|
|
17
|
+
/** Helper function to check in the item config if a given trinket has a given cache flag. */
|
|
18
|
+
export declare function trinketHasCacheFlag(trinketType: TrinketType, cacheFlag: CacheFlag): boolean;
|
|
11
19
|
//# sourceMappingURL=trinketCacheFlag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinketCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/trinketCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"trinketCacheFlag.d.ts","sourceRoot":"","sources":["../../src/functions/trinketCacheFlag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA2BtE;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAYvB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,WAAW,CAAC,CASlB;AAED,6FAA6F;AAC7F,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
|
|
@@ -4,21 +4,27 @@ local __TS__New = ____lualib.__TS__New
|
|
|
4
4
|
local Set = ____lualib.Set
|
|
5
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local
|
|
7
|
+
local lazyInitCacheFlagMap, CACHE_FLAG_TO_TRINKETS_MAP
|
|
8
8
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
9
|
local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
|
|
10
|
+
local ____cachedClasses = require("core.cachedClasses")
|
|
11
|
+
local itemConfig = ____cachedClasses.itemConfig
|
|
12
|
+
local ____firstLast = require("features.firstLast")
|
|
13
|
+
local getTrinketTypes = ____firstLast.getTrinketTypes
|
|
10
14
|
local ____enums = require("functions.enums")
|
|
11
15
|
local getEnumValues = ____enums.getEnumValues
|
|
16
|
+
local ____flag = require("functions.flag")
|
|
17
|
+
local hasFlag = ____flag.hasFlag
|
|
12
18
|
local ____set = require("functions.set")
|
|
13
19
|
local copySet = ____set.copySet
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
function lazyInitCacheFlagMap(self)
|
|
21
|
+
if CACHE_FLAG_TO_TRINKETS_MAP.size > 0 then
|
|
22
|
+
return
|
|
23
|
+
end
|
|
18
24
|
for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
|
|
19
25
|
local trinketsSet = __TS__New(Set)
|
|
20
26
|
for ____, trinketType in ipairs(getTrinketTypes(nil)) do
|
|
21
|
-
if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
|
|
27
|
+
if ____exports.trinketHasCacheFlag(nil, trinketType, cacheFlag) then
|
|
22
28
|
trinketsSet:add(trinketType)
|
|
23
29
|
end
|
|
24
30
|
end
|
|
@@ -26,19 +32,31 @@ function initCacheFlagMap(self)
|
|
|
26
32
|
end
|
|
27
33
|
end
|
|
28
34
|
--- Returns a set containing every trinket type with the given cache flag, including modded trinkets.
|
|
35
|
+
--
|
|
36
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
37
|
+
-- all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
29
38
|
function ____exports.getTrinketsForCacheFlag(self, cacheFlag)
|
|
30
|
-
|
|
31
|
-
initCacheFlagMap(nil)
|
|
32
|
-
end
|
|
39
|
+
lazyInitCacheFlagMap(nil)
|
|
33
40
|
local trinketsSet = CACHE_FLAG_TO_TRINKETS_MAP:get(cacheFlag)
|
|
34
41
|
if trinketsSet == nil then
|
|
35
42
|
return __TS__New(Set)
|
|
36
43
|
end
|
|
37
44
|
return copySet(nil, trinketsSet)
|
|
38
45
|
end
|
|
46
|
+
--- Helper function to check in the item config if a given trinket has a given cache flag.
|
|
47
|
+
function ____exports.trinketHasCacheFlag(self, trinketType, cacheFlag)
|
|
48
|
+
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
49
|
+
if itemConfigItem == nil then
|
|
50
|
+
return false
|
|
51
|
+
end
|
|
52
|
+
return hasFlag(nil, itemConfigItem.CacheFlags, cacheFlag)
|
|
53
|
+
end
|
|
39
54
|
CACHE_FLAG_TO_TRINKETS_MAP = __TS__New(Map)
|
|
40
55
|
--- Returns a map containing every trinket type that the player has that matches the provided
|
|
41
|
-
-- CacheFlag
|
|
56
|
+
-- `CacheFlag`. The values of the map correspond to the multiplier for that trinket.
|
|
57
|
+
--
|
|
58
|
+
-- This function can only be called if at least one callback has been executed. This is because not
|
|
59
|
+
-- all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
42
60
|
function ____exports.getPlayerTrinketsForCacheFlag(self, player, cacheFlag)
|
|
43
61
|
local trinketsForCacheFlag = ____exports.getTrinketsForCacheFlag(nil, cacheFlag)
|
|
44
62
|
local playerTrinkets = __TS__New(Map)
|