isaacscript-common 1.2.67 → 1.2.68
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/functions/collectibleCacheFlag.lua +3 -3
- package/dist/functions/collectibleSet.lua +3 -3
- package/dist/functions/collectibles.d.ts +1 -1
- package/dist/functions/collectibles.lua +1 -1
- package/dist/functions/doors.d.ts +6 -0
- package/dist/functions/doors.lua +8 -0
- package/dist/functions/transformations.lua +3 -3
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ local __TS__Iterator = ____lualib.__TS__Iterator
|
|
|
8
8
|
local ____exports = {}
|
|
9
9
|
local ____collectibles = require("functions.collectibles")
|
|
10
10
|
local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
|
|
11
|
-
local
|
|
11
|
+
local getMaxCollectibleType = ____collectibles.getMaxCollectibleType
|
|
12
12
|
local ____math = require("functions.math")
|
|
13
13
|
local range = ____math.range
|
|
14
14
|
local ____set = require("functions.set")
|
|
@@ -17,10 +17,10 @@ local ____utils = require("functions.utils")
|
|
|
17
17
|
local getEnumValues = ____utils.getEnumValues
|
|
18
18
|
local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
|
|
19
19
|
local function initCacheFlagMap(self)
|
|
20
|
-
local
|
|
20
|
+
local maxCollectibleType = getMaxCollectibleType(nil)
|
|
21
21
|
for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
|
|
22
22
|
local collectiblesSet = __TS__New(Set)
|
|
23
|
-
for ____, collectibleType in ipairs(range(nil, 1,
|
|
23
|
+
for ____, collectibleType in ipairs(range(nil, 1, maxCollectibleType)) do
|
|
24
24
|
if collectibleHasCacheFlag(nil, collectibleType, cacheFlag) then
|
|
25
25
|
collectiblesSet:add(collectibleType)
|
|
26
26
|
end
|
|
@@ -4,7 +4,7 @@ local Set = ____lualib.Set
|
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local ____exports = {}
|
|
6
6
|
local ____collectibles = require("functions.collectibles")
|
|
7
|
-
local
|
|
7
|
+
local getMaxCollectibleType = ____collectibles.getMaxCollectibleType
|
|
8
8
|
local ____math = require("functions.math")
|
|
9
9
|
local range = ____math.range
|
|
10
10
|
local ____set = require("functions.set")
|
|
@@ -12,8 +12,8 @@ local copySet = ____set.copySet
|
|
|
12
12
|
local COLLECTIBLE_SET = __TS__New(Set)
|
|
13
13
|
local function initCollectibleSet(self)
|
|
14
14
|
local itemConfig = Isaac.GetItemConfig()
|
|
15
|
-
local
|
|
16
|
-
for ____, collectibleType in ipairs(range(nil, 1,
|
|
15
|
+
local maxCollectibleType = getMaxCollectibleType(nil)
|
|
16
|
+
for ____, collectibleType in ipairs(range(nil, 1, maxCollectibleType)) do
|
|
17
17
|
local itemConfigItem = itemConfig:GetCollectible(collectibleType)
|
|
18
18
|
if itemConfigItem ~= nil then
|
|
19
19
|
COLLECTIBLE_SET:add(collectibleType)
|
|
@@ -49,7 +49,7 @@ export declare function getCollectibleMaxCharges(collectibleType: CollectibleTyp
|
|
|
49
49
|
export declare function getCollectibleName(collectibleType: CollectibleType | int): string;
|
|
50
50
|
/** Helper function to get all of the collectible entities in the room. */
|
|
51
51
|
export declare function getCollectibles(matchingSubType?: number): EntityPickup[];
|
|
52
|
-
export declare function
|
|
52
|
+
export declare function getMaxCollectibleType(): int;
|
|
53
53
|
/**
|
|
54
54
|
* Returns whether or not the given collectible is a "glitched" item. All items are replaced by
|
|
55
55
|
* glitched items once a player has TMTRAINER. However, glitched items can also "naturally" appear
|
|
@@ -141,7 +141,7 @@ function ____exports.getCollectibles(self, matchingSubType)
|
|
|
141
141
|
end
|
|
142
142
|
return getPickups(nil, PickupVariant.PICKUP_COLLECTIBLE, matchingSubType)
|
|
143
143
|
end
|
|
144
|
-
function ____exports.
|
|
144
|
+
function ____exports.getMaxCollectibleType(self)
|
|
145
145
|
local itemConfig = Isaac.GetItemConfig()
|
|
146
146
|
return itemConfig:GetCollectibles().Size - 1
|
|
147
147
|
end
|
|
@@ -88,3 +88,9 @@ export declare function openDoorFast(door: GridEntityDoor): void;
|
|
|
88
88
|
* @returns The number of doors removed.
|
|
89
89
|
*/
|
|
90
90
|
export declare function removeAllDoors(...roomTypes: RoomType[]): int;
|
|
91
|
+
/**
|
|
92
|
+
* Helper function to remove the door(s) provided.
|
|
93
|
+
*
|
|
94
|
+
* This function is variadic, meaning that you can specify as many doors as you want to remove.
|
|
95
|
+
*/
|
|
96
|
+
export declare function removeDoors(...doors: GridEntityDoor[]): void;
|
package/dist/functions/doors.lua
CHANGED
|
@@ -191,4 +191,12 @@ function ____exports.removeAllDoors(self, ...)
|
|
|
191
191
|
end
|
|
192
192
|
return numDoorsRemoved
|
|
193
193
|
end
|
|
194
|
+
function ____exports.removeDoors(self, ...)
|
|
195
|
+
local doors = {...}
|
|
196
|
+
local game = Game()
|
|
197
|
+
local room = game:GetRoom()
|
|
198
|
+
for ____, door in ipairs(doors) do
|
|
199
|
+
room:RemoveDoor(door.Slot)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
194
202
|
return ____exports
|
|
@@ -9,7 +9,7 @@ local ____transformationNameMap = require("maps.transformationNameMap")
|
|
|
9
9
|
local TRANSFORMATION_NAME_MAP = ____transformationNameMap.TRANSFORMATION_NAME_MAP
|
|
10
10
|
local ____collectibles = require("functions.collectibles")
|
|
11
11
|
local collectibleHasTag = ____collectibles.collectibleHasTag
|
|
12
|
-
local
|
|
12
|
+
local getMaxCollectibleType = ____collectibles.getMaxCollectibleType
|
|
13
13
|
local ____math = require("functions.math")
|
|
14
14
|
local range = ____math.range
|
|
15
15
|
local ____set = require("functions.set")
|
|
@@ -33,14 +33,14 @@ local TRANSFORMATIONS_THAT_GRANT_FLYING = __TS__New(Set, {PlayerForm.PLAYERFORM_
|
|
|
33
33
|
local TRANSFORMATION_TO_COLLECTIBLE_TYPES_MAP = __TS__New(Map)
|
|
34
34
|
local COLLECTIBLE_TYPE_TO_TRANSFORMATION_MAP = __TS__New(Map)
|
|
35
35
|
local function initMaps(self)
|
|
36
|
-
local
|
|
36
|
+
local maxCollectibleType = getMaxCollectibleType(nil)
|
|
37
37
|
for ____, playerForm in __TS__Iterator(TRANSFORMATION_TO_TAG_MAP:keys()) do
|
|
38
38
|
TRANSFORMATION_TO_COLLECTIBLE_TYPES_MAP:set(
|
|
39
39
|
playerForm,
|
|
40
40
|
__TS__New(Set)
|
|
41
41
|
)
|
|
42
42
|
end
|
|
43
|
-
for ____, collectibleType in ipairs(range(nil, 1,
|
|
43
|
+
for ____, collectibleType in ipairs(range(nil, 1, maxCollectibleType)) do
|
|
44
44
|
for ____, ____value in __TS__Iterator(TRANSFORMATION_TO_TAG_MAP:entries()) do
|
|
45
45
|
local playerForm = ____value[1]
|
|
46
46
|
local tag = ____value[2]
|