isaacscript-common 6.17.1 → 6.20.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/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +2 -7
- package/dist/features/customTrapdoor/init.d.ts.map +1 -1
- package/dist/features/customTrapdoor/init.lua +10 -2
- package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +2 -1
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +2 -1
- package/dist/features/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +2 -4
- package/dist/functions/curses.d.ts +3 -0
- package/dist/functions/curses.d.ts.map +1 -0
- package/dist/functions/curses.lua +11 -0
- package/dist/functions/dimensions.d.ts +12 -0
- package/dist/functions/dimensions.d.ts.map +1 -0
- package/dist/functions/dimensions.lua +35 -0
- package/dist/functions/eden.d.ts.map +1 -1
- package/dist/functions/eden.lua +2 -4
- package/dist/functions/itemPool.d.ts +8 -0
- package/dist/functions/itemPool.d.ts.map +1 -1
- package/dist/functions/itemPool.lua +53 -36
- package/dist/functions/level.d.ts.map +1 -1
- package/dist/functions/level.lua +8 -7
- package/dist/functions/levelGrid.d.ts +152 -0
- package/dist/functions/levelGrid.d.ts.map +1 -0
- package/dist/functions/levelGrid.lua +326 -0
- package/dist/functions/roomData.d.ts +5 -0
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.lua +6 -0
- package/dist/functions/roomGrid.d.ts +8 -0
- package/dist/functions/roomGrid.d.ts.map +1 -1
- package/dist/functions/rooms.d.ts +39 -61
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +126 -200
- package/dist/functions/saveFile.d.ts +1 -1
- package/dist/functions/saveFile.lua +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +24 -0
- package/package.json +2 -2
- package/src/features/customStage/exports.ts +10 -11
- package/src/features/customTrapdoor/init.ts +7 -3
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -1
- package/src/features/extraConsoleCommands/listCommands.ts +2 -1
- package/src/features/playerInventory.ts +2 -3
- package/src/functions/curses.ts +9 -0
- package/src/functions/dimensions.ts +41 -0
- package/src/functions/eden.ts +2 -4
- package/src/functions/itemPool.ts +30 -5
- package/src/functions/level.ts +7 -10
- package/src/functions/levelGrid.ts +424 -0
- package/src/functions/roomData.ts +12 -0
- package/src/functions/roomGrid.ts +9 -0
- package/src/functions/rooms.ts +90 -206
- package/src/functions/saveFile.ts +1 -1
- package/src/index.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKX,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CAyGlE;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAQ1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN"}
|
|
@@ -2,7 +2,6 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Map = ____lualib.Map
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
|
-
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
6
5
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
7
6
|
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
8
7
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
@@ -18,12 +17,10 @@ local log = ____log.log
|
|
|
18
17
|
local logError = ____log.logError
|
|
19
18
|
local ____rng = require("functions.rng")
|
|
20
19
|
local newRNG = ____rng.newRNG
|
|
21
|
-
local ____roomData = require("functions.roomData")
|
|
22
|
-
local getRoomData = ____roomData.getRoomData
|
|
23
20
|
local ____rooms = require("functions.rooms")
|
|
21
|
+
local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
|
|
24
22
|
local getRooms = ____rooms.getRooms
|
|
25
23
|
local ____stage = require("functions.stage")
|
|
26
|
-
local getGotoCommand = ____stage.getGotoCommand
|
|
27
24
|
local setStage = ____stage.setStage
|
|
28
25
|
local ____customStageUtils = require("features.customStage.customStageUtils")
|
|
29
26
|
local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
|
|
@@ -88,9 +85,7 @@ function ____exports.setCustomStage(self, name, verbose)
|
|
|
88
85
|
local randomRoom = getRandomCustomStageRoom(nil, roomsMetadata, rng, verbose)
|
|
89
86
|
local newRoomData = customStageCachedRoomData:get(randomRoom.variant)
|
|
90
87
|
if newRoomData == nil then
|
|
91
|
-
|
|
92
|
-
Isaac.ExecuteCommand(command)
|
|
93
|
-
newRoomData = getRoomData(nil, GridRoom.DEBUG)
|
|
88
|
+
newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
|
|
94
89
|
if newRoomData == nil then
|
|
95
90
|
logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. name)
|
|
96
91
|
goto __continue4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAyBxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
|
|
@@ -20,6 +20,8 @@ local getAllPlayers = ____playerIndex.getAllPlayers
|
|
|
20
20
|
local ____roomData = require("functions.roomData")
|
|
21
21
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
22
22
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
23
|
+
local ____rooms = require("functions.rooms")
|
|
24
|
+
local teleport = ____rooms.teleport
|
|
23
25
|
local ____stage = require("functions.stage")
|
|
24
26
|
local setStage = ____stage.setStage
|
|
25
27
|
local ____types = require("functions.types")
|
|
@@ -66,7 +68,7 @@ function checkAllPlayersJumpComplete(self)
|
|
|
66
68
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
67
69
|
v.run.state = StageTravelState.PIXELATION_TO_BLACK
|
|
68
70
|
v.run.stateRenderFrame = renderFrameCount
|
|
69
|
-
|
|
71
|
+
teleport(nil, roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
70
72
|
end
|
|
71
73
|
function checkPixelationToBlackComplete(self)
|
|
72
74
|
if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
|
|
@@ -83,7 +85,13 @@ function checkPixelationToBlackComplete(self)
|
|
|
83
85
|
v.run.stateRenderFrame = renderFrameCount
|
|
84
86
|
hud:SetVisible(false)
|
|
85
87
|
goToCustomDestination(nil)
|
|
86
|
-
|
|
88
|
+
teleport(
|
|
89
|
+
nil,
|
|
90
|
+
roomGridIndex,
|
|
91
|
+
Direction.NO_DIRECTION,
|
|
92
|
+
RoomTransitionAnim.PIXELATION,
|
|
93
|
+
true
|
|
94
|
+
)
|
|
87
95
|
end
|
|
88
96
|
function checkPausingOnBlackComplete(self)
|
|
89
97
|
if v.run.state ~= StageTravelState.PAUSING_ON_BLACK or v.run.stateRenderFrame == nil then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandsSubroutines.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/commandsSubroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"commandsSubroutines.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/commandsSubroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgBpD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAcrE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAqBlD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,wBAAwB,EAAE,OAAO,GAChC,IAAI,CAYN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAY5E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAgBrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAUjE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAevD"}
|
|
@@ -11,6 +11,8 @@ local ____direction = require("functions.direction")
|
|
|
11
11
|
local directionToVector = ____direction.directionToVector
|
|
12
12
|
local ____gridEntities = require("functions.gridEntities")
|
|
13
13
|
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
14
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
15
|
+
local getRoomGridIndexesForType = ____levelGrid.getRoomGridIndexesForType
|
|
14
16
|
local ____log = require("functions.log")
|
|
15
17
|
local logAllEntities = ____log.logAllEntities
|
|
16
18
|
local logAllGridEntities = ____log.logAllGridEntities
|
|
@@ -21,7 +23,6 @@ local getRoomData = ____roomData.getRoomData
|
|
|
21
23
|
local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
22
24
|
local ____rooms = require("functions.rooms")
|
|
23
25
|
local changeRoom = ____rooms.changeRoom
|
|
24
|
-
local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
|
|
25
26
|
local ____utils = require("functions.utils")
|
|
26
27
|
local printConsole = ____utils.printConsole
|
|
27
28
|
local ____roomTypeNames = require("objects.roomTypeNames")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AA2GA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;AACtE,wBAAgB,OAAO,IAAI,IAAI,CAkB9B;AAED,2CAA2C;AAC3C,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAA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AGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -52,6 +52,8 @@ local ____flag = require("functions.flag")
|
|
|
52
52
|
local addFlag = ____flag.addFlag
|
|
53
53
|
local ____gridEntities = require("functions.gridEntities")
|
|
54
54
|
local spawnGridEntity = ____gridEntities.spawnGridEntity
|
|
55
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
56
|
+
local getRoomGridIndexesForType = ____levelGrid.getRoomGridIndexesForType
|
|
55
57
|
local ____log = require("functions.log")
|
|
56
58
|
local logPlayerEffects = ____log.logPlayerEffects
|
|
57
59
|
local logRoom = ____log.logRoom
|
|
@@ -78,7 +80,6 @@ local ____roomGrid = require("functions.roomGrid")
|
|
|
78
80
|
local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
|
|
79
81
|
local ____rooms = require("functions.rooms")
|
|
80
82
|
local changeRoom = ____rooms.changeRoom
|
|
81
|
-
local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
|
|
82
83
|
local ____run = require("functions.run")
|
|
83
84
|
local onSetSeed = ____run.onSetSeed
|
|
84
85
|
local restart = ____run.restart
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAyG5E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
4
3
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
4
|
local ____exports = {}
|
|
6
5
|
local newPlayerInventory, resetInventory, useItemD4, postGameStarted, postCollectibleAdded, postCollectibleRemoved, v
|
|
@@ -19,7 +18,7 @@ local copyArray = ____array.copyArray
|
|
|
19
18
|
local ____collectibles = require("functions.collectibles")
|
|
20
19
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
21
20
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
22
|
-
local
|
|
21
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
23
22
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
24
23
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
25
24
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
@@ -32,8 +31,7 @@ local ____exports = require("features.saveDataManager.exports")
|
|
|
32
31
|
local saveDataManager = ____exports.saveDataManager
|
|
33
32
|
function newPlayerInventory(self, player)
|
|
34
33
|
local inventory = {}
|
|
35
|
-
|
|
36
|
-
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
34
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
37
35
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
38
36
|
____repeat(
|
|
39
37
|
nil,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curses.d.ts","sourceRoot":"","sources":["../../src/functions/curses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAInD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____cachedClasses = require("cachedClasses")
|
|
3
|
+
local game = ____cachedClasses.game
|
|
4
|
+
local ____flag = require("functions.flag")
|
|
5
|
+
local hasFlag = ____flag.hasFlag
|
|
6
|
+
function ____exports.hasCurse(self, curse)
|
|
7
|
+
local level = game:GetLevel()
|
|
8
|
+
local curses = level:GetCurses()
|
|
9
|
+
return hasFlag(nil, curses, curse)
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dimension } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
4
|
+
*/
|
|
5
|
+
export declare function getAllDimensions(): Dimension[];
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
|
|
8
|
+
* but it can change if e.g. the player is in the mirror world of Downpour/Dross.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDimension(): Dimension;
|
|
11
|
+
export declare function inDimension(dimension: Dimension): boolean;
|
|
12
|
+
//# sourceMappingURL=dimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../src/functions/dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAMzD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAmBxC;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
4
|
+
local ____cachedClasses = require("cachedClasses")
|
|
5
|
+
local game = ____cachedClasses.game
|
|
6
|
+
local ____constants = require("constants")
|
|
7
|
+
local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
8
|
+
local ____roomData = require("functions.roomData")
|
|
9
|
+
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
10
|
+
local ____utils = require("functions.utils")
|
|
11
|
+
local erange = ____utils.erange
|
|
12
|
+
--- Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
13
|
+
function ____exports.getAllDimensions(self)
|
|
14
|
+
return erange(nil, NUM_DIMENSIONS)
|
|
15
|
+
end
|
|
16
|
+
--- Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
|
|
17
|
+
-- but it can change if e.g. the player is in the mirror world of Downpour/Dross.
|
|
18
|
+
function ____exports.getDimension(self)
|
|
19
|
+
local level = game:GetLevel()
|
|
20
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
21
|
+
local roomDescription = level:GetRoomByIdx(roomGridIndex, Dimension.CURRENT)
|
|
22
|
+
local currentRoomHash = GetPtrHash(roomDescription)
|
|
23
|
+
for ____, dimension in ipairs(____exports.getAllDimensions(nil)) do
|
|
24
|
+
local dimensionRoomDescription = level:GetRoomByIdx(roomGridIndex, dimension)
|
|
25
|
+
local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
|
|
26
|
+
if dimensionRoomHash == currentRoomHash then
|
|
27
|
+
return dimension
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
error("Failed to get the current dimension.")
|
|
31
|
+
end
|
|
32
|
+
function ____exports.inDimension(self, dimension)
|
|
33
|
+
return dimension == ____exports.getDimension(nil)
|
|
34
|
+
end
|
|
35
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,GAAG,CAAC,eAAe,CAAC,CAOtD;AAED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe,CAWjB"}
|
package/dist/functions/eden.lua
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
4
|
local ____exports = {}
|
|
6
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
6
|
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
@@ -9,7 +8,7 @@ local ____collectibles = require("functions.collectibles")
|
|
|
9
8
|
local isHiddenCollectible = ____collectibles.isHiddenCollectible
|
|
10
9
|
local isPassiveCollectible = ____collectibles.isPassiveCollectible
|
|
11
10
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
12
|
-
local
|
|
11
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
13
12
|
local ____collectibleTag = require("functions.collectibleTag")
|
|
14
13
|
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
15
14
|
local ____rng = require("functions.rng")
|
|
@@ -19,8 +18,7 @@ local copySet = ____set.copySet
|
|
|
19
18
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
20
19
|
local EDEN_PASSIVE_COLLECTIBLES_SET = __TS__New(Set)
|
|
21
20
|
local function initCollectibleSet(self)
|
|
22
|
-
|
|
23
|
-
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
21
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
24
22
|
if isPassiveCollectible(nil, collectibleType) and not isHiddenCollectible(nil, collectibleType) and not collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
|
|
25
23
|
EDEN_PASSIVE_COLLECTIBLES_SET:add(collectibleType)
|
|
26
24
|
end
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get the remaining collectibles in a given item pool. This function is
|
|
4
|
+
* expensive, so only use it in situations where the lag is acceptable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCollectiblesInItemPool(itemPoolType: ItemPoolType): CollectibleType[];
|
|
2
7
|
/**
|
|
3
8
|
* Helper function to see if the given collectible is still present in the given item pool.
|
|
4
9
|
*
|
|
5
10
|
* If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
|
|
6
11
|
* then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
|
|
7
12
|
* collectibles from item pools).
|
|
13
|
+
*
|
|
14
|
+
* Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to blacklist
|
|
15
|
+
* every collectible except for the one provided.
|
|
8
16
|
*/
|
|
9
17
|
export declare function isCollectibleInItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean;
|
|
10
18
|
//# sourceMappingURL=itemPool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAGb,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAsBtC;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,YAAY,GACzB,eAAe,EAAE,CAKnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CA6DT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
2
3
|
local Map = ____lualib.Map
|
|
3
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local ____exports = {}
|
|
6
|
-
local removeItemsAndTrinketsThatAffectItemPools, restoreItemsAndTrinketsThatAffectItemPools, COLLECTIBLES_THAT_AFFECT_ITEM_POOLS, TRINKETS_THAT_AFFECT_ITEM_POOLS
|
|
6
|
+
local removeItemsAndTrinketsThatAffectItemPools, restoreItemsAndTrinketsThatAffectItemPools, COLLECTIBLES_THAT_AFFECT_ITEM_POOLS, TRINKETS_THAT_AFFECT_ITEM_POOLS, COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS
|
|
7
7
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
8
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
9
|
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
@@ -12,7 +12,7 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
|
12
12
|
local ____cachedClasses = require("cachedClasses")
|
|
13
13
|
local game = ____cachedClasses.game
|
|
14
14
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
15
|
-
local
|
|
15
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
16
16
|
local ____collectibleTag = require("functions.collectibleTag")
|
|
17
17
|
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
18
18
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
@@ -24,6 +24,47 @@ local ____players = require("functions.players")
|
|
|
24
24
|
local getPlayersOfType = ____players.getPlayersOfType
|
|
25
25
|
local ____utils = require("functions.utils")
|
|
26
26
|
local ____repeat = ____utils["repeat"]
|
|
27
|
+
--- Helper function to see if the given collectible is still present in the given item pool.
|
|
28
|
+
--
|
|
29
|
+
-- If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
|
|
30
|
+
-- then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
|
|
31
|
+
-- collectibles from item pools).
|
|
32
|
+
--
|
|
33
|
+
-- Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to blacklist
|
|
34
|
+
-- every collectible except for the one provided.
|
|
35
|
+
function ____exports.isCollectibleInItemPool(self, collectibleType, itemPoolType)
|
|
36
|
+
if collectibleType == COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS then
|
|
37
|
+
return false
|
|
38
|
+
end
|
|
39
|
+
local taintedLosts = getPlayersOfType(nil, PlayerType.THE_LOST_B)
|
|
40
|
+
local isOffensive = collectibleHasTag(nil, collectibleType, ItemConfigTag.OFFENSIVE)
|
|
41
|
+
local changedPlayerTypes = false
|
|
42
|
+
if not isOffensive then
|
|
43
|
+
changedPlayerTypes = true
|
|
44
|
+
for ____, player in ipairs(taintedLosts) do
|
|
45
|
+
player:ChangePlayerType(PlayerType.ISAAC)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
local removedItemsMap, removedTrinketsMap = table.unpack(removeItemsAndTrinketsThatAffectItemPools(nil))
|
|
49
|
+
local itemPool = game:GetItemPool()
|
|
50
|
+
itemPool:ResetRoomBlacklist()
|
|
51
|
+
for ____, collectibleTypeInSet in ipairs(getCollectibleArray(nil)) do
|
|
52
|
+
if collectibleTypeInSet ~= collectibleType then
|
|
53
|
+
itemPool:AddRoomBlacklist(collectibleTypeInSet)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
local seed = 1
|
|
57
|
+
local retrievedCollectibleType = itemPool:GetCollectible(itemPoolType, false, seed, COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS)
|
|
58
|
+
local collectibleUnlocked = retrievedCollectibleType == collectibleType
|
|
59
|
+
itemPool:ResetRoomBlacklist()
|
|
60
|
+
restoreItemsAndTrinketsThatAffectItemPools(nil, removedItemsMap, removedTrinketsMap)
|
|
61
|
+
if changedPlayerTypes then
|
|
62
|
+
for ____, player in ipairs(taintedLosts) do
|
|
63
|
+
player:ChangePlayerType(PlayerType.THE_LOST_B)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
return collectibleUnlocked
|
|
67
|
+
end
|
|
27
68
|
function removeItemsAndTrinketsThatAffectItemPools(self)
|
|
28
69
|
local removedItemsMap = __TS__New(Map)
|
|
29
70
|
local removedTrinketsMap = __TS__New(Map)
|
|
@@ -79,38 +120,14 @@ function restoreItemsAndTrinketsThatAffectItemPools(self, removedItemsMap, remov
|
|
|
79
120
|
end
|
|
80
121
|
COLLECTIBLES_THAT_AFFECT_ITEM_POOLS = {CollectibleType.CHAOS, CollectibleType.SACRED_ORB, CollectibleType.TMTRAINER}
|
|
81
122
|
TRINKETS_THAT_AFFECT_ITEM_POOLS = {TrinketType.NO}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
--
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if not isOffensive then
|
|
92
|
-
changedPlayerTypes = true
|
|
93
|
-
for ____, player in ipairs(taintedLosts) do
|
|
94
|
-
player:ChangePlayerType(PlayerType.ISAAC)
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
local removedItemsMap, removedTrinketsMap = table.unpack(removeItemsAndTrinketsThatAffectItemPools(nil))
|
|
98
|
-
local itemPool = game:GetItemPool()
|
|
99
|
-
local collectibleSet = getCollectibleSet(nil)
|
|
100
|
-
for ____, collectibleTypeInSet in __TS__Iterator(collectibleSet:values()) do
|
|
101
|
-
if collectibleTypeInSet ~= collectibleType then
|
|
102
|
-
itemPool:AddRoomBlacklist(collectibleTypeInSet)
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
local retrievedCollectibleType = itemPool:GetCollectible(itemPoolType, false, 1)
|
|
106
|
-
local collectibleUnlocked = retrievedCollectibleType == collectibleType
|
|
107
|
-
itemPool:ResetRoomBlacklist()
|
|
108
|
-
restoreItemsAndTrinketsThatAffectItemPools(nil, removedItemsMap, removedTrinketsMap)
|
|
109
|
-
if changedPlayerTypes then
|
|
110
|
-
for ____, player in ipairs(taintedLosts) do
|
|
111
|
-
player:ChangePlayerType(PlayerType.THE_LOST_B)
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
return collectibleUnlocked
|
|
123
|
+
COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS = CollectibleType.KEY_PIECE_1
|
|
124
|
+
--- Helper function to get the remaining collectibles in a given item pool. This function is
|
|
125
|
+
-- expensive, so only use it in situations where the lag is acceptable.
|
|
126
|
+
function ____exports.getCollectiblesInItemPool(self, itemPoolType)
|
|
127
|
+
local collectibleArray = getCollectibleArray(nil)
|
|
128
|
+
return __TS__ArrayFilter(
|
|
129
|
+
collectibleArray,
|
|
130
|
+
function(____, collectibleType) return ____exports.isCollectibleInItemPool(nil, collectibleType, itemPoolType) end
|
|
131
|
+
)
|
|
115
132
|
end
|
|
116
133
|
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/functions/level.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/functions/level.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,IAAI,IAAI,CAqB5C"}
|
package/dist/functions/level.lua
CHANGED
|
@@ -5,18 +5,19 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
6
|
local ____enums = require("functions.enums")
|
|
7
7
|
local getEnumValues = ____enums.getEnumValues
|
|
8
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
9
|
+
local isDoorSlotValidAtGridIndexForRedRoom = ____levelGrid.isDoorSlotValidAtGridIndexForRedRoom
|
|
8
10
|
local ____rooms = require("functions.rooms")
|
|
9
11
|
local getNumRooms = ____rooms.getNumRooms
|
|
10
|
-
local
|
|
11
|
-
local isDoorSlotValidAtGridIndexForRedRoom = ____rooms.isDoorSlotValidAtGridIndexForRedRoom
|
|
12
|
+
local getRoomsInGrid = ____rooms.getRoomsInGrid
|
|
12
13
|
function ____exports.fillLevelWithRedRooms(self)
|
|
13
14
|
local level = game:GetLevel()
|
|
14
|
-
local
|
|
15
|
+
local numRoomsInGrid
|
|
15
16
|
repeat
|
|
16
17
|
do
|
|
17
|
-
local
|
|
18
|
-
|
|
19
|
-
for ____, roomDescriptor in ipairs(
|
|
18
|
+
local roomsInGrid = getRoomsInGrid(nil)
|
|
19
|
+
numRoomsInGrid = #roomsInGrid
|
|
20
|
+
for ____, roomDescriptor in ipairs(roomsInGrid) do
|
|
20
21
|
for ____, doorSlot in ipairs(getEnumValues(nil, DoorSlot)) do
|
|
21
22
|
if isDoorSlotValidAtGridIndexForRedRoom(nil, doorSlot, roomDescriptor.GridIndex) then
|
|
22
23
|
level:MakeRedRoomDoor(roomDescriptor.GridIndex, doorSlot)
|
|
@@ -24,6 +25,6 @@ function ____exports.fillLevelWithRedRooms(self)
|
|
|
24
25
|
end
|
|
25
26
|
end
|
|
26
27
|
end
|
|
27
|
-
until not (
|
|
28
|
+
until not (numRoomsInGrid ~= getNumRooms(nil))
|
|
28
29
|
end
|
|
29
30
|
return ____exports
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These functions have to do with the room grid index for the level (i.e. the position that the
|
|
3
|
+
* room is on the grid that represents the map for the level).
|
|
4
|
+
*
|
|
5
|
+
* For functions having to do with the grid index inside of the room, see the "Room Grid" functions.
|
|
6
|
+
*
|
|
7
|
+
* @module
|
|
8
|
+
*/
|
|
9
|
+
import { DoorSlot, RoomShape, RoomType } from "isaac-typescript-definitions";
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to get the room grid indexes that are adjacent to a given room grid index.
|
|
12
|
+
*
|
|
13
|
+
* Adjacent room grid indexes that are outside of the grid will not be included in the returned
|
|
14
|
+
* array.
|
|
15
|
+
*
|
|
16
|
+
* If a room grid index is provided that is outside of the grid, then an empty array will be
|
|
17
|
+
* returned.
|
|
18
|
+
*
|
|
19
|
+
* Note that this function does not take the shape of the room into account; it only looks at a
|
|
20
|
+
* single room grid index.
|
|
21
|
+
*
|
|
22
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getAdjacentRoomGridIndexes(roomGridIndex?: int): int[];
|
|
25
|
+
/** Helper function to get the room safe grid index for every room on the entire floor. */
|
|
26
|
+
export declare function getAllRoomGridIndexes(): int[];
|
|
27
|
+
/**
|
|
28
|
+
* Helper function to pick a random valid spot on the floor to insert a brand new room. Note that
|
|
29
|
+
* some floors will not have any valid spots. If this is the case, this function will return
|
|
30
|
+
* undefined.
|
|
31
|
+
*
|
|
32
|
+
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
33
|
+
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
34
|
+
* @returns Either a tuple of adjacent room grid index, `DoorSlot`, and new room grid index, or
|
|
35
|
+
* undefined.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getNewRoomCandidate(seedOrRNG?: Seed | RNG): [adjacentRoomGridIndex: int, doorSlot: DoorSlot, newRoomGridIndex: int] | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to iterate through the possible doors for a room and see if any of them would be
|
|
40
|
+
* a valid spot to insert a brand new room on the floor.
|
|
41
|
+
*
|
|
42
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
43
|
+
* @returns A array of tuples of `DoorSlot` and room grid index.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getNewRoomCandidatesBesideRoom(roomGridIndex?: int): Array<[doorSlot: DoorSlot, roomGridIndex: int]>;
|
|
46
|
+
/**
|
|
47
|
+
* Helper function to search through all of the rooms on the floor for a spot to insert a brand new
|
|
48
|
+
* room.
|
|
49
|
+
*
|
|
50
|
+
* @returns A array of tuples of adjacent room grid index, `DoorSlot`, and new room grid index.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getNewRoomCandidatesForFloor(): Array<[
|
|
53
|
+
adjacentRoomGridIndex: int,
|
|
54
|
+
doorSlot: DoorSlot,
|
|
55
|
+
newRoomGridIndex: int
|
|
56
|
+
]>;
|
|
57
|
+
/**
|
|
58
|
+
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
59
|
+
* specified room type.
|
|
60
|
+
*
|
|
61
|
+
* This function only searches through rooms in the current dimension.
|
|
62
|
+
*
|
|
63
|
+
* This function is variadic, meaning that you can specify N arguments to get the combined grid
|
|
64
|
+
* indexes for N room types.
|
|
65
|
+
*/
|
|
66
|
+
export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[];
|
|
67
|
+
/**
|
|
68
|
+
* Helper function to get the grid indexes of all the rooms connected to the given room index,
|
|
69
|
+
* taking the shape of the room into account. (This will only include rooms with valid data.)
|
|
70
|
+
*
|
|
71
|
+
* Returns an empty map if the provided room grid index is out of bounds or has no associated room
|
|
72
|
+
* data.
|
|
73
|
+
*
|
|
74
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
75
|
+
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
76
|
+
*/
|
|
77
|
+
export declare function getRoomNeighbors(roomGridIndex?: int): Map<DoorSlot, int>;
|
|
78
|
+
/**
|
|
79
|
+
* Helper function to get the room grid index delta that each hypothetical door in a given room
|
|
80
|
+
* shape would go to.
|
|
81
|
+
*
|
|
82
|
+
* This is used by the `getRoomShapeNeighborGridIndexes` function.
|
|
83
|
+
*
|
|
84
|
+
* @returns A map of `DoorSlot` to the corresponding room grid index delta.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getRoomShapeNeighborGridIndexDeltas(roomShape: RoomShape): Map<DoorSlot, int>;
|
|
87
|
+
/**
|
|
88
|
+
* Helper function to get the room grid index that each hypothetical door in a given room shape
|
|
89
|
+
* would go to. (This will not include room grid indexes that are outside of the grid.)
|
|
90
|
+
*
|
|
91
|
+
* @param safeRoomGridIndex This must be the room safe grid index (i.e. the top-left room grid index
|
|
92
|
+
* for the respective room).
|
|
93
|
+
* @param roomShape The shape of the room.
|
|
94
|
+
* @returns A map of `DoorSlot` to the corresponding room grid index.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getRoomShapeNeighborGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to check if the given room grid index is a dead end. Specifically, this is
|
|
99
|
+
* defined as having only one adjacent room that exists.
|
|
100
|
+
*
|
|
101
|
+
* Note that this function does not take the shape of the room into account; it only looks at a
|
|
102
|
+
* single room grid index.
|
|
103
|
+
*
|
|
104
|
+
* This function does not care if the given room grid index actually exists, so you can use it to
|
|
105
|
+
* check if a hypothetical room would be a dead end.
|
|
106
|
+
*
|
|
107
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
108
|
+
*/
|
|
109
|
+
export declare function isDeadEnd(roomGridIndex?: int): boolean;
|
|
110
|
+
export declare function isDoorSlotValidAtGridIndex(doorSlot: DoorSlot, roomGridIndex: int): boolean;
|
|
111
|
+
export declare function isDoorSlotValidAtGridIndexForRedRoom(doorSlot: DoorSlot, roomGridIndex: int): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Helper function to detect if the provided room was created by the Red Key item. Under the hood,
|
|
114
|
+
* this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
|
|
115
|
+
*
|
|
116
|
+
* @param roomGridIndex Optional. Default is the current room index.
|
|
117
|
+
*/
|
|
118
|
+
export declare function isRedKeyRoom(roomGridIndex?: int): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
121
|
+
*
|
|
122
|
+
* For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
|
|
123
|
+
*/
|
|
124
|
+
export declare function isRoomGridIndexInBounds(roomGridIndex: int): boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Helper function to generate a new room on the floor at a valid dead end attached to a normal
|
|
127
|
+
* room.
|
|
128
|
+
*
|
|
129
|
+
* Under the hood, this function uses the `Level.MakeRedRoomDoor` method to create the room.
|
|
130
|
+
*
|
|
131
|
+
* The newly created room will have data corresponding to the game's randomly generated red room. If
|
|
132
|
+
* you want to modify this, use the `setRoomData` helper function.
|
|
133
|
+
*
|
|
134
|
+
* @returns The room grid index of the new room or undefined if the floor had no valid dead ends to
|
|
135
|
+
* place a room.
|
|
136
|
+
*/
|
|
137
|
+
export declare function newRoom(): int | undefined;
|
|
138
|
+
/** Helper function to check if a room exists at the given room grid index. */
|
|
139
|
+
export declare function roomExists(roomGridIndex: int): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Helper function to get the coordinates of a given grid index. The floor is represented by a 13x13
|
|
142
|
+
* grid.
|
|
143
|
+
*
|
|
144
|
+
* - Since the starting room is in the center, the starting room grid index of 84 is equal to
|
|
145
|
+
* coordinates of (6, 6).
|
|
146
|
+
* - The top-left grid index of 0 is equal to coordinates of: (12, 0)
|
|
147
|
+
* - The top-right grid index of 12 is equal to coordinates of: (0, 0)
|
|
148
|
+
* - The bottom-left grid index of 156 is equal to coordinates of: (0, 12)
|
|
149
|
+
* - The bottom-right grid index of 168 is equal to coordinates of: (12, 12)
|
|
150
|
+
*/
|
|
151
|
+
export declare function roomGridIndexToXY(roomGridIndex: int): [x: int, y: int];
|
|
152
|
+
//# sourceMappingURL=levelGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,QAAQ,EAIR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAyBtC;;;;;;;;;;;;;GAaG;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;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,GAClB,KAAK,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,CAAC,CAAC,CA8CjD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,KAAK,CACnD;IAAC,qBAAqB,EAAE,GAAG;IAAE,QAAQ,EAAE,QAAQ;IAAE,gBAAgB,EAAE,GAAG;CAAC,CACxE,CAsBA;AA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