isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
124 lines (111 loc) • 3.17 kB
text/typescript
import { DoorSlot, RoomShape } from "isaac-typescript-definitions";
/**
* The coordinates correspond to the x and y values that are present in a room's XML file.
*
* e.g. `<door exists="False" x="-1" y="3" />`
*/
export const ROOM_SHAPE_TO_DOOR_SLOT_COORDINATES = {
// 1
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [13, 3], // 2
[]: [6, 7], // 3
},
// 2
[]: {
[]: [-1, 3], // 0
[]: [13, 3], // 2
},
// 3
[]: {
[]: [6, -1], // 1
[]: [6, 7], // 3
},
// 4
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [13, 3], // 2
[]: [6, 14], // 3
[]: [-1, 10], // 4
[]: [13, 10], // 6
},
// 5
[]: {
[]: [6, -1], // 1
[]: [6, 14], // 3
},
// 6
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [26, 3], // 2
[]: [6, 7], // 3
[]: [19, -1], // 5
[]: [19, 7], // 7
},
// 7
[]: {
[]: [-1, 3], // 0
[]: [26, 3], // 2
},
// 8
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [26, 3], // 2
[]: [6, 14], // 3
[]: [-1, 10], // 4
[]: [19, -1], // 5
[]: [26, 10], // 6
[]: [19, 14], // 7
},
// 9
[]: {
[]: [12, 3], // 0
[]: [6, 6], // 1
[]: [26, 3], // 2
[]: [6, 14], // 3
[]: [-1, 10], // 4
[]: [19, -1], // 5
[]: [26, 10], // 6
[]: [19, 14], // 7
},
// 10
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [13, 3], // 2
[]: [6, 14], // 3
[]: [-1, 10], // 4
[]: [19, 6], // 5
[]: [26, 10], // 6
[]: [19, 14], // 7
},
// 11
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [26, 3], // 2
[]: [6, 7], // 3
[]: [12, 10], // 4
[]: [19, -1], // 5
[]: [26, 10], // 6
[]: [19, 14], // 7
},
// 12
[]: {
[]: [-1, 3], // 0
[]: [6, -1], // 1
[]: [26, 3], // 2
[]: [6, 14], // 3
[]: [-1, 10], // 4
[]: [19, -1], // 5
[]: [13, 10], // 6
[]: [19, 7], // 7
},
} as const satisfies Record<
RoomShape,
Partial<Record<DoorSlot, readonly [x: int, y: int]>>
>;