@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/avl/index.cjs
CHANGED
|
@@ -15350,13 +15350,29 @@ var init_boardEntity = __esm({
|
|
|
15350
15350
|
"components/game/organisms/boardEntity.ts"() {
|
|
15351
15351
|
}
|
|
15352
15352
|
});
|
|
15353
|
+
function buildDefaultBattleTiles() {
|
|
15354
|
+
const tiles = [];
|
|
15355
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
15356
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
15357
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
15358
|
+
tiles.push({
|
|
15359
|
+
x,
|
|
15360
|
+
y,
|
|
15361
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
15362
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
15363
|
+
passable: true
|
|
15364
|
+
});
|
|
15365
|
+
}
|
|
15366
|
+
}
|
|
15367
|
+
return tiles;
|
|
15368
|
+
}
|
|
15353
15369
|
function BattleBoard({
|
|
15354
15370
|
entity,
|
|
15355
15371
|
tiles: propTiles,
|
|
15356
15372
|
units: propUnits,
|
|
15357
15373
|
features: propFeatures,
|
|
15358
15374
|
assetManifest: propAssetManifest,
|
|
15359
|
-
scale = 0.
|
|
15375
|
+
scale = 0.25,
|
|
15360
15376
|
unitScale = 1,
|
|
15361
15377
|
spriteHeightRatio = 1.5,
|
|
15362
15378
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -15383,10 +15399,11 @@ function BattleBoard({
|
|
|
15383
15399
|
className
|
|
15384
15400
|
}) {
|
|
15385
15401
|
const board = boardEntity(entity) ?? {};
|
|
15386
|
-
const
|
|
15402
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
15403
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
15387
15404
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
15388
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
15389
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
15405
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
15406
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
15390
15407
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
15391
15408
|
const backgroundImage = board.backgroundImage;
|
|
15392
15409
|
const units = rows(board.units);
|
|
@@ -15708,6 +15725,7 @@ function BattleBoard({
|
|
|
15708
15725
|
] }) }))
|
|
15709
15726
|
] });
|
|
15710
15727
|
}
|
|
15728
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
15711
15729
|
var init_BattleBoard = __esm({
|
|
15712
15730
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
15713
15731
|
"use client";
|
|
@@ -15720,6 +15738,17 @@ var init_BattleBoard = __esm({
|
|
|
15720
15738
|
init_IsometricCanvas();
|
|
15721
15739
|
init_boardEntity();
|
|
15722
15740
|
init_isometric();
|
|
15741
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
15742
|
+
BATTLE_GRID_W = 16;
|
|
15743
|
+
BATTLE_GRID_H = 16;
|
|
15744
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
15745
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
15746
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
15747
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
15748
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
15749
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
15750
|
+
];
|
|
15751
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
15723
15752
|
BattleBoard.displayName = "BattleBoard";
|
|
15724
15753
|
}
|
|
15725
15754
|
});
|
|
@@ -15727,7 +15756,7 @@ function BattleTemplate({
|
|
|
15727
15756
|
entity,
|
|
15728
15757
|
scale = 0.45,
|
|
15729
15758
|
unitScale = 1,
|
|
15730
|
-
tiles =
|
|
15759
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
15731
15760
|
units = DEFAULT_BATTLE_UNITS,
|
|
15732
15761
|
features = DEFAULT_BATTLE_FEATURES,
|
|
15733
15762
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -15756,12 +15785,12 @@ function BattleTemplate({
|
|
|
15756
15785
|
}
|
|
15757
15786
|
);
|
|
15758
15787
|
}
|
|
15759
|
-
var CDN,
|
|
15788
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
15760
15789
|
var init_BattleTemplate = __esm({
|
|
15761
15790
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
15762
15791
|
init_BattleBoard();
|
|
15763
15792
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
15764
|
-
|
|
15793
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
15765
15794
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
15766
15795
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
15767
15796
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -44386,7 +44415,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
44386
44415
|
selectedTileIds = [],
|
|
44387
44416
|
selectedUnitId = null,
|
|
44388
44417
|
unitScale = 1,
|
|
44389
|
-
scale = 0.45,
|
|
44390
44418
|
children
|
|
44391
44419
|
}, ref) => {
|
|
44392
44420
|
const containerRef = React90.useRef(null);
|
|
@@ -44833,7 +44861,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
44833
44861
|
fadeStrength: 1
|
|
44834
44862
|
}
|
|
44835
44863
|
),
|
|
44836
|
-
/* @__PURE__ */ jsxRuntime.jsxs("group", {
|
|
44864
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { children: [
|
|
44837
44865
|
tiles.map((tile, index) => {
|
|
44838
44866
|
const position = gridToWorld(
|
|
44839
44867
|
tile.x,
|
|
@@ -46976,6 +47004,35 @@ var init_PricingPageTemplate = __esm({
|
|
|
46976
47004
|
PricingPageTemplate.displayName = "PricingPageTemplate";
|
|
46977
47005
|
}
|
|
46978
47006
|
});
|
|
47007
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
47008
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
47009
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
47010
|
+
const isWall = isBorder || isPillar;
|
|
47011
|
+
if (x === stairsX && y === stairsY) {
|
|
47012
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
47013
|
+
}
|
|
47014
|
+
if (isWall) {
|
|
47015
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
47016
|
+
}
|
|
47017
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
47018
|
+
const sprites = [
|
|
47019
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
47020
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
47021
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
47022
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
47023
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
47024
|
+
];
|
|
47025
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
47026
|
+
}
|
|
47027
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
47028
|
+
const tiles = [];
|
|
47029
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
47030
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
47031
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
47032
|
+
}
|
|
47033
|
+
}
|
|
47034
|
+
return tiles;
|
|
47035
|
+
}
|
|
46979
47036
|
function RoguelikeBoard({
|
|
46980
47037
|
entity,
|
|
46981
47038
|
tiles: propTiles,
|
|
@@ -46991,7 +47048,7 @@ function RoguelikeBoard({
|
|
|
46991
47048
|
stairsX: propStairsX,
|
|
46992
47049
|
stairsY: propStairsY,
|
|
46993
47050
|
assetManifest: propAssetManifest,
|
|
46994
|
-
scale = 0.
|
|
47051
|
+
scale = 0.25,
|
|
46995
47052
|
unitScale = 1,
|
|
46996
47053
|
spriteHeightRatio = 1.5,
|
|
46997
47054
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -47001,7 +47058,9 @@ function RoguelikeBoard({
|
|
|
47001
47058
|
className
|
|
47002
47059
|
}) {
|
|
47003
47060
|
const board = boardEntity(entity) ?? {};
|
|
47004
|
-
const
|
|
47061
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
47062
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
47063
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
47005
47064
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
47006
47065
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
47007
47066
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -47011,8 +47070,8 @@ function RoguelikeBoard({
|
|
|
47011
47070
|
const depth = propDepth ?? num(board.depth, 1);
|
|
47012
47071
|
const result = propResult ?? (str(board.result) || "none");
|
|
47013
47072
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
47014
|
-
propStairsX ?? num(board.stairsX,
|
|
47015
|
-
propStairsY ?? num(board.stairsY,
|
|
47073
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
47074
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
47016
47075
|
const eventBus = useEventBus();
|
|
47017
47076
|
const { t } = hooks.useTranslate();
|
|
47018
47077
|
const [hoveredTile, setHoveredTile] = React90.useState(null);
|
|
@@ -47188,7 +47247,7 @@ function RoguelikeBoard({
|
|
|
47188
47247
|
] }) })
|
|
47189
47248
|
] });
|
|
47190
47249
|
}
|
|
47191
|
-
var CDN4,
|
|
47250
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
47192
47251
|
var init_RoguelikeBoard = __esm({
|
|
47193
47252
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
47194
47253
|
"use client";
|
|
@@ -47201,39 +47260,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
47201
47260
|
init_IsometricCanvas();
|
|
47202
47261
|
init_boardEntity();
|
|
47203
47262
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
47204
|
-
|
|
47205
|
-
|
|
47206
|
-
|
|
47207
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47208
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47209
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47210
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47211
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
47212
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
47213
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
47214
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47215
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47216
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
47217
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
47218
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
47219
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47220
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47221
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
47222
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
47223
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
47224
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47225
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47226
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47227
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47228
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
47229
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
47230
|
-
];
|
|
47263
|
+
DUNGEON_GRID_W = 16;
|
|
47264
|
+
DUNGEON_GRID_H = 16;
|
|
47265
|
+
buildDefaultDungeonTiles(14, 14);
|
|
47231
47266
|
DEFAULT_ENEMIES = [
|
|
47232
|
-
{ id: "e1", x:
|
|
47233
|
-
{ id: "e2", x:
|
|
47267
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
47268
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
47269
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
47270
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
47234
47271
|
];
|
|
47235
47272
|
DEFAULT_ITEMS = [
|
|
47236
|
-
{ id: "i1", x:
|
|
47273
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
47274
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
47275
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
47237
47276
|
];
|
|
47238
47277
|
FEATURE_SPRITE = {
|
|
47239
47278
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -51460,6 +51499,22 @@ var init_ToastSlot = __esm({
|
|
|
51460
51499
|
ToastSlot.displayName = "ToastSlot";
|
|
51461
51500
|
}
|
|
51462
51501
|
});
|
|
51502
|
+
function buildDefaultTDTiles() {
|
|
51503
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
51504
|
+
const tiles = [];
|
|
51505
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
51506
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
51507
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
51508
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
51509
|
+
} else {
|
|
51510
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
51511
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
51512
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
51513
|
+
}
|
|
51514
|
+
}
|
|
51515
|
+
}
|
|
51516
|
+
return tiles;
|
|
51517
|
+
}
|
|
51463
51518
|
function tilesToIso(tiles) {
|
|
51464
51519
|
return tiles.map((t) => ({
|
|
51465
51520
|
x: t.x,
|
|
@@ -51515,7 +51570,7 @@ function TowerDefenseBoard({
|
|
|
51515
51570
|
result: propResult,
|
|
51516
51571
|
waveActive: propWaveActive,
|
|
51517
51572
|
towerCost = 25,
|
|
51518
|
-
scale = 0.
|
|
51573
|
+
scale = 0.25,
|
|
51519
51574
|
unitScale = 1,
|
|
51520
51575
|
spriteHeightRatio = 1.5,
|
|
51521
51576
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -51528,8 +51583,10 @@ function TowerDefenseBoard({
|
|
|
51528
51583
|
const board = boardEntity(entity) ?? {};
|
|
51529
51584
|
const eventBus = useEventBus();
|
|
51530
51585
|
const { t } = hooks.useTranslate();
|
|
51531
|
-
const
|
|
51532
|
-
const
|
|
51586
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
51587
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
51588
|
+
const rawPath = propPath ?? rows(board.path);
|
|
51589
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
51533
51590
|
const towers = propTowers ?? rows(board.towers);
|
|
51534
51591
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
51535
51592
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -51659,7 +51716,7 @@ function TowerDefenseBoard({
|
|
|
51659
51716
|
] }) })
|
|
51660
51717
|
] });
|
|
51661
51718
|
}
|
|
51662
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
51719
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
51663
51720
|
var init_TowerDefenseBoard = __esm({
|
|
51664
51721
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
51665
51722
|
"use client";
|
|
@@ -51672,11 +51729,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
51672
51729
|
init_IsometricCanvas();
|
|
51673
51730
|
init_boardEntity();
|
|
51674
51731
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
51732
|
+
TD_GRID_W = 16;
|
|
51733
|
+
TD_GRID_H = 16;
|
|
51675
51734
|
TERRAIN_SPRITES = {
|
|
51676
51735
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
51677
51736
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
51678
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
51679
|
-
|
|
51737
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
51738
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
51739
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
51740
|
+
};
|
|
51741
|
+
DEFAULT_TD_PATH = [
|
|
51742
|
+
{ x: 2, y: 0 },
|
|
51743
|
+
{ x: 2, y: 1 },
|
|
51744
|
+
{ x: 2, y: 2 },
|
|
51745
|
+
{ x: 2, y: 3 },
|
|
51746
|
+
{ x: 3, y: 3 },
|
|
51747
|
+
{ x: 4, y: 3 },
|
|
51748
|
+
{ x: 5, y: 3 },
|
|
51749
|
+
{ x: 6, y: 3 },
|
|
51750
|
+
{ x: 7, y: 3 },
|
|
51751
|
+
{ x: 8, y: 3 },
|
|
51752
|
+
{ x: 9, y: 3 },
|
|
51753
|
+
{ x: 10, y: 3 },
|
|
51754
|
+
{ x: 11, y: 3 },
|
|
51755
|
+
{ x: 12, y: 3 },
|
|
51756
|
+
{ x: 13, y: 3 },
|
|
51757
|
+
{ x: 13, y: 4 },
|
|
51758
|
+
{ x: 13, y: 5 },
|
|
51759
|
+
{ x: 13, y: 6 },
|
|
51760
|
+
{ x: 13, y: 7 },
|
|
51761
|
+
{ x: 12, y: 7 },
|
|
51762
|
+
{ x: 11, y: 7 },
|
|
51763
|
+
{ x: 10, y: 7 },
|
|
51764
|
+
{ x: 9, y: 7 },
|
|
51765
|
+
{ x: 8, y: 7 },
|
|
51766
|
+
{ x: 7, y: 7 },
|
|
51767
|
+
{ x: 6, y: 7 },
|
|
51768
|
+
{ x: 5, y: 7 },
|
|
51769
|
+
{ x: 4, y: 7 },
|
|
51770
|
+
{ x: 3, y: 7 },
|
|
51771
|
+
{ x: 2, y: 7 },
|
|
51772
|
+
{ x: 2, y: 8 },
|
|
51773
|
+
{ x: 2, y: 9 },
|
|
51774
|
+
{ x: 2, y: 10 },
|
|
51775
|
+
{ x: 2, y: 11 },
|
|
51776
|
+
{ x: 3, y: 11 },
|
|
51777
|
+
{ x: 4, y: 11 },
|
|
51778
|
+
{ x: 5, y: 11 },
|
|
51779
|
+
{ x: 6, y: 11 },
|
|
51780
|
+
{ x: 7, y: 11 },
|
|
51781
|
+
{ x: 8, y: 11 },
|
|
51782
|
+
{ x: 9, y: 11 },
|
|
51783
|
+
{ x: 10, y: 11 },
|
|
51784
|
+
{ x: 11, y: 11 },
|
|
51785
|
+
{ x: 12, y: 11 },
|
|
51786
|
+
{ x: 13, y: 11 },
|
|
51787
|
+
{ x: 13, y: 12 },
|
|
51788
|
+
{ x: 13, y: 13 },
|
|
51789
|
+
{ x: 13, y: 14 },
|
|
51790
|
+
{ x: 13, y: 15 }
|
|
51791
|
+
];
|
|
51792
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
51680
51793
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
51681
51794
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
51682
51795
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -51953,6 +52066,17 @@ function heroPosition(h) {
|
|
|
51953
52066
|
function heroMovement(h) {
|
|
51954
52067
|
return num(h.movement);
|
|
51955
52068
|
}
|
|
52069
|
+
function buildDefaultWorldTiles() {
|
|
52070
|
+
const tiles = [];
|
|
52071
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
52072
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
52073
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
52074
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
52075
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
52076
|
+
}
|
|
52077
|
+
}
|
|
52078
|
+
return tiles;
|
|
52079
|
+
}
|
|
51956
52080
|
function defaultIsInRange(from, to, range) {
|
|
51957
52081
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
51958
52082
|
}
|
|
@@ -51963,7 +52087,7 @@ function WorldMapBoard({
|
|
|
51963
52087
|
features: propFeatures,
|
|
51964
52088
|
assetManifest: propAssetManifest,
|
|
51965
52089
|
isLoading,
|
|
51966
|
-
scale = 0.
|
|
52090
|
+
scale = 0.25,
|
|
51967
52091
|
unitScale = 2.5,
|
|
51968
52092
|
spriteHeightRatio = 1.5,
|
|
51969
52093
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -52007,7 +52131,8 @@ function WorldMapBoard({
|
|
|
52007
52131
|
})),
|
|
52008
52132
|
[entityTiles]
|
|
52009
52133
|
);
|
|
52010
|
-
const
|
|
52134
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
52135
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
52011
52136
|
const baseUnits = React90.useMemo(
|
|
52012
52137
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
52013
52138
|
id: str(u.id),
|
|
@@ -52217,6 +52342,7 @@ function WorldMapBoard({
|
|
|
52217
52342
|
footer && footer(ctx)
|
|
52218
52343
|
] });
|
|
52219
52344
|
}
|
|
52345
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
52220
52346
|
var init_WorldMapBoard = __esm({
|
|
52221
52347
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
52222
52348
|
"use client";
|
|
@@ -52227,6 +52353,17 @@ var init_WorldMapBoard = __esm({
|
|
|
52227
52353
|
init_IsometricCanvas();
|
|
52228
52354
|
init_boardEntity();
|
|
52229
52355
|
init_isometric();
|
|
52356
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
52357
|
+
WORLD_GRID_W = 16;
|
|
52358
|
+
WORLD_GRID_H = 16;
|
|
52359
|
+
WORLD_TERRAIN_DEFS = [
|
|
52360
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
52361
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
52362
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
52363
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
52364
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
52365
|
+
];
|
|
52366
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
52230
52367
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
52231
52368
|
}
|
|
52232
52369
|
});
|