@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
|
@@ -10544,13 +10544,29 @@ var init_boardEntity = __esm({
|
|
|
10544
10544
|
"components/game/organisms/boardEntity.ts"() {
|
|
10545
10545
|
}
|
|
10546
10546
|
});
|
|
10547
|
+
function buildDefaultBattleTiles() {
|
|
10548
|
+
const tiles = [];
|
|
10549
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
10550
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
10551
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
10552
|
+
tiles.push({
|
|
10553
|
+
x,
|
|
10554
|
+
y,
|
|
10555
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
10556
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
10557
|
+
passable: true
|
|
10558
|
+
});
|
|
10559
|
+
}
|
|
10560
|
+
}
|
|
10561
|
+
return tiles;
|
|
10562
|
+
}
|
|
10547
10563
|
function BattleBoard({
|
|
10548
10564
|
entity,
|
|
10549
10565
|
tiles: propTiles,
|
|
10550
10566
|
units: propUnits,
|
|
10551
10567
|
features: propFeatures,
|
|
10552
10568
|
assetManifest: propAssetManifest,
|
|
10553
|
-
scale = 0.
|
|
10569
|
+
scale = 0.25,
|
|
10554
10570
|
unitScale = 1,
|
|
10555
10571
|
spriteHeightRatio = 1.5,
|
|
10556
10572
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -10577,10 +10593,11 @@ function BattleBoard({
|
|
|
10577
10593
|
className
|
|
10578
10594
|
}) {
|
|
10579
10595
|
const board = boardEntity(entity) ?? {};
|
|
10580
|
-
const
|
|
10596
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
10597
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
10581
10598
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
10582
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
10583
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
10599
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
10600
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
10584
10601
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
10585
10602
|
const backgroundImage = board.backgroundImage;
|
|
10586
10603
|
const units = rows(board.units);
|
|
@@ -10902,6 +10919,7 @@ function BattleBoard({
|
|
|
10902
10919
|
] }) }))
|
|
10903
10920
|
] });
|
|
10904
10921
|
}
|
|
10922
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
10905
10923
|
var init_BattleBoard = __esm({
|
|
10906
10924
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
10907
10925
|
"use client";
|
|
@@ -10914,6 +10932,17 @@ var init_BattleBoard = __esm({
|
|
|
10914
10932
|
init_IsometricCanvas();
|
|
10915
10933
|
init_boardEntity();
|
|
10916
10934
|
init_isometric();
|
|
10935
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
10936
|
+
BATTLE_GRID_W = 16;
|
|
10937
|
+
BATTLE_GRID_H = 16;
|
|
10938
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
10939
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
10940
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
10941
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
10942
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
10943
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
10944
|
+
];
|
|
10945
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
10917
10946
|
BattleBoard.displayName = "BattleBoard";
|
|
10918
10947
|
}
|
|
10919
10948
|
});
|
|
@@ -10921,7 +10950,7 @@ function BattleTemplate({
|
|
|
10921
10950
|
entity,
|
|
10922
10951
|
scale = 0.45,
|
|
10923
10952
|
unitScale = 1,
|
|
10924
|
-
tiles =
|
|
10953
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
10925
10954
|
units = DEFAULT_BATTLE_UNITS,
|
|
10926
10955
|
features = DEFAULT_BATTLE_FEATURES,
|
|
10927
10956
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -10950,12 +10979,12 @@ function BattleTemplate({
|
|
|
10950
10979
|
}
|
|
10951
10980
|
);
|
|
10952
10981
|
}
|
|
10953
|
-
var CDN,
|
|
10982
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
10954
10983
|
var init_BattleTemplate = __esm({
|
|
10955
10984
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
10956
10985
|
init_BattleBoard();
|
|
10957
10986
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
10958
|
-
|
|
10987
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
10959
10988
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
10960
10989
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
10961
10990
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -42933,7 +42962,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42933
42962
|
selectedTileIds = [],
|
|
42934
42963
|
selectedUnitId = null,
|
|
42935
42964
|
unitScale = 1,
|
|
42936
|
-
scale = 0.45,
|
|
42937
42965
|
children
|
|
42938
42966
|
}, ref) => {
|
|
42939
42967
|
const containerRef = React76.useRef(null);
|
|
@@ -43380,7 +43408,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
43380
43408
|
fadeStrength: 1
|
|
43381
43409
|
}
|
|
43382
43410
|
),
|
|
43383
|
-
/* @__PURE__ */ jsxRuntime.jsxs("group", {
|
|
43411
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { children: [
|
|
43384
43412
|
tiles.map((tile, index) => {
|
|
43385
43413
|
const position = gridToWorld(
|
|
43386
43414
|
tile.x,
|
|
@@ -45697,6 +45725,35 @@ var init_ResourceCounter = __esm({
|
|
|
45697
45725
|
ResourceCounter.displayName = "ResourceCounter";
|
|
45698
45726
|
}
|
|
45699
45727
|
});
|
|
45728
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
45729
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
45730
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
45731
|
+
const isWall = isBorder || isPillar;
|
|
45732
|
+
if (x === stairsX && y === stairsY) {
|
|
45733
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
45734
|
+
}
|
|
45735
|
+
if (isWall) {
|
|
45736
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
45737
|
+
}
|
|
45738
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
45739
|
+
const sprites = [
|
|
45740
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
45741
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
45742
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
45743
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
45744
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
45745
|
+
];
|
|
45746
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
45747
|
+
}
|
|
45748
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
45749
|
+
const tiles = [];
|
|
45750
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
45751
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
45752
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
45753
|
+
}
|
|
45754
|
+
}
|
|
45755
|
+
return tiles;
|
|
45756
|
+
}
|
|
45700
45757
|
function RoguelikeBoard({
|
|
45701
45758
|
entity,
|
|
45702
45759
|
tiles: propTiles,
|
|
@@ -45712,7 +45769,7 @@ function RoguelikeBoard({
|
|
|
45712
45769
|
stairsX: propStairsX,
|
|
45713
45770
|
stairsY: propStairsY,
|
|
45714
45771
|
assetManifest: propAssetManifest,
|
|
45715
|
-
scale = 0.
|
|
45772
|
+
scale = 0.25,
|
|
45716
45773
|
unitScale = 1,
|
|
45717
45774
|
spriteHeightRatio = 1.5,
|
|
45718
45775
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -45722,7 +45779,9 @@ function RoguelikeBoard({
|
|
|
45722
45779
|
className
|
|
45723
45780
|
}) {
|
|
45724
45781
|
const board = boardEntity(entity) ?? {};
|
|
45725
|
-
const
|
|
45782
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
45783
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
45784
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
45726
45785
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
45727
45786
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
45728
45787
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -45732,8 +45791,8 @@ function RoguelikeBoard({
|
|
|
45732
45791
|
const depth = propDepth ?? num(board.depth, 1);
|
|
45733
45792
|
const result = propResult ?? (str(board.result) || "none");
|
|
45734
45793
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
45735
|
-
propStairsX ?? num(board.stairsX,
|
|
45736
|
-
propStairsY ?? num(board.stairsY,
|
|
45794
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
45795
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
45737
45796
|
const eventBus = useEventBus();
|
|
45738
45797
|
const { t } = hooks.useTranslate();
|
|
45739
45798
|
const [hoveredTile, setHoveredTile] = React76.useState(null);
|
|
@@ -45909,7 +45968,7 @@ function RoguelikeBoard({
|
|
|
45909
45968
|
] }) })
|
|
45910
45969
|
] });
|
|
45911
45970
|
}
|
|
45912
|
-
var CDN4,
|
|
45971
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
45913
45972
|
var init_RoguelikeBoard = __esm({
|
|
45914
45973
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
45915
45974
|
"use client";
|
|
@@ -45922,39 +45981,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
45922
45981
|
init_IsometricCanvas();
|
|
45923
45982
|
init_boardEntity();
|
|
45924
45983
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
45925
|
-
|
|
45926
|
-
|
|
45927
|
-
|
|
45928
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45929
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45930
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45931
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45932
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45933
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45934
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45935
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45936
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45937
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45938
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45939
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45940
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45941
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45942
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45943
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45944
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
45945
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45946
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45947
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45948
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45949
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45950
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
45951
|
-
];
|
|
45984
|
+
DUNGEON_GRID_W = 16;
|
|
45985
|
+
DUNGEON_GRID_H = 16;
|
|
45986
|
+
buildDefaultDungeonTiles(14, 14);
|
|
45952
45987
|
DEFAULT_ENEMIES = [
|
|
45953
|
-
{ id: "e1", x:
|
|
45954
|
-
{ id: "e2", x:
|
|
45988
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
45989
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
45990
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
45991
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
45955
45992
|
];
|
|
45956
45993
|
DEFAULT_ITEMS = [
|
|
45957
|
-
{ id: "i1", x:
|
|
45994
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
45995
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
45996
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
45958
45997
|
];
|
|
45959
45998
|
FEATURE_SPRITE = {
|
|
45960
45999
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -50403,6 +50442,22 @@ var init_ToastSlot = __esm({
|
|
|
50403
50442
|
exports.ToastSlot.displayName = "ToastSlot";
|
|
50404
50443
|
}
|
|
50405
50444
|
});
|
|
50445
|
+
function buildDefaultTDTiles() {
|
|
50446
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
50447
|
+
const tiles = [];
|
|
50448
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
50449
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
50450
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
50451
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
50452
|
+
} else {
|
|
50453
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
50454
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
50455
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
50456
|
+
}
|
|
50457
|
+
}
|
|
50458
|
+
}
|
|
50459
|
+
return tiles;
|
|
50460
|
+
}
|
|
50406
50461
|
function tilesToIso(tiles) {
|
|
50407
50462
|
return tiles.map((t) => ({
|
|
50408
50463
|
x: t.x,
|
|
@@ -50458,7 +50513,7 @@ function TowerDefenseBoard({
|
|
|
50458
50513
|
result: propResult,
|
|
50459
50514
|
waveActive: propWaveActive,
|
|
50460
50515
|
towerCost = 25,
|
|
50461
|
-
scale = 0.
|
|
50516
|
+
scale = 0.25,
|
|
50462
50517
|
unitScale = 1,
|
|
50463
50518
|
spriteHeightRatio = 1.5,
|
|
50464
50519
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -50471,8 +50526,10 @@ function TowerDefenseBoard({
|
|
|
50471
50526
|
const board = boardEntity(entity) ?? {};
|
|
50472
50527
|
const eventBus = useEventBus();
|
|
50473
50528
|
const { t } = hooks.useTranslate();
|
|
50474
|
-
const
|
|
50475
|
-
const
|
|
50529
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
50530
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
50531
|
+
const rawPath = propPath ?? rows(board.path);
|
|
50532
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
50476
50533
|
const towers = propTowers ?? rows(board.towers);
|
|
50477
50534
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
50478
50535
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -50602,7 +50659,7 @@ function TowerDefenseBoard({
|
|
|
50602
50659
|
] }) })
|
|
50603
50660
|
] });
|
|
50604
50661
|
}
|
|
50605
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
50662
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
50606
50663
|
var init_TowerDefenseBoard = __esm({
|
|
50607
50664
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
50608
50665
|
"use client";
|
|
@@ -50615,11 +50672,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
50615
50672
|
init_IsometricCanvas();
|
|
50616
50673
|
init_boardEntity();
|
|
50617
50674
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
50675
|
+
TD_GRID_W = 16;
|
|
50676
|
+
TD_GRID_H = 16;
|
|
50618
50677
|
TERRAIN_SPRITES = {
|
|
50619
50678
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
50620
50679
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
50621
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
50622
|
-
|
|
50680
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
50681
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
50682
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
50683
|
+
};
|
|
50684
|
+
DEFAULT_TD_PATH = [
|
|
50685
|
+
{ x: 2, y: 0 },
|
|
50686
|
+
{ x: 2, y: 1 },
|
|
50687
|
+
{ x: 2, y: 2 },
|
|
50688
|
+
{ x: 2, y: 3 },
|
|
50689
|
+
{ x: 3, y: 3 },
|
|
50690
|
+
{ x: 4, y: 3 },
|
|
50691
|
+
{ x: 5, y: 3 },
|
|
50692
|
+
{ x: 6, y: 3 },
|
|
50693
|
+
{ x: 7, y: 3 },
|
|
50694
|
+
{ x: 8, y: 3 },
|
|
50695
|
+
{ x: 9, y: 3 },
|
|
50696
|
+
{ x: 10, y: 3 },
|
|
50697
|
+
{ x: 11, y: 3 },
|
|
50698
|
+
{ x: 12, y: 3 },
|
|
50699
|
+
{ x: 13, y: 3 },
|
|
50700
|
+
{ x: 13, y: 4 },
|
|
50701
|
+
{ x: 13, y: 5 },
|
|
50702
|
+
{ x: 13, y: 6 },
|
|
50703
|
+
{ x: 13, y: 7 },
|
|
50704
|
+
{ x: 12, y: 7 },
|
|
50705
|
+
{ x: 11, y: 7 },
|
|
50706
|
+
{ x: 10, y: 7 },
|
|
50707
|
+
{ x: 9, y: 7 },
|
|
50708
|
+
{ x: 8, y: 7 },
|
|
50709
|
+
{ x: 7, y: 7 },
|
|
50710
|
+
{ x: 6, y: 7 },
|
|
50711
|
+
{ x: 5, y: 7 },
|
|
50712
|
+
{ x: 4, y: 7 },
|
|
50713
|
+
{ x: 3, y: 7 },
|
|
50714
|
+
{ x: 2, y: 7 },
|
|
50715
|
+
{ x: 2, y: 8 },
|
|
50716
|
+
{ x: 2, y: 9 },
|
|
50717
|
+
{ x: 2, y: 10 },
|
|
50718
|
+
{ x: 2, y: 11 },
|
|
50719
|
+
{ x: 3, y: 11 },
|
|
50720
|
+
{ x: 4, y: 11 },
|
|
50721
|
+
{ x: 5, y: 11 },
|
|
50722
|
+
{ x: 6, y: 11 },
|
|
50723
|
+
{ x: 7, y: 11 },
|
|
50724
|
+
{ x: 8, y: 11 },
|
|
50725
|
+
{ x: 9, y: 11 },
|
|
50726
|
+
{ x: 10, y: 11 },
|
|
50727
|
+
{ x: 11, y: 11 },
|
|
50728
|
+
{ x: 12, y: 11 },
|
|
50729
|
+
{ x: 13, y: 11 },
|
|
50730
|
+
{ x: 13, y: 12 },
|
|
50731
|
+
{ x: 13, y: 13 },
|
|
50732
|
+
{ x: 13, y: 14 },
|
|
50733
|
+
{ x: 13, y: 15 }
|
|
50734
|
+
];
|
|
50735
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
50623
50736
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
50624
50737
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
50625
50738
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -50896,6 +51009,17 @@ function heroPosition(h) {
|
|
|
50896
51009
|
function heroMovement(h) {
|
|
50897
51010
|
return num(h.movement);
|
|
50898
51011
|
}
|
|
51012
|
+
function buildDefaultWorldTiles() {
|
|
51013
|
+
const tiles = [];
|
|
51014
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
51015
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
51016
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
51017
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
51018
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
51019
|
+
}
|
|
51020
|
+
}
|
|
51021
|
+
return tiles;
|
|
51022
|
+
}
|
|
50899
51023
|
function defaultIsInRange(from, to, range) {
|
|
50900
51024
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
50901
51025
|
}
|
|
@@ -50906,7 +51030,7 @@ function WorldMapBoard({
|
|
|
50906
51030
|
features: propFeatures,
|
|
50907
51031
|
assetManifest: propAssetManifest,
|
|
50908
51032
|
isLoading,
|
|
50909
|
-
scale = 0.
|
|
51033
|
+
scale = 0.25,
|
|
50910
51034
|
unitScale = 2.5,
|
|
50911
51035
|
spriteHeightRatio = 1.5,
|
|
50912
51036
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -50950,7 +51074,8 @@ function WorldMapBoard({
|
|
|
50950
51074
|
})),
|
|
50951
51075
|
[entityTiles]
|
|
50952
51076
|
);
|
|
50953
|
-
const
|
|
51077
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
51078
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
50954
51079
|
const baseUnits = React76.useMemo(
|
|
50955
51080
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
50956
51081
|
id: str(u.id),
|
|
@@ -51160,6 +51285,7 @@ function WorldMapBoard({
|
|
|
51160
51285
|
footer && footer(ctx)
|
|
51161
51286
|
] });
|
|
51162
51287
|
}
|
|
51288
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
51163
51289
|
var init_WorldMapBoard = __esm({
|
|
51164
51290
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
51165
51291
|
"use client";
|
|
@@ -51170,6 +51296,17 @@ var init_WorldMapBoard = __esm({
|
|
|
51170
51296
|
init_IsometricCanvas();
|
|
51171
51297
|
init_boardEntity();
|
|
51172
51298
|
init_isometric();
|
|
51299
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
51300
|
+
WORLD_GRID_W = 16;
|
|
51301
|
+
WORLD_GRID_H = 16;
|
|
51302
|
+
WORLD_TERRAIN_DEFS = [
|
|
51303
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
51304
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
51305
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
51306
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
51307
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
51308
|
+
];
|
|
51309
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
51173
51310
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
51174
51311
|
}
|
|
51175
51312
|
});
|