isaacscript-common 1.2.225 → 1.2.228
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/constants.d.ts +1 -0
- package/dist/constants.lua +1 -0
- package/dist/functions/roomShape.d.ts +41 -0
- package/dist/functions/roomShape.lua +38 -0
- package/dist/functions/rooms.d.ts +0 -7
- package/dist/functions/rooms.lua +6 -13
- package/dist/functions/utils.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/objects/roomShapeBounds.d.ts +8 -0
- package/dist/objects/roomShapeBounds.lua +24 -0
- package/dist/objects/roomShapeLayoutSizes.d.ts +10 -0
- package/dist/objects/roomShapeLayoutSizes.lua +25 -0
- package/dist/objects/roomShapeToBottomRightPosition.d.ts +8 -0
- package/dist/objects/roomShapeToBottomRightPosition.lua +20 -0
- package/dist/objects/roomShapeToTopLeftPosition.d.ts +8 -0
- package/dist/objects/roomShapeToTopLeftPosition.lua +20 -0
- package/dist/objects/roomShapeVolumes.d.ts +13 -0
- package/dist/objects/roomShapeVolumes.lua +27 -0
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: number;
|
|
|
37
37
|
export declare const GAME_FRAMES_PER_SECOND = 30;
|
|
38
38
|
export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
|
|
39
39
|
export declare const ISAAC_FRAMES_PER_SECOND = 60;
|
|
40
|
+
export declare const LEVEL_GRID_COLUMN_HEIGHT = 13;
|
|
40
41
|
export declare const LEVEL_GRID_ROW_LENGTH = 13;
|
|
41
42
|
/** In a 2x2 room, there can be 8 doors. */
|
|
42
43
|
export declare const MAX_NUM_DOORS = 8;
|
package/dist/constants.lua
CHANGED
|
@@ -13,6 +13,7 @@ ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
|
|
|
13
13
|
____exports.GAME_FRAMES_PER_SECOND = 30
|
|
14
14
|
____exports.GRID_INDEX_CENTER_OF_1X1_ROOM = 67
|
|
15
15
|
____exports.ISAAC_FRAMES_PER_SECOND = 60
|
|
16
|
+
____exports.LEVEL_GRID_COLUMN_HEIGHT = 13
|
|
16
17
|
____exports.LEVEL_GRID_ROW_LENGTH = 13
|
|
17
18
|
____exports.MAX_NUM_DOORS = 8
|
|
18
19
|
____exports.MAX_NUM_FAMILIARS = 64
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get the grid index delta that a door out of the given room shape would lead
|
|
4
|
+
* to. For example, if you went through the bottom door in a room of `RoomShape.ROOMSHAPE_1x2`, you
|
|
5
|
+
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
|
|
6
|
+
* started.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to get the grid position of the bottom-right tile of a given room shape.
|
|
11
|
+
*
|
|
12
|
+
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
13
|
+
* wall would be at "Vector(-1, -1)".)
|
|
14
|
+
*/
|
|
15
|
+
export declare function getRoomShapeBottomRightPosition(roomShape: RoomShape): Vector;
|
|
16
|
+
/**
|
|
17
|
+
* Helper function to get the bounds of a room shape, which are a box representing its contents.
|
|
18
|
+
* This does not include the tiles that the walls are on. L rooms use the same bounds as a 2x2 room.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getRoomShapeBounds(roomShape: RoomShape): Vector;
|
|
21
|
+
/**
|
|
22
|
+
* Helper function to get the dimensions of a room shape's layout. This is NOT the size of the
|
|
23
|
+
* room's actual contents! For that, use the `getRoomShapeBounds` function.
|
|
24
|
+
*
|
|
25
|
+
* For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRoomShapeLayoutSize(roomShape: RoomShape): Vector;
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to get the grid position of the top-left tile of a given room shape.
|
|
30
|
+
*
|
|
31
|
+
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
32
|
+
* wall would be at "Vector(-1, -1)".)
|
|
33
|
+
*/
|
|
34
|
+
export declare function getRoomShapeTopLeftPosition(roomShape: RoomShape): Vector;
|
|
35
|
+
/**
|
|
36
|
+
* Helper function to get the volume of a room shape, which is the amount of tiles that are inside
|
|
37
|
+
* the room.
|
|
38
|
+
*
|
|
39
|
+
* (This cannot be directly calculated from the bounds since L rooms are a special case.)
|
|
40
|
+
*/
|
|
41
|
+
export declare function getRoomShapeVolume(roomShape: RoomShape): int;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____roomShapeBounds = require("objects.roomShapeBounds")
|
|
5
|
+
local ROOM_SHAPE_BOUNDS = ____roomShapeBounds.ROOM_SHAPE_BOUNDS
|
|
6
|
+
local ____roomShapeLayoutSizes = require("objects.roomShapeLayoutSizes")
|
|
7
|
+
local ROOM_SHAPE_LAYOUT_SIZES = ____roomShapeLayoutSizes.ROOM_SHAPE_LAYOUT_SIZES
|
|
8
|
+
local ____roomShapeToBottomRightPosition = require("objects.roomShapeToBottomRightPosition")
|
|
9
|
+
local ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = ____roomShapeToBottomRightPosition.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION
|
|
10
|
+
local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
|
|
11
|
+
local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
|
|
12
|
+
local ____roomShapeToTopLeftPosition = require("objects.roomShapeToTopLeftPosition")
|
|
13
|
+
local ROOM_SHAPE_TO_TOP_LEFT_POSITION = ____roomShapeToTopLeftPosition.ROOM_SHAPE_TO_TOP_LEFT_POSITION
|
|
14
|
+
local ____roomShapeVolumes = require("objects.roomShapeVolumes")
|
|
15
|
+
local ROOM_SHAPE_VOLUMES = ____roomShapeVolumes.ROOM_SHAPE_VOLUMES
|
|
16
|
+
function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
|
|
17
|
+
local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
|
|
18
|
+
if doorSlotToGridIndexMap == nil then
|
|
19
|
+
return nil
|
|
20
|
+
end
|
|
21
|
+
return doorSlotToGridIndexMap:get(doorSlot)
|
|
22
|
+
end
|
|
23
|
+
function ____exports.getRoomShapeBottomRightPosition(self, roomShape)
|
|
24
|
+
return ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION[roomShape]
|
|
25
|
+
end
|
|
26
|
+
function ____exports.getRoomShapeBounds(self, roomShape)
|
|
27
|
+
return ROOM_SHAPE_BOUNDS[roomShape]
|
|
28
|
+
end
|
|
29
|
+
function ____exports.getRoomShapeLayoutSize(self, roomShape)
|
|
30
|
+
return ROOM_SHAPE_LAYOUT_SIZES[roomShape]
|
|
31
|
+
end
|
|
32
|
+
function ____exports.getRoomShapeTopLeftPosition(self, roomShape)
|
|
33
|
+
return ROOM_SHAPE_TO_TOP_LEFT_POSITION[roomShape]
|
|
34
|
+
end
|
|
35
|
+
function ____exports.getRoomShapeVolume(self, roomShape)
|
|
36
|
+
return ROOM_SHAPE_VOLUMES[roomShape]
|
|
37
|
+
end
|
|
38
|
+
return ____exports
|
|
@@ -15,13 +15,6 @@ export declare function getAllRoomGridIndexes(): int[];
|
|
|
15
15
|
* tricky to properly detect.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCurrentDimension(): Dimension;
|
|
18
|
-
/**
|
|
19
|
-
* Helper function to get the grid index delta that a door out of the given room shape would lead
|
|
20
|
-
* to. For example, if you went through the bottom door in a room of `RoomShape.ROOMSHAPE_1x2`, you
|
|
21
|
-
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
|
|
22
|
-
* started.
|
|
23
|
-
*/
|
|
24
|
-
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
25
18
|
/**
|
|
26
19
|
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
27
20
|
* specified room type.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
|
-
local Map = ____lualib.Map
|
|
4
3
|
local Set = ____lualib.Set
|
|
5
4
|
local __TS__New = ____lualib.__TS__New
|
|
6
5
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
7
6
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
8
7
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
8
|
+
local Map = ____lualib.Map
|
|
9
9
|
local ____exports = {}
|
|
10
10
|
local ____cachedClasses = require("cachedClasses")
|
|
11
11
|
local game = ____cachedClasses.game
|
|
@@ -13,8 +13,6 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
13
13
|
local ____constants = require("constants")
|
|
14
14
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
15
15
|
local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
16
|
-
local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
|
|
17
|
-
local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
|
|
18
16
|
local ____doors = require("functions.doors")
|
|
19
17
|
local closeAllDoors = ____doors.closeAllDoors
|
|
20
18
|
local getDoors = ____doors.getDoors
|
|
@@ -40,6 +38,8 @@ local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
|
40
38
|
local getRoomShape = ____roomData.getRoomShape
|
|
41
39
|
local getRoomStageID = ____roomData.getRoomStageID
|
|
42
40
|
local getRoomSubType = ____roomData.getRoomSubType
|
|
41
|
+
local ____roomShape = require("functions.roomShape")
|
|
42
|
+
local getGridIndexDelta = ____roomShape.getGridIndexDelta
|
|
43
43
|
function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
44
44
|
if includeExtraDimensionalRooms == nil then
|
|
45
45
|
includeExtraDimensionalRooms = false
|
|
@@ -114,13 +114,6 @@ function ____exports.getCurrentDimension(self)
|
|
|
114
114
|
end
|
|
115
115
|
return error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
|
|
116
116
|
end
|
|
117
|
-
function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
|
|
118
|
-
local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
|
|
119
|
-
if doorSlotToGridIndexMap == nil then
|
|
120
|
-
return nil
|
|
121
|
-
end
|
|
122
|
-
return doorSlotToGridIndexMap:get(doorSlot)
|
|
123
|
-
end
|
|
124
117
|
function ____exports.getRoomGridIndexesForType(self, ...)
|
|
125
118
|
local roomTypesSet = __TS__New(Set, {...})
|
|
126
119
|
local rooms = ____exports.getRooms(nil)
|
|
@@ -245,7 +238,7 @@ function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGr
|
|
|
245
238
|
if roomShape == nil then
|
|
246
239
|
return false
|
|
247
240
|
end
|
|
248
|
-
local delta =
|
|
241
|
+
local delta = getGridIndexDelta(nil, roomShape, doorSlot)
|
|
249
242
|
if delta == nil then
|
|
250
243
|
return false
|
|
251
244
|
end
|
|
@@ -281,12 +274,12 @@ function ____exports.setRoomCleared(self)
|
|
|
281
274
|
for ____, door in ipairs(getDoors(nil)) do
|
|
282
275
|
do
|
|
283
276
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
284
|
-
goto
|
|
277
|
+
goto __continue52
|
|
285
278
|
end
|
|
286
279
|
openDoorFast(nil, door)
|
|
287
280
|
door.ExtraVisible = false
|
|
288
281
|
end
|
|
289
|
-
::
|
|
282
|
+
::__continue52::
|
|
290
283
|
end
|
|
291
284
|
sfxManager:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
292
285
|
game:ShakeScreen(0)
|
|
@@ -122,5 +122,14 @@ export declare function repeat(n: int, func: (i: int) => void): void;
|
|
|
122
122
|
/**
|
|
123
123
|
* Helper function to check every value of a custom enum for -1. This is helpful as a run-time check
|
|
124
124
|
* because many methods of the Isaac class return -1 if they fail.
|
|
125
|
+
*
|
|
126
|
+
* Example:
|
|
127
|
+
* ```ts
|
|
128
|
+
* enum EntityTypeCustom {
|
|
129
|
+
* FOO = Isaac.GetEntityTypeByName("Foo"),
|
|
130
|
+
* }
|
|
131
|
+
*
|
|
132
|
+
* validateCustomEnum("EntityTypeCustom", EntityTypeCustom);
|
|
133
|
+
* ```
|
|
125
134
|
*/
|
|
126
135
|
export declare function validateCustomEnum(transpiledEnumName: string, transpiledEnum: unknown): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export * from "./functions/revive";
|
|
|
74
74
|
export * from "./functions/rng";
|
|
75
75
|
export * from "./functions/roomData";
|
|
76
76
|
export * from "./functions/rooms";
|
|
77
|
+
export * from "./functions/roomShape";
|
|
77
78
|
export * from "./functions/run";
|
|
78
79
|
export * from "./functions/seeds";
|
|
79
80
|
export * from "./functions/serialization";
|
package/dist/index.lua
CHANGED
|
@@ -592,6 +592,14 @@ do
|
|
|
592
592
|
end
|
|
593
593
|
end
|
|
594
594
|
end
|
|
595
|
+
do
|
|
596
|
+
local ____export = require("functions.roomShape")
|
|
597
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
598
|
+
if ____exportKey ~= "default" then
|
|
599
|
+
____exports[____exportKey] = ____exportValue
|
|
600
|
+
end
|
|
601
|
+
end
|
|
602
|
+
end
|
|
595
603
|
do
|
|
596
604
|
local ____export = require("functions.run")
|
|
597
605
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* The size of a room shape's contents. This does not include the tiles that the walls are on. L
|
|
4
|
+
* rooms use the same bounds as a 2x2 room.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOM_SHAPE_BOUNDS: {
|
|
7
|
+
readonly [key in RoomShape]: Vector;
|
|
8
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____roomShapeVolumes = require("objects.roomShapeVolumes")
|
|
4
|
+
local NARROW_CONTENTS_HEIGHT = ____roomShapeVolumes.NARROW_CONTENTS_HEIGHT
|
|
5
|
+
local NARROW_CONTENTS_WIDTH = ____roomShapeVolumes.NARROW_CONTENTS_WIDTH
|
|
6
|
+
local ONE_BY_ONE_CONTENTS_HEIGHT = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_HEIGHT
|
|
7
|
+
local ONE_BY_ONE_CONTENTS_WIDTH = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_WIDTH
|
|
8
|
+
local TWO_BY_TWO_BOUNDS = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
|
|
9
|
+
____exports.ROOM_SHAPE_BOUNDS = {
|
|
10
|
+
[RoomShape.ROOMSHAPE_1x1] = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT),
|
|
11
|
+
[RoomShape.ROOMSHAPE_IH] = Vector(ONE_BY_ONE_CONTENTS_WIDTH, NARROW_CONTENTS_HEIGHT),
|
|
12
|
+
[RoomShape.ROOMSHAPE_IV] = Vector(NARROW_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT),
|
|
13
|
+
[RoomShape.ROOMSHAPE_1x2] = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT * 2),
|
|
14
|
+
[RoomShape.ROOMSHAPE_IIV] = Vector(NARROW_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT * 2),
|
|
15
|
+
[RoomShape.ROOMSHAPE_2x1] = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT),
|
|
16
|
+
[RoomShape.ROOMSHAPE_IIH] = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, NARROW_CONTENTS_HEIGHT),
|
|
17
|
+
[RoomShape.ROOMSHAPE_2x2] = TWO_BY_TWO_BOUNDS,
|
|
18
|
+
[RoomShape.ROOMSHAPE_LTL] = TWO_BY_TWO_BOUNDS,
|
|
19
|
+
[RoomShape.ROOMSHAPE_LTR] = TWO_BY_TWO_BOUNDS,
|
|
20
|
+
[RoomShape.ROOMSHAPE_LBL] = TWO_BY_TWO_BOUNDS,
|
|
21
|
+
[RoomShape.ROOMSHAPE_LBR] = TWO_BY_TWO_BOUNDS,
|
|
22
|
+
[RoomShape.NUM_ROOMSHAPES] = Vector.Zero
|
|
23
|
+
}
|
|
24
|
+
return ____exports
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* The dimensions of a room shape's layout. This is NOT the size of the room's actual contents! For
|
|
4
|
+
* that, use `ROOM_SHAPE_BOUNDS`.
|
|
5
|
+
*
|
|
6
|
+
* For example, a horizontal narrow room has a layout size of equal to that of a 1x1 room.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ROOM_SHAPE_LAYOUT_SIZES: {
|
|
9
|
+
readonly [key in RoomShape]: Vector;
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____roomShapeVolumes = require("objects.roomShapeVolumes")
|
|
4
|
+
local ONE_BY_ONE_CONTENTS_HEIGHT = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_HEIGHT
|
|
5
|
+
local ONE_BY_ONE_CONTENTS_WIDTH = ____roomShapeVolumes.ONE_BY_ONE_CONTENTS_WIDTH
|
|
6
|
+
local ONE_BY_ONE_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT)
|
|
7
|
+
local TWO_BY_ONE_VERTICAL_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
|
|
8
|
+
local TWO_BY_ONE_HORIZONTAL_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT)
|
|
9
|
+
local TWO_BY_TWO_LAYOUT_SIZE = Vector(ONE_BY_ONE_CONTENTS_WIDTH * 2, ONE_BY_ONE_CONTENTS_HEIGHT * 2)
|
|
10
|
+
____exports.ROOM_SHAPE_LAYOUT_SIZES = {
|
|
11
|
+
[RoomShape.ROOMSHAPE_1x1] = ONE_BY_ONE_LAYOUT_SIZE,
|
|
12
|
+
[RoomShape.ROOMSHAPE_IH] = ONE_BY_ONE_LAYOUT_SIZE,
|
|
13
|
+
[RoomShape.ROOMSHAPE_IV] = ONE_BY_ONE_LAYOUT_SIZE,
|
|
14
|
+
[RoomShape.ROOMSHAPE_1x2] = TWO_BY_ONE_VERTICAL_LAYOUT_SIZE,
|
|
15
|
+
[RoomShape.ROOMSHAPE_IIV] = TWO_BY_ONE_VERTICAL_LAYOUT_SIZE,
|
|
16
|
+
[RoomShape.ROOMSHAPE_2x1] = TWO_BY_ONE_HORIZONTAL_LAYOUT_SIZE,
|
|
17
|
+
[RoomShape.ROOMSHAPE_IIH] = TWO_BY_ONE_HORIZONTAL_LAYOUT_SIZE,
|
|
18
|
+
[RoomShape.ROOMSHAPE_2x2] = TWO_BY_TWO_LAYOUT_SIZE,
|
|
19
|
+
[RoomShape.ROOMSHAPE_LTL] = TWO_BY_TWO_LAYOUT_SIZE,
|
|
20
|
+
[RoomShape.ROOMSHAPE_LTR] = TWO_BY_TWO_LAYOUT_SIZE,
|
|
21
|
+
[RoomShape.ROOMSHAPE_LBL] = TWO_BY_TWO_LAYOUT_SIZE,
|
|
22
|
+
[RoomShape.ROOMSHAPE_LBR] = TWO_BY_TWO_LAYOUT_SIZE,
|
|
23
|
+
[RoomShape.NUM_ROOMSHAPES] = TWO_BY_TWO_LAYOUT_SIZE
|
|
24
|
+
}
|
|
25
|
+
return ____exports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
4
|
+
* wall would be at "Vector(-1, -1)".)
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION: {
|
|
7
|
+
readonly [key in RoomShape]: Vector;
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local TWO_BY_TWO_BOTTOM_RIGHT_POSITION = Vector(25, 13)
|
|
4
|
+
local ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION = Vector(12, 13)
|
|
5
|
+
____exports.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = {
|
|
6
|
+
[RoomShape.ROOMSHAPE_1x1] = Vector(12, 6),
|
|
7
|
+
[RoomShape.ROOMSHAPE_IH] = Vector(12, 4),
|
|
8
|
+
[RoomShape.ROOMSHAPE_IV] = Vector(8, 6),
|
|
9
|
+
[RoomShape.ROOMSHAPE_1x2] = ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION,
|
|
10
|
+
[RoomShape.ROOMSHAPE_IIV] = Vector(8, 13),
|
|
11
|
+
[RoomShape.ROOMSHAPE_2x1] = Vector(25, 6),
|
|
12
|
+
[RoomShape.ROOMSHAPE_IIH] = Vector(25, 4),
|
|
13
|
+
[RoomShape.ROOMSHAPE_2x2] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
14
|
+
[RoomShape.ROOMSHAPE_LTL] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
15
|
+
[RoomShape.ROOMSHAPE_LTR] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
16
|
+
[RoomShape.ROOMSHAPE_LBL] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
17
|
+
[RoomShape.ROOMSHAPE_LBR] = ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION,
|
|
18
|
+
[RoomShape.NUM_ROOMSHAPES] = Vector.Zero
|
|
19
|
+
}
|
|
20
|
+
return ____exports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
4
|
+
* wall would be at "Vector(-1, -1)".)
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOM_SHAPE_TO_TOP_LEFT_POSITION: {
|
|
7
|
+
readonly [key in RoomShape]: Vector;
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local NARROW_HORIZONTAL_TOP_LEFT_POSITION = Vector(0, 2)
|
|
4
|
+
local NARROW_VERTICAL_TOP_LEFT_POSITION = Vector(4, 0)
|
|
5
|
+
____exports.ROOM_SHAPE_TO_TOP_LEFT_POSITION = {
|
|
6
|
+
[RoomShape.ROOMSHAPE_1x1] = Vector.Zero,
|
|
7
|
+
[RoomShape.ROOMSHAPE_IH] = NARROW_HORIZONTAL_TOP_LEFT_POSITION,
|
|
8
|
+
[RoomShape.ROOMSHAPE_IV] = NARROW_VERTICAL_TOP_LEFT_POSITION,
|
|
9
|
+
[RoomShape.ROOMSHAPE_1x2] = Vector.Zero,
|
|
10
|
+
[RoomShape.ROOMSHAPE_IIV] = NARROW_VERTICAL_TOP_LEFT_POSITION,
|
|
11
|
+
[RoomShape.ROOMSHAPE_2x1] = Vector.Zero,
|
|
12
|
+
[RoomShape.ROOMSHAPE_IIH] = NARROW_HORIZONTAL_TOP_LEFT_POSITION,
|
|
13
|
+
[RoomShape.ROOMSHAPE_2x2] = Vector.Zero,
|
|
14
|
+
[RoomShape.ROOMSHAPE_LTL] = Vector(13, 0),
|
|
15
|
+
[RoomShape.ROOMSHAPE_LTR] = Vector.Zero,
|
|
16
|
+
[RoomShape.ROOMSHAPE_LBL] = Vector.Zero,
|
|
17
|
+
[RoomShape.ROOMSHAPE_LBR] = Vector.Zero,
|
|
18
|
+
[RoomShape.NUM_ROOMSHAPES] = Vector.Zero
|
|
19
|
+
}
|
|
20
|
+
return ____exports
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare const ONE_BY_ONE_CONTENTS_WIDTH = 13;
|
|
3
|
+
export declare const ONE_BY_ONE_CONTENTS_HEIGHT = 7;
|
|
4
|
+
export declare const NARROW_CONTENTS_WIDTH = 5;
|
|
5
|
+
export declare const NARROW_CONTENTS_HEIGHT = 3;
|
|
6
|
+
/**
|
|
7
|
+
* Volume is the amount of tiles that are inside the room shape.
|
|
8
|
+
*
|
|
9
|
+
* (This cannot be directly calculated from the bounds since L rooms are a special case.)
|
|
10
|
+
*/
|
|
11
|
+
export declare const ROOM_SHAPE_VOLUMES: {
|
|
12
|
+
readonly [key in RoomShape]: int;
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
____exports.ONE_BY_ONE_CONTENTS_WIDTH = 13
|
|
4
|
+
____exports.ONE_BY_ONE_CONTENTS_HEIGHT = 7
|
|
5
|
+
local ONE_BY_ONE_VOLUME = ____exports.ONE_BY_ONE_CONTENTS_HEIGHT * ____exports.ONE_BY_ONE_CONTENTS_WIDTH
|
|
6
|
+
____exports.NARROW_CONTENTS_WIDTH = 5
|
|
7
|
+
____exports.NARROW_CONTENTS_HEIGHT = 3
|
|
8
|
+
local NARROW_HORIZONTAL_VOLUME = ____exports.ONE_BY_ONE_CONTENTS_WIDTH * ____exports.NARROW_CONTENTS_HEIGHT
|
|
9
|
+
local NARROW_VERTICAL_VOLUME = ____exports.NARROW_CONTENTS_WIDTH * ____exports.ONE_BY_ONE_CONTENTS_HEIGHT
|
|
10
|
+
local ONE_BY_TWO_VOLUME = ONE_BY_ONE_VOLUME * 2
|
|
11
|
+
local L_ROOM_VOLUME = ONE_BY_ONE_VOLUME * 3
|
|
12
|
+
____exports.ROOM_SHAPE_VOLUMES = {
|
|
13
|
+
[RoomShape.ROOMSHAPE_1x1] = ONE_BY_ONE_VOLUME,
|
|
14
|
+
[RoomShape.ROOMSHAPE_IH] = NARROW_HORIZONTAL_VOLUME,
|
|
15
|
+
[RoomShape.ROOMSHAPE_IV] = NARROW_VERTICAL_VOLUME,
|
|
16
|
+
[RoomShape.ROOMSHAPE_1x2] = ONE_BY_TWO_VOLUME,
|
|
17
|
+
[RoomShape.ROOMSHAPE_IIV] = NARROW_VERTICAL_VOLUME * 2,
|
|
18
|
+
[RoomShape.ROOMSHAPE_2x1] = ONE_BY_TWO_VOLUME,
|
|
19
|
+
[RoomShape.ROOMSHAPE_IIH] = NARROW_HORIZONTAL_VOLUME * 2,
|
|
20
|
+
[RoomShape.ROOMSHAPE_2x2] = ONE_BY_ONE_VOLUME * 4,
|
|
21
|
+
[RoomShape.ROOMSHAPE_LTL] = L_ROOM_VOLUME,
|
|
22
|
+
[RoomShape.ROOMSHAPE_LTR] = L_ROOM_VOLUME,
|
|
23
|
+
[RoomShape.ROOMSHAPE_LBL] = L_ROOM_VOLUME,
|
|
24
|
+
[RoomShape.ROOMSHAPE_LBR] = L_ROOM_VOLUME,
|
|
25
|
+
[RoomShape.NUM_ROOMSHAPES] = 0
|
|
26
|
+
}
|
|
27
|
+
return ____exports
|