@downcity/ui 0.1.84 → 0.1.93
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/index.cjs +39 -39
- package/dist/index.js +39 -39
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1184,7 +1184,7 @@ var GRID_COLS = 40;
|
|
|
1184
1184
|
var GRID_ROWS = 24;
|
|
1185
1185
|
var STAGE_WIDTH = TILE_SIZE * GRID_COLS;
|
|
1186
1186
|
var STAGE_HEIGHT = TILE_SIZE * GRID_ROWS;
|
|
1187
|
-
var
|
|
1187
|
+
var WORKBOARD_VILLAGE_PLAZA_POINT = { x: 800, y: 480 };
|
|
1188
1188
|
var WORKBOARD_ZONE_GATE_POINTS = {
|
|
1189
1189
|
engaged: { x: 560, y: 400 },
|
|
1190
1190
|
steady: { x: 1040, y: 400 },
|
|
@@ -1227,7 +1227,7 @@ var ZONE_PIXEL_PALETTE = {
|
|
|
1227
1227
|
shadow: "rgba(146,78,28,0.2)"
|
|
1228
1228
|
}
|
|
1229
1229
|
};
|
|
1230
|
-
var
|
|
1230
|
+
var VILLAGE_PATH_TILES = [
|
|
1231
1231
|
{ col: 0, row: 10, cols: 40, rows: 4 },
|
|
1232
1232
|
{ col: 19, row: 0, cols: 2, rows: 24 },
|
|
1233
1233
|
{ col: 12, row: 7, cols: 7, rows: 2 },
|
|
@@ -1235,7 +1235,7 @@ var TOWN_PATH_TILES = [
|
|
|
1235
1235
|
{ col: 12, row: 15, cols: 7, rows: 2 },
|
|
1236
1236
|
{ col: 21, row: 15, cols: 7, rows: 2 }
|
|
1237
1237
|
];
|
|
1238
|
-
var
|
|
1238
|
+
var VILLAGE_WATER_TILES = [
|
|
1239
1239
|
{ col: 0, row: 0, cols: 10, rows: 2 },
|
|
1240
1240
|
{ col: 30, row: 0, cols: 10, rows: 2 },
|
|
1241
1241
|
{ col: 0, row: 22, cols: 11, rows: 2 },
|
|
@@ -1243,13 +1243,13 @@ var TOWN_WATER_TILES = [
|
|
|
1243
1243
|
{ col: 0, row: 2, cols: 2, rows: 5 },
|
|
1244
1244
|
{ col: 38, row: 17, cols: 2, rows: 5 }
|
|
1245
1245
|
];
|
|
1246
|
-
var
|
|
1246
|
+
var VILLAGE_FENCE_TILES = [
|
|
1247
1247
|
{ col: 2, row: 2, cols: 15, rows: 1 },
|
|
1248
1248
|
{ col: 23, row: 2, cols: 15, rows: 1 },
|
|
1249
1249
|
{ col: 2, row: 22, cols: 15, rows: 1 },
|
|
1250
1250
|
{ col: 23, row: 22, cols: 15, rows: 1 }
|
|
1251
1251
|
];
|
|
1252
|
-
var
|
|
1252
|
+
var VILLAGE_BUILDINGS = [
|
|
1253
1253
|
{
|
|
1254
1254
|
col: 1,
|
|
1255
1255
|
row: 3,
|
|
@@ -1343,7 +1343,7 @@ var TOWN_BUILDINGS = [
|
|
|
1343
1343
|
]
|
|
1344
1344
|
}
|
|
1345
1345
|
];
|
|
1346
|
-
var
|
|
1346
|
+
var VILLAGE_TREE_POINTS = [
|
|
1347
1347
|
{ col: 19, row: 2 },
|
|
1348
1348
|
{ col: 20, row: 21 },
|
|
1349
1349
|
{ col: 7, row: 2 },
|
|
@@ -1353,7 +1353,7 @@ var TOWN_TREE_POINTS = [
|
|
|
1353
1353
|
{ col: 17, row: 19 },
|
|
1354
1354
|
{ col: 22, row: 19 }
|
|
1355
1355
|
];
|
|
1356
|
-
var
|
|
1356
|
+
var VILLAGE_SHRUB_POINTS = [
|
|
1357
1357
|
{ col: 16, row: 8 },
|
|
1358
1358
|
{ col: 23, row: 8 },
|
|
1359
1359
|
{ col: 16, row: 15 },
|
|
@@ -1363,7 +1363,7 @@ var TOWN_SHRUB_POINTS = [
|
|
|
1363
1363
|
{ col: 4, row: 22 },
|
|
1364
1364
|
{ col: 35, row: 22 }
|
|
1365
1365
|
];
|
|
1366
|
-
var
|
|
1366
|
+
var VILLAGE_FLOWER_POINTS = [
|
|
1367
1367
|
{ col: 6, row: 11 },
|
|
1368
1368
|
{ col: 11, row: 12 },
|
|
1369
1369
|
{ col: 16, row: 9 },
|
|
@@ -1427,43 +1427,43 @@ function renderGrassTiles() {
|
|
|
1427
1427
|
] }, `grass-${col}-${row}`);
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function renderVillagePath(tile, index) {
|
|
1431
1431
|
const rect2 = tileToRect(tile);
|
|
1432
1432
|
const cobbles = Array.from({ length: tile.cols * tile.rows }, (_, cobbleIndex) => {
|
|
1433
1433
|
const col = tile.col + cobbleIndex % tile.cols;
|
|
1434
1434
|
const row = tile.row + Math.floor(cobbleIndex / tile.cols);
|
|
1435
1435
|
const x = col * TILE_SIZE + ((col + row) % 2 === 0 ? 8 : 22);
|
|
1436
1436
|
const y = row * TILE_SIZE + ((col * 3 + row) % 2 === 0 ? 10 : 24);
|
|
1437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y, width: "8", height: "5", fill: "rgba(134,105,67,0.24)" }, `
|
|
1437
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y, width: "8", height: "5", fill: "rgba(134,105,67,0.24)" }, `village-path-cobble-${index}-${cobbleIndex}`);
|
|
1438
1438
|
});
|
|
1439
1439
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1440
1440
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: rect2.height, fill: "rgba(193,165,104,0.98)" }),
|
|
1441
1441
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: "4", fill: "rgba(116,92,62,0.34)" }),
|
|
1442
1442
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x, y: rect2.y + rect2.height - 4, width: rect2.width, height: "4", fill: "rgba(116,92,62,0.28)" }),
|
|
1443
1443
|
cobbles
|
|
1444
|
-
] }, `
|
|
1444
|
+
] }, `village-path-${index}`);
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1446
|
+
function renderVillageWater(tile, index) {
|
|
1447
1447
|
const rect2 = tileToRect(tile);
|
|
1448
1448
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1449
1449
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: rect2.height, fill: "rgba(82,139,149,0.9)" }),
|
|
1450
1450
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x + 8, y: rect2.y + 10, width: Math.max(12, rect2.width - 16), height: "4", fill: "rgba(160,205,199,0.34)" }),
|
|
1451
1451
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x + 18, y: rect2.y + rect2.height - 14, width: Math.max(18, rect2.width - 48), height: "4", fill: "rgba(53,103,112,0.24)" })
|
|
1452
|
-
] }, `
|
|
1452
|
+
] }, `village-water-${index}`);
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function renderVillageFence(tile, index) {
|
|
1455
1455
|
const rect2 = tileToRect(tile);
|
|
1456
1456
|
const posts = Array.from({ length: tile.cols }, (_, postIndex) => {
|
|
1457
1457
|
const x = rect2.x + postIndex * TILE_SIZE + 16;
|
|
1458
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y: rect2.y + 8, width: "8", height: "24", fill: "rgba(111,78,47,0.88)" }, `
|
|
1458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y: rect2.y + 8, width: "8", height: "24", fill: "rgba(111,78,47,0.88)" }, `village-fence-post-${index}-${postIndex}`);
|
|
1459
1459
|
});
|
|
1460
1460
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1461
1461
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x + 8, y: rect2.y + 15, width: rect2.width - 16, height: "6", fill: "rgba(151,104,61,0.82)" }),
|
|
1462
1462
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x + 8, y: rect2.y + 25, width: rect2.width - 16, height: "5", fill: "rgba(126,88,54,0.7)" }),
|
|
1463
1463
|
posts
|
|
1464
|
-
] }, `
|
|
1464
|
+
] }, `village-fence-${index}`);
|
|
1465
1465
|
}
|
|
1466
|
-
function
|
|
1466
|
+
function renderVillagePlaza() {
|
|
1467
1467
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1468
1468
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TileRectSvg, { tile: { col: 17, row: 9, cols: 6, rows: 6 }, fill: "rgba(211,189,128,0.96)", stroke: "rgba(126,97,58,0.36)" }),
|
|
1469
1469
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TileRectSvg, { tile: { col: 18, row: 10, cols: 4, rows: 4 }, fill: "rgba(232,210,148,0.98)", stroke: "rgba(126,97,58,0.32)" }),
|
|
@@ -1475,7 +1475,7 @@ function renderTownPlaza() {
|
|
|
1475
1475
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "856", y: "436", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" }),
|
|
1476
1476
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "736", y: "556", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" }),
|
|
1477
1477
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: "856", y: "556", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" })
|
|
1478
|
-
] }, "
|
|
1478
|
+
] }, "village-plaza");
|
|
1479
1479
|
}
|
|
1480
1480
|
function renderTree(point, index) {
|
|
1481
1481
|
const x = point.col * TILE_SIZE;
|
|
@@ -1505,7 +1505,7 @@ function renderFlower(point, index) {
|
|
|
1505
1505
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 17, y: y + 26, width: "4", height: "4", fill: "rgba(134,104,218,0.76)" })
|
|
1506
1506
|
] }, `flower-${index}`);
|
|
1507
1507
|
}
|
|
1508
|
-
function
|
|
1508
|
+
function renderVillageProp(prop, index) {
|
|
1509
1509
|
const rect2 = tileToRect(prop);
|
|
1510
1510
|
const x = rect2.x + 6;
|
|
1511
1511
|
const y = rect2.y + 7;
|
|
@@ -1514,33 +1514,33 @@ function renderTownProp(prop, index) {
|
|
|
1514
1514
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y, width: "28", height: "24", fill: "rgba(178,112,68,0.88)" }),
|
|
1515
1515
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 4, y: y + 4, width: "20", height: "8", fill: "rgba(249,209,122,0.9)" }),
|
|
1516
1516
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 4, y: y + 14, width: "20", height: "7", fill: "rgba(208,94,67,0.78)" })
|
|
1517
|
-
] }, `
|
|
1517
|
+
] }, `village-prop-${index}`);
|
|
1518
1518
|
}
|
|
1519
1519
|
if (prop.kind === "shelf") {
|
|
1520
1520
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1521
1521
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y, width: Math.max(24, rect2.width - 12), height: "9", fill: "rgba(124,83,56,0.92)" }),
|
|
1522
1522
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y: y + 12, width: Math.max(24, rect2.width - 12), height: "9", fill: "rgba(124,83,56,0.84)" }),
|
|
1523
1523
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 5, y: y + 3, width: "5", height: "4", fill: "rgba(229,195,96,0.9)" })
|
|
1524
|
-
] }, `
|
|
1524
|
+
] }, `village-prop-${index}`);
|
|
1525
1525
|
}
|
|
1526
1526
|
if (prop.kind === "table") {
|
|
1527
1527
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1528
1528
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 3, y: y + 5, width: Math.max(28, rect2.width - 18), height: "18", fill: "rgba(156,103,64,0.92)" }),
|
|
1529
1529
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 8, y: y + 9, width: "6", height: "6", fill: "rgba(236,226,188,0.9)" })
|
|
1530
|
-
] }, `
|
|
1530
|
+
] }, `village-prop-${index}`);
|
|
1531
1531
|
}
|
|
1532
1532
|
if (prop.kind === "sofa") {
|
|
1533
1533
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1534
1534
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y: y + 4, width: "26", height: "19", fill: "rgba(99,143,178,0.88)" }),
|
|
1535
1535
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 4, y: y + 8, width: "18", height: "7", fill: "rgba(145,185,211,0.9)" })
|
|
1536
|
-
] }, `
|
|
1536
|
+
] }, `village-prop-${index}`);
|
|
1537
1537
|
}
|
|
1538
1538
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { children: [
|
|
1539
1539
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x, y: y + 4, width: "26", height: "16", fill: "rgba(124,83,56,0.92)" }),
|
|
1540
1540
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: x + 4, y, width: "18", height: "8", fill: "rgba(194,214,221,0.9)" })
|
|
1541
|
-
] }, `
|
|
1541
|
+
] }, `village-prop-${index}`);
|
|
1542
1542
|
}
|
|
1543
|
-
function
|
|
1543
|
+
function renderVillageBuilding(building, activeZoneId) {
|
|
1544
1544
|
const rect2 = tileToRect(building);
|
|
1545
1545
|
const active = building.zoneId === activeZoneId;
|
|
1546
1546
|
const doorX = rect2.x + rect2.width / 2 - 24;
|
|
@@ -1583,9 +1583,9 @@ function renderTownBuilding(building, activeZoneId) {
|
|
|
1583
1583
|
}),
|
|
1584
1584
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: doorX, y: doorY, width: "48", height: "16", fill: "rgba(226,204,139,0.98)" }),
|
|
1585
1585
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: doorX + 8, y: doorY + 4, width: "32", height: "8", fill: "rgba(91,65,44,0.55)" }),
|
|
1586
|
-
building.props.map(
|
|
1586
|
+
building.props.map(renderVillageProp),
|
|
1587
1587
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: rect2.x - 8, y: rect2.y - 8, width: rect2.width + 16, height: rect2.height + 16, fill: "none", stroke: active ? ZONE_PIXEL_PALETTE[building.zoneId].stroke : "rgba(17,17,19,0.34)", strokeWidth: active ? 5 : 3 })
|
|
1588
|
-
] }, `
|
|
1588
|
+
] }, `village-building-${building.zoneId}`);
|
|
1589
1589
|
}
|
|
1590
1590
|
function PixelAtlasMap(props) {
|
|
1591
1591
|
const activeZoneId = props.zones.find((zone) => zone.active)?.id;
|
|
@@ -1600,16 +1600,16 @@ function PixelAtlasMap(props) {
|
|
|
1600
1600
|
children: [
|
|
1601
1601
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("rect", { x: 0, y: 0, width: STAGE_WIDTH, height: STAGE_HEIGHT, fill: "rgba(247,244,236,0.98)" }),
|
|
1602
1602
|
renderGrassTiles(),
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1603
|
+
VILLAGE_WATER_TILES.map(renderVillageWater),
|
|
1604
|
+
VILLAGE_PATH_TILES.map(renderVillagePath),
|
|
1605
|
+
renderVillagePlaza(),
|
|
1606
|
+
VILLAGE_FENCE_TILES.map(renderVillageFence),
|
|
1607
|
+
VILLAGE_SHRUB_POINTS.map(renderShrub),
|
|
1608
|
+
VILLAGE_TREE_POINTS.map(renderTree),
|
|
1609
|
+
VILLAGE_FLOWER_POINTS.map(renderFlower),
|
|
1610
|
+
VILLAGE_BUILDINGS.map((building) => renderVillageBuilding(building, activeZoneId)),
|
|
1611
1611
|
props.zones.map((zone) => {
|
|
1612
|
-
const building =
|
|
1612
|
+
const building = VILLAGE_BUILDINGS.find((item) => item.zoneId === zone.id);
|
|
1613
1613
|
if (!building) return null;
|
|
1614
1614
|
const layout = WORKBOARD_ZONE_LAYOUT[zone.id];
|
|
1615
1615
|
const active = zone.active;
|
|
@@ -2373,8 +2373,8 @@ function buildOverviewPatrolRoute(params) {
|
|
|
2373
2373
|
const laneOffset = (laneIndex - 1) * 10;
|
|
2374
2374
|
const roadY = params.zoneId === "engaged" || params.zoneId === "steady" ? 460 : 500;
|
|
2375
2375
|
const plazaLane = {
|
|
2376
|
-
x:
|
|
2377
|
-
y:
|
|
2376
|
+
x: WORKBOARD_VILLAGE_PLAZA_POINT.x + laneOffset,
|
|
2377
|
+
y: WORKBOARD_VILLAGE_PLAZA_POINT.y + (roadY < WORKBOARD_VILLAGE_PLAZA_POINT.y ? -10 : 10)
|
|
2378
2378
|
};
|
|
2379
2379
|
return [
|
|
2380
2380
|
anchor,
|
|
@@ -2385,7 +2385,7 @@ function buildOverviewPatrolRoute(params) {
|
|
|
2385
2385
|
{ x: city.x, y: roadY },
|
|
2386
2386
|
{ x: plazaLane.x, y: roadY },
|
|
2387
2387
|
plazaLane,
|
|
2388
|
-
|
|
2388
|
+
WORKBOARD_VILLAGE_PLAZA_POINT,
|
|
2389
2389
|
plazaLane,
|
|
2390
2390
|
{ x: plazaLane.x, y: roadY },
|
|
2391
2391
|
{ x: city.x, y: roadY },
|
package/dist/index.js
CHANGED
|
@@ -1081,7 +1081,7 @@ var GRID_COLS = 40;
|
|
|
1081
1081
|
var GRID_ROWS = 24;
|
|
1082
1082
|
var STAGE_WIDTH = TILE_SIZE * GRID_COLS;
|
|
1083
1083
|
var STAGE_HEIGHT = TILE_SIZE * GRID_ROWS;
|
|
1084
|
-
var
|
|
1084
|
+
var WORKBOARD_VILLAGE_PLAZA_POINT = { x: 800, y: 480 };
|
|
1085
1085
|
var WORKBOARD_ZONE_GATE_POINTS = {
|
|
1086
1086
|
engaged: { x: 560, y: 400 },
|
|
1087
1087
|
steady: { x: 1040, y: 400 },
|
|
@@ -1124,7 +1124,7 @@ var ZONE_PIXEL_PALETTE = {
|
|
|
1124
1124
|
shadow: "rgba(146,78,28,0.2)"
|
|
1125
1125
|
}
|
|
1126
1126
|
};
|
|
1127
|
-
var
|
|
1127
|
+
var VILLAGE_PATH_TILES = [
|
|
1128
1128
|
{ col: 0, row: 10, cols: 40, rows: 4 },
|
|
1129
1129
|
{ col: 19, row: 0, cols: 2, rows: 24 },
|
|
1130
1130
|
{ col: 12, row: 7, cols: 7, rows: 2 },
|
|
@@ -1132,7 +1132,7 @@ var TOWN_PATH_TILES = [
|
|
|
1132
1132
|
{ col: 12, row: 15, cols: 7, rows: 2 },
|
|
1133
1133
|
{ col: 21, row: 15, cols: 7, rows: 2 }
|
|
1134
1134
|
];
|
|
1135
|
-
var
|
|
1135
|
+
var VILLAGE_WATER_TILES = [
|
|
1136
1136
|
{ col: 0, row: 0, cols: 10, rows: 2 },
|
|
1137
1137
|
{ col: 30, row: 0, cols: 10, rows: 2 },
|
|
1138
1138
|
{ col: 0, row: 22, cols: 11, rows: 2 },
|
|
@@ -1140,13 +1140,13 @@ var TOWN_WATER_TILES = [
|
|
|
1140
1140
|
{ col: 0, row: 2, cols: 2, rows: 5 },
|
|
1141
1141
|
{ col: 38, row: 17, cols: 2, rows: 5 }
|
|
1142
1142
|
];
|
|
1143
|
-
var
|
|
1143
|
+
var VILLAGE_FENCE_TILES = [
|
|
1144
1144
|
{ col: 2, row: 2, cols: 15, rows: 1 },
|
|
1145
1145
|
{ col: 23, row: 2, cols: 15, rows: 1 },
|
|
1146
1146
|
{ col: 2, row: 22, cols: 15, rows: 1 },
|
|
1147
1147
|
{ col: 23, row: 22, cols: 15, rows: 1 }
|
|
1148
1148
|
];
|
|
1149
|
-
var
|
|
1149
|
+
var VILLAGE_BUILDINGS = [
|
|
1150
1150
|
{
|
|
1151
1151
|
col: 1,
|
|
1152
1152
|
row: 3,
|
|
@@ -1240,7 +1240,7 @@ var TOWN_BUILDINGS = [
|
|
|
1240
1240
|
]
|
|
1241
1241
|
}
|
|
1242
1242
|
];
|
|
1243
|
-
var
|
|
1243
|
+
var VILLAGE_TREE_POINTS = [
|
|
1244
1244
|
{ col: 19, row: 2 },
|
|
1245
1245
|
{ col: 20, row: 21 },
|
|
1246
1246
|
{ col: 7, row: 2 },
|
|
@@ -1250,7 +1250,7 @@ var TOWN_TREE_POINTS = [
|
|
|
1250
1250
|
{ col: 17, row: 19 },
|
|
1251
1251
|
{ col: 22, row: 19 }
|
|
1252
1252
|
];
|
|
1253
|
-
var
|
|
1253
|
+
var VILLAGE_SHRUB_POINTS = [
|
|
1254
1254
|
{ col: 16, row: 8 },
|
|
1255
1255
|
{ col: 23, row: 8 },
|
|
1256
1256
|
{ col: 16, row: 15 },
|
|
@@ -1260,7 +1260,7 @@ var TOWN_SHRUB_POINTS = [
|
|
|
1260
1260
|
{ col: 4, row: 22 },
|
|
1261
1261
|
{ col: 35, row: 22 }
|
|
1262
1262
|
];
|
|
1263
|
-
var
|
|
1263
|
+
var VILLAGE_FLOWER_POINTS = [
|
|
1264
1264
|
{ col: 6, row: 11 },
|
|
1265
1265
|
{ col: 11, row: 12 },
|
|
1266
1266
|
{ col: 16, row: 9 },
|
|
@@ -1324,43 +1324,43 @@ function renderGrassTiles() {
|
|
|
1324
1324
|
] }, `grass-${col}-${row}`);
|
|
1325
1325
|
});
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function renderVillagePath(tile, index) {
|
|
1328
1328
|
const rect2 = tileToRect(tile);
|
|
1329
1329
|
const cobbles = Array.from({ length: tile.cols * tile.rows }, (_, cobbleIndex) => {
|
|
1330
1330
|
const col = tile.col + cobbleIndex % tile.cols;
|
|
1331
1331
|
const row = tile.row + Math.floor(cobbleIndex / tile.cols);
|
|
1332
1332
|
const x = col * TILE_SIZE + ((col + row) % 2 === 0 ? 8 : 22);
|
|
1333
1333
|
const y = row * TILE_SIZE + ((col * 3 + row) % 2 === 0 ? 10 : 24);
|
|
1334
|
-
return /* @__PURE__ */ jsx18("rect", { x, y, width: "8", height: "5", fill: "rgba(134,105,67,0.24)" }, `
|
|
1334
|
+
return /* @__PURE__ */ jsx18("rect", { x, y, width: "8", height: "5", fill: "rgba(134,105,67,0.24)" }, `village-path-cobble-${index}-${cobbleIndex}`);
|
|
1335
1335
|
});
|
|
1336
1336
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1337
1337
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: rect2.height, fill: "rgba(193,165,104,0.98)" }),
|
|
1338
1338
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: "4", fill: "rgba(116,92,62,0.34)" }),
|
|
1339
1339
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x, y: rect2.y + rect2.height - 4, width: rect2.width, height: "4", fill: "rgba(116,92,62,0.28)" }),
|
|
1340
1340
|
cobbles
|
|
1341
|
-
] }, `
|
|
1341
|
+
] }, `village-path-${index}`);
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function renderVillageWater(tile, index) {
|
|
1344
1344
|
const rect2 = tileToRect(tile);
|
|
1345
1345
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1346
1346
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x, y: rect2.y, width: rect2.width, height: rect2.height, fill: "rgba(82,139,149,0.9)" }),
|
|
1347
1347
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x + 8, y: rect2.y + 10, width: Math.max(12, rect2.width - 16), height: "4", fill: "rgba(160,205,199,0.34)" }),
|
|
1348
1348
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x + 18, y: rect2.y + rect2.height - 14, width: Math.max(18, rect2.width - 48), height: "4", fill: "rgba(53,103,112,0.24)" })
|
|
1349
|
-
] }, `
|
|
1349
|
+
] }, `village-water-${index}`);
|
|
1350
1350
|
}
|
|
1351
|
-
function
|
|
1351
|
+
function renderVillageFence(tile, index) {
|
|
1352
1352
|
const rect2 = tileToRect(tile);
|
|
1353
1353
|
const posts = Array.from({ length: tile.cols }, (_, postIndex) => {
|
|
1354
1354
|
const x = rect2.x + postIndex * TILE_SIZE + 16;
|
|
1355
|
-
return /* @__PURE__ */ jsx18("rect", { x, y: rect2.y + 8, width: "8", height: "24", fill: "rgba(111,78,47,0.88)" }, `
|
|
1355
|
+
return /* @__PURE__ */ jsx18("rect", { x, y: rect2.y + 8, width: "8", height: "24", fill: "rgba(111,78,47,0.88)" }, `village-fence-post-${index}-${postIndex}`);
|
|
1356
1356
|
});
|
|
1357
1357
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1358
1358
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x + 8, y: rect2.y + 15, width: rect2.width - 16, height: "6", fill: "rgba(151,104,61,0.82)" }),
|
|
1359
1359
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x + 8, y: rect2.y + 25, width: rect2.width - 16, height: "5", fill: "rgba(126,88,54,0.7)" }),
|
|
1360
1360
|
posts
|
|
1361
|
-
] }, `
|
|
1361
|
+
] }, `village-fence-${index}`);
|
|
1362
1362
|
}
|
|
1363
|
-
function
|
|
1363
|
+
function renderVillagePlaza() {
|
|
1364
1364
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1365
1365
|
/* @__PURE__ */ jsx18(TileRectSvg, { tile: { col: 17, row: 9, cols: 6, rows: 6 }, fill: "rgba(211,189,128,0.96)", stroke: "rgba(126,97,58,0.36)" }),
|
|
1366
1366
|
/* @__PURE__ */ jsx18(TileRectSvg, { tile: { col: 18, row: 10, cols: 4, rows: 4 }, fill: "rgba(232,210,148,0.98)", stroke: "rgba(126,97,58,0.32)" }),
|
|
@@ -1372,7 +1372,7 @@ function renderTownPlaza() {
|
|
|
1372
1372
|
/* @__PURE__ */ jsx18("rect", { x: "856", y: "436", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" }),
|
|
1373
1373
|
/* @__PURE__ */ jsx18("rect", { x: "736", y: "556", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" }),
|
|
1374
1374
|
/* @__PURE__ */ jsx18("rect", { x: "856", y: "556", width: "8", height: "8", fill: "rgba(238,228,183,0.9)" })
|
|
1375
|
-
] }, "
|
|
1375
|
+
] }, "village-plaza");
|
|
1376
1376
|
}
|
|
1377
1377
|
function renderTree(point, index) {
|
|
1378
1378
|
const x = point.col * TILE_SIZE;
|
|
@@ -1402,7 +1402,7 @@ function renderFlower(point, index) {
|
|
|
1402
1402
|
/* @__PURE__ */ jsx18("rect", { x: x + 17, y: y + 26, width: "4", height: "4", fill: "rgba(134,104,218,0.76)" })
|
|
1403
1403
|
] }, `flower-${index}`);
|
|
1404
1404
|
}
|
|
1405
|
-
function
|
|
1405
|
+
function renderVillageProp(prop, index) {
|
|
1406
1406
|
const rect2 = tileToRect(prop);
|
|
1407
1407
|
const x = rect2.x + 6;
|
|
1408
1408
|
const y = rect2.y + 7;
|
|
@@ -1411,33 +1411,33 @@ function renderTownProp(prop, index) {
|
|
|
1411
1411
|
/* @__PURE__ */ jsx18("rect", { x, y, width: "28", height: "24", fill: "rgba(178,112,68,0.88)" }),
|
|
1412
1412
|
/* @__PURE__ */ jsx18("rect", { x: x + 4, y: y + 4, width: "20", height: "8", fill: "rgba(249,209,122,0.9)" }),
|
|
1413
1413
|
/* @__PURE__ */ jsx18("rect", { x: x + 4, y: y + 14, width: "20", height: "7", fill: "rgba(208,94,67,0.78)" })
|
|
1414
|
-
] }, `
|
|
1414
|
+
] }, `village-prop-${index}`);
|
|
1415
1415
|
}
|
|
1416
1416
|
if (prop.kind === "shelf") {
|
|
1417
1417
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1418
1418
|
/* @__PURE__ */ jsx18("rect", { x, y, width: Math.max(24, rect2.width - 12), height: "9", fill: "rgba(124,83,56,0.92)" }),
|
|
1419
1419
|
/* @__PURE__ */ jsx18("rect", { x, y: y + 12, width: Math.max(24, rect2.width - 12), height: "9", fill: "rgba(124,83,56,0.84)" }),
|
|
1420
1420
|
/* @__PURE__ */ jsx18("rect", { x: x + 5, y: y + 3, width: "5", height: "4", fill: "rgba(229,195,96,0.9)" })
|
|
1421
|
-
] }, `
|
|
1421
|
+
] }, `village-prop-${index}`);
|
|
1422
1422
|
}
|
|
1423
1423
|
if (prop.kind === "table") {
|
|
1424
1424
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1425
1425
|
/* @__PURE__ */ jsx18("rect", { x: x + 3, y: y + 5, width: Math.max(28, rect2.width - 18), height: "18", fill: "rgba(156,103,64,0.92)" }),
|
|
1426
1426
|
/* @__PURE__ */ jsx18("rect", { x: x + 8, y: y + 9, width: "6", height: "6", fill: "rgba(236,226,188,0.9)" })
|
|
1427
|
-
] }, `
|
|
1427
|
+
] }, `village-prop-${index}`);
|
|
1428
1428
|
}
|
|
1429
1429
|
if (prop.kind === "sofa") {
|
|
1430
1430
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1431
1431
|
/* @__PURE__ */ jsx18("rect", { x, y: y + 4, width: "26", height: "19", fill: "rgba(99,143,178,0.88)" }),
|
|
1432
1432
|
/* @__PURE__ */ jsx18("rect", { x: x + 4, y: y + 8, width: "18", height: "7", fill: "rgba(145,185,211,0.9)" })
|
|
1433
|
-
] }, `
|
|
1433
|
+
] }, `village-prop-${index}`);
|
|
1434
1434
|
}
|
|
1435
1435
|
return /* @__PURE__ */ jsxs5("g", { children: [
|
|
1436
1436
|
/* @__PURE__ */ jsx18("rect", { x, y: y + 4, width: "26", height: "16", fill: "rgba(124,83,56,0.92)" }),
|
|
1437
1437
|
/* @__PURE__ */ jsx18("rect", { x: x + 4, y, width: "18", height: "8", fill: "rgba(194,214,221,0.9)" })
|
|
1438
|
-
] }, `
|
|
1438
|
+
] }, `village-prop-${index}`);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1440
|
+
function renderVillageBuilding(building, activeZoneId) {
|
|
1441
1441
|
const rect2 = tileToRect(building);
|
|
1442
1442
|
const active = building.zoneId === activeZoneId;
|
|
1443
1443
|
const doorX = rect2.x + rect2.width / 2 - 24;
|
|
@@ -1480,9 +1480,9 @@ function renderTownBuilding(building, activeZoneId) {
|
|
|
1480
1480
|
}),
|
|
1481
1481
|
/* @__PURE__ */ jsx18("rect", { x: doorX, y: doorY, width: "48", height: "16", fill: "rgba(226,204,139,0.98)" }),
|
|
1482
1482
|
/* @__PURE__ */ jsx18("rect", { x: doorX + 8, y: doorY + 4, width: "32", height: "8", fill: "rgba(91,65,44,0.55)" }),
|
|
1483
|
-
building.props.map(
|
|
1483
|
+
building.props.map(renderVillageProp),
|
|
1484
1484
|
/* @__PURE__ */ jsx18("rect", { x: rect2.x - 8, y: rect2.y - 8, width: rect2.width + 16, height: rect2.height + 16, fill: "none", stroke: active ? ZONE_PIXEL_PALETTE[building.zoneId].stroke : "rgba(17,17,19,0.34)", strokeWidth: active ? 5 : 3 })
|
|
1485
|
-
] }, `
|
|
1485
|
+
] }, `village-building-${building.zoneId}`);
|
|
1486
1486
|
}
|
|
1487
1487
|
function PixelAtlasMap(props) {
|
|
1488
1488
|
const activeZoneId = props.zones.find((zone) => zone.active)?.id;
|
|
@@ -1497,16 +1497,16 @@ function PixelAtlasMap(props) {
|
|
|
1497
1497
|
children: [
|
|
1498
1498
|
/* @__PURE__ */ jsx18("rect", { x: 0, y: 0, width: STAGE_WIDTH, height: STAGE_HEIGHT, fill: "rgba(247,244,236,0.98)" }),
|
|
1499
1499
|
renderGrassTiles(),
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1500
|
+
VILLAGE_WATER_TILES.map(renderVillageWater),
|
|
1501
|
+
VILLAGE_PATH_TILES.map(renderVillagePath),
|
|
1502
|
+
renderVillagePlaza(),
|
|
1503
|
+
VILLAGE_FENCE_TILES.map(renderVillageFence),
|
|
1504
|
+
VILLAGE_SHRUB_POINTS.map(renderShrub),
|
|
1505
|
+
VILLAGE_TREE_POINTS.map(renderTree),
|
|
1506
|
+
VILLAGE_FLOWER_POINTS.map(renderFlower),
|
|
1507
|
+
VILLAGE_BUILDINGS.map((building) => renderVillageBuilding(building, activeZoneId)),
|
|
1508
1508
|
props.zones.map((zone) => {
|
|
1509
|
-
const building =
|
|
1509
|
+
const building = VILLAGE_BUILDINGS.find((item) => item.zoneId === zone.id);
|
|
1510
1510
|
if (!building) return null;
|
|
1511
1511
|
const layout = WORKBOARD_ZONE_LAYOUT[zone.id];
|
|
1512
1512
|
const active = zone.active;
|
|
@@ -2270,8 +2270,8 @@ function buildOverviewPatrolRoute(params) {
|
|
|
2270
2270
|
const laneOffset = (laneIndex - 1) * 10;
|
|
2271
2271
|
const roadY = params.zoneId === "engaged" || params.zoneId === "steady" ? 460 : 500;
|
|
2272
2272
|
const plazaLane = {
|
|
2273
|
-
x:
|
|
2274
|
-
y:
|
|
2273
|
+
x: WORKBOARD_VILLAGE_PLAZA_POINT.x + laneOffset,
|
|
2274
|
+
y: WORKBOARD_VILLAGE_PLAZA_POINT.y + (roadY < WORKBOARD_VILLAGE_PLAZA_POINT.y ? -10 : 10)
|
|
2275
2275
|
};
|
|
2276
2276
|
return [
|
|
2277
2277
|
anchor,
|
|
@@ -2282,7 +2282,7 @@ function buildOverviewPatrolRoute(params) {
|
|
|
2282
2282
|
{ x: city.x, y: roadY },
|
|
2283
2283
|
{ x: plazaLane.x, y: roadY },
|
|
2284
2284
|
plazaLane,
|
|
2285
|
-
|
|
2285
|
+
WORKBOARD_VILLAGE_PLAZA_POINT,
|
|
2286
2286
|
plazaLane,
|
|
2287
2287
|
{ x: plazaLane.x, y: roadY },
|
|
2288
2288
|
{ x: city.x, y: roadY },
|