@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/runtime/index.js
CHANGED
|
@@ -11564,13 +11564,29 @@ var init_boardEntity = __esm({
|
|
|
11564
11564
|
"components/game/organisms/boardEntity.ts"() {
|
|
11565
11565
|
}
|
|
11566
11566
|
});
|
|
11567
|
+
function buildDefaultBattleTiles() {
|
|
11568
|
+
const tiles = [];
|
|
11569
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
11570
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
11571
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
11572
|
+
tiles.push({
|
|
11573
|
+
x,
|
|
11574
|
+
y,
|
|
11575
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
11576
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
11577
|
+
passable: true
|
|
11578
|
+
});
|
|
11579
|
+
}
|
|
11580
|
+
}
|
|
11581
|
+
return tiles;
|
|
11582
|
+
}
|
|
11567
11583
|
function BattleBoard({
|
|
11568
11584
|
entity,
|
|
11569
11585
|
tiles: propTiles,
|
|
11570
11586
|
units: propUnits,
|
|
11571
11587
|
features: propFeatures,
|
|
11572
11588
|
assetManifest: propAssetManifest,
|
|
11573
|
-
scale = 0.
|
|
11589
|
+
scale = 0.25,
|
|
11574
11590
|
unitScale = 1,
|
|
11575
11591
|
spriteHeightRatio = 1.5,
|
|
11576
11592
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -11597,10 +11613,11 @@ function BattleBoard({
|
|
|
11597
11613
|
className
|
|
11598
11614
|
}) {
|
|
11599
11615
|
const board = boardEntity(entity) ?? {};
|
|
11600
|
-
const
|
|
11616
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
11617
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
11601
11618
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
11602
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
11603
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
11619
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
11620
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
11604
11621
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
11605
11622
|
const backgroundImage = board.backgroundImage;
|
|
11606
11623
|
const units = rows(board.units);
|
|
@@ -11922,6 +11939,7 @@ function BattleBoard({
|
|
|
11922
11939
|
] }) }))
|
|
11923
11940
|
] });
|
|
11924
11941
|
}
|
|
11942
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
11925
11943
|
var init_BattleBoard = __esm({
|
|
11926
11944
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
11927
11945
|
"use client";
|
|
@@ -11934,6 +11952,17 @@ var init_BattleBoard = __esm({
|
|
|
11934
11952
|
init_IsometricCanvas();
|
|
11935
11953
|
init_boardEntity();
|
|
11936
11954
|
init_isometric();
|
|
11955
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
11956
|
+
BATTLE_GRID_W = 16;
|
|
11957
|
+
BATTLE_GRID_H = 16;
|
|
11958
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
11959
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
11960
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
11961
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
11962
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
11963
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
11964
|
+
];
|
|
11965
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
11937
11966
|
BattleBoard.displayName = "BattleBoard";
|
|
11938
11967
|
}
|
|
11939
11968
|
});
|
|
@@ -11941,7 +11970,7 @@ function BattleTemplate({
|
|
|
11941
11970
|
entity,
|
|
11942
11971
|
scale = 0.45,
|
|
11943
11972
|
unitScale = 1,
|
|
11944
|
-
tiles =
|
|
11973
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
11945
11974
|
units = DEFAULT_BATTLE_UNITS,
|
|
11946
11975
|
features = DEFAULT_BATTLE_FEATURES,
|
|
11947
11976
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -11970,12 +11999,12 @@ function BattleTemplate({
|
|
|
11970
11999
|
}
|
|
11971
12000
|
);
|
|
11972
12001
|
}
|
|
11973
|
-
var CDN,
|
|
12002
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
11974
12003
|
var init_BattleTemplate = __esm({
|
|
11975
12004
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
11976
12005
|
init_BattleBoard();
|
|
11977
12006
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
11978
|
-
|
|
12007
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
11979
12008
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
11980
12009
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
11981
12010
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -41838,7 +41867,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
41838
41867
|
selectedTileIds = [],
|
|
41839
41868
|
selectedUnitId = null,
|
|
41840
41869
|
unitScale = 1,
|
|
41841
|
-
scale = 0.45,
|
|
41842
41870
|
children
|
|
41843
41871
|
}, ref) => {
|
|
41844
41872
|
const containerRef = useRef(null);
|
|
@@ -42285,7 +42313,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42285
42313
|
fadeStrength: 1
|
|
42286
42314
|
}
|
|
42287
42315
|
),
|
|
42288
|
-
/* @__PURE__ */ jsxs("group", {
|
|
42316
|
+
/* @__PURE__ */ jsxs("group", { children: [
|
|
42289
42317
|
tiles.map((tile, index) => {
|
|
42290
42318
|
const position = gridToWorld(
|
|
42291
42319
|
tile.x,
|
|
@@ -44428,6 +44456,35 @@ var init_PricingPageTemplate = __esm({
|
|
|
44428
44456
|
PricingPageTemplate.displayName = "PricingPageTemplate";
|
|
44429
44457
|
}
|
|
44430
44458
|
});
|
|
44459
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
44460
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
44461
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
44462
|
+
const isWall = isBorder || isPillar;
|
|
44463
|
+
if (x === stairsX && y === stairsY) {
|
|
44464
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
44465
|
+
}
|
|
44466
|
+
if (isWall) {
|
|
44467
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
44468
|
+
}
|
|
44469
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
44470
|
+
const sprites = [
|
|
44471
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
44472
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
44473
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
44474
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
44475
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
44476
|
+
];
|
|
44477
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
44478
|
+
}
|
|
44479
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
44480
|
+
const tiles = [];
|
|
44481
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
44482
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
44483
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
44484
|
+
}
|
|
44485
|
+
}
|
|
44486
|
+
return tiles;
|
|
44487
|
+
}
|
|
44431
44488
|
function RoguelikeBoard({
|
|
44432
44489
|
entity,
|
|
44433
44490
|
tiles: propTiles,
|
|
@@ -44443,7 +44500,7 @@ function RoguelikeBoard({
|
|
|
44443
44500
|
stairsX: propStairsX,
|
|
44444
44501
|
stairsY: propStairsY,
|
|
44445
44502
|
assetManifest: propAssetManifest,
|
|
44446
|
-
scale = 0.
|
|
44503
|
+
scale = 0.25,
|
|
44447
44504
|
unitScale = 1,
|
|
44448
44505
|
spriteHeightRatio = 1.5,
|
|
44449
44506
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -44453,7 +44510,9 @@ function RoguelikeBoard({
|
|
|
44453
44510
|
className
|
|
44454
44511
|
}) {
|
|
44455
44512
|
const board = boardEntity(entity) ?? {};
|
|
44456
|
-
const
|
|
44513
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
44514
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
44515
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
44457
44516
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
44458
44517
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
44459
44518
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -44463,8 +44522,8 @@ function RoguelikeBoard({
|
|
|
44463
44522
|
const depth = propDepth ?? num(board.depth, 1);
|
|
44464
44523
|
const result = propResult ?? (str(board.result) || "none");
|
|
44465
44524
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
44466
|
-
propStairsX ?? num(board.stairsX,
|
|
44467
|
-
propStairsY ?? num(board.stairsY,
|
|
44525
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
44526
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
44468
44527
|
const eventBus = useEventBus();
|
|
44469
44528
|
const { t } = useTranslate();
|
|
44470
44529
|
const [hoveredTile, setHoveredTile] = useState(null);
|
|
@@ -44640,7 +44699,7 @@ function RoguelikeBoard({
|
|
|
44640
44699
|
] }) })
|
|
44641
44700
|
] });
|
|
44642
44701
|
}
|
|
44643
|
-
var CDN4,
|
|
44702
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
44644
44703
|
var init_RoguelikeBoard = __esm({
|
|
44645
44704
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
44646
44705
|
"use client";
|
|
@@ -44653,39 +44712,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
44653
44712
|
init_IsometricCanvas();
|
|
44654
44713
|
init_boardEntity();
|
|
44655
44714
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
44656
|
-
|
|
44657
|
-
|
|
44658
|
-
|
|
44659
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44660
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44661
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44662
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44663
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44664
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44665
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44666
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44667
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44668
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44669
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44670
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44671
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44672
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44673
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44674
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44675
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
44676
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44677
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44678
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44679
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44680
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44681
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
44682
|
-
];
|
|
44715
|
+
DUNGEON_GRID_W = 16;
|
|
44716
|
+
DUNGEON_GRID_H = 16;
|
|
44717
|
+
buildDefaultDungeonTiles(14, 14);
|
|
44683
44718
|
DEFAULT_ENEMIES = [
|
|
44684
|
-
{ id: "e1", x:
|
|
44685
|
-
{ id: "e2", x:
|
|
44719
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
44720
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
44721
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
44722
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
44686
44723
|
];
|
|
44687
44724
|
DEFAULT_ITEMS = [
|
|
44688
|
-
{ id: "i1", x:
|
|
44725
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
44726
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
44727
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
44689
44728
|
];
|
|
44690
44729
|
FEATURE_SPRITE = {
|
|
44691
44730
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -48912,6 +48951,22 @@ var init_ToastSlot = __esm({
|
|
|
48912
48951
|
ToastSlot.displayName = "ToastSlot";
|
|
48913
48952
|
}
|
|
48914
48953
|
});
|
|
48954
|
+
function buildDefaultTDTiles() {
|
|
48955
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
48956
|
+
const tiles = [];
|
|
48957
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
48958
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
48959
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
48960
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
48961
|
+
} else {
|
|
48962
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
48963
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
48964
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
48965
|
+
}
|
|
48966
|
+
}
|
|
48967
|
+
}
|
|
48968
|
+
return tiles;
|
|
48969
|
+
}
|
|
48915
48970
|
function tilesToIso(tiles) {
|
|
48916
48971
|
return tiles.map((t) => ({
|
|
48917
48972
|
x: t.x,
|
|
@@ -48967,7 +49022,7 @@ function TowerDefenseBoard({
|
|
|
48967
49022
|
result: propResult,
|
|
48968
49023
|
waveActive: propWaveActive,
|
|
48969
49024
|
towerCost = 25,
|
|
48970
|
-
scale = 0.
|
|
49025
|
+
scale = 0.25,
|
|
48971
49026
|
unitScale = 1,
|
|
48972
49027
|
spriteHeightRatio = 1.5,
|
|
48973
49028
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -48980,8 +49035,10 @@ function TowerDefenseBoard({
|
|
|
48980
49035
|
const board = boardEntity(entity) ?? {};
|
|
48981
49036
|
const eventBus = useEventBus();
|
|
48982
49037
|
const { t } = useTranslate();
|
|
48983
|
-
const
|
|
48984
|
-
const
|
|
49038
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
49039
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
49040
|
+
const rawPath = propPath ?? rows(board.path);
|
|
49041
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
48985
49042
|
const towers = propTowers ?? rows(board.towers);
|
|
48986
49043
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
48987
49044
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -49111,7 +49168,7 @@ function TowerDefenseBoard({
|
|
|
49111
49168
|
] }) })
|
|
49112
49169
|
] });
|
|
49113
49170
|
}
|
|
49114
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49171
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49115
49172
|
var init_TowerDefenseBoard = __esm({
|
|
49116
49173
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
49117
49174
|
"use client";
|
|
@@ -49124,11 +49181,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
49124
49181
|
init_IsometricCanvas();
|
|
49125
49182
|
init_boardEntity();
|
|
49126
49183
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
49184
|
+
TD_GRID_W = 16;
|
|
49185
|
+
TD_GRID_H = 16;
|
|
49127
49186
|
TERRAIN_SPRITES = {
|
|
49128
49187
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
49129
49188
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
49130
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
49131
|
-
|
|
49189
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
49190
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
49191
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
49192
|
+
};
|
|
49193
|
+
DEFAULT_TD_PATH = [
|
|
49194
|
+
{ x: 2, y: 0 },
|
|
49195
|
+
{ x: 2, y: 1 },
|
|
49196
|
+
{ x: 2, y: 2 },
|
|
49197
|
+
{ x: 2, y: 3 },
|
|
49198
|
+
{ x: 3, y: 3 },
|
|
49199
|
+
{ x: 4, y: 3 },
|
|
49200
|
+
{ x: 5, y: 3 },
|
|
49201
|
+
{ x: 6, y: 3 },
|
|
49202
|
+
{ x: 7, y: 3 },
|
|
49203
|
+
{ x: 8, y: 3 },
|
|
49204
|
+
{ x: 9, y: 3 },
|
|
49205
|
+
{ x: 10, y: 3 },
|
|
49206
|
+
{ x: 11, y: 3 },
|
|
49207
|
+
{ x: 12, y: 3 },
|
|
49208
|
+
{ x: 13, y: 3 },
|
|
49209
|
+
{ x: 13, y: 4 },
|
|
49210
|
+
{ x: 13, y: 5 },
|
|
49211
|
+
{ x: 13, y: 6 },
|
|
49212
|
+
{ x: 13, y: 7 },
|
|
49213
|
+
{ x: 12, y: 7 },
|
|
49214
|
+
{ x: 11, y: 7 },
|
|
49215
|
+
{ x: 10, y: 7 },
|
|
49216
|
+
{ x: 9, y: 7 },
|
|
49217
|
+
{ x: 8, y: 7 },
|
|
49218
|
+
{ x: 7, y: 7 },
|
|
49219
|
+
{ x: 6, y: 7 },
|
|
49220
|
+
{ x: 5, y: 7 },
|
|
49221
|
+
{ x: 4, y: 7 },
|
|
49222
|
+
{ x: 3, y: 7 },
|
|
49223
|
+
{ x: 2, y: 7 },
|
|
49224
|
+
{ x: 2, y: 8 },
|
|
49225
|
+
{ x: 2, y: 9 },
|
|
49226
|
+
{ x: 2, y: 10 },
|
|
49227
|
+
{ x: 2, y: 11 },
|
|
49228
|
+
{ x: 3, y: 11 },
|
|
49229
|
+
{ x: 4, y: 11 },
|
|
49230
|
+
{ x: 5, y: 11 },
|
|
49231
|
+
{ x: 6, y: 11 },
|
|
49232
|
+
{ x: 7, y: 11 },
|
|
49233
|
+
{ x: 8, y: 11 },
|
|
49234
|
+
{ x: 9, y: 11 },
|
|
49235
|
+
{ x: 10, y: 11 },
|
|
49236
|
+
{ x: 11, y: 11 },
|
|
49237
|
+
{ x: 12, y: 11 },
|
|
49238
|
+
{ x: 13, y: 11 },
|
|
49239
|
+
{ x: 13, y: 12 },
|
|
49240
|
+
{ x: 13, y: 13 },
|
|
49241
|
+
{ x: 13, y: 14 },
|
|
49242
|
+
{ x: 13, y: 15 }
|
|
49243
|
+
];
|
|
49244
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
49132
49245
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
49133
49246
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
49134
49247
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -49405,6 +49518,17 @@ function heroPosition(h) {
|
|
|
49405
49518
|
function heroMovement(h) {
|
|
49406
49519
|
return num(h.movement);
|
|
49407
49520
|
}
|
|
49521
|
+
function buildDefaultWorldTiles() {
|
|
49522
|
+
const tiles = [];
|
|
49523
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
49524
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
49525
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
49526
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
49527
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
49528
|
+
}
|
|
49529
|
+
}
|
|
49530
|
+
return tiles;
|
|
49531
|
+
}
|
|
49408
49532
|
function defaultIsInRange(from, to, range) {
|
|
49409
49533
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
49410
49534
|
}
|
|
@@ -49415,7 +49539,7 @@ function WorldMapBoard({
|
|
|
49415
49539
|
features: propFeatures,
|
|
49416
49540
|
assetManifest: propAssetManifest,
|
|
49417
49541
|
isLoading,
|
|
49418
|
-
scale = 0.
|
|
49542
|
+
scale = 0.25,
|
|
49419
49543
|
unitScale = 2.5,
|
|
49420
49544
|
spriteHeightRatio = 1.5,
|
|
49421
49545
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -49459,7 +49583,8 @@ function WorldMapBoard({
|
|
|
49459
49583
|
})),
|
|
49460
49584
|
[entityTiles]
|
|
49461
49585
|
);
|
|
49462
|
-
const
|
|
49586
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
49587
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
49463
49588
|
const baseUnits = useMemo(
|
|
49464
49589
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
49465
49590
|
id: str(u.id),
|
|
@@ -49669,6 +49794,7 @@ function WorldMapBoard({
|
|
|
49669
49794
|
footer && footer(ctx)
|
|
49670
49795
|
] });
|
|
49671
49796
|
}
|
|
49797
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
49672
49798
|
var init_WorldMapBoard = __esm({
|
|
49673
49799
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
49674
49800
|
"use client";
|
|
@@ -49679,6 +49805,17 @@ var init_WorldMapBoard = __esm({
|
|
|
49679
49805
|
init_IsometricCanvas();
|
|
49680
49806
|
init_boardEntity();
|
|
49681
49807
|
init_isometric();
|
|
49808
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
49809
|
+
WORLD_GRID_W = 16;
|
|
49810
|
+
WORLD_GRID_H = 16;
|
|
49811
|
+
WORLD_TERRAIN_DEFS = [
|
|
49812
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
49813
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
49814
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
49815
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
49816
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
49817
|
+
];
|
|
49818
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
49682
49819
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
49683
49820
|
}
|
|
49684
49821
|
});
|