isaacscript-common 6.22.1 → 6.22.4
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/callbacks/postTransformation.d.ts.map +1 -1
- package/dist/callbacks/postTransformation.lua +6 -2
- package/dist/callbacks/postTrinketBreak.lua +6 -2
- package/dist/features/customStage/exports.lua +2 -2
- package/dist/functions/index.d.ts +1 -0
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.lua +8 -0
- package/dist/functions/indexTypeDoc.d.ts +1 -0
- package/dist/functions/indexTypeDoc.d.ts.map +1 -1
- package/dist/functions/indexTypeDoc.lua +1 -0
- package/dist/functions/level.lua +2 -2
- package/dist/functions/levelGrid.d.ts +3 -1
- package/dist/functions/levelGrid.d.ts.map +1 -1
- package/dist/functions/levelGrid.lua +15 -10
- package/dist/functions/minimap.lua +3 -3
- package/dist/functions/rooms.d.ts +1 -1
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +4 -4
- package/dist/interfaces/CustomStageLua.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/callbacks/postTransformation.ts +7 -3
- package/src/callbacks/postTrinketBreak.ts +9 -5
- package/src/features/customStage/exports.ts +2 -2
- package/src/functions/index.ts +1 -0
- package/src/functions/indexTypeDoc.ts +1 -0
- package/src/functions/level.ts +2 -2
- package/src/functions/levelGrid.ts +16 -12
- package/src/functions/minimap.ts +3 -3
- package/src/functions/rooms.ts +4 -4
- package/src/interfaces/CustomStageLua.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postTransformation.d.ts","sourceRoot":"","sources":["../../src/callbacks/postTransformation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"postTransformation.d.ts","sourceRoot":"","sources":["../../src/callbacks/postTransformation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAuBrD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAO7D"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
2
3
|
local __TS__New = ____lualib.__TS__New
|
|
3
4
|
local ____exports = {}
|
|
4
5
|
local hasSubscriptions, postPEffectUpdateReordered, PLAYER_FORMS, v
|
|
@@ -27,7 +28,10 @@ function postPEffectUpdateReordered(self, player)
|
|
|
27
28
|
local playerTransformationsMap = defaultMapGetPlayer(nil, v.run.playersTransformationsMap, player)
|
|
28
29
|
for ____, playerForm in ipairs(PLAYER_FORMS) do
|
|
29
30
|
local hasForm = player:HasPlayerForm(playerForm)
|
|
30
|
-
local storedForm = playerTransformationsMap:
|
|
31
|
+
local storedForm = playerTransformationsMap:get(playerForm)
|
|
32
|
+
if storedForm == nil then
|
|
33
|
+
storedForm = false
|
|
34
|
+
end
|
|
31
35
|
if hasForm ~= storedForm then
|
|
32
36
|
playerTransformationsMap:set(playerForm, hasForm)
|
|
33
37
|
postTransformationFire(nil, player, playerForm, hasForm)
|
|
@@ -37,7 +41,7 @@ end
|
|
|
37
41
|
PLAYER_FORMS = getEnumValues(nil, PlayerForm)
|
|
38
42
|
v = {run = {playersTransformationsMap = __TS__New(
|
|
39
43
|
DefaultMap,
|
|
40
|
-
function() return __TS__New(
|
|
44
|
+
function() return __TS__New(Map) end
|
|
41
45
|
)}}
|
|
42
46
|
function ____exports.postTransformationInit(self, mod)
|
|
43
47
|
saveDataManager(nil, "postTransformation", v, hasSubscriptions)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
2
3
|
local __TS__New = ____lualib.__TS__New
|
|
3
4
|
local ____exports = {}
|
|
4
5
|
local hasSubscriptions, entityTakeDmgPlayer, postPEffectUpdateReordered, TRINKETS_THAT_CAN_BREAK, v
|
|
@@ -33,7 +34,10 @@ function entityTakeDmgPlayer(self, tookDamage, _damageAmount, _damageFlags, _dam
|
|
|
33
34
|
for ____, trinketType in ipairs(TRINKETS_THAT_CAN_BREAK) do
|
|
34
35
|
do
|
|
35
36
|
local numTrinketsHeld = player:GetTrinketMultiplier(trinketType)
|
|
36
|
-
local oldNumTrinketsHeld = trinketMap:
|
|
37
|
+
local oldNumTrinketsHeld = trinketMap:get(trinketType)
|
|
38
|
+
if oldNumTrinketsHeld == nil then
|
|
39
|
+
oldNumTrinketsHeld = 0
|
|
40
|
+
end
|
|
37
41
|
if numTrinketsHeld >= oldNumTrinketsHeld then
|
|
38
42
|
goto __continue8
|
|
39
43
|
end
|
|
@@ -61,7 +65,7 @@ end
|
|
|
61
65
|
TRINKETS_THAT_CAN_BREAK = {TrinketType.WISH_BONE, TrinketType.WALNUT}
|
|
62
66
|
v = {run = {playersTrinketMap = __TS__New(
|
|
63
67
|
DefaultMap,
|
|
64
|
-
function() return __TS__New(
|
|
68
|
+
function() return __TS__New(Map) end
|
|
65
69
|
)}}
|
|
66
70
|
function ____exports.postTrinketBreakInit(self, mod)
|
|
67
71
|
saveDataManager(nil, "postTrinketBreak", v, hasSubscriptions)
|
|
@@ -19,7 +19,7 @@ local ____rng = require("functions.rng")
|
|
|
19
19
|
local newRNG = ____rng.newRNG
|
|
20
20
|
local ____rooms = require("functions.rooms")
|
|
21
21
|
local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
|
|
22
|
-
local
|
|
22
|
+
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
23
23
|
local ____stage = require("functions.stage")
|
|
24
24
|
local setStage = ____stage.setStage
|
|
25
25
|
local ____customStageUtils = require("features.customStage.customStageUtils")
|
|
@@ -32,7 +32,7 @@ local customStagesMap = ____v.customStagesMap
|
|
|
32
32
|
function setStageRoomsData(self, customStage, rng, verbose)
|
|
33
33
|
local level = game:GetLevel()
|
|
34
34
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
35
|
-
for ____, room in ipairs(
|
|
35
|
+
for ____, room in ipairs(getRoomsInsideGrid(nil)) do
|
|
36
36
|
do
|
|
37
37
|
if room.SafeGridIndex == startingRoomGridIndex then
|
|
38
38
|
goto __continue7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAEA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;A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W,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/dist/functions/index.lua
CHANGED
|
@@ -607,6 +607,14 @@ do
|
|
|
607
607
|
end
|
|
608
608
|
end
|
|
609
609
|
end
|
|
610
|
+
do
|
|
611
|
+
local ____export = require("functions.roomTransition")
|
|
612
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
613
|
+
if ____exportKey ~= "default" then
|
|
614
|
+
____exports[____exportKey] = ____exportValue
|
|
615
|
+
end
|
|
616
|
+
end
|
|
617
|
+
end
|
|
610
618
|
do
|
|
611
619
|
local ____export = require("functions.run")
|
|
612
620
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -74,6 +74,7 @@ export * as RoomData from "./roomData";
|
|
|
74
74
|
export * as RoomGrid from "./roomGrid";
|
|
75
75
|
export * as Rooms from "./rooms";
|
|
76
76
|
export * as RoomShape from "./roomShape";
|
|
77
|
+
export * as RoomTransition from "./roomTransition";
|
|
77
78
|
export * as Run from "./run";
|
|
78
79
|
export * as SaveFile from "./saveFile";
|
|
79
80
|
export * as Seeds from "./seeds";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexTypeDoc.d.ts","sourceRoot":"","sources":["../../src/functions/indexTypeDoc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,O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K,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,eAAe,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC"}
|
|
@@ -75,6 +75,7 @@ ____exports.RoomData = require("functions.roomData")
|
|
|
75
75
|
____exports.RoomGrid = require("functions.roomGrid")
|
|
76
76
|
____exports.Rooms = require("functions.rooms")
|
|
77
77
|
____exports.RoomShape = require("functions.roomShape")
|
|
78
|
+
____exports.RoomTransition = require("functions.roomTransition")
|
|
78
79
|
____exports.Run = require("functions.run")
|
|
79
80
|
____exports.SaveFile = require("functions.saveFile")
|
|
80
81
|
____exports.Seeds = require("functions.seeds")
|
package/dist/functions/level.lua
CHANGED
|
@@ -9,13 +9,13 @@ local ____levelGrid = require("functions.levelGrid")
|
|
|
9
9
|
local isDoorSlotValidAtGridIndexForRedRoom = ____levelGrid.isDoorSlotValidAtGridIndexForRedRoom
|
|
10
10
|
local ____rooms = require("functions.rooms")
|
|
11
11
|
local getNumRooms = ____rooms.getNumRooms
|
|
12
|
-
local
|
|
12
|
+
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
13
13
|
function ____exports.fillLevelWithRedRooms(self)
|
|
14
14
|
local level = game:GetLevel()
|
|
15
15
|
local numRoomsInGrid
|
|
16
16
|
repeat
|
|
17
17
|
do
|
|
18
|
-
local roomsInGrid =
|
|
18
|
+
local roomsInGrid = getRoomsInsideGrid(nil)
|
|
19
19
|
numRoomsInGrid = #roomsInGrid
|
|
20
20
|
for ____, roomDescriptor in ipairs(roomsInGrid) do
|
|
21
21
|
for ____, doorSlot in ipairs(getEnumValues(nil, DoorSlot)) do
|
|
@@ -120,8 +120,10 @@ export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
|
|
|
120
120
|
* Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
121
121
|
*
|
|
122
122
|
* For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
|
|
123
|
+
*
|
|
124
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
123
125
|
*/
|
|
124
|
-
export declare function
|
|
126
|
+
export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
|
|
125
127
|
/**
|
|
126
128
|
* Helper function to generate a new room on the floor at a valid dead end attached to a normal
|
|
127
129
|
* room.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,E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,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CA+BxE;AAED;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CACjD,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAEpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAapB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAUtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,IAAI,GAAG,GAAG,SAAS,CA6CzC;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"}
|
|
@@ -40,7 +40,7 @@ local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
|
40
40
|
local getRoomShape = ____roomData.getRoomShape
|
|
41
41
|
local ____rooms = require("functions.rooms")
|
|
42
42
|
local getRooms = ____rooms.getRooms
|
|
43
|
-
local
|
|
43
|
+
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
44
44
|
local ____roomShape = require("functions.roomShape")
|
|
45
45
|
local getGridIndexDelta = ____roomShape.getGridIndexDelta
|
|
46
46
|
--- Helper function to get the room grid indexes that are adjacent to a given room grid index.
|
|
@@ -57,7 +57,7 @@ local getGridIndexDelta = ____roomShape.getGridIndexDelta
|
|
|
57
57
|
-- @param roomGridIndex Optional. Default is the current room index.
|
|
58
58
|
function ____exports.getAdjacentRoomGridIndexes(self, roomGridIndex)
|
|
59
59
|
local roomGridIndexToUse = roomGridIndex == nil and getRoomGridIndex(nil) or roomGridIndex
|
|
60
|
-
if not ____exports.
|
|
60
|
+
if not ____exports.isRoomInsideGrid(nil, roomGridIndexToUse) then
|
|
61
61
|
return {}
|
|
62
62
|
end
|
|
63
63
|
local adjacentRoomGridIndexes = __TS__ArrayMap(
|
|
@@ -66,7 +66,7 @@ function ____exports.getAdjacentRoomGridIndexes(self, roomGridIndex)
|
|
|
66
66
|
)
|
|
67
67
|
return __TS__ArrayFilter(
|
|
68
68
|
adjacentRoomGridIndexes,
|
|
69
|
-
function(____, adjacentRoomGridIndex) return ____exports.
|
|
69
|
+
function(____, adjacentRoomGridIndex) return ____exports.isRoomInsideGrid(nil, adjacentRoomGridIndex) end
|
|
70
70
|
)
|
|
71
71
|
end
|
|
72
72
|
--- Helper function to iterate through the possible doors for a room and see if any of them would be
|
|
@@ -76,7 +76,7 @@ end
|
|
|
76
76
|
-- @returns A array of tuples of `DoorSlot` and room grid index.
|
|
77
77
|
function ____exports.getNewRoomCandidatesBesideRoom(self, roomGridIndex)
|
|
78
78
|
local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
|
|
79
|
-
if not ____exports.
|
|
79
|
+
if not ____exports.isRoomInsideGrid(nil, roomDescriptor.SafeGridIndex) then
|
|
80
80
|
return {}
|
|
81
81
|
end
|
|
82
82
|
local roomData = roomDescriptor.Data
|
|
@@ -110,7 +110,7 @@ end
|
|
|
110
110
|
--
|
|
111
111
|
-- @returns A array of tuples of adjacent room grid index, `DoorSlot`, and new room grid index.
|
|
112
112
|
function ____exports.getNewRoomCandidatesForLevel(self)
|
|
113
|
-
local rooms =
|
|
113
|
+
local rooms = getRoomsInsideGrid(nil)
|
|
114
114
|
local normalRooms = __TS__ArrayFilter(
|
|
115
115
|
rooms,
|
|
116
116
|
function(____, room) return room.Data ~= nil and room.Data.Type == RoomType.DEFAULT and room.Data.Subtype ~= DownpourRoomSubType.MIRROR and room.Data.Subtype ~= MinesRoomSubType.MINESHAFT_ENTRANCE end
|
|
@@ -149,7 +149,7 @@ function ____exports.getRoomShapeNeighborGridIndexes(self, safeRoomGridIndex, ro
|
|
|
149
149
|
local doorSlot = ____value[1]
|
|
150
150
|
local delta = ____value[2]
|
|
151
151
|
local roomGridIndex = safeRoomGridIndex + delta
|
|
152
|
-
if ____exports.
|
|
152
|
+
if ____exports.isRoomInsideGrid(nil, roomGridIndex) then
|
|
153
153
|
neighborGridIndexes:set(doorSlot, roomGridIndex)
|
|
154
154
|
end
|
|
155
155
|
end
|
|
@@ -180,7 +180,12 @@ end
|
|
|
180
180
|
--- Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
181
181
|
--
|
|
182
182
|
-- For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
|
|
183
|
-
|
|
183
|
+
--
|
|
184
|
+
-- @param roomGridIndex Optional. Default is the current room index.
|
|
185
|
+
function ____exports.isRoomInsideGrid(self, roomGridIndex)
|
|
186
|
+
if roomGridIndex == nil then
|
|
187
|
+
roomGridIndex = getRoomGridIndex(nil)
|
|
188
|
+
end
|
|
184
189
|
return roomGridIndex >= 0 and roomGridIndex <= MAX_LEVEL_GRID_INDEX
|
|
185
190
|
end
|
|
186
191
|
--- Helper function to check if a room exists at the given room grid index. (A room will exist if it
|
|
@@ -229,7 +234,7 @@ end
|
|
|
229
234
|
-- indexes for N room types.
|
|
230
235
|
function ____exports.getRoomGridIndexesForType(self, ...)
|
|
231
236
|
local roomTypesSet = __TS__New(Set, {...})
|
|
232
|
-
local rooms =
|
|
237
|
+
local rooms = getRoomsInsideGrid(nil)
|
|
233
238
|
local matchingRooms = __TS__ArrayFilter(
|
|
234
239
|
rooms,
|
|
235
240
|
function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypesSet:has(roomDescriptor.Data.Type) end
|
|
@@ -249,7 +254,7 @@ end
|
|
|
249
254
|
-- @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
250
255
|
function ____exports.getRoomNeighbors(self, roomGridIndex)
|
|
251
256
|
local roomDescriptor = getRoomDescriptor(nil, roomGridIndex)
|
|
252
|
-
if not ____exports.
|
|
257
|
+
if not ____exports.isRoomInsideGrid(nil, roomDescriptor.SafeGridIndex) then
|
|
253
258
|
return __TS__New(Map)
|
|
254
259
|
end
|
|
255
260
|
local roomData = roomDescriptor.Data
|
|
@@ -285,7 +290,7 @@ function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGr
|
|
|
285
290
|
return false
|
|
286
291
|
end
|
|
287
292
|
local redRoomGridIndex = roomGridIndex + delta
|
|
288
|
-
return not ____exports.roomExists(nil, redRoomGridIndex) and ____exports.
|
|
293
|
+
return not ____exports.roomExists(nil, redRoomGridIndex) and ____exports.isRoomInsideGrid(nil, redRoomGridIndex)
|
|
289
294
|
end
|
|
290
295
|
--- Helper function to detect if the provided room was created by the Red Key item. Under the hood,
|
|
291
296
|
-- this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
|
|
@@ -10,7 +10,7 @@ local game = ____cachedClasses.game
|
|
|
10
10
|
local ____roomData = require("functions.roomData")
|
|
11
11
|
local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
12
12
|
local ____rooms = require("functions.rooms")
|
|
13
|
-
local
|
|
13
|
+
local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
|
|
14
14
|
--- Helper function to set a particular room's minimap display flags (e.g. whether or not it is
|
|
15
15
|
-- visible and so on).
|
|
16
16
|
--
|
|
@@ -26,7 +26,7 @@ end
|
|
|
26
26
|
-- the changes will be immediately visible.
|
|
27
27
|
function ____exports.clearFloorDisplayFlags(self)
|
|
28
28
|
local level = game:GetLevel()
|
|
29
|
-
for ____, room in ipairs(
|
|
29
|
+
for ____, room in ipairs(getRoomsInsideGrid(nil)) do
|
|
30
30
|
room.DisplayFlags = DisplayFlagZero
|
|
31
31
|
end
|
|
32
32
|
level:UpdateVisibility()
|
|
@@ -35,7 +35,7 @@ end
|
|
|
35
35
|
-- that is indexed by the room's safe grid index.
|
|
36
36
|
function ____exports.getFloorDisplayFlags(self)
|
|
37
37
|
local displayFlagsMap = __TS__New(Map)
|
|
38
|
-
local roomsInGrid =
|
|
38
|
+
local roomsInGrid = getRoomsInsideGrid(nil)
|
|
39
39
|
for ____, roomDescriptor in ipairs(roomsInGrid) do
|
|
40
40
|
displayFlagsMap:set(roomDescriptor.SafeGridIndex, roomDescriptor.DisplayFlags)
|
|
41
41
|
end
|
|
@@ -79,7 +79,7 @@ export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDe
|
|
|
79
79
|
* extra-dimensional rooms are automatically be generated. Default
|
|
80
80
|
* is false.
|
|
81
81
|
*/
|
|
82
|
-
export declare function
|
|
82
|
+
export declare function getRoomsInsideGrid(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
|
|
83
83
|
/**
|
|
84
84
|
* Helper function to get the room descriptor for every room on the level in a specific dimension.
|
|
85
85
|
* This will not include any off-grid rooms, such as the Devil Room.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAKT,YAAY,EACZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAiCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,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;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,OAAO,CAcxE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,+DAA+D;AAC/D,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -97,7 +97,7 @@ end
|
|
|
97
97
|
-- @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
|
|
98
98
|
-- extra-dimensional rooms are automatically be generated. Default
|
|
99
99
|
-- is false.
|
|
100
|
-
function ____exports.
|
|
100
|
+
function ____exports.getRoomsInsideGrid(self, includeExtraDimensionalRooms)
|
|
101
101
|
if includeExtraDimensionalRooms == nil then
|
|
102
102
|
includeExtraDimensionalRooms = false
|
|
103
103
|
end
|
|
@@ -146,7 +146,7 @@ end
|
|
|
146
146
|
--- Helper function to get the number of rooms that are currently on the floor layout. This does not
|
|
147
147
|
-- include off-grid rooms, like the Devil Room.
|
|
148
148
|
function ____exports.getNumRooms(self)
|
|
149
|
-
local rooms = ____exports.
|
|
149
|
+
local rooms = ____exports.getRoomsInsideGrid(nil)
|
|
150
150
|
return #rooms
|
|
151
151
|
end
|
|
152
152
|
--- Helper function to get the room data for a specific room type and variant combination. This is
|
|
@@ -210,7 +210,7 @@ function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
|
210
210
|
if includeExtraDimensionalRooms == nil then
|
|
211
211
|
includeExtraDimensionalRooms = false
|
|
212
212
|
end
|
|
213
|
-
local roomsInGrid = ____exports.
|
|
213
|
+
local roomsInGrid = ____exports.getRoomsInsideGrid(nil, includeExtraDimensionalRooms)
|
|
214
214
|
local roomsOutsideGrid = ____exports.getRoomsOutsideGrid(nil)
|
|
215
215
|
local ____array_0 = __TS__SparseArrayNew(table.unpack(roomsInGrid))
|
|
216
216
|
__TS__SparseArrayPush(
|
|
@@ -356,7 +356,7 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
|
356
356
|
____temp_1 = __TS__New(Set, onlyCheckRoomTypes)
|
|
357
357
|
end
|
|
358
358
|
local roomTypeWhitelist = ____temp_1
|
|
359
|
-
local rooms = ____exports.
|
|
359
|
+
local rooms = ____exports.getRoomsInsideGrid(nil)
|
|
360
360
|
local matchingRooms = roomTypeWhitelist == nil and rooms or __TS__ArrayFilter(
|
|
361
361
|
rooms,
|
|
362
362
|
function(____, roomDescriptor) return roomDescriptor.Data ~= nil and roomTypeWhitelist:has(roomDescriptor.Data.Type) end
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomStageLua.d.ts","sourceRoot":"","sources":["../../src/interfaces/CustomStageLua.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,oBAAY,mBAAmB,GAAG,QAAQ,CAAC;IACzC,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;OAOG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC;QAC1B;;;;;;;;WAQG;QACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QAE3B;;;;;;;;WAQG;QACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QAE3B;;;;;;;;;;WAUG;QACH,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;QAEzB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC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AC;KACX,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,oEAAoE;AAEpE,MAAM,WAAW,wBAAwB;IACvC;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,QAAQ,CAAC,aAAa,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC5D;AAED;;;GAGG;AACH,oBAAY,uBAAuB,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,10 +15,11 @@ const PLAYER_FORMS: readonly PlayerForm[] = getEnumValues(PlayerForm);
|
|
|
15
15
|
|
|
16
16
|
const v = {
|
|
17
17
|
run: {
|
|
18
|
+
// We cannot use a nested `DefaultMap` here.
|
|
18
19
|
playersTransformationsMap: new DefaultMap<
|
|
19
20
|
PlayerIndex,
|
|
20
|
-
|
|
21
|
-
>(() => new
|
|
21
|
+
Map<PlayerForm, boolean>
|
|
22
|
+
>(() => new Map()),
|
|
22
23
|
},
|
|
23
24
|
};
|
|
24
25
|
|
|
@@ -48,7 +49,10 @@ function postPEffectUpdateReordered(player: EntityPlayer) {
|
|
|
48
49
|
|
|
49
50
|
for (const playerForm of PLAYER_FORMS) {
|
|
50
51
|
const hasForm = player.HasPlayerForm(playerForm);
|
|
51
|
-
|
|
52
|
+
let storedForm = playerTransformationsMap.get(playerForm);
|
|
53
|
+
if (storedForm === undefined) {
|
|
54
|
+
storedForm = false;
|
|
55
|
+
}
|
|
52
56
|
|
|
53
57
|
if (hasForm !== storedForm) {
|
|
54
58
|
playerTransformationsMap.set(playerForm, hasForm);
|
|
@@ -23,10 +23,10 @@ const TRINKETS_THAT_CAN_BREAK: readonly TrinketType[] = [
|
|
|
23
23
|
|
|
24
24
|
const v = {
|
|
25
25
|
run: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
// We cannot use a nested `DefaultMap` here.
|
|
27
|
+
playersTrinketMap: new DefaultMap<PlayerIndex, Map<TrinketType, int>>(
|
|
28
|
+
() => new Map(),
|
|
29
|
+
),
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
|
|
@@ -71,7 +71,11 @@ function entityTakeDmgPlayer(
|
|
|
71
71
|
|
|
72
72
|
for (const trinketType of TRINKETS_THAT_CAN_BREAK) {
|
|
73
73
|
const numTrinketsHeld = player.GetTrinketMultiplier(trinketType);
|
|
74
|
-
|
|
74
|
+
let oldNumTrinketsHeld = trinketMap.get(trinketType);
|
|
75
|
+
if (oldNumTrinketsHeld === undefined) {
|
|
76
|
+
oldNumTrinketsHeld = 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
75
79
|
if (numTrinketsHeld >= oldNumTrinketsHeld) {
|
|
76
80
|
continue;
|
|
77
81
|
}
|
|
@@ -21,7 +21,7 @@ import { logError } from "../../functions/log";
|
|
|
21
21
|
import { newRNG } from "../../functions/rng";
|
|
22
22
|
import {
|
|
23
23
|
getRoomDataForTypeVariant,
|
|
24
|
-
|
|
24
|
+
getRoomsInsideGrid,
|
|
25
25
|
} from "../../functions/rooms";
|
|
26
26
|
import { setStage } from "../../functions/stage";
|
|
27
27
|
import { CustomStage } from "../../interfaces/private/CustomStage";
|
|
@@ -121,7 +121,7 @@ function setStageRoomsData(
|
|
|
121
121
|
const level = game.GetLevel();
|
|
122
122
|
const startingRoomGridIndex = level.GetStartingRoomIndex();
|
|
123
123
|
|
|
124
|
-
for (const room of
|
|
124
|
+
for (const room of getRoomsInsideGrid()) {
|
|
125
125
|
// The starting floor of each room should stay empty.
|
|
126
126
|
if (room.SafeGridIndex === startingRoomGridIndex) {
|
|
127
127
|
continue;
|
package/src/functions/index.ts
CHANGED
|
@@ -76,6 +76,7 @@ export * as RoomData from "./roomData";
|
|
|
76
76
|
export * as RoomGrid from "./roomGrid";
|
|
77
77
|
export * as Rooms from "./rooms";
|
|
78
78
|
export * as RoomShape from "./roomShape";
|
|
79
|
+
export * as RoomTransition from "./roomTransition";
|
|
79
80
|
export * as Run from "./run";
|
|
80
81
|
export * as SaveFile from "./saveFile";
|
|
81
82
|
export * as Seeds from "./seeds";
|
package/src/functions/level.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { DoorSlot } from "isaac-typescript-definitions";
|
|
|
2
2
|
import { game } from "../core/cachedClasses";
|
|
3
3
|
import { getEnumValues } from "./enums";
|
|
4
4
|
import { isDoorSlotValidAtGridIndexForRedRoom } from "./levelGrid";
|
|
5
|
-
import { getNumRooms,
|
|
5
|
+
import { getNumRooms, getRoomsInsideGrid } from "./rooms";
|
|
6
6
|
|
|
7
7
|
export function fillLevelWithRedRooms(): void {
|
|
8
8
|
const level = game.GetLevel();
|
|
9
9
|
|
|
10
10
|
let numRoomsInGrid: int;
|
|
11
11
|
do {
|
|
12
|
-
const roomsInGrid =
|
|
12
|
+
const roomsInGrid = getRoomsInsideGrid();
|
|
13
13
|
numRoomsInGrid = roomsInGrid.length;
|
|
14
14
|
|
|
15
15
|
for (const roomDescriptor of roomsInGrid) {
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
getRoomGridIndex,
|
|
36
36
|
getRoomShape,
|
|
37
37
|
} from "./roomData";
|
|
38
|
-
import { getRooms,
|
|
38
|
+
import { getRooms, getRoomsInsideGrid } from "./rooms";
|
|
39
39
|
import { getGridIndexDelta } from "./roomShape";
|
|
40
40
|
|
|
41
41
|
const LEFT = -1;
|
|
@@ -63,7 +63,7 @@ export function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[] {
|
|
|
63
63
|
const roomGridIndexToUse =
|
|
64
64
|
roomGridIndex === undefined ? getRoomGridIndex() : roomGridIndex;
|
|
65
65
|
|
|
66
|
-
if (!
|
|
66
|
+
if (!isRoomInsideGrid(roomGridIndexToUse)) {
|
|
67
67
|
return [];
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -72,7 +72,7 @@ export function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[] {
|
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
return adjacentRoomGridIndexes.filter((adjacentRoomGridIndex) =>
|
|
75
|
-
|
|
75
|
+
isRoomInsideGrid(adjacentRoomGridIndex),
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -117,7 +117,7 @@ export function getNewRoomCandidatesBesideRoom(
|
|
|
117
117
|
): Array<[doorSlot: DoorSlot, roomGridIndex: int]> {
|
|
118
118
|
const roomDescriptor = getRoomDescriptor(roomGridIndex);
|
|
119
119
|
|
|
120
|
-
if (!
|
|
120
|
+
if (!isRoomInsideGrid(roomDescriptor.SafeGridIndex)) {
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -172,7 +172,7 @@ export function getNewRoomCandidatesBesideRoom(
|
|
|
172
172
|
export function getNewRoomCandidatesForLevel(): Array<
|
|
173
173
|
[adjacentRoomGridIndex: int, doorSlot: DoorSlot, newRoomGridIndex: int]
|
|
174
174
|
> {
|
|
175
|
-
const rooms =
|
|
175
|
+
const rooms = getRoomsInsideGrid();
|
|
176
176
|
const normalRooms = rooms.filter(
|
|
177
177
|
(room) =>
|
|
178
178
|
room.Data !== undefined &&
|
|
@@ -207,7 +207,7 @@ export function getNewRoomCandidatesForLevel(): Array<
|
|
|
207
207
|
export function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[] {
|
|
208
208
|
const roomTypesSet = new Set<RoomType>([...roomTypes]);
|
|
209
209
|
|
|
210
|
-
const rooms =
|
|
210
|
+
const rooms = getRoomsInsideGrid();
|
|
211
211
|
const matchingRooms = rooms.filter(
|
|
212
212
|
(roomDescriptor) =>
|
|
213
213
|
roomDescriptor.Data !== undefined &&
|
|
@@ -230,7 +230,7 @@ export function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[] {
|
|
|
230
230
|
export function getRoomNeighbors(roomGridIndex?: int): Map<DoorSlot, int> {
|
|
231
231
|
const roomDescriptor = getRoomDescriptor(roomGridIndex);
|
|
232
232
|
|
|
233
|
-
if (!
|
|
233
|
+
if (!isRoomInsideGrid(roomDescriptor.SafeGridIndex)) {
|
|
234
234
|
return new Map();
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -293,7 +293,7 @@ export function getRoomShapeNeighborGridIndexes(
|
|
|
293
293
|
const neighborGridIndexes = new Map<DoorSlot, int>();
|
|
294
294
|
for (const [doorSlot, delta] of roomShapeNeighborGridIndexDeltas.entries()) {
|
|
295
295
|
const roomGridIndex = safeRoomGridIndex + delta;
|
|
296
|
-
if (
|
|
296
|
+
if (isRoomInsideGrid(roomGridIndex)) {
|
|
297
297
|
neighborGridIndexes.set(doorSlot, roomGridIndex);
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -356,9 +356,7 @@ export function isDoorSlotValidAtGridIndexForRedRoom(
|
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
const redRoomGridIndex = roomGridIndex + delta;
|
|
359
|
-
return (
|
|
360
|
-
!roomExists(redRoomGridIndex) && isRoomGridIndexInBounds(redRoomGridIndex)
|
|
361
|
-
);
|
|
359
|
+
return !roomExists(redRoomGridIndex) && isRoomInsideGrid(redRoomGridIndex);
|
|
362
360
|
}
|
|
363
361
|
|
|
364
362
|
/**
|
|
@@ -376,8 +374,14 @@ export function isRedKeyRoom(roomGridIndex?: int): boolean {
|
|
|
376
374
|
* Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
377
375
|
*
|
|
378
376
|
* For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
|
|
377
|
+
*
|
|
378
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
379
379
|
*/
|
|
380
|
-
export function
|
|
380
|
+
export function isRoomInsideGrid(roomGridIndex?: int): boolean {
|
|
381
|
+
if (roomGridIndex === undefined) {
|
|
382
|
+
roomGridIndex = getRoomGridIndex();
|
|
383
|
+
}
|
|
384
|
+
|
|
381
385
|
return roomGridIndex >= 0 && roomGridIndex <= MAX_LEVEL_GRID_INDEX;
|
|
382
386
|
}
|
|
383
387
|
|
package/src/functions/minimap.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DisplayFlag, DisplayFlagZero } from "isaac-typescript-definitions";
|
|
2
2
|
import { game } from "../core/cachedClasses";
|
|
3
3
|
import { getRoomDescriptor } from "./roomData";
|
|
4
|
-
import {
|
|
4
|
+
import { getRoomsInsideGrid } from "./rooms";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Helper function to set the value of `DisplayFlag` for every room on the floor to 0.
|
|
@@ -12,7 +12,7 @@ import { getRoomsInGrid } from "./rooms";
|
|
|
12
12
|
export function clearFloorDisplayFlags(): void {
|
|
13
13
|
const level = game.GetLevel();
|
|
14
14
|
|
|
15
|
-
for (const room of
|
|
15
|
+
for (const room of getRoomsInsideGrid()) {
|
|
16
16
|
room.DisplayFlags = DisplayFlagZero;
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -27,7 +27,7 @@ export function clearFloorDisplayFlags(): void {
|
|
|
27
27
|
export function getFloorDisplayFlags(): Map<int, BitFlags<DisplayFlag>> {
|
|
28
28
|
const displayFlagsMap = new Map<int, BitFlags<DisplayFlag>>();
|
|
29
29
|
|
|
30
|
-
const roomsInGrid =
|
|
30
|
+
const roomsInGrid = getRoomsInsideGrid();
|
|
31
31
|
for (const roomDescriptor of roomsInGrid) {
|
|
32
32
|
displayFlagsMap.set(
|
|
33
33
|
roomDescriptor.SafeGridIndex,
|
package/src/functions/rooms.ts
CHANGED
|
@@ -74,7 +74,7 @@ export function changeRoom(roomGridIndex: int): void {
|
|
|
74
74
|
* include off-grid rooms, like the Devil Room.
|
|
75
75
|
*/
|
|
76
76
|
export function getNumRooms(): int {
|
|
77
|
-
const rooms =
|
|
77
|
+
const rooms = getRoomsInsideGrid();
|
|
78
78
|
return rooms.length;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -186,7 +186,7 @@ export function getRooms(
|
|
|
186
186
|
// The obvious way to get all of the rooms would be to iterate over the `RoomList` from the
|
|
187
187
|
// `Level.GetRooms` method. However, this results in read-only data, and we want to return a
|
|
188
188
|
// writable object. Instead, we let the heavy lifting be handled by other functions.
|
|
189
|
-
const roomsInGrid =
|
|
189
|
+
const roomsInGrid = getRoomsInsideGrid(includeExtraDimensionalRooms);
|
|
190
190
|
const roomsOutsideGrid = getRoomsOutsideGrid();
|
|
191
191
|
return [...roomsInGrid, ...roomsOutsideGrid];
|
|
192
192
|
}
|
|
@@ -201,7 +201,7 @@ export function getRooms(
|
|
|
201
201
|
* extra-dimensional rooms are automatically be generated. Default
|
|
202
202
|
* is false.
|
|
203
203
|
*/
|
|
204
|
-
export function
|
|
204
|
+
export function getRoomsInsideGrid(
|
|
205
205
|
includeExtraDimensionalRooms = false,
|
|
206
206
|
): RoomDescriptor[] {
|
|
207
207
|
const level = game.GetLevel();
|
|
@@ -463,7 +463,7 @@ export function inStartingRoom(): boolean {
|
|
|
463
463
|
export function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean {
|
|
464
464
|
const roomTypeWhitelist =
|
|
465
465
|
onlyCheckRoomTypes === undefined ? null : new Set(onlyCheckRoomTypes);
|
|
466
|
-
const rooms =
|
|
466
|
+
const rooms = getRoomsInsideGrid();
|
|
467
467
|
const matchingRooms =
|
|
468
468
|
roomTypeWhitelist === null
|
|
469
469
|
? rooms
|
|
@@ -384,6 +384,7 @@ export type CustomStageShadow = Readonly<{
|
|
|
384
384
|
}>;
|
|
385
385
|
|
|
386
386
|
/** An object that represents a possible boss for a custom stage. */
|
|
387
|
+
// ts-prune-ignore-next
|
|
387
388
|
export interface CustomStageBossPoolEntry {
|
|
388
389
|
/**
|
|
389
390
|
* The name of the boss. This must correspond to the entry in "entities2.xml".
|