isaacscript-common 16.1.0 → 16.1.2
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.d.ts +16 -9
- package/dist/isaacscript-common.lua +16 -11
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +3 -3
- package/dist/src/classes/features/other/extraConsoleCommands/subroutines.lua +0 -1
- package/dist/src/functions/collectibles.d.ts +1 -1
- package/dist/src/functions/collectibles.lua +1 -1
- package/dist/src/functions/levelGrid.d.ts +5 -5
- package/dist/src/functions/levelGrid.d.ts.map +1 -1
- package/dist/src/functions/levelGrid.lua +11 -3
- package/dist/src/functions/map.d.ts +1 -1
- package/dist/src/functions/map.d.ts.map +1 -1
- package/dist/src/functions/trinkets.d.ts +9 -2
- package/dist/src/functions/trinkets.d.ts.map +1 -1
- package/dist/src/functions/trinkets.lua +7 -2
- package/package.json +2 -2
- package/src/classes/features/other/ModdedElementSets.ts +7 -5
- package/src/functions/collectibles.ts +1 -1
- package/src/functions/levelGrid.ts +10 -11
- package/src/functions/map.ts +3 -1
- package/src/functions/trinkets.ts +9 -2
package/dist/index.d.ts
CHANGED
|
@@ -1422,7 +1422,7 @@ export declare function copyIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaac
|
|
|
1422
1422
|
export declare function copyKColor(kColor: KColor): KColor;
|
|
1423
1423
|
|
|
1424
1424
|
/** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
|
|
1425
|
-
export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
1425
|
+
export declare function copyMap<K, V>(oldMap: Map<K, V> | ReadonlyMap<K, V>): Map<K, V>;
|
|
1426
1426
|
|
|
1427
1427
|
/** Helper function to copy an `RNG` Isaac API class. */
|
|
1428
1428
|
export declare function copyRNG(rng: RNG): RNG;
|
|
@@ -5843,7 +5843,7 @@ export declare function getRocks(variant?: number): GridEntityRock[];
|
|
|
5843
5843
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
5844
5844
|
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
5845
5845
|
*/
|
|
5846
|
-
export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int):
|
|
5846
|
+
export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): ReadonlyMap<DoorSlot, int>;
|
|
5847
5847
|
|
|
5848
5848
|
/**
|
|
5849
5849
|
* Helper function to get the set of allowed door slots for the room at the supplied grid index.
|
|
@@ -5987,7 +5987,7 @@ export declare function getRoomShape(roomGridIndex?: int): RoomShape | undefined
|
|
|
5987
5987
|
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
5988
5988
|
* that function for more information.
|
|
5989
5989
|
*/
|
|
5990
|
-
export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
5990
|
+
export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
5991
5991
|
|
|
5992
5992
|
/**
|
|
5993
5993
|
* Helper function to get the room grid index delta that each hypothetical door in a given room
|
|
@@ -5997,7 +5997,7 @@ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridInde
|
|
|
5997
5997
|
*
|
|
5998
5998
|
* @returns A map of `DoorSlot` to the corresponding room grid index delta.
|
|
5999
5999
|
*/
|
|
6000
|
-
export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape):
|
|
6000
|
+
export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
6001
6001
|
|
|
6002
6002
|
/**
|
|
6003
6003
|
* Helper function to get the room grid index that each hypothetical door in a given room shape
|
|
@@ -6008,7 +6008,7 @@ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape
|
|
|
6008
6008
|
* @param roomShape The shape of the room.
|
|
6009
6009
|
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
6010
6010
|
*/
|
|
6011
|
-
export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
6011
|
+
export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
6012
6012
|
|
|
6013
6013
|
/**
|
|
6014
6014
|
* Helper function to get only the adjacent room grid indexes for a room shape that do not exist
|
|
@@ -6017,7 +6017,7 @@ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int,
|
|
|
6017
6017
|
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
6018
6018
|
* that function for more information.
|
|
6019
6019
|
*/
|
|
6020
|
-
export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
6020
|
+
export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
6021
6021
|
|
|
6022
6022
|
/**
|
|
6023
6023
|
* Helper function to see if a given room shape will grant a single charge or a double charge to the
|
|
@@ -6496,15 +6496,22 @@ export declare function getVanillaCardTypes(): CardType[];
|
|
|
6496
6496
|
*
|
|
6497
6497
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
6498
6498
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
6499
|
-
* instead.
|
|
6499
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
6500
6500
|
*/
|
|
6501
6501
|
export declare function getVanillaCollectibleTypeRange(): CollectibleType[];
|
|
6502
6502
|
|
|
6503
6503
|
/** Helper function to get an array with every vanilla pill effect. */
|
|
6504
6504
|
export declare function getVanillaPillEffects(): PillEffect[];
|
|
6505
6505
|
|
|
6506
|
-
/**
|
|
6507
|
-
|
|
6506
|
+
/**
|
|
6507
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
6508
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
6509
|
+
*
|
|
6510
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
6511
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
6512
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
6513
|
+
*/
|
|
6514
|
+
export declare function getVanillaTrinketTypeRange(): TrinketType[];
|
|
6508
6515
|
|
|
6509
6516
|
/**
|
|
6510
6517
|
* Get how many hearts are currently being shown on the hearts UI.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 16.1.
|
|
3
|
+
isaacscript-common 16.1.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -7127,8 +7127,6 @@ ____exports.TrinketType.ACE_SPADES = 45
|
|
|
7127
7127
|
____exports.TrinketType[____exports.TrinketType.ACE_SPADES] = "ACE_SPADES"
|
|
7128
7128
|
____exports.TrinketType.ISAACS_FORK = 46
|
|
7129
7129
|
____exports.TrinketType[____exports.TrinketType.ISAACS_FORK] = "ISAACS_FORK"
|
|
7130
|
-
____exports.TrinketType.POLAROID_OBSOLETE = 47
|
|
7131
|
-
____exports.TrinketType[____exports.TrinketType.POLAROID_OBSOLETE] = "POLAROID_OBSOLETE"
|
|
7132
7130
|
____exports.TrinketType.MISSING_PAGE = 48
|
|
7133
7131
|
____exports.TrinketType[____exports.TrinketType.MISSING_PAGE] = "MISSING_PAGE"
|
|
7134
7132
|
____exports.TrinketType.BLOODY_PENNY = 49
|
|
@@ -27079,7 +27077,7 @@ function ____exports.getTrinketName(self, trinketType)
|
|
|
27079
27077
|
end
|
|
27080
27078
|
return DEFAULT_TRINKET_NAME
|
|
27081
27079
|
end
|
|
27082
|
-
function ____exports.
|
|
27080
|
+
function ____exports.getVanillaTrinketTypeRange(self)
|
|
27083
27081
|
return iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
|
|
27084
27082
|
end
|
|
27085
27083
|
function ____exports.hasOpenTrinketSlot(self, player)
|
|
@@ -32177,7 +32175,7 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
|
32177
32175
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
32178
32176
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
32179
32177
|
local ____trinkets = require("src.functions.trinkets")
|
|
32180
|
-
local
|
|
32178
|
+
local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
|
|
32181
32179
|
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
|
|
32182
32180
|
local ____utils = require("src.functions.utils")
|
|
32183
32181
|
local ____repeat = ____utils["repeat"]
|
|
@@ -32268,8 +32266,8 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
|
|
|
32268
32266
|
if #self.vanillaTrinketTypesArray > 0 then
|
|
32269
32267
|
return
|
|
32270
32268
|
end
|
|
32271
|
-
local
|
|
32272
|
-
for ____, trinketType in ipairs(
|
|
32269
|
+
local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
|
|
32270
|
+
for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
|
|
32273
32271
|
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
32274
32272
|
if itemConfigItem ~= nil then
|
|
32275
32273
|
local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
|
|
@@ -42885,8 +42883,8 @@ return ____exports
|
|
|
42885
42883
|
local ____lualib = require("lualib_bundle")
|
|
42886
42884
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
42887
42885
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
42888
|
-
local Map = ____lualib.Map
|
|
42889
42886
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
42887
|
+
local Map = ____lualib.Map
|
|
42890
42888
|
local __TS__New = ____lualib.__TS__New
|
|
42891
42889
|
local Set = ____lualib.Set
|
|
42892
42890
|
local ____exports = {}
|
|
@@ -42914,6 +42912,8 @@ local ____flag = require("src.functions.flag")
|
|
|
42914
42912
|
local addFlag = ____flag.addFlag
|
|
42915
42913
|
local hasFlag = ____flag.hasFlag
|
|
42916
42914
|
local removeFlag = ____flag.removeFlag
|
|
42915
|
+
local ____map = require("src.functions.map")
|
|
42916
|
+
local copyMap = ____map.copyMap
|
|
42917
42917
|
local ____rng = require("src.functions.rng")
|
|
42918
42918
|
local getRandomSeed = ____rng.getRandomSeed
|
|
42919
42919
|
local isRNG = ____rng.isRNG
|
|
@@ -42998,7 +42998,10 @@ function ____exports.getNewRoomCandidatesForLevel(self)
|
|
|
42998
42998
|
return newRoomCandidates
|
|
42999
42999
|
end
|
|
43000
43000
|
function ____exports.getRoomShapeAdjacentExistingGridIndexes(self, safeRoomGridIndex, roomShape)
|
|
43001
|
-
local roomShapeAdjacentGridIndexes =
|
|
43001
|
+
local roomShapeAdjacentGridIndexes = copyMap(
|
|
43002
|
+
nil,
|
|
43003
|
+
____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
|
|
43004
|
+
)
|
|
43002
43005
|
for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
|
|
43003
43006
|
local doorSlot = ____value[1]
|
|
43004
43007
|
local roomGridIndex = ____value[2]
|
|
@@ -43026,7 +43029,10 @@ function ____exports.getRoomShapeAdjacentGridIndexes(self, safeRoomGridIndex, ro
|
|
|
43026
43029
|
return adjacentGridIndexes
|
|
43027
43030
|
end
|
|
43028
43031
|
function ____exports.getRoomShapeAdjacentNonExistingGridIndexes(self, safeRoomGridIndex, roomShape)
|
|
43029
|
-
local roomShapeAdjacentGridIndexes =
|
|
43032
|
+
local roomShapeAdjacentGridIndexes = copyMap(
|
|
43033
|
+
nil,
|
|
43034
|
+
____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
|
|
43035
|
+
)
|
|
43030
43036
|
for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
|
|
43031
43037
|
local doorSlot = ____value[1]
|
|
43032
43038
|
local roomGridIndex = ____value[2]
|
|
@@ -44689,7 +44695,6 @@ return ____exports
|
|
|
44689
44695
|
end,
|
|
44690
44696
|
["src.classes.features.other.extraConsoleCommands.subroutines"] = function(...)
|
|
44691
44697
|
local ____lualib = require("lualib_bundle")
|
|
44692
|
-
local Map = ____lualib.Map
|
|
44693
44698
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
44694
44699
|
local ____exports = {}
|
|
44695
44700
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AA2BtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA4BhD,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,wBAAwB,CAAyB;IACzD,OAAO,CAAC,sBAAsB,CAA8B;IAE5D,OAAO,CAAC,4BAA4B,CAAyB;IAC7D,OAAO,CAAC,0BAA0B,CAA8B;IAEhE,OAAO,CAAC,2BAA2B,CAAyB;IAC5D,OAAO,CAAC,yBAAyB,CAA8B;IAE/D,OAAO,CAAC,oBAAoB,CAAqB;IACjD,OAAO,CAAC,kBAAkB,CAA0B;IAEpD,OAAO,CAAC,wBAAwB,CAAqB;IACrD,OAAO,CAAC,sBAAsB,CAA0B;IAExD,OAAO,CAAC,uBAAuB,CAAqB;IACpD,OAAO,CAAC,qBAAqB,CAA0B;IAEvD,OAAO,C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;;;;;;OAOG;IAEI,wBAAwB,IAAI,WAAW,CAAC,eAAe,CAAC;IAK/D;;;;;;;OAOG;IAEI,sBAAsB,IAAI,SAAS,WAAW,EAAE;IAKvD;;;;;;;OAOG;IAEI,oBAAoB,IAAI,WAAW,CAAC,WAAW,CAAC;CAIxD"}
|
|
@@ -41,7 +41,7 @@ local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
|
41
41
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
42
42
|
local getSortedSetValues = ____set.getSortedSetValues
|
|
43
43
|
local ____trinkets = require("src.functions.trinkets")
|
|
44
|
-
local
|
|
44
|
+
local getVanillaTrinketTypeRange = ____trinkets.getVanillaTrinketTypeRange
|
|
45
45
|
local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
|
|
46
46
|
local ____utils = require("src.functions.utils")
|
|
47
47
|
local ____repeat = ____utils["repeat"]
|
|
@@ -132,8 +132,8 @@ function ModdedElementSets.prototype.lazyInitVanillaTrinketTypes(self)
|
|
|
132
132
|
if #self.vanillaTrinketTypesArray > 0 then
|
|
133
133
|
return
|
|
134
134
|
end
|
|
135
|
-
local
|
|
136
|
-
for ____, trinketType in ipairs(
|
|
135
|
+
local vanillaTrinketTypeRange = getVanillaTrinketTypeRange(nil)
|
|
136
|
+
for ____, trinketType in ipairs(vanillaTrinketTypeRange) do
|
|
137
137
|
local itemConfigItem = itemConfig:GetTrinket(trinketType)
|
|
138
138
|
if itemConfigItem ~= nil then
|
|
139
139
|
local ____self_vanillaTrinketTypesArray_4 = self.vanillaTrinketTypesArray
|
|
@@ -140,7 +140,7 @@ export declare function getCollectibleTags(collectibleType: CollectibleType): Bi
|
|
|
140
140
|
*
|
|
141
141
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
142
142
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
143
|
-
* instead.
|
|
143
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
144
144
|
*/
|
|
145
145
|
export declare function getVanillaCollectibleTypeRange(): CollectibleType[];
|
|
146
146
|
/** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
|
|
@@ -357,7 +357,7 @@ end
|
|
|
357
357
|
--
|
|
358
358
|
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
359
359
|
-- should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
360
|
-
-- instead.
|
|
360
|
+
-- instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
361
361
|
function ____exports.getVanillaCollectibleTypeRange(self)
|
|
362
362
|
return iRange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
|
|
363
363
|
end
|
|
@@ -82,7 +82,7 @@ export declare function getNewRoomCandidatesForLevel(): Array<[
|
|
|
82
82
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
83
83
|
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
84
84
|
*/
|
|
85
|
-
export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int):
|
|
85
|
+
export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): ReadonlyMap<DoorSlot, int>;
|
|
86
86
|
/**
|
|
87
87
|
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
88
88
|
* specified room type.
|
|
@@ -100,7 +100,7 @@ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int
|
|
|
100
100
|
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
101
101
|
* that function for more information.
|
|
102
102
|
*/
|
|
103
|
-
export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
103
|
+
export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
104
104
|
/**
|
|
105
105
|
* Helper function to get the room grid index delta that each hypothetical door in a given room
|
|
106
106
|
* shape would go to.
|
|
@@ -109,7 +109,7 @@ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridInde
|
|
|
109
109
|
*
|
|
110
110
|
* @returns A map of `DoorSlot` to the corresponding room grid index delta.
|
|
111
111
|
*/
|
|
112
|
-
export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape):
|
|
112
|
+
export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
113
113
|
/**
|
|
114
114
|
* Helper function to get the room grid index that each hypothetical door in a given room shape
|
|
115
115
|
* would go to. (This will not include room grid indexes that are outside of the grid.)
|
|
@@ -119,7 +119,7 @@ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape
|
|
|
119
119
|
* @param roomShape The shape of the room.
|
|
120
120
|
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
121
121
|
*/
|
|
122
|
-
export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
122
|
+
export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
123
123
|
/**
|
|
124
124
|
* Helper function to get only the adjacent room grid indexes for a room shape that do not exist
|
|
125
125
|
* (i.e. do not have room data).
|
|
@@ -127,7 +127,7 @@ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int,
|
|
|
127
127
|
* This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
128
128
|
* that function for more information.
|
|
129
129
|
*/
|
|
130
|
-
export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape):
|
|
130
|
+
export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
|
|
131
131
|
/**
|
|
132
132
|
* Helper function to check if the given room grid index is a dead end. Specifically, this is
|
|
133
133
|
* defined as having only one adjacent room that exists.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA+BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,GAAG,EAAE,CAKP;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAerE;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,GAAG,EAAE,CAG7C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GAErC,CAAC,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,CAAC,GACvE,SAAS,CAOZ;AAED;;;;;;;GAOG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,GAClB,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CA8CjD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,IAAI,KAAK,CACnD;IAAC,qBAAqB,EAAE,GAAG;IAAE,QAAQ,EAAE,QAAQ;IAAE,gBAAgB,EAAE,GAAG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AED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAmD/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAKtE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
3
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
4
|
-
local Map = ____lualib.Map
|
|
5
4
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
|
+
local Map = ____lualib.Map
|
|
6
6
|
local __TS__New = ____lualib.__TS__New
|
|
7
7
|
local Set = ____lualib.Set
|
|
8
8
|
local ____exports = {}
|
|
@@ -30,6 +30,8 @@ local ____flag = require("src.functions.flag")
|
|
|
30
30
|
local addFlag = ____flag.addFlag
|
|
31
31
|
local hasFlag = ____flag.hasFlag
|
|
32
32
|
local removeFlag = ____flag.removeFlag
|
|
33
|
+
local ____map = require("src.functions.map")
|
|
34
|
+
local copyMap = ____map.copyMap
|
|
33
35
|
local ____rng = require("src.functions.rng")
|
|
34
36
|
local getRandomSeed = ____rng.getRandomSeed
|
|
35
37
|
local isRNG = ____rng.isRNG
|
|
@@ -147,7 +149,10 @@ end
|
|
|
147
149
|
-- This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
148
150
|
-- that function for more information.
|
|
149
151
|
function ____exports.getRoomShapeAdjacentExistingGridIndexes(self, safeRoomGridIndex, roomShape)
|
|
150
|
-
local roomShapeAdjacentGridIndexes =
|
|
152
|
+
local roomShapeAdjacentGridIndexes = copyMap(
|
|
153
|
+
nil,
|
|
154
|
+
____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
|
|
155
|
+
)
|
|
151
156
|
for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
|
|
152
157
|
local doorSlot = ____value[1]
|
|
153
158
|
local roomGridIndex = ____value[2]
|
|
@@ -193,7 +198,10 @@ end
|
|
|
193
198
|
-- This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
|
|
194
199
|
-- that function for more information.
|
|
195
200
|
function ____exports.getRoomShapeAdjacentNonExistingGridIndexes(self, safeRoomGridIndex, roomShape)
|
|
196
|
-
local roomShapeAdjacentGridIndexes =
|
|
201
|
+
local roomShapeAdjacentGridIndexes = copyMap(
|
|
202
|
+
nil,
|
|
203
|
+
____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
|
|
204
|
+
)
|
|
197
205
|
for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
|
|
198
206
|
local doorSlot = ____value[1]
|
|
199
207
|
local roomGridIndex = ____value[2]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/// <reference types="isaac-typescript-definitions" />
|
|
3
3
|
import { DefaultMap } from "../classes/DefaultMap";
|
|
4
4
|
/** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
|
|
5
|
-
export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
|
|
5
|
+
export declare function copyMap<K, V>(oldMap: Map<K, V> | ReadonlyMap<K, V>): Map<K, V>;
|
|
6
6
|
/**
|
|
7
7
|
* Helper function to get the value from a `DefaultMap` that corresponds to an entity, assuming that
|
|
8
8
|
* the map uses `PtrHash` as an index.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/functions/map.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,mG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AW,CAAC,OAAO,EAAE,MAAM,CAAC,GACvD,MAAM,CAGR"}
|
|
@@ -46,8 +46,15 @@ export declare function getTrinketGfxFilename(trinketType: TrinketType): string;
|
|
|
46
46
|
* This function works for both vanilla and modded trinkets.
|
|
47
47
|
*/
|
|
48
48
|
export declare function getTrinketName(trinketType: TrinketType): string;
|
|
49
|
-
/**
|
|
50
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
51
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
52
|
+
*
|
|
53
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
54
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
55
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
56
|
+
*/
|
|
57
|
+
export declare function getVanillaTrinketTypeRange(): TrinketType[];
|
|
51
58
|
/**
|
|
52
59
|
* Returns whether or not the player can hold an additional trinket, beyond what they are currently
|
|
53
60
|
* carrying. This takes into account items that modify the max number of trinkets, like Mom's Purse.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinkets.d.ts","sourceRoot":"","sources":["../../../src/functions/trinkets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmCtC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAE1E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAkBxE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CActE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAOtE;AAED;;;;;;;GAOG;AACH,wBAAgB,cA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ACxB,SAAS,EAAE,SAAS,GACnB,OAAO,CAOT"}
|
|
@@ -120,8 +120,13 @@ function ____exports.getTrinketName(self, trinketType)
|
|
|
120
120
|
end
|
|
121
121
|
return DEFAULT_TRINKET_NAME
|
|
122
122
|
end
|
|
123
|
-
--- Helper function to get an array that represents
|
|
124
|
-
|
|
123
|
+
--- Helper function to get an array that represents the range from the first trinket type to the last
|
|
124
|
+
-- vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
125
|
+
--
|
|
126
|
+
-- This function is only useful when building collectible type objects. For most purposes, you
|
|
127
|
+
-- should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
128
|
+
-- are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
129
|
+
function ____exports.getVanillaTrinketTypeRange(self)
|
|
125
130
|
return iRange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
|
|
126
131
|
end
|
|
127
132
|
--- Returns whether or not the player can hold an additional trinket, beyond what they are currently
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "16.1.
|
|
3
|
+
"version": "16.1.2",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/src/index",
|
|
23
23
|
"types": "dist/src/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^9.5.
|
|
25
|
+
"isaac-typescript-definitions": "^9.5.2"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getSortedSetValues,
|
|
28
28
|
} from "../../../functions/set";
|
|
29
29
|
import {
|
|
30
|
-
|
|
30
|
+
getVanillaTrinketTypeRange,
|
|
31
31
|
trinketHasCacheFlag,
|
|
32
32
|
} from "../../../functions/trinkets";
|
|
33
33
|
import { repeat } from "../../../functions/utils";
|
|
@@ -115,7 +115,8 @@ export class ModdedElementSets extends Feature {
|
|
|
115
115
|
|
|
116
116
|
const vanillaCollectibleTypeRange = getVanillaCollectibleTypeRange();
|
|
117
117
|
for (const collectibleType of vanillaCollectibleTypeRange) {
|
|
118
|
-
// Vanilla collectible types are not contiguous, so we must check every value.
|
|
118
|
+
// Vanilla collectible types are not contiguous, so we must check every value. (There are
|
|
119
|
+
// several gaps, e.g. 666.)
|
|
119
120
|
const itemConfigItem = itemConfig.GetCollectible(collectibleType);
|
|
120
121
|
if (itemConfigItem !== undefined) {
|
|
121
122
|
this.vanillaCollectibleTypesArray.push(collectibleType);
|
|
@@ -156,9 +157,10 @@ export class ModdedElementSets extends Feature {
|
|
|
156
157
|
return;
|
|
157
158
|
}
|
|
158
159
|
|
|
159
|
-
const
|
|
160
|
-
for (const trinketType of
|
|
161
|
-
// Vanilla trinket types are contiguous,
|
|
160
|
+
const vanillaTrinketTypeRange = getVanillaTrinketTypeRange();
|
|
161
|
+
for (const trinketType of vanillaTrinketTypeRange) {
|
|
162
|
+
// Vanilla trinket types are not contiguous, so we must check every value. (The only gap is 47
|
|
163
|
+
// for `POLAROID_OBSOLETE`.)
|
|
162
164
|
const itemConfigItem = itemConfig.GetTrinket(trinketType);
|
|
163
165
|
if (itemConfigItem !== undefined) {
|
|
164
166
|
this.vanillaTrinketTypesArray.push(trinketType);
|
|
@@ -412,7 +412,7 @@ export function getCollectibleTags(
|
|
|
412
412
|
*
|
|
413
413
|
* This function is only useful when building collectible type objects. For most purposes, you
|
|
414
414
|
* should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
415
|
-
* instead.
|
|
415
|
+
* instead (which are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
416
416
|
*/
|
|
417
417
|
export function getVanillaCollectibleTypeRange(): CollectibleType[] {
|
|
418
418
|
return iRange(FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE);
|
|
@@ -27,6 +27,7 @@ import { ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA } from "../objects/roomSha
|
|
|
27
27
|
import { getRandomArrayElement } from "./array";
|
|
28
28
|
import { doorSlotToDoorSlotFlag } from "./doors";
|
|
29
29
|
import { addFlag, hasFlag, removeFlag } from "./flag";
|
|
30
|
+
import { copyMap } from "./map";
|
|
30
31
|
import { getRandomSeed, isRNG, newRNG } from "./rng";
|
|
31
32
|
import {
|
|
32
33
|
getRoomAllowedDoors,
|
|
@@ -244,7 +245,7 @@ export function getNewRoomCandidatesForLevel(): Array<
|
|
|
244
245
|
*/
|
|
245
246
|
export function getRoomAdjacentGridIndexes(
|
|
246
247
|
roomGridIndex?: int,
|
|
247
|
-
):
|
|
248
|
+
): ReadonlyMap<DoorSlot, int> {
|
|
248
249
|
const roomDescriptor = getRoomDescriptor(roomGridIndex);
|
|
249
250
|
|
|
250
251
|
if (!isRoomInsideGrid(roomDescriptor.SafeGridIndex)) {
|
|
@@ -294,10 +295,9 @@ export function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[] {
|
|
|
294
295
|
export function getRoomShapeAdjacentExistingGridIndexes(
|
|
295
296
|
safeRoomGridIndex: int,
|
|
296
297
|
roomShape: RoomShape,
|
|
297
|
-
):
|
|
298
|
-
const roomShapeAdjacentGridIndexes =
|
|
299
|
-
safeRoomGridIndex,
|
|
300
|
-
roomShape,
|
|
298
|
+
): ReadonlyMap<DoorSlot, int> {
|
|
299
|
+
const roomShapeAdjacentGridIndexes = copyMap(
|
|
300
|
+
getRoomShapeAdjacentGridIndexes(safeRoomGridIndex, roomShape),
|
|
301
301
|
);
|
|
302
302
|
|
|
303
303
|
for (const [
|
|
@@ -323,7 +323,7 @@ export function getRoomShapeAdjacentExistingGridIndexes(
|
|
|
323
323
|
*/
|
|
324
324
|
export function getRoomShapeAdjacentGridIndexDeltas(
|
|
325
325
|
roomShape: RoomShape,
|
|
326
|
-
):
|
|
326
|
+
): ReadonlyMap<DoorSlot, int> {
|
|
327
327
|
return ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape];
|
|
328
328
|
}
|
|
329
329
|
|
|
@@ -339,7 +339,7 @@ export function getRoomShapeAdjacentGridIndexDeltas(
|
|
|
339
339
|
export function getRoomShapeAdjacentGridIndexes(
|
|
340
340
|
safeRoomGridIndex: int,
|
|
341
341
|
roomShape: RoomShape,
|
|
342
|
-
):
|
|
342
|
+
): ReadonlyMap<DoorSlot, int> {
|
|
343
343
|
const roomShapeAdjacentGridIndexDeltas =
|
|
344
344
|
getRoomShapeAdjacentGridIndexDeltas(roomShape);
|
|
345
345
|
|
|
@@ -364,10 +364,9 @@ export function getRoomShapeAdjacentGridIndexes(
|
|
|
364
364
|
export function getRoomShapeAdjacentNonExistingGridIndexes(
|
|
365
365
|
safeRoomGridIndex: int,
|
|
366
366
|
roomShape: RoomShape,
|
|
367
|
-
):
|
|
368
|
-
const roomShapeAdjacentGridIndexes =
|
|
369
|
-
safeRoomGridIndex,
|
|
370
|
-
roomShape,
|
|
367
|
+
): ReadonlyMap<DoorSlot, int> {
|
|
368
|
+
const roomShapeAdjacentGridIndexes = copyMap(
|
|
369
|
+
getRoomShapeAdjacentGridIndexes(safeRoomGridIndex, roomShape),
|
|
371
370
|
);
|
|
372
371
|
|
|
373
372
|
for (const [
|
package/src/functions/map.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { sumArray } from "./array";
|
|
|
3
3
|
import { getPartialMatch } from "./string";
|
|
4
4
|
|
|
5
5
|
/** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
|
|
6
|
-
export function copyMap<K, V>(
|
|
6
|
+
export function copyMap<K, V>(
|
|
7
|
+
oldMap: Map<K, V> | ReadonlyMap<K, V>,
|
|
8
|
+
): Map<K, V> {
|
|
7
9
|
const newMap = new Map<K, V>();
|
|
8
10
|
for (const [key, value] of oldMap.entries()) {
|
|
9
11
|
newMap.set(key, value);
|
|
@@ -145,8 +145,15 @@ export function getTrinketName(trinketType: TrinketType): string {
|
|
|
145
145
|
return DEFAULT_TRINKET_NAME;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
/**
|
|
149
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Helper function to get an array that represents the range from the first trinket type to the last
|
|
150
|
+
* vanilla trinket type. This will include integers that do not represent any valid trinket types.
|
|
151
|
+
*
|
|
152
|
+
* This function is only useful when building collectible type objects. For most purposes, you
|
|
153
|
+
* should use the `getVanillaTrinketArray` or `getVanillaTrinketSet` helper functions instead (which
|
|
154
|
+
* are part of `ISCFeature.MODDED_ELEMENT_SETS`).
|
|
155
|
+
*/
|
|
156
|
+
export function getVanillaTrinketTypeRange(): TrinketType[] {
|
|
150
157
|
return iRange(FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE);
|
|
151
158
|
}
|
|
152
159
|
|