File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed
plugins/skills/construction Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export class World {
92
92
return { object : templateMapObject , cacheOriginal : true } ;
93
93
}
94
94
95
- return null ;
95
+ return { object : null , cacheOriginal : false } ;
96
96
}
97
97
98
98
let cacheOriginal = true ;
@@ -161,10 +161,7 @@ export class World {
161
161
const chunkIndexX = objectChunk . position . x - ( mapChunk . position . x - 2 ) ;
162
162
const chunkIndexY = objectChunk . position . y - ( mapChunk . position . y - 2 ) ;
163
163
164
- const centerOffsetX = map . centerOffsetX || 0 ;
165
- const centerOffsetY = map . centerOffsetY || 0 ;
166
-
167
- const objectTile = map . tileData [ actor . position . level ] [ chunkIndexX + centerOffsetX ] [ chunkIndexY + centerOffsetY ] ;
164
+ const objectTile = map . tileData [ actor . position . level ] [ chunkIndexX ] [ chunkIndexY ] ;
168
165
169
166
const tileX = objectTile >> 14 & 0x3ff ;
170
167
const tileY = objectTile >> 3 & 0x7ff ;
Original file line number Diff line number Diff line change @@ -33,29 +33,27 @@ export interface ConstructedMap {
33
33
34
34
35
35
export const getRotatedObjectX = ( orientation : number , localX : number , localY : number ) : number => {
36
- orientation &= 0x3 ;
37
36
if ( orientation === 0 ) {
38
37
return localX ;
39
38
}
40
39
if ( orientation === 1 ) {
41
- return localY ;
40
+ return 7 + - localY ;
42
41
}
43
42
if ( orientation === 2 ) {
44
43
return - localX + 7 ;
45
44
}
46
- return 7 + - localY ;
45
+ return localY ;
47
46
} ;
48
47
49
48
export const getRotatedObjectY = ( orientation : number , localX : number , localY : number ) : number => {
50
- orientation &= 0x3 ;
51
49
if ( orientation === 0 ) {
52
50
return localY ;
53
51
}
54
52
if ( orientation === 1 ) {
55
- return 7 + - localX ;
53
+ return localX ;
56
54
}
57
55
if ( orientation === 2 ) {
58
56
return - localY + 7 ;
59
57
}
60
- return localX ;
58
+ return 7 + - localX ;
61
59
} ;
Original file line number Diff line number Diff line change @@ -13,14 +13,23 @@ const openHouse = (player: Player): void => {
13
13
14
14
const gardenPortal = new Room ( 'garden_1' ) ;
15
15
const firstParlor = new Room ( 'parlor' ) ;
16
+ const secondParlor = new Room ( 'parlor' , 1 ) ;
17
+ const thirdParlor = new Room ( 'parlor' , 2 ) ;
18
+ const fourthParlor = new Room ( 'parlor' , 3 ) ;
16
19
const emptySpace = new Room ( 'empty_grass' ) ;
17
20
18
21
for ( let x = 0 ; x < MAP_SIZE ; x ++ ) {
19
22
for ( let y = 0 ; y < MAP_SIZE ; y ++ ) {
20
23
if ( x === 6 && y === 6 ) {
21
24
house . rooms [ 0 ] [ x ] [ y ] = gardenPortal ;
22
- } else if ( ( x === 7 && y === 6 ) || ( x === 6 && y === 7 ) || ( x === 5 && y === 6 ) ) {
25
+ } else if ( x === 5 && y === 6 ) {
23
26
house . rooms [ 0 ] [ x ] [ y ] = firstParlor ;
27
+ } else if ( x === 7 && y === 6 ) {
28
+ house . rooms [ 0 ] [ x ] [ y ] = secondParlor ;
29
+ } else if ( x === 6 && y === 5 ) {
30
+ house . rooms [ 0 ] [ x ] [ y ] = thirdParlor ;
31
+ } else if ( x === 6 && y === 7 ) {
32
+ house . rooms [ 0 ] [ x ] [ y ] = fourthParlor ;
24
33
}
25
34
}
26
35
}
You can’t perform that action at this time.
0 commit comments