isaacscript-common 4.2.4 → 4.2.5
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.
|
@@ -7,8 +7,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
7
7
|
local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
|
|
8
8
|
local ____cachedClasses = require("cachedClasses")
|
|
9
9
|
local itemConfig = ____cachedClasses.itemConfig
|
|
10
|
-
local
|
|
11
|
-
local
|
|
10
|
+
local ____collectibleSet = require("functions.collectibleSet")
|
|
11
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
12
12
|
local ____enums = require("functions.enums")
|
|
13
13
|
local getEnumValues = ____enums.getEnumValues
|
|
14
14
|
local ____flag = require("functions.flag")
|
|
@@ -29,7 +29,7 @@ local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
|
|
|
29
29
|
local function initCacheFlagMap(self)
|
|
30
30
|
for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
|
|
31
31
|
local collectiblesSet = __TS__New(Set)
|
|
32
|
-
for ____, collectibleType in ipairs(
|
|
32
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
33
33
|
if ____exports.collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
|
|
34
34
|
collectiblesSet:add(collectibleType)
|
|
35
35
|
end
|
|
@@ -6,9 +6,11 @@ local ____exports = {}
|
|
|
6
6
|
local ____cachedClasses = require("cachedClasses")
|
|
7
7
|
local itemConfig = ____cachedClasses.itemConfig
|
|
8
8
|
local ____constantsFirstLast = require("constantsFirstLast")
|
|
9
|
+
local FIRST_COLLECTIBLE_TYPE = ____constantsFirstLast.FIRST_COLLECTIBLE_TYPE
|
|
10
|
+
local LAST_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_COLLECTIBLE_TYPE
|
|
9
11
|
local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsFirstLast.LAST_VANILLA_COLLECTIBLE_TYPE
|
|
10
|
-
local
|
|
11
|
-
local
|
|
12
|
+
local ____utils = require("functions.utils")
|
|
13
|
+
local irange = ____utils.irange
|
|
12
14
|
local ALL_COLLECTIBLES_ARRAY = {}
|
|
13
15
|
local VANILLA_COLLECTIBLES_ARRAY = {}
|
|
14
16
|
local MODDED_COLLECTIBLES_ARRAY = {}
|
|
@@ -19,7 +21,8 @@ local function initCollectibleArraysAndSets(self)
|
|
|
19
21
|
if #ALL_COLLECTIBLES_ARRAY ~= 0 then
|
|
20
22
|
return
|
|
21
23
|
end
|
|
22
|
-
|
|
24
|
+
local collectibleTypeRange = irange(nil, FIRST_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE)
|
|
25
|
+
for ____, collectibleType in ipairs(collectibleTypeRange) do
|
|
23
26
|
do
|
|
24
27
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
25
28
|
if itemConfigItem == nil then
|
|
@@ -8,8 +8,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
8
8
|
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
9
9
|
local ____cachedClasses = require("cachedClasses")
|
|
10
10
|
local itemConfig = ____cachedClasses.itemConfig
|
|
11
|
-
local
|
|
12
|
-
local
|
|
11
|
+
local ____collectibleSet = require("functions.collectibleSet")
|
|
12
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
13
13
|
local ____enums = require("functions.enums")
|
|
14
14
|
local getEnumValues = ____enums.getEnumValues
|
|
15
15
|
local ____flag = require("functions.flag")
|
|
@@ -33,7 +33,7 @@ local function initTagMap(self)
|
|
|
33
33
|
__TS__New(Set)
|
|
34
34
|
)
|
|
35
35
|
end
|
|
36
|
-
for ____, collectibleType in ipairs(
|
|
36
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
37
37
|
for ____, itemConfigTag in ipairs(getEnumValues(nil, ItemConfigTag)) do
|
|
38
38
|
do
|
|
39
39
|
if not ____exports.collectibleHasTag(nil, collectibleType, itemConfigTag) then
|
|
@@ -106,15 +106,6 @@ export declare function getCollectibleQuality(collectibleType: CollectibleType):
|
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
108
|
export declare function getCollectibleTags(collectibleType: CollectibleType): BitFlags<ItemConfigTag>;
|
|
109
|
-
/**
|
|
110
|
-
* Helper function to get an array that represents the range from the first collectible type to the
|
|
111
|
-
* last collectible type. This will include integers that do not represent any valid collectible
|
|
112
|
-
* types.
|
|
113
|
-
*
|
|
114
|
-
* This function is only useful when building collectible type objects. For most purposes, you
|
|
115
|
-
* should use the `getCollectibleSet` helper function instead.
|
|
116
|
-
*/
|
|
117
|
-
export declare function getCollectibleTypeRange(): CollectibleType[];
|
|
118
109
|
/**
|
|
119
110
|
* Helper function to get an array that represents the all modded collectible types.
|
|
120
111
|
*
|
|
@@ -311,15 +311,6 @@ function ____exports.getCollectibleTags(self, collectibleType)
|
|
|
311
311
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
312
312
|
return itemConfigItem == nil and ItemConfigTagZero or itemConfigItem.Tags
|
|
313
313
|
end
|
|
314
|
-
--- Helper function to get an array that represents the range from the first collectible type to the
|
|
315
|
-
-- last collectible type. This will include integers that do not represent any valid collectible
|
|
316
|
-
-- types.
|
|
317
|
-
--
|
|
318
|
-
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
319
|
-
-- should use the `getCollectibleSet` helper function instead.
|
|
320
|
-
function ____exports.getCollectibleTypeRange(self)
|
|
321
|
-
return irange(nil, FIRST_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE)
|
|
322
|
-
end
|
|
323
314
|
--- Helper function to get an array that represents the all modded collectible types.
|
|
324
315
|
--
|
|
325
316
|
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
@@ -20,10 +20,7 @@ local getPlayerBlackHearts = ____player.getPlayerBlackHearts
|
|
|
20
20
|
local getPlayerHearts = ____player.getPlayerHearts
|
|
21
21
|
local getPlayerSoulHearts = ____player.getPlayerSoulHearts
|
|
22
22
|
local isCharacter = ____player.isCharacter
|
|
23
|
-
local isKeeper = ____player.isKeeper
|
|
24
23
|
local setActiveItem = ____player.setActiveItem
|
|
25
|
-
local ____utils = require("functions.utils")
|
|
26
|
-
local ____repeat = ____utils["repeat"]
|
|
27
24
|
function ____exports.removeAllPlayerHealth(self, player)
|
|
28
25
|
local goldenHearts = player:GetGoldenHearts()
|
|
29
26
|
local eternalHearts = player:GetEternalHearts()
|
|
@@ -89,24 +86,15 @@ function ____exports.setPlayerHealth(self, player, playerHealth)
|
|
|
89
86
|
end
|
|
90
87
|
end
|
|
91
88
|
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
player:AddRottenHearts(playerHealth.rottenHearts)
|
|
90
|
+
if character == PlayerType.MAGDALENE_B then
|
|
91
|
+
local effectiveHearts = playerHealth.hearts / 2
|
|
92
|
+
player:AddHearts(effectiveHearts)
|
|
95
93
|
else
|
|
96
|
-
player:
|
|
97
|
-
____repeat(
|
|
98
|
-
nil,
|
|
99
|
-
playerHealth.hearts,
|
|
100
|
-
function()
|
|
101
|
-
player:AddHearts(1)
|
|
102
|
-
if character == PlayerType.MAGDALENE_B then
|
|
103
|
-
player:AddHearts(-1)
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
)
|
|
107
|
-
player:AddGoldenHearts(playerHealth.goldenHearts)
|
|
108
|
-
player:AddBrokenHearts(playerHealth.brokenHearts)
|
|
94
|
+
player:AddHearts(playerHealth.hearts)
|
|
109
95
|
end
|
|
96
|
+
player:AddGoldenHearts(playerHealth.goldenHearts)
|
|
97
|
+
player:AddBrokenHearts(playerHealth.brokenHearts)
|
|
110
98
|
if character == PlayerType.BETHANY then
|
|
111
99
|
player:SetSoulCharge(playerHealth.soulCharges)
|
|
112
100
|
elseif character == PlayerType.BETHANY_B then
|