isaacscript-common 6.22.2 → 6.23.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.lua +2 -2
- package/dist/features/saveDataManager/exports.d.ts +13 -8
- package/dist/features/saveDataManager/exports.d.ts.map +1 -1
- package/dist/features/saveDataManager/exports.lua +12 -7
- package/dist/features/saveDataManager/maps.d.ts +2 -2
- package/dist/features/saveDataManager/maps.d.ts.map +1 -1
- package/dist/features/taintedLazarusPlayers.lua +1 -6
- 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/isaacAPIClass.d.ts +1 -1
- package/dist/functions/isaacAPIClass.d.ts.map +1 -1
- 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/dist/interfaces/SaveData.d.ts +33 -4
- package/dist/interfaces/SaveData.d.ts.map +1 -1
- package/dist/types/AnyClass.d.ts +2 -0
- package/dist/types/AnyClass.d.ts.map +1 -0
- package/dist/{interfaces/indexTypeDoc.lua → types/AnyClass.lua} +0 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/customStage/exports.ts +2 -2
- package/src/features/saveDataManager/exports.ts +28 -10
- package/src/features/saveDataManager/save.ts +2 -1
- package/src/features/taintedLazarusPlayers.ts +2 -2
- package/src/functions/entities.ts +2 -2
- package/src/functions/index.ts +1 -0
- package/src/functions/indexTypeDoc.ts +1 -0
- package/src/functions/isaacAPIClass.ts +0 -1
- 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
- package/src/interfaces/SaveData.ts +55 -5
- package/src/types/AnyClass.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/types/indexTypeDoc.ts +1 -1
- package/dist/classes/indexTypeDoc.d.ts +0 -3
- package/dist/classes/indexTypeDoc.d.ts.map +0 -1
- package/dist/classes/indexTypeDoc.lua +0 -4
- package/dist/core/indexTypeDoc.d.ts +0 -5
- package/dist/core/indexTypeDoc.d.ts.map +0 -1
- package/dist/core/indexTypeDoc.lua +0 -6
- package/dist/enums/indexTypeDoc.d.ts +0 -9
- package/dist/enums/indexTypeDoc.d.ts.map +0 -1
- package/dist/enums/indexTypeDoc.lua +0 -10
- package/dist/features/indexTypeDoc.d.ts +0 -30
- package/dist/features/indexTypeDoc.d.ts.map +0 -1
- package/dist/features/indexTypeDoc.lua +0 -31
- package/dist/functions/indexTypeDoc.d.ts +0 -98
- package/dist/functions/indexTypeDoc.d.ts.map +0 -1
- package/dist/functions/indexTypeDoc.lua +0 -99
- package/dist/indexTypeDoc.d.ts +0 -10
- package/dist/indexTypeDoc.d.ts.map +0 -1
- package/dist/indexTypeDoc.lua +0 -11
- package/dist/interfaces/indexTypeDoc.d.ts +0 -11
- package/dist/interfaces/indexTypeDoc.d.ts.map +0 -1
- package/dist/maps/indexTypeDoc.d.ts +0 -5
- package/dist/maps/indexTypeDoc.d.ts.map +0 -1
- package/dist/maps/indexTypeDoc.lua +0 -6
- package/dist/objects/indexTypeDoc.d.ts +0 -2
- package/dist/objects/indexTypeDoc.d.ts.map +0 -1
- package/dist/objects/indexTypeDoc.lua +0 -3
- package/dist/types/IsaacAPIClass.d.ts +0 -5
- package/dist/types/IsaacAPIClass.d.ts.map +0 -1
- package/dist/types/IsaacAPIClass.lua +0 -2
- package/dist/types/indexTypeDoc.d.ts +0 -12
- package/dist/types/indexTypeDoc.d.ts.map +0 -1
- package/dist/types/indexTypeDoc.lua +0 -3
- package/src/types/IsaacAPIClass.ts +0 -3
|
@@ -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
|
|
@@ -79,15 +79,20 @@ import { SaveData } from "../../interfaces/SaveData";
|
|
|
79
79
|
* manager. The save data manager will throw an error if the key is already registered.
|
|
80
80
|
* @param v An object that corresponds to the `SaveData` interface. The object is conventionally
|
|
81
81
|
* called "v" for brevity. ("v" is short for "local variables").
|
|
82
|
-
* @param conditionalFunc
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* save
|
|
88
|
-
*
|
|
82
|
+
* @param conditionalFunc Optional. A function to run to check if this save data should be written
|
|
83
|
+
* to disk. Default is `() => true`, meaning that this save data will always
|
|
84
|
+
* be written to disk. Use a conditional function for the situations when the
|
|
85
|
+
* local variables are for a feature that the end-user can disable. (If the
|
|
86
|
+
* feature is disabled, then there would be no point in writing any of the
|
|
87
|
+
* variables to the "save#.dat" file.) You can also specify `false` to this
|
|
88
|
+
* argument in order to completely disable saving data. (Specifying `false`
|
|
89
|
+
* will allow you to use non-serializable objects in your save data, such as
|
|
90
|
+
* `EntityPtr`.
|
|
89
91
|
*/
|
|
90
|
-
export declare function saveDataManager(key: string,
|
|
92
|
+
export declare function saveDataManager<Persistent, Run, Level>(key: string, // This is the overload for the standard case with serializable data.
|
|
93
|
+
v: SaveData<Persistent, Run, Level>, conditionalFunc?: () => boolean): void;
|
|
94
|
+
export declare function saveDataManager(key: string, // This is the overload for the case when saving data is disabled.
|
|
95
|
+
v: SaveData<unknown, unknown, unknown>, conditionalFunc: false): void;
|
|
91
96
|
/**
|
|
92
97
|
* The save data manager will automatically load variables from disk at the appropriate times (i.e.
|
|
93
98
|
* when a new run is started). Use this function to explicitly force the save data manager to load
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/exports.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,EACpD,GAAG,EAAE,MAAM,EAAE,qEAAqE;AAClF,CAAC,EAAE,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,eAAe,CAAC,EAAE,MAAM,OAAO,GAC9B,IAAI,CAAC;AACR,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EAAE,kEAAkE;AAC/E,CAAC,EAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EACtC,eAAe,EAAE,KAAK,GACrB,IAAI,CAAC;AA+CR;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAQD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAK/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GACrB,IAAI,CAiBN"}
|
|
@@ -99,13 +99,15 @@ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MA
|
|
|
99
99
|
-- manager. The save data manager will throw an error if the key is already registered.
|
|
100
100
|
-- @param v An object that corresponds to the `SaveData` interface. The object is conventionally
|
|
101
101
|
-- called "v" for brevity. ("v" is short for "local variables").
|
|
102
|
-
-- @param conditionalFunc
|
|
103
|
-
--
|
|
104
|
-
--
|
|
105
|
-
--
|
|
106
|
-
--
|
|
107
|
-
-- save
|
|
108
|
-
--
|
|
102
|
+
-- @param conditionalFunc Optional. A function to run to check if this save data should be written
|
|
103
|
+
-- to disk. Default is `() => true`, meaning that this save data will always
|
|
104
|
+
-- be written to disk. Use a conditional function for the situations when the
|
|
105
|
+
-- local variables are for a feature that the end-user can disable. (If the
|
|
106
|
+
-- feature is disabled, then there would be no point in writing any of the
|
|
107
|
+
-- variables to the "save#.dat" file.) You can also specify `false` to this
|
|
108
|
+
-- argument in order to completely disable saving data. (Specifying `false`
|
|
109
|
+
-- will allow you to use non-serializable objects in your save data, such as
|
|
110
|
+
-- `EntityPtr`.
|
|
109
111
|
function ____exports.saveDataManager(self, key, v, conditionalFunc)
|
|
110
112
|
errorIfFeaturesNotInitialized(nil, SAVE_DATA_MANAGER_FEATURE_NAME)
|
|
111
113
|
if not isString(nil, key) then
|
|
@@ -115,6 +117,9 @@ function ____exports.saveDataManager(self, key, v, conditionalFunc)
|
|
|
115
117
|
error((("The " .. SAVE_DATA_MANAGER_FEATURE_NAME) .. " is already managing save data for a key of: ") .. key)
|
|
116
118
|
end
|
|
117
119
|
saveDataMap[key] = v
|
|
120
|
+
if conditionalFunc == false then
|
|
121
|
+
conditionalFunc = function() return false end
|
|
122
|
+
end
|
|
118
123
|
local saveDataKeys = __TS__ObjectKeys(v)
|
|
119
124
|
if #saveDataKeys == 1 and saveDataKeys[1] == "room" then
|
|
120
125
|
conditionalFunc = function() return false end
|
|
@@ -5,7 +5,7 @@ import { SaveData } from "../../interfaces/SaveData";
|
|
|
5
5
|
* Maps for the master map so that we can access the variables via the in-game console when
|
|
6
6
|
* debugging. (TSTL Maps don't expose the map keys as normal keys.)
|
|
7
7
|
*/
|
|
8
|
-
export declare const saveDataMap: LuaMap<string, SaveData
|
|
9
|
-
export declare const saveDataDefaultsMap: LuaMap<string, SaveData
|
|
8
|
+
export declare const saveDataMap: LuaMap<string, SaveData<unknown, unknown, unknown>>;
|
|
9
|
+
export declare const saveDataDefaultsMap: LuaMap<string, SaveData<unknown, unknown, unknown>>;
|
|
10
10
|
export declare const saveDataConditionalFuncMap: LuaMap<string, () => boolean>;
|
|
11
11
|
//# sourceMappingURL=maps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"maps.d.ts","sourceRoot":"","sources":["../../../src/features/saveDataManager/maps.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,WAAW,qDAAiC,CAAC;AAE1D,eAAO,MAAM,mBAAmB,qDAAiC,CAAC;AAClE,eAAO,MAAM,0BAA0B,uBAA4B,OAAO,CAAG,CAAC"}
|
|
@@ -50,12 +50,7 @@ v = {run = {
|
|
|
50
50
|
subPlayerMap = __TS__New(Map)
|
|
51
51
|
}}
|
|
52
52
|
function ____exports.taintedLazarusPlayersInit(self, mod)
|
|
53
|
-
saveDataManager(
|
|
54
|
-
nil,
|
|
55
|
-
FEATURE_NAME,
|
|
56
|
-
v,
|
|
57
|
-
function() return false end
|
|
58
|
-
)
|
|
53
|
+
saveDataManager(nil, FEATURE_NAME, v, false)
|
|
59
54
|
mod:AddCallback(ModCallback.POST_PLAYER_INIT, postPlayerInit)
|
|
60
55
|
end
|
|
61
56
|
--- Helper function to get the other version of Tainted Lazarus.
|
|
@@ -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,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;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,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
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
/// <reference types="isaac-typescript-definitions" />
|
|
18
18
|
/// <reference types="isaac-typescript-definitions" />
|
|
19
19
|
/// <reference types="isaac-typescript-definitions" />
|
|
20
|
-
|
|
20
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
21
21
|
/**
|
|
22
22
|
* Helper function to get the name of a class from the Isaac API. This is contained within the
|
|
23
23
|
* "__type" metatable key.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkBxE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAEpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAExE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAGxE;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAElE;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG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Grid = 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,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA6BtC;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CAAC,aAAa,CAAC,EAAE,GAAG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S,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,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAA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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;KAC5B,CAAC,CAAC;IAEH;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;;;;;;;;OAYG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IA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G;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"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
3
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
4
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
5
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
6
|
+
import { AnyClass } from "../types";
|
|
1
7
|
/**
|
|
2
8
|
* This is the format of the object that you give to the save data manager. It will contains all of
|
|
3
9
|
* the variables for the particular mod feature.
|
|
@@ -11,6 +17,8 @@
|
|
|
11
17
|
* - `boolean`
|
|
12
18
|
* - `number`
|
|
13
19
|
* - `string`
|
|
20
|
+
* - `undefined` (will be skipped over when saving)
|
|
21
|
+
* - `null` (will be skipped over when saving)
|
|
14
22
|
* - `Map` / `DefaultMap`
|
|
15
23
|
* - `Set`
|
|
16
24
|
* - serializable Isaac API classes (such as `Color`)
|
|
@@ -21,10 +29,31 @@
|
|
|
21
29
|
* properties. This means that the TypeScript compiler will not be able to validate that you are
|
|
22
30
|
* passing in serializable data.)
|
|
23
31
|
*/
|
|
24
|
-
export interface SaveData {
|
|
25
|
-
persistent?:
|
|
26
|
-
run?:
|
|
27
|
-
level?:
|
|
32
|
+
export interface SaveData<Persistent = unknown, Run = unknown, Level = unknown> {
|
|
33
|
+
persistent?: Serializable<Persistent>;
|
|
34
|
+
run?: Serializable<Run>;
|
|
35
|
+
level?: Serializable<Level>;
|
|
28
36
|
room?: Record<string, unknown>;
|
|
29
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* A type that represents valid serializable data fed to the save data manager.
|
|
40
|
+
*
|
|
41
|
+
* Custom errors are thrown when an Isaac API class or a nested custom class is detected.
|
|
42
|
+
*
|
|
43
|
+
* The recursive nature of this type is based on the `Immutable` type:
|
|
44
|
+
* https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
|
|
45
|
+
*/
|
|
46
|
+
declare type Serializable<T> = T extends SerializableIsaacAPIClass ? T : T extends IsaacAPIClass ? IsaacAPIClassIsNotSerializable : T extends SerializablePrimitive ? T : T extends Array<infer U> ? SerializableArray<U> : T extends Map<infer K, infer V> ? SerializableMap<K, V> : T extends Set<infer M> ? SerializableSet<M> : SerializableObject<T>;
|
|
47
|
+
declare type SerializableInsideArrayOrMap<T> = T extends AnyClass ? CustomClassIsNotSerializable : Serializable<T>;
|
|
48
|
+
declare type SerializablePrimitive = boolean | string | number | undefined | null;
|
|
49
|
+
declare type SerializableArray<T> = Array<SerializableInsideArrayOrMap<T>>;
|
|
50
|
+
declare type SerializableMap<K, V> = Map<SerializableInsideArrayOrMap<K>, SerializableInsideArrayOrMap<V>>;
|
|
51
|
+
declare type SerializableSet<T> = Set<SerializableInsideArrayOrMap<T>>;
|
|
52
|
+
declare type SerializableObject<T> = {
|
|
53
|
+
[K in keyof T]: Serializable<T[K]>;
|
|
54
|
+
};
|
|
55
|
+
declare type SerializableIsaacAPIClass = Color | KColor | RNG | Vector;
|
|
56
|
+
declare type IsaacAPIClassIsNotSerializable = "Error: Isaac API classes (such as e.g. `Entity` or `RoomConfig`) are not serializable. For more information, see: https://isaacscript.github.io/main/gotchas#isaac-api-classes-are-not-serializable";
|
|
57
|
+
declare type CustomClassIsNotSerializable = 'Error: The "DefaultMap" class and other custom classes are not serializable when they are placed inside of an array, map, or set. For more information, see: https://isaacscript.github.io/main/gotchas#defaultmap-and-other-custom-classes-are-not-serializable';
|
|
58
|
+
export {};
|
|
30
59
|
//# sourceMappingURL=SaveData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SaveData.d.ts","sourceRoot":"","sources":["../../src/interfaces/SaveData.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SaveData.d.ts","sourceRoot":"","sources":["../../src/interfaces/SaveData.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,QAAQ,CACvB,UAAU,GAAG,OAAO,EACpB,GAAG,GAAG,OAAO,EACb,KAAK,GAAG,OAAO;IAEf,UAAU,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IACtC,GAAG,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,aAAK,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,yBAAyB,GACtD,CAAC,GACD,CAAC,SAAS,aAAa,GACvB,8BAA8B,GAC9B,CAAC,SAAS,qBAAqB,GAC/B,CAAC,GACD,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACxB,iBAAiB,CAAC,CAAC,CAAC,GACpB,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,GAC/B,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC,GACtB,eAAe,CAAC,CAAC,CAAC,GAClB,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAE1B,aAAK,4BAA4B,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,GACrD,4BAA4B,GAC5B,YAAY,CAAC,CAAC,CAAC,CAAC;AAEpB,aAAK,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC1E,aAAK,iBAAiB,CAAC,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,aAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,GAAG,CAC9B,4BAA4B,CAAC,CAAC,CAAC,EAC/B,4BAA4B,CAAC,CAAC,CAAC,CAChC,CAAC;AACF,aAAK,eAAe,CAAC,CAAC,IAAI,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,aAAK,kBAAkB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AACpE,aAAK,yBAAyB,GAAG,KAAK,GAAG,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;AAE/D,aAAK,8BAA8B,GACjC,qMAAqM,CAAC;AAExM,aAAK,4BAA4B,GAC/B,kQAAkQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnyClass.d.ts","sourceRoot":"","sources":["../../src/types/AnyClass.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ,GAAG,KAAK,GAAG,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,OAAO,CAAC"}
|
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export * from "./AnyClass";
|
|
1
2
|
export * from "./AnyEntity";
|
|
2
3
|
export * from "./AnyGridEntity";
|
|
3
4
|
export * from "./CollectibleIndex";
|
|
4
5
|
export * from "./Immutable";
|
|
5
|
-
export * from "./IsaacAPIClass";
|
|
6
6
|
export * from "./PickingUpItem";
|
|
7
7
|
export * from "./PickupIndex";
|
|
8
8
|
export * from "./PlayerIndex";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.23.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/index",
|
|
23
23
|
"types": "dist/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^3.1
|
|
25
|
+
"isaac-typescript-definitions": "^3.2.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -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;
|