@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.cjs
CHANGED
|
@@ -11611,13 +11611,29 @@ var init_boardEntity = __esm({
|
|
|
11611
11611
|
"components/game/organisms/boardEntity.ts"() {
|
|
11612
11612
|
}
|
|
11613
11613
|
});
|
|
11614
|
+
function buildDefaultBattleTiles() {
|
|
11615
|
+
const tiles = [];
|
|
11616
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
11617
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
11618
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
11619
|
+
tiles.push({
|
|
11620
|
+
x,
|
|
11621
|
+
y,
|
|
11622
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
11623
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
11624
|
+
passable: true
|
|
11625
|
+
});
|
|
11626
|
+
}
|
|
11627
|
+
}
|
|
11628
|
+
return tiles;
|
|
11629
|
+
}
|
|
11614
11630
|
function BattleBoard({
|
|
11615
11631
|
entity,
|
|
11616
11632
|
tiles: propTiles,
|
|
11617
11633
|
units: propUnits,
|
|
11618
11634
|
features: propFeatures,
|
|
11619
11635
|
assetManifest: propAssetManifest,
|
|
11620
|
-
scale = 0.
|
|
11636
|
+
scale = 0.25,
|
|
11621
11637
|
unitScale = 1,
|
|
11622
11638
|
spriteHeightRatio = 1.5,
|
|
11623
11639
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -11644,10 +11660,11 @@ function BattleBoard({
|
|
|
11644
11660
|
className
|
|
11645
11661
|
}) {
|
|
11646
11662
|
const board = boardEntity(entity) ?? {};
|
|
11647
|
-
const
|
|
11663
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
11664
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
11648
11665
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
11649
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
11650
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
11666
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
11667
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
11651
11668
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
11652
11669
|
const backgroundImage = board.backgroundImage;
|
|
11653
11670
|
const units = rows(board.units);
|
|
@@ -11969,6 +11986,7 @@ function BattleBoard({
|
|
|
11969
11986
|
] }) }))
|
|
11970
11987
|
] });
|
|
11971
11988
|
}
|
|
11989
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
11972
11990
|
var init_BattleBoard = __esm({
|
|
11973
11991
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
11974
11992
|
"use client";
|
|
@@ -11981,6 +11999,17 @@ var init_BattleBoard = __esm({
|
|
|
11981
11999
|
init_IsometricCanvas();
|
|
11982
12000
|
init_boardEntity();
|
|
11983
12001
|
init_isometric();
|
|
12002
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
12003
|
+
BATTLE_GRID_W = 16;
|
|
12004
|
+
BATTLE_GRID_H = 16;
|
|
12005
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
12006
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
12007
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
12008
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
12009
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
12010
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
12011
|
+
];
|
|
12012
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
11984
12013
|
BattleBoard.displayName = "BattleBoard";
|
|
11985
12014
|
}
|
|
11986
12015
|
});
|
|
@@ -11988,7 +12017,7 @@ function BattleTemplate({
|
|
|
11988
12017
|
entity,
|
|
11989
12018
|
scale = 0.45,
|
|
11990
12019
|
unitScale = 1,
|
|
11991
|
-
tiles =
|
|
12020
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
11992
12021
|
units = DEFAULT_BATTLE_UNITS,
|
|
11993
12022
|
features = DEFAULT_BATTLE_FEATURES,
|
|
11994
12023
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -12017,12 +12046,12 @@ function BattleTemplate({
|
|
|
12017
12046
|
}
|
|
12018
12047
|
);
|
|
12019
12048
|
}
|
|
12020
|
-
var CDN,
|
|
12049
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
12021
12050
|
var init_BattleTemplate = __esm({
|
|
12022
12051
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
12023
12052
|
init_BattleBoard();
|
|
12024
12053
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
12025
|
-
|
|
12054
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
12026
12055
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
12027
12056
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
12028
12057
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -41885,7 +41914,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
41885
41914
|
selectedTileIds = [],
|
|
41886
41915
|
selectedUnitId = null,
|
|
41887
41916
|
unitScale = 1,
|
|
41888
|
-
scale = 0.45,
|
|
41889
41917
|
children
|
|
41890
41918
|
}, ref) => {
|
|
41891
41919
|
const containerRef = React81.useRef(null);
|
|
@@ -42332,7 +42360,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42332
42360
|
fadeStrength: 1
|
|
42333
42361
|
}
|
|
42334
42362
|
),
|
|
42335
|
-
/* @__PURE__ */ jsxRuntime.jsxs("group", {
|
|
42363
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { children: [
|
|
42336
42364
|
tiles.map((tile, index) => {
|
|
42337
42365
|
const position = gridToWorld(
|
|
42338
42366
|
tile.x,
|
|
@@ -44475,6 +44503,35 @@ var init_PricingPageTemplate = __esm({
|
|
|
44475
44503
|
PricingPageTemplate.displayName = "PricingPageTemplate";
|
|
44476
44504
|
}
|
|
44477
44505
|
});
|
|
44506
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
44507
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
44508
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
44509
|
+
const isWall = isBorder || isPillar;
|
|
44510
|
+
if (x === stairsX && y === stairsY) {
|
|
44511
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
44512
|
+
}
|
|
44513
|
+
if (isWall) {
|
|
44514
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
44515
|
+
}
|
|
44516
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
44517
|
+
const sprites = [
|
|
44518
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
44519
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
44520
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
44521
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
44522
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
44523
|
+
];
|
|
44524
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
44525
|
+
}
|
|
44526
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
44527
|
+
const tiles = [];
|
|
44528
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
44529
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
44530
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
44531
|
+
}
|
|
44532
|
+
}
|
|
44533
|
+
return tiles;
|
|
44534
|
+
}
|
|
44478
44535
|
function RoguelikeBoard({
|
|
44479
44536
|
entity,
|
|
44480
44537
|
tiles: propTiles,
|
|
@@ -44490,7 +44547,7 @@ function RoguelikeBoard({
|
|
|
44490
44547
|
stairsX: propStairsX,
|
|
44491
44548
|
stairsY: propStairsY,
|
|
44492
44549
|
assetManifest: propAssetManifest,
|
|
44493
|
-
scale = 0.
|
|
44550
|
+
scale = 0.25,
|
|
44494
44551
|
unitScale = 1,
|
|
44495
44552
|
spriteHeightRatio = 1.5,
|
|
44496
44553
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -44500,7 +44557,9 @@ function RoguelikeBoard({
|
|
|
44500
44557
|
className
|
|
44501
44558
|
}) {
|
|
44502
44559
|
const board = boardEntity(entity) ?? {};
|
|
44503
|
-
const
|
|
44560
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
44561
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
44562
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
44504
44563
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
44505
44564
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
44506
44565
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -44510,8 +44569,8 @@ function RoguelikeBoard({
|
|
|
44510
44569
|
const depth = propDepth ?? num(board.depth, 1);
|
|
44511
44570
|
const result = propResult ?? (str(board.result) || "none");
|
|
44512
44571
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
44513
|
-
propStairsX ?? num(board.stairsX,
|
|
44514
|
-
propStairsY ?? num(board.stairsY,
|
|
44572
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
44573
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
44515
44574
|
const eventBus = useEventBus();
|
|
44516
44575
|
const { t } = hooks.useTranslate();
|
|
44517
44576
|
const [hoveredTile, setHoveredTile] = React81.useState(null);
|
|
@@ -44687,7 +44746,7 @@ function RoguelikeBoard({
|
|
|
44687
44746
|
] }) })
|
|
44688
44747
|
] });
|
|
44689
44748
|
}
|
|
44690
|
-
var CDN4,
|
|
44749
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
44691
44750
|
var init_RoguelikeBoard = __esm({
|
|
44692
44751
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
44693
44752
|
"use client";
|
|
@@ -44700,39 +44759,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
44700
44759
|
init_IsometricCanvas();
|
|
44701
44760
|
init_boardEntity();
|
|
44702
44761
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
44703
|
-
|
|
44704
|
-
|
|
44705
|
-
|
|
44706
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44707
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44708
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44709
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44710
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44711
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44712
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44713
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44714
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44715
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44716
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44717
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44718
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44719
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44720
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
44721
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
44722
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
44723
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44724
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44725
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44726
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44727
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
44728
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
44729
|
-
];
|
|
44762
|
+
DUNGEON_GRID_W = 16;
|
|
44763
|
+
DUNGEON_GRID_H = 16;
|
|
44764
|
+
buildDefaultDungeonTiles(14, 14);
|
|
44730
44765
|
DEFAULT_ENEMIES = [
|
|
44731
|
-
{ id: "e1", x:
|
|
44732
|
-
{ id: "e2", x:
|
|
44766
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
44767
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
44768
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
44769
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
44733
44770
|
];
|
|
44734
44771
|
DEFAULT_ITEMS = [
|
|
44735
|
-
{ id: "i1", x:
|
|
44772
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
44773
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
44774
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
44736
44775
|
];
|
|
44737
44776
|
FEATURE_SPRITE = {
|
|
44738
44777
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -48959,6 +48998,22 @@ var init_ToastSlot = __esm({
|
|
|
48959
48998
|
ToastSlot.displayName = "ToastSlot";
|
|
48960
48999
|
}
|
|
48961
49000
|
});
|
|
49001
|
+
function buildDefaultTDTiles() {
|
|
49002
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
49003
|
+
const tiles = [];
|
|
49004
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
49005
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
49006
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
49007
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
49008
|
+
} else {
|
|
49009
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
49010
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
49011
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
49012
|
+
}
|
|
49013
|
+
}
|
|
49014
|
+
}
|
|
49015
|
+
return tiles;
|
|
49016
|
+
}
|
|
48962
49017
|
function tilesToIso(tiles) {
|
|
48963
49018
|
return tiles.map((t) => ({
|
|
48964
49019
|
x: t.x,
|
|
@@ -49014,7 +49069,7 @@ function TowerDefenseBoard({
|
|
|
49014
49069
|
result: propResult,
|
|
49015
49070
|
waveActive: propWaveActive,
|
|
49016
49071
|
towerCost = 25,
|
|
49017
|
-
scale = 0.
|
|
49072
|
+
scale = 0.25,
|
|
49018
49073
|
unitScale = 1,
|
|
49019
49074
|
spriteHeightRatio = 1.5,
|
|
49020
49075
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -49027,8 +49082,10 @@ function TowerDefenseBoard({
|
|
|
49027
49082
|
const board = boardEntity(entity) ?? {};
|
|
49028
49083
|
const eventBus = useEventBus();
|
|
49029
49084
|
const { t } = hooks.useTranslate();
|
|
49030
|
-
const
|
|
49031
|
-
const
|
|
49085
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
49086
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
49087
|
+
const rawPath = propPath ?? rows(board.path);
|
|
49088
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
49032
49089
|
const towers = propTowers ?? rows(board.towers);
|
|
49033
49090
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
49034
49091
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -49158,7 +49215,7 @@ function TowerDefenseBoard({
|
|
|
49158
49215
|
] }) })
|
|
49159
49216
|
] });
|
|
49160
49217
|
}
|
|
49161
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49218
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49162
49219
|
var init_TowerDefenseBoard = __esm({
|
|
49163
49220
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
49164
49221
|
"use client";
|
|
@@ -49171,11 +49228,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
49171
49228
|
init_IsometricCanvas();
|
|
49172
49229
|
init_boardEntity();
|
|
49173
49230
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
49231
|
+
TD_GRID_W = 16;
|
|
49232
|
+
TD_GRID_H = 16;
|
|
49174
49233
|
TERRAIN_SPRITES = {
|
|
49175
49234
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
49176
49235
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
49177
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
49178
|
-
|
|
49236
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
49237
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
49238
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
49239
|
+
};
|
|
49240
|
+
DEFAULT_TD_PATH = [
|
|
49241
|
+
{ x: 2, y: 0 },
|
|
49242
|
+
{ x: 2, y: 1 },
|
|
49243
|
+
{ x: 2, y: 2 },
|
|
49244
|
+
{ x: 2, y: 3 },
|
|
49245
|
+
{ x: 3, y: 3 },
|
|
49246
|
+
{ x: 4, y: 3 },
|
|
49247
|
+
{ x: 5, y: 3 },
|
|
49248
|
+
{ x: 6, y: 3 },
|
|
49249
|
+
{ x: 7, y: 3 },
|
|
49250
|
+
{ x: 8, y: 3 },
|
|
49251
|
+
{ x: 9, y: 3 },
|
|
49252
|
+
{ x: 10, y: 3 },
|
|
49253
|
+
{ x: 11, y: 3 },
|
|
49254
|
+
{ x: 12, y: 3 },
|
|
49255
|
+
{ x: 13, y: 3 },
|
|
49256
|
+
{ x: 13, y: 4 },
|
|
49257
|
+
{ x: 13, y: 5 },
|
|
49258
|
+
{ x: 13, y: 6 },
|
|
49259
|
+
{ x: 13, y: 7 },
|
|
49260
|
+
{ x: 12, y: 7 },
|
|
49261
|
+
{ x: 11, y: 7 },
|
|
49262
|
+
{ x: 10, y: 7 },
|
|
49263
|
+
{ x: 9, y: 7 },
|
|
49264
|
+
{ x: 8, y: 7 },
|
|
49265
|
+
{ x: 7, y: 7 },
|
|
49266
|
+
{ x: 6, y: 7 },
|
|
49267
|
+
{ x: 5, y: 7 },
|
|
49268
|
+
{ x: 4, y: 7 },
|
|
49269
|
+
{ x: 3, y: 7 },
|
|
49270
|
+
{ x: 2, y: 7 },
|
|
49271
|
+
{ x: 2, y: 8 },
|
|
49272
|
+
{ x: 2, y: 9 },
|
|
49273
|
+
{ x: 2, y: 10 },
|
|
49274
|
+
{ x: 2, y: 11 },
|
|
49275
|
+
{ x: 3, y: 11 },
|
|
49276
|
+
{ x: 4, y: 11 },
|
|
49277
|
+
{ x: 5, y: 11 },
|
|
49278
|
+
{ x: 6, y: 11 },
|
|
49279
|
+
{ x: 7, y: 11 },
|
|
49280
|
+
{ x: 8, y: 11 },
|
|
49281
|
+
{ x: 9, y: 11 },
|
|
49282
|
+
{ x: 10, y: 11 },
|
|
49283
|
+
{ x: 11, y: 11 },
|
|
49284
|
+
{ x: 12, y: 11 },
|
|
49285
|
+
{ x: 13, y: 11 },
|
|
49286
|
+
{ x: 13, y: 12 },
|
|
49287
|
+
{ x: 13, y: 13 },
|
|
49288
|
+
{ x: 13, y: 14 },
|
|
49289
|
+
{ x: 13, y: 15 }
|
|
49290
|
+
];
|
|
49291
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
49179
49292
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
49180
49293
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
49181
49294
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -49452,6 +49565,17 @@ function heroPosition(h) {
|
|
|
49452
49565
|
function heroMovement(h) {
|
|
49453
49566
|
return num(h.movement);
|
|
49454
49567
|
}
|
|
49568
|
+
function buildDefaultWorldTiles() {
|
|
49569
|
+
const tiles = [];
|
|
49570
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
49571
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
49572
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
49573
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
49574
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
49575
|
+
}
|
|
49576
|
+
}
|
|
49577
|
+
return tiles;
|
|
49578
|
+
}
|
|
49455
49579
|
function defaultIsInRange(from, to, range) {
|
|
49456
49580
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
49457
49581
|
}
|
|
@@ -49462,7 +49586,7 @@ function WorldMapBoard({
|
|
|
49462
49586
|
features: propFeatures,
|
|
49463
49587
|
assetManifest: propAssetManifest,
|
|
49464
49588
|
isLoading,
|
|
49465
|
-
scale = 0.
|
|
49589
|
+
scale = 0.25,
|
|
49466
49590
|
unitScale = 2.5,
|
|
49467
49591
|
spriteHeightRatio = 1.5,
|
|
49468
49592
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -49506,7 +49630,8 @@ function WorldMapBoard({
|
|
|
49506
49630
|
})),
|
|
49507
49631
|
[entityTiles]
|
|
49508
49632
|
);
|
|
49509
|
-
const
|
|
49633
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
49634
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
49510
49635
|
const baseUnits = React81.useMemo(
|
|
49511
49636
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
49512
49637
|
id: str(u.id),
|
|
@@ -49716,6 +49841,7 @@ function WorldMapBoard({
|
|
|
49716
49841
|
footer && footer(ctx)
|
|
49717
49842
|
] });
|
|
49718
49843
|
}
|
|
49844
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
49719
49845
|
var init_WorldMapBoard = __esm({
|
|
49720
49846
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
49721
49847
|
"use client";
|
|
@@ -49726,6 +49852,17 @@ var init_WorldMapBoard = __esm({
|
|
|
49726
49852
|
init_IsometricCanvas();
|
|
49727
49853
|
init_boardEntity();
|
|
49728
49854
|
init_isometric();
|
|
49855
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
49856
|
+
WORLD_GRID_W = 16;
|
|
49857
|
+
WORLD_GRID_H = 16;
|
|
49858
|
+
WORLD_TERRAIN_DEFS = [
|
|
49859
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
49860
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
49861
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
49862
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
49863
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
49864
|
+
];
|
|
49865
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
49729
49866
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
49730
49867
|
}
|
|
49731
49868
|
});
|