isaacscript-common 33.9.1 → 33.10.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 +7 -8
- package/dist/isaacscript-common.lua +7 -8
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +1 -0
- package/dist/src/functions/minimap.d.ts +2 -2
- package/dist/src/functions/minimap.d.ts.map +1 -1
- package/dist/src/functions/minimap.lua +5 -2
- package/dist/src/functions/roomData.d.ts +5 -6
- package/dist/src/functions/roomData.d.ts.map +1 -1
- package/dist/src/functions/roomData.lua +5 -11
- package/dist/src/maps/collectibleTypeToNameMap.lua +1 -1
- package/package.json +1 -1
- package/src/classes/features/other/ModdedElementSets.ts +1 -0
- package/src/functions/minimap.ts +10 -2
- package/src/functions/roomData.ts +5 -16
- package/src/maps/collectibleTypeToNameMap.ts +1 -1
package/dist/index.rollup.d.ts
CHANGED
|
@@ -6670,13 +6670,12 @@ export declare function getRoomDescriptorsForType(...roomTypes: RoomType[]): Roo
|
|
|
6670
6670
|
export declare function getRoomDisplayFlags(roomGridIndex?: int, minimapAPI?: boolean): BitFlags<DisplayFlag>;
|
|
6671
6671
|
|
|
6672
6672
|
/**
|
|
6673
|
-
* Helper function to get the grid index of the current room.
|
|
6673
|
+
* Helper function to get the safe grid index of the current room. (The safe grid index is defined
|
|
6674
|
+
* as the top-left 1x1 section that the room overlaps with, or the top-right 1x1 section of a
|
|
6675
|
+
* `RoomType.SHAPE_LTL` room.)
|
|
6674
6676
|
*
|
|
6675
|
-
*
|
|
6676
|
-
*
|
|
6677
|
-
* overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
|
|
6678
|
-
* - If the current room is outside of the grid, it will return the index from the
|
|
6679
|
-
* `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases).
|
|
6677
|
+
* Under the hood, this function uses the `Level.GetCurrentRoomDesc` method. (In Afterbirth+, this
|
|
6678
|
+
* method was bugged for rooms outside of the grid, but it is now fixed.)
|
|
6680
6679
|
*
|
|
6681
6680
|
* Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
|
|
6682
6681
|
* will return the specific 1x1 quadrant that the player entered the room at. For most situations,
|
|
@@ -8822,10 +8821,10 @@ export declare function isRoomType(roomData: RoomConfig, ...roomTypes: RoomType[
|
|
|
8822
8821
|
/**
|
|
8823
8822
|
* Helper function to check if a given room is visible on the minimap.
|
|
8824
8823
|
*
|
|
8825
|
-
* @param
|
|
8824
|
+
* @param roomGridIndexOrRoomDescriptor The room to check.
|
|
8826
8825
|
* @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true.
|
|
8827
8826
|
*/
|
|
8828
|
-
export declare function isRoomVisible(
|
|
8827
|
+
export declare function isRoomVisible(roomGridIndexOrRoomDescriptor: int | RoomDescriptor, minimapAPI?: boolean): boolean;
|
|
8829
8828
|
|
|
8830
8829
|
/** Returns true for cards that have `CardType.RUNE`. */
|
|
8831
8830
|
export declare function isRune(cardType: CardType): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 33.
|
|
3
|
+
isaacscript-common 33.10.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -20710,7 +20710,7 @@ ____exports.COLLECTIBLE_TYPE_TO_NAME_MAP = __TS__New(ReadonlyMap, {
|
|
|
20710
20710
|
{653, "Vade Retro"},
|
|
20711
20711
|
{654, "False PHD"},
|
|
20712
20712
|
{655, "Spin to Win"},
|
|
20713
|
-
{656, "Damocles"},
|
|
20713
|
+
{656, "Damocles (Passive)"},
|
|
20714
20714
|
{657, "Vasculitis"},
|
|
20715
20715
|
{658, "Giant Cell"},
|
|
20716
20716
|
{659, "Tropicamide"},
|
|
@@ -26764,11 +26764,6 @@ function ____exports.getRoomDescriptorReadOnly(self)
|
|
|
26764
26764
|
return level:GetCurrentRoomDesc()
|
|
26765
26765
|
end
|
|
26766
26766
|
function ____exports.getRoomGridIndex(self)
|
|
26767
|
-
local level = game:GetLevel()
|
|
26768
|
-
local currentRoomIndex = level:GetCurrentRoomIndex()
|
|
26769
|
-
if currentRoomIndex < 0 then
|
|
26770
|
-
return currentRoomIndex
|
|
26771
|
-
end
|
|
26772
26767
|
local roomDescriptor = ____exports.getRoomDescriptorReadOnly(nil)
|
|
26773
26768
|
return roomDescriptor.SafeGridIndex
|
|
26774
26769
|
end
|
|
@@ -39068,6 +39063,7 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
|
39068
39063
|
if exceptions == nil then
|
|
39069
39064
|
exceptions = {}
|
|
39070
39065
|
end
|
|
39066
|
+
self:lazyInitCardTypes()
|
|
39071
39067
|
return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
|
|
39072
39068
|
end
|
|
39073
39069
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
|
|
@@ -53785,6 +53781,8 @@ local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
|
53785
53781
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
53786
53782
|
local ____rooms = require("src.functions.rooms")
|
|
53787
53783
|
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
53784
|
+
local ____types = require("src.functions.types")
|
|
53785
|
+
local isNumber = ____types.isNumber
|
|
53788
53786
|
local ____utils = require("src.functions.utils")
|
|
53789
53787
|
local assertDefined = ____utils.assertDefined
|
|
53790
53788
|
function ____exports.getRoomDisplayFlags(self, roomGridIndex, minimapAPI)
|
|
@@ -53877,10 +53875,11 @@ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
|
|
|
53877
53875
|
minimapAPIRoomDescriptor.Hidden = true
|
|
53878
53876
|
end
|
|
53879
53877
|
end
|
|
53880
|
-
function ____exports.isRoomVisible(self,
|
|
53878
|
+
function ____exports.isRoomVisible(self, roomGridIndexOrRoomDescriptor, minimapAPI)
|
|
53881
53879
|
if minimapAPI == nil then
|
|
53882
53880
|
minimapAPI = true
|
|
53883
53881
|
end
|
|
53882
|
+
local roomGridIndex = isNumber(nil, roomGridIndexOrRoomDescriptor) and roomGridIndexOrRoomDescriptor or roomGridIndexOrRoomDescriptor.SafeGridIndex
|
|
53884
53883
|
local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
|
|
53885
53884
|
return roomDisplayFlags ~= DisplayFlagZero
|
|
53886
53885
|
end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModdedElementSets.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/ModdedElementSets.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAsCtC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA2BhD,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAyB;IAClE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA8B;IAErE,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAAyB;IACtE,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAA8B;IAEzE,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAyB;IACrE,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAA8B;IAExE,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAqB;IAC1D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA0B;IAE7D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAqB;IAC9D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAA0B;IAEjE,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAqB;IAC7D,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exceptions = {}
|
|
574
574
|
end
|
|
575
|
+
self:lazyInitCardTypes()
|
|
575
576
|
return getRandomSetElement(nil, self.cardSet, seedOrRNG, exceptions)
|
|
576
577
|
end
|
|
577
578
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
|
|
@@ -65,10 +65,10 @@ export declare function hideRoomOnMinimap(roomGridIndex: int): void;
|
|
|
65
65
|
/**
|
|
66
66
|
* Helper function to check if a given room is visible on the minimap.
|
|
67
67
|
*
|
|
68
|
-
* @param
|
|
68
|
+
* @param roomGridIndexOrRoomDescriptor The room to check.
|
|
69
69
|
* @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true.
|
|
70
70
|
*/
|
|
71
|
-
export declare function isRoomVisible(
|
|
71
|
+
export declare function isRoomVisible(roomGridIndexOrRoomDescriptor: int | RoomDescriptor, minimapAPI?: boolean): boolean;
|
|
72
72
|
/**
|
|
73
73
|
* Helper function to set the minimap `DisplayFlag` value for every room on the floor at once.
|
|
74
74
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../../../src/functions/minimap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"minimap.d.ts","sourceRoot":"","sources":["../../../src/functions/minimap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAShE;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,WAAW,EAAE,WAAW,EACxB,gBAAgB,UAAO,GACtB,IAAI,CAIN;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAE9D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,UAAO,GAChB,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAUjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,GAAG,EACnB,UAAU,UAAO,GAChB,QAAQ,CAAC,WAAW,CAAC,CAiBvB;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAe1D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,6BAA6B,EAAE,GAAG,GAAG,cAAc,EACnD,UAAU,UAAO,GAChB,OAAO,CAOT;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAW5E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,GAC/C,IAAI,CAWN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,GAAG,GAAG,SAAS,EAC9B,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,EACnC,gBAAgB,UAAO,GACtB,IAAI,CAsBN"}
|
|
@@ -14,6 +14,8 @@ local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
|
14
14
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
15
15
|
local ____rooms = require("src.functions.rooms")
|
|
16
16
|
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
17
|
+
local ____types = require("src.functions.types")
|
|
18
|
+
local isNumber = ____types.isNumber
|
|
17
19
|
local ____utils = require("src.functions.utils")
|
|
18
20
|
local assertDefined = ____utils.assertDefined
|
|
19
21
|
--- Helper function to get a particular room's minimap display flags (e.g. whether it is visible and
|
|
@@ -170,12 +172,13 @@ function ____exports.hideRoomOnMinimap(self, roomGridIndex)
|
|
|
170
172
|
end
|
|
171
173
|
--- Helper function to check if a given room is visible on the minimap.
|
|
172
174
|
--
|
|
173
|
-
-- @param
|
|
175
|
+
-- @param roomGridIndexOrRoomDescriptor The room to check.
|
|
174
176
|
-- @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true.
|
|
175
|
-
function ____exports.isRoomVisible(self,
|
|
177
|
+
function ____exports.isRoomVisible(self, roomGridIndexOrRoomDescriptor, minimapAPI)
|
|
176
178
|
if minimapAPI == nil then
|
|
177
179
|
minimapAPI = true
|
|
178
180
|
end
|
|
181
|
+
local roomGridIndex = isNumber(nil, roomGridIndexOrRoomDescriptor) and roomGridIndexOrRoomDescriptor or roomGridIndexOrRoomDescriptor.SafeGridIndex
|
|
179
182
|
local roomDisplayFlags = ____exports.getRoomDisplayFlags(nil, roomGridIndex, minimapAPI)
|
|
180
183
|
return roomDisplayFlags ~= DisplayFlagZero
|
|
181
184
|
end
|
|
@@ -18,13 +18,12 @@ export declare function getRoomDescriptor(roomGridIndex?: int): RoomDescriptor;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function getRoomDescriptorReadOnly(): Readonly<RoomDescriptor>;
|
|
20
20
|
/**
|
|
21
|
-
* Helper function to get the grid index of the current room.
|
|
21
|
+
* Helper function to get the safe grid index of the current room. (The safe grid index is defined
|
|
22
|
+
* as the top-left 1x1 section that the room overlaps with, or the top-right 1x1 section of a
|
|
23
|
+
* `RoomType.SHAPE_LTL` room.)
|
|
22
24
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
|
|
26
|
-
* - If the current room is outside of the grid, it will return the index from the
|
|
27
|
-
* `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases).
|
|
25
|
+
* Under the hood, this function uses the `Level.GetCurrentRoomDesc` method. (In Afterbirth+, this
|
|
26
|
+
* method was bugged for rooms outside of the grid, but it is now fixed.)
|
|
28
27
|
*
|
|
29
28
|
* Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
|
|
30
29
|
* will return the specific 1x1 quadrant that the player entered the room at. For most situations,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomData.d.ts","sourceRoot":"","sources":["../../../src/functions/roomData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAMtC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAgBtE;AAGD,wBAAgB,WAAW,IAAI,UAAU,CAAC;AAC1C,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAAC;AAYzE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAQrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,cAAc,CAAC,CAGpE;AAED
|
|
1
|
+
{"version":3,"file":"roomData.d.ts","sourceRoot":"","sources":["../../../src/functions/roomData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAMtC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAgBtE;AAGD,wBAAgB,WAAW,IAAI,UAAU,CAAC;AAC1C,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,CAAC;AAYzE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAQrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,cAAc,CAAC,CAGpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,IAAI,GAAG,CAGtC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,MAAM,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,SAAS,GAAG,SAAS,CAGvE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,GAAG,CAAC,CAAC,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGvD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,QAAQ,GAAG,CAAC,CAAC,CAG9D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAGvD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAG5D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,GAAG,IAAI,CAG1E"}
|
|
@@ -33,13 +33,12 @@ function ____exports.getRoomDescriptorReadOnly(self)
|
|
|
33
33
|
local level = game:GetLevel()
|
|
34
34
|
return level:GetCurrentRoomDesc()
|
|
35
35
|
end
|
|
36
|
-
--- Helper function to get the grid index of the current room.
|
|
36
|
+
--- Helper function to get the safe grid index of the current room. (The safe grid index is defined
|
|
37
|
+
-- as the top-left 1x1 section that the room overlaps with, or the top-right 1x1 section of a
|
|
38
|
+
-- `RoomType.SHAPE_LTL` room.)
|
|
37
39
|
--
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
-- overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
|
|
41
|
-
-- - If the current room is outside of the grid, it will return the index from the
|
|
42
|
-
-- `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases).
|
|
40
|
+
-- Under the hood, this function uses the `Level.GetCurrentRoomDesc` method. (In Afterbirth+, this
|
|
41
|
+
-- method was bugged for rooms outside of the grid, but it is now fixed.)
|
|
43
42
|
--
|
|
44
43
|
-- Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
|
|
45
44
|
-- will return the specific 1x1 quadrant that the player entered the room at. For most situations,
|
|
@@ -48,11 +47,6 @@ end
|
|
|
48
47
|
-- Data structures that store data per room should use the room's `ListIndex` instead of
|
|
49
48
|
-- `SafeGridIndex`, since the former is unique across different dimensions.
|
|
50
49
|
function ____exports.getRoomGridIndex(self)
|
|
51
|
-
local level = game:GetLevel()
|
|
52
|
-
local currentRoomIndex = level:GetCurrentRoomIndex()
|
|
53
|
-
if currentRoomIndex < 0 then
|
|
54
|
-
return currentRoomIndex
|
|
55
|
-
end
|
|
56
50
|
local roomDescriptor = ____exports.getRoomDescriptorReadOnly(nil)
|
|
57
51
|
return roomDescriptor.SafeGridIndex
|
|
58
52
|
end
|
|
@@ -657,7 +657,7 @@ ____exports.COLLECTIBLE_TYPE_TO_NAME_MAP = __TS__New(ReadonlyMap, {
|
|
|
657
657
|
{653, "Vade Retro"},
|
|
658
658
|
{654, "False PHD"},
|
|
659
659
|
{655, "Spin to Win"},
|
|
660
|
-
{656, "Damocles"},
|
|
660
|
+
{656, "Damocles (Passive)"},
|
|
661
661
|
{657, "Vasculitis"},
|
|
662
662
|
{658, "Giant Cell"},
|
|
663
663
|
{659, "Tropicamide"},
|
package/package.json
CHANGED
|
@@ -1022,6 +1022,7 @@ export class ModdedElementSets extends Feature {
|
|
|
1022
1022
|
seedOrRNG: Seed | RNG = getRandomSeed(),
|
|
1023
1023
|
exceptions: CardType[] = [],
|
|
1024
1024
|
): CardType {
|
|
1025
|
+
this.lazyInitCardTypes();
|
|
1025
1026
|
return getRandomSetElement(this.cardSet, seedOrRNG, exceptions);
|
|
1026
1027
|
}
|
|
1027
1028
|
|
package/src/functions/minimap.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { game } from "../core/cachedClasses";
|
|
|
4
4
|
import { addFlag } from "./flag";
|
|
5
5
|
import { getRoomDescriptor, getRoomGridIndex } from "./roomData";
|
|
6
6
|
import { getRoomsInsideGrid } from "./rooms";
|
|
7
|
+
import { isNumber } from "./types";
|
|
7
8
|
import { assertDefined } from "./utils";
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -137,11 +138,18 @@ export function hideRoomOnMinimap(roomGridIndex: int): void {
|
|
|
137
138
|
/**
|
|
138
139
|
* Helper function to check if a given room is visible on the minimap.
|
|
139
140
|
*
|
|
140
|
-
* @param
|
|
141
|
+
* @param roomGridIndexOrRoomDescriptor The room to check.
|
|
141
142
|
* @param minimapAPI Optional. Whether MinimapAPI should be used, if present. Default is true.
|
|
142
143
|
*/
|
|
143
|
-
export function isRoomVisible(
|
|
144
|
+
export function isRoomVisible(
|
|
145
|
+
roomGridIndexOrRoomDescriptor: int | RoomDescriptor,
|
|
146
|
+
minimapAPI = true,
|
|
147
|
+
): boolean {
|
|
148
|
+
const roomGridIndex = isNumber(roomGridIndexOrRoomDescriptor)
|
|
149
|
+
? roomGridIndexOrRoomDescriptor
|
|
150
|
+
: roomGridIndexOrRoomDescriptor.SafeGridIndex;
|
|
144
151
|
const roomDisplayFlags = getRoomDisplayFlags(roomGridIndex, minimapAPI);
|
|
152
|
+
|
|
145
153
|
return roomDisplayFlags !== DisplayFlagZero;
|
|
146
154
|
}
|
|
147
155
|
|
|
@@ -70,13 +70,12 @@ export function getRoomDescriptorReadOnly(): Readonly<RoomDescriptor> {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Helper function to get the grid index of the current room.
|
|
73
|
+
* Helper function to get the safe grid index of the current room. (The safe grid index is defined
|
|
74
|
+
* as the top-left 1x1 section that the room overlaps with, or the top-right 1x1 section of a
|
|
75
|
+
* `RoomType.SHAPE_LTL` room.)
|
|
74
76
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* overlaps with, or the top-right 1x1 section of a `RoomType.SHAPE_LTL` room.)
|
|
78
|
-
* - If the current room is outside of the grid, it will return the index from the
|
|
79
|
-
* `Level.GetCurrentRoomIndex` method (since `SafeGridIndex` is bugged for these cases).
|
|
77
|
+
* Under the hood, this function uses the `Level.GetCurrentRoomDesc` method. (In Afterbirth+, this
|
|
78
|
+
* method was bugged for rooms outside of the grid, but it is now fixed.)
|
|
80
79
|
*
|
|
81
80
|
* Use this function instead of the `Level.GetCurrentRoomIndex` method directly because the latter
|
|
82
81
|
* will return the specific 1x1 quadrant that the player entered the room at. For most situations,
|
|
@@ -86,16 +85,6 @@ export function getRoomDescriptorReadOnly(): Readonly<RoomDescriptor> {
|
|
|
86
85
|
* `SafeGridIndex`, since the former is unique across different dimensions.
|
|
87
86
|
*/
|
|
88
87
|
export function getRoomGridIndex(): int {
|
|
89
|
-
const level = game.GetLevel();
|
|
90
|
-
const currentRoomIndex = level.GetCurrentRoomIndex();
|
|
91
|
-
|
|
92
|
-
// Both `RoomDescriptor.GridIndex` and `RoomDescriptor.SafeGridIndex` will always be equal to -1
|
|
93
|
-
// for rooms outside of the grid. Thus, we revert to using the `Level.GetCurrentRoomIndex` method
|
|
94
|
-
// for these cases.
|
|
95
|
-
if (currentRoomIndex < 0) {
|
|
96
|
-
return currentRoomIndex;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
88
|
const roomDescriptor = getRoomDescriptorReadOnly();
|
|
100
89
|
return roomDescriptor.SafeGridIndex;
|
|
101
90
|
}
|
|
@@ -661,7 +661,7 @@ export const COLLECTIBLE_TYPE_TO_NAME_MAP = new ReadonlyMap<
|
|
|
661
661
|
[653, "Vade Retro"],
|
|
662
662
|
[654, "False PHD"],
|
|
663
663
|
[655, "Spin to Win"],
|
|
664
|
-
[656, "Damocles"],
|
|
664
|
+
[656, "Damocles (Passive)"],
|
|
665
665
|
[657, "Vasculitis"],
|
|
666
666
|
[658, "Giant Cell"],
|
|
667
667
|
[659, "Tropicamide"],
|