Skip to content

Commit

Permalink
Add third floor rooms and some position points, add stairs positions
Browse files Browse the repository at this point in the history
  • Loading branch information
VityaSchel committed Jan 10, 2024
1 parent 72cbed0 commit 4d22422
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 8 deletions.
4 changes: 2 additions & 2 deletions remapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</style>
</head>
<body style="margin: 0">
<!-- <img src="src/assets/map/floor-1.png" onClick="pointRoom(event)" /> -->
<img src="src/assets/map/floor-1.png" onClick="pointRoom(event)" />
<!-- <img src="src/assets/map/floor-1.png" onClick="pointPos(event)" /> -->
<img src="src/assets/map/floor-2.png" onClick="pointRoom(event)" />
<!-- <img src="src/assets/map/floor-2.png" onClick="pointRoom(event)" /> -->
<!-- <img src="src/assets/map/floor-2.png" onClick="pointPos(event)" /> -->
<!-- <img src="src/assets/map/floor-3.png" onClick="pointRoom(event)" /> -->
<!-- <img src="src/assets/map/floor-3.png" onClick="pointPos(event)" /> -->
Expand Down
95 changes: 93 additions & 2 deletions src/data.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
type Room = { room: number, x: number, y: number }
type Point = { xpos: number, ypos: number, x: number, y: number }

export const floors: { rooms: Room[], points: Point[] }[] = [
export const floors: { stairs: { x: number, y: number }, rooms: Room[], points: Point[] }[] = [
{
stairs: { x: 792, y: 430 },
rooms: [
{
'room': 105,
Expand Down Expand Up @@ -358,6 +359,7 @@ export const floors: { rooms: Room[], points: Point[] }[] = [
]
},
{
stairs: { x: 792, y: 430 },
rooms: [
{
'room': 201,
Expand Down Expand Up @@ -707,7 +709,54 @@ export const floors: { rooms: Room[], points: Point[] }[] = [
]
},
{
rooms: [],
stairs: { x: 415, y: 199 },
rooms: [
{
'room': 308,
'x': 613,
'y': 102
},
{
'room': 309,
'x': 613,
'y': 270
},
{
'room': 301,
'x': 81,
'y': 339
},
{
'room': 307,
'x': 278,
'y': 657
},
{
'room': 303,
'x': 454,
'y': 627
},
{
'room': 306,
'x': 542,
'y': 600
},
{
'room': 305,
'x': 540,
'y': 492
},
{
'room': 304,
'x': 458,
'y': 465
},
{
'room': 302,
'x': 322,
'y': 529
}
],
points: [
{
'xpos': 60,
Expand Down Expand Up @@ -792,6 +841,48 @@ export const floors: { rooms: Room[], points: Point[] }[] = [
'ypos': 21,
'x': 616,
'y': 172
},
{
'xpos': 61,
'ypos': 14,
'x': 357,
'y': 581
},
{
'xpos': 62,
'ypos': 14,
'x': 281,
'y': 594
},
{
'xpos': 63,
'ypos': 14,
'x': 209,
'y': 593
},
{
'xpos': 61,
'ypos': 15,
'x': 374,
'y': 554
},
{
'xpos': 60,
'ypos': 16,
'x': 458,
'y': 535
},
{
'xpos': 59,
'ypos': 16,
'x': 537,
'y': 535
},
{
'xpos': 61,
'ypos': 16,
'x': 374,
'y': 521
}
]
}
Expand Down
23 changes: 19 additions & 4 deletions src/radar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,15 @@ export function initRadar() {
}

if (window.inroom === 0) {
const xpos = window.pos[0]
const ypos = window.pos[1]
const dir = window.pos[2]
moveCharacter(maya, xpos, ypos, dir, skipTransition ? '0s' : '1s')
if (window.stairs === 2) {
const { x, y } = floorMap.stairs
moveCharacter(maya, x, y, 'N', skipTransition ? '0s' : '1s')
} else {
const xpos = window.pos[0]
const ypos = window.pos[1]
const dir = window.pos[2]
moveCharacter(maya, xpos, ypos, dir, skipTransition ? '0s' : '1s')
}
} else {
const room = floorMap.rooms.find(({ room }) => room === window.inroom)
if (!room) return
Expand Down Expand Up @@ -255,6 +260,14 @@ export function initRadar() {
}
}, 1)
}

const checkIfJimmyInRoomWithMaya = () => {
if(window.jhinroom === window.inroom) {
maya.style.opacity = '0.1'
} else {
maya.style.opacity = '1'
}
}

onPropertyChange('menon', () => {
if(window.menon === 0) {
Expand Down Expand Up @@ -286,10 +299,12 @@ export function initRadar() {

onPropertyChange('inroom', () => {
moveMaya()
checkIfJimmyInRoomWithMaya()
})

onPropertyChange('jhinroom', () => {
moveJimmy()
checkIfJimmyInRoomWithMaya()
})

onPropertyChange('pos', () => {
Expand Down
1 change: 1 addition & 0 deletions src/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ interface Window {
jhfloor: number
jhinroom: number
menon: 0 | 1
stairs: number
}

0 comments on commit 4d22422

Please sign in to comment.