@almadar/ui 5.56.0 → 5.57.0
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/avl/index.cjs +189 -52
- package/dist/avl/index.js +189 -52
- package/dist/components/game/molecules/three/index.cjs +1 -2
- package/dist/components/game/molecules/three/index.js +1 -2
- package/dist/components/index.cjs +189 -52
- package/dist/components/index.js +189 -52
- package/dist/providers/index.cjs +189 -52
- package/dist/providers/index.js +189 -52
- package/dist/runtime/index.cjs +189 -52
- package/dist/runtime/index.js +189 -52
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -10498,13 +10498,29 @@ var init_boardEntity = __esm({
|
|
|
10498
10498
|
"components/game/organisms/boardEntity.ts"() {
|
|
10499
10499
|
}
|
|
10500
10500
|
});
|
|
10501
|
+
function buildDefaultBattleTiles() {
|
|
10502
|
+
const tiles = [];
|
|
10503
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
10504
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
10505
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
10506
|
+
tiles.push({
|
|
10507
|
+
x,
|
|
10508
|
+
y,
|
|
10509
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
10510
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
10511
|
+
passable: true
|
|
10512
|
+
});
|
|
10513
|
+
}
|
|
10514
|
+
}
|
|
10515
|
+
return tiles;
|
|
10516
|
+
}
|
|
10501
10517
|
function BattleBoard({
|
|
10502
10518
|
entity,
|
|
10503
10519
|
tiles: propTiles,
|
|
10504
10520
|
units: propUnits,
|
|
10505
10521
|
features: propFeatures,
|
|
10506
10522
|
assetManifest: propAssetManifest,
|
|
10507
|
-
scale = 0.
|
|
10523
|
+
scale = 0.25,
|
|
10508
10524
|
unitScale = 1,
|
|
10509
10525
|
spriteHeightRatio = 1.5,
|
|
10510
10526
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -10531,10 +10547,11 @@ function BattleBoard({
|
|
|
10531
10547
|
className
|
|
10532
10548
|
}) {
|
|
10533
10549
|
const board = boardEntity(entity) ?? {};
|
|
10534
|
-
const
|
|
10550
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
10551
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
10535
10552
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
10536
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
10537
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
10553
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
10554
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
10538
10555
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
10539
10556
|
const backgroundImage = board.backgroundImage;
|
|
10540
10557
|
const units = rows(board.units);
|
|
@@ -10856,6 +10873,7 @@ function BattleBoard({
|
|
|
10856
10873
|
] }) }))
|
|
10857
10874
|
] });
|
|
10858
10875
|
}
|
|
10876
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
10859
10877
|
var init_BattleBoard = __esm({
|
|
10860
10878
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
10861
10879
|
"use client";
|
|
@@ -10868,6 +10886,17 @@ var init_BattleBoard = __esm({
|
|
|
10868
10886
|
init_IsometricCanvas();
|
|
10869
10887
|
init_boardEntity();
|
|
10870
10888
|
init_isometric();
|
|
10889
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
10890
|
+
BATTLE_GRID_W = 16;
|
|
10891
|
+
BATTLE_GRID_H = 16;
|
|
10892
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
10893
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
10894
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
10895
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
10896
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
10897
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
10898
|
+
];
|
|
10899
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
10871
10900
|
BattleBoard.displayName = "BattleBoard";
|
|
10872
10901
|
}
|
|
10873
10902
|
});
|
|
@@ -10875,7 +10904,7 @@ function BattleTemplate({
|
|
|
10875
10904
|
entity,
|
|
10876
10905
|
scale = 0.45,
|
|
10877
10906
|
unitScale = 1,
|
|
10878
|
-
tiles =
|
|
10907
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
10879
10908
|
units = DEFAULT_BATTLE_UNITS,
|
|
10880
10909
|
features = DEFAULT_BATTLE_FEATURES,
|
|
10881
10910
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -10904,12 +10933,12 @@ function BattleTemplate({
|
|
|
10904
10933
|
}
|
|
10905
10934
|
);
|
|
10906
10935
|
}
|
|
10907
|
-
var CDN,
|
|
10936
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
10908
10937
|
var init_BattleTemplate = __esm({
|
|
10909
10938
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
10910
10939
|
init_BattleBoard();
|
|
10911
10940
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
10912
|
-
|
|
10941
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
10913
10942
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
10914
10943
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
10915
10944
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -42887,7 +42916,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42887
42916
|
selectedTileIds = [],
|
|
42888
42917
|
selectedUnitId = null,
|
|
42889
42918
|
unitScale = 1,
|
|
42890
|
-
scale = 0.45,
|
|
42891
42919
|
children
|
|
42892
42920
|
}, ref) => {
|
|
42893
42921
|
const containerRef = useRef(null);
|
|
@@ -43334,7 +43362,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
43334
43362
|
fadeStrength: 1
|
|
43335
43363
|
}
|
|
43336
43364
|
),
|
|
43337
|
-
/* @__PURE__ */ jsxs("group", {
|
|
43365
|
+
/* @__PURE__ */ jsxs("group", { children: [
|
|
43338
43366
|
tiles.map((tile, index) => {
|
|
43339
43367
|
const position = gridToWorld(
|
|
43340
43368
|
tile.x,
|
|
@@ -45651,6 +45679,35 @@ var init_ResourceCounter = __esm({
|
|
|
45651
45679
|
ResourceCounter.displayName = "ResourceCounter";
|
|
45652
45680
|
}
|
|
45653
45681
|
});
|
|
45682
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
45683
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
45684
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
45685
|
+
const isWall = isBorder || isPillar;
|
|
45686
|
+
if (x === stairsX && y === stairsY) {
|
|
45687
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
45688
|
+
}
|
|
45689
|
+
if (isWall) {
|
|
45690
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
45691
|
+
}
|
|
45692
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
45693
|
+
const sprites = [
|
|
45694
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
45695
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
45696
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
45697
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
45698
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
45699
|
+
];
|
|
45700
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
45701
|
+
}
|
|
45702
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
45703
|
+
const tiles = [];
|
|
45704
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
45705
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
45706
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
45707
|
+
}
|
|
45708
|
+
}
|
|
45709
|
+
return tiles;
|
|
45710
|
+
}
|
|
45654
45711
|
function RoguelikeBoard({
|
|
45655
45712
|
entity,
|
|
45656
45713
|
tiles: propTiles,
|
|
@@ -45666,7 +45723,7 @@ function RoguelikeBoard({
|
|
|
45666
45723
|
stairsX: propStairsX,
|
|
45667
45724
|
stairsY: propStairsY,
|
|
45668
45725
|
assetManifest: propAssetManifest,
|
|
45669
|
-
scale = 0.
|
|
45726
|
+
scale = 0.25,
|
|
45670
45727
|
unitScale = 1,
|
|
45671
45728
|
spriteHeightRatio = 1.5,
|
|
45672
45729
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -45676,7 +45733,9 @@ function RoguelikeBoard({
|
|
|
45676
45733
|
className
|
|
45677
45734
|
}) {
|
|
45678
45735
|
const board = boardEntity(entity) ?? {};
|
|
45679
|
-
const
|
|
45736
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
45737
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
45738
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
45680
45739
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
45681
45740
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
45682
45741
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -45686,8 +45745,8 @@ function RoguelikeBoard({
|
|
|
45686
45745
|
const depth = propDepth ?? num(board.depth, 1);
|
|
45687
45746
|
const result = propResult ?? (str(board.result) || "none");
|
|
45688
45747
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
45689
|
-
propStairsX ?? num(board.stairsX,
|
|
45690
|
-
propStairsY ?? num(board.stairsY,
|
|
45748
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
45749
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
45691
45750
|
const eventBus = useEventBus();
|
|
45692
45751
|
const { t } = useTranslate();
|
|
45693
45752
|
const [hoveredTile, setHoveredTile] = useState(null);
|
|
@@ -45863,7 +45922,7 @@ function RoguelikeBoard({
|
|
|
45863
45922
|
] }) })
|
|
45864
45923
|
] });
|
|
45865
45924
|
}
|
|
45866
|
-
var CDN4,
|
|
45925
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
45867
45926
|
var init_RoguelikeBoard = __esm({
|
|
45868
45927
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
45869
45928
|
"use client";
|
|
@@ -45876,39 +45935,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
45876
45935
|
init_IsometricCanvas();
|
|
45877
45936
|
init_boardEntity();
|
|
45878
45937
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
45879
|
-
|
|
45880
|
-
|
|
45881
|
-
|
|
45882
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45883
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45884
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45885
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45886
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45887
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45888
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45889
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45890
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45891
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45892
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45893
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45894
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45895
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45896
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45897
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45898
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
45899
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45900
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45901
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45902
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45903
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45904
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
45905
|
-
];
|
|
45938
|
+
DUNGEON_GRID_W = 16;
|
|
45939
|
+
DUNGEON_GRID_H = 16;
|
|
45940
|
+
buildDefaultDungeonTiles(14, 14);
|
|
45906
45941
|
DEFAULT_ENEMIES = [
|
|
45907
|
-
{ id: "e1", x:
|
|
45908
|
-
{ id: "e2", x:
|
|
45942
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
45943
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
45944
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
45945
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
45909
45946
|
];
|
|
45910
45947
|
DEFAULT_ITEMS = [
|
|
45911
|
-
{ id: "i1", x:
|
|
45948
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
45949
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
45950
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
45912
45951
|
];
|
|
45913
45952
|
FEATURE_SPRITE = {
|
|
45914
45953
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -50357,6 +50396,22 @@ var init_ToastSlot = __esm({
|
|
|
50357
50396
|
ToastSlot.displayName = "ToastSlot";
|
|
50358
50397
|
}
|
|
50359
50398
|
});
|
|
50399
|
+
function buildDefaultTDTiles() {
|
|
50400
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
50401
|
+
const tiles = [];
|
|
50402
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
50403
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
50404
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
50405
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
50406
|
+
} else {
|
|
50407
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
50408
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
50409
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
50410
|
+
}
|
|
50411
|
+
}
|
|
50412
|
+
}
|
|
50413
|
+
return tiles;
|
|
50414
|
+
}
|
|
50360
50415
|
function tilesToIso(tiles) {
|
|
50361
50416
|
return tiles.map((t) => ({
|
|
50362
50417
|
x: t.x,
|
|
@@ -50412,7 +50467,7 @@ function TowerDefenseBoard({
|
|
|
50412
50467
|
result: propResult,
|
|
50413
50468
|
waveActive: propWaveActive,
|
|
50414
50469
|
towerCost = 25,
|
|
50415
|
-
scale = 0.
|
|
50470
|
+
scale = 0.25,
|
|
50416
50471
|
unitScale = 1,
|
|
50417
50472
|
spriteHeightRatio = 1.5,
|
|
50418
50473
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -50425,8 +50480,10 @@ function TowerDefenseBoard({
|
|
|
50425
50480
|
const board = boardEntity(entity) ?? {};
|
|
50426
50481
|
const eventBus = useEventBus();
|
|
50427
50482
|
const { t } = useTranslate();
|
|
50428
|
-
const
|
|
50429
|
-
const
|
|
50483
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
50484
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
50485
|
+
const rawPath = propPath ?? rows(board.path);
|
|
50486
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
50430
50487
|
const towers = propTowers ?? rows(board.towers);
|
|
50431
50488
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
50432
50489
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -50556,7 +50613,7 @@ function TowerDefenseBoard({
|
|
|
50556
50613
|
] }) })
|
|
50557
50614
|
] });
|
|
50558
50615
|
}
|
|
50559
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
50616
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
50560
50617
|
var init_TowerDefenseBoard = __esm({
|
|
50561
50618
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
50562
50619
|
"use client";
|
|
@@ -50569,11 +50626,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
50569
50626
|
init_IsometricCanvas();
|
|
50570
50627
|
init_boardEntity();
|
|
50571
50628
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
50629
|
+
TD_GRID_W = 16;
|
|
50630
|
+
TD_GRID_H = 16;
|
|
50572
50631
|
TERRAIN_SPRITES = {
|
|
50573
50632
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
50574
50633
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
50575
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
50576
|
-
|
|
50634
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
50635
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
50636
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
50637
|
+
};
|
|
50638
|
+
DEFAULT_TD_PATH = [
|
|
50639
|
+
{ x: 2, y: 0 },
|
|
50640
|
+
{ x: 2, y: 1 },
|
|
50641
|
+
{ x: 2, y: 2 },
|
|
50642
|
+
{ x: 2, y: 3 },
|
|
50643
|
+
{ x: 3, y: 3 },
|
|
50644
|
+
{ x: 4, y: 3 },
|
|
50645
|
+
{ x: 5, y: 3 },
|
|
50646
|
+
{ x: 6, y: 3 },
|
|
50647
|
+
{ x: 7, y: 3 },
|
|
50648
|
+
{ x: 8, y: 3 },
|
|
50649
|
+
{ x: 9, y: 3 },
|
|
50650
|
+
{ x: 10, y: 3 },
|
|
50651
|
+
{ x: 11, y: 3 },
|
|
50652
|
+
{ x: 12, y: 3 },
|
|
50653
|
+
{ x: 13, y: 3 },
|
|
50654
|
+
{ x: 13, y: 4 },
|
|
50655
|
+
{ x: 13, y: 5 },
|
|
50656
|
+
{ x: 13, y: 6 },
|
|
50657
|
+
{ x: 13, y: 7 },
|
|
50658
|
+
{ x: 12, y: 7 },
|
|
50659
|
+
{ x: 11, y: 7 },
|
|
50660
|
+
{ x: 10, y: 7 },
|
|
50661
|
+
{ x: 9, y: 7 },
|
|
50662
|
+
{ x: 8, y: 7 },
|
|
50663
|
+
{ x: 7, y: 7 },
|
|
50664
|
+
{ x: 6, y: 7 },
|
|
50665
|
+
{ x: 5, y: 7 },
|
|
50666
|
+
{ x: 4, y: 7 },
|
|
50667
|
+
{ x: 3, y: 7 },
|
|
50668
|
+
{ x: 2, y: 7 },
|
|
50669
|
+
{ x: 2, y: 8 },
|
|
50670
|
+
{ x: 2, y: 9 },
|
|
50671
|
+
{ x: 2, y: 10 },
|
|
50672
|
+
{ x: 2, y: 11 },
|
|
50673
|
+
{ x: 3, y: 11 },
|
|
50674
|
+
{ x: 4, y: 11 },
|
|
50675
|
+
{ x: 5, y: 11 },
|
|
50676
|
+
{ x: 6, y: 11 },
|
|
50677
|
+
{ x: 7, y: 11 },
|
|
50678
|
+
{ x: 8, y: 11 },
|
|
50679
|
+
{ x: 9, y: 11 },
|
|
50680
|
+
{ x: 10, y: 11 },
|
|
50681
|
+
{ x: 11, y: 11 },
|
|
50682
|
+
{ x: 12, y: 11 },
|
|
50683
|
+
{ x: 13, y: 11 },
|
|
50684
|
+
{ x: 13, y: 12 },
|
|
50685
|
+
{ x: 13, y: 13 },
|
|
50686
|
+
{ x: 13, y: 14 },
|
|
50687
|
+
{ x: 13, y: 15 }
|
|
50688
|
+
];
|
|
50689
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
50577
50690
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
50578
50691
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
50579
50692
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -50850,6 +50963,17 @@ function heroPosition(h) {
|
|
|
50850
50963
|
function heroMovement(h) {
|
|
50851
50964
|
return num(h.movement);
|
|
50852
50965
|
}
|
|
50966
|
+
function buildDefaultWorldTiles() {
|
|
50967
|
+
const tiles = [];
|
|
50968
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
50969
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
50970
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
50971
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
50972
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
50973
|
+
}
|
|
50974
|
+
}
|
|
50975
|
+
return tiles;
|
|
50976
|
+
}
|
|
50853
50977
|
function defaultIsInRange(from, to, range) {
|
|
50854
50978
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
50855
50979
|
}
|
|
@@ -50860,7 +50984,7 @@ function WorldMapBoard({
|
|
|
50860
50984
|
features: propFeatures,
|
|
50861
50985
|
assetManifest: propAssetManifest,
|
|
50862
50986
|
isLoading,
|
|
50863
|
-
scale = 0.
|
|
50987
|
+
scale = 0.25,
|
|
50864
50988
|
unitScale = 2.5,
|
|
50865
50989
|
spriteHeightRatio = 1.5,
|
|
50866
50990
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -50904,7 +51028,8 @@ function WorldMapBoard({
|
|
|
50904
51028
|
})),
|
|
50905
51029
|
[entityTiles]
|
|
50906
51030
|
);
|
|
50907
|
-
const
|
|
51031
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
51032
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
50908
51033
|
const baseUnits = useMemo(
|
|
50909
51034
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
50910
51035
|
id: str(u.id),
|
|
@@ -51114,6 +51239,7 @@ function WorldMapBoard({
|
|
|
51114
51239
|
footer && footer(ctx)
|
|
51115
51240
|
] });
|
|
51116
51241
|
}
|
|
51242
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
51117
51243
|
var init_WorldMapBoard = __esm({
|
|
51118
51244
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
51119
51245
|
"use client";
|
|
@@ -51124,6 +51250,17 @@ var init_WorldMapBoard = __esm({
|
|
|
51124
51250
|
init_IsometricCanvas();
|
|
51125
51251
|
init_boardEntity();
|
|
51126
51252
|
init_isometric();
|
|
51253
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
51254
|
+
WORLD_GRID_W = 16;
|
|
51255
|
+
WORLD_GRID_H = 16;
|
|
51256
|
+
WORLD_TERRAIN_DEFS = [
|
|
51257
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
51258
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
51259
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
51260
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
51261
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
51262
|
+
];
|
|
51263
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
51127
51264
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
51128
51265
|
}
|
|
51129
51266
|
});
|