@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/providers/index.cjs
CHANGED
|
@@ -11913,13 +11913,29 @@ var init_boardEntity = __esm({
|
|
|
11913
11913
|
"components/game/organisms/boardEntity.ts"() {
|
|
11914
11914
|
}
|
|
11915
11915
|
});
|
|
11916
|
+
function buildDefaultBattleTiles() {
|
|
11917
|
+
const tiles = [];
|
|
11918
|
+
for (let y = 0; y < BATTLE_GRID_H; y++) {
|
|
11919
|
+
for (let x = 0; x < BATTLE_GRID_W; x++) {
|
|
11920
|
+
const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
|
|
11921
|
+
tiles.push({
|
|
11922
|
+
x,
|
|
11923
|
+
y,
|
|
11924
|
+
terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
|
|
11925
|
+
terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
|
|
11926
|
+
passable: true
|
|
11927
|
+
});
|
|
11928
|
+
}
|
|
11929
|
+
}
|
|
11930
|
+
return tiles;
|
|
11931
|
+
}
|
|
11916
11932
|
function BattleBoard({
|
|
11917
11933
|
entity,
|
|
11918
11934
|
tiles: propTiles,
|
|
11919
11935
|
units: propUnits,
|
|
11920
11936
|
features: propFeatures,
|
|
11921
11937
|
assetManifest: propAssetManifest,
|
|
11922
|
-
scale = 0.
|
|
11938
|
+
scale = 0.25,
|
|
11923
11939
|
unitScale = 1,
|
|
11924
11940
|
spriteHeightRatio = 1.5,
|
|
11925
11941
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -11946,10 +11962,11 @@ function BattleBoard({
|
|
|
11946
11962
|
className
|
|
11947
11963
|
}) {
|
|
11948
11964
|
const board = boardEntity(entity) ?? {};
|
|
11949
|
-
const
|
|
11965
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
|
|
11966
|
+
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
11950
11967
|
const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
|
|
11951
|
-
const boardWidth = num(board.gridWidth ?? board.boardWidth,
|
|
11952
|
-
const boardHeight = num(board.gridHeight ?? board.boardHeight,
|
|
11968
|
+
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
11969
|
+
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
11953
11970
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
11954
11971
|
const backgroundImage = board.backgroundImage;
|
|
11955
11972
|
const units = rows(board.units);
|
|
@@ -12271,6 +12288,7 @@ function BattleBoard({
|
|
|
12271
12288
|
] }) }))
|
|
12272
12289
|
] });
|
|
12273
12290
|
}
|
|
12291
|
+
var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
|
|
12274
12292
|
var init_BattleBoard = __esm({
|
|
12275
12293
|
"components/game/organisms/BattleBoard.tsx"() {
|
|
12276
12294
|
"use client";
|
|
@@ -12283,6 +12301,17 @@ var init_BattleBoard = __esm({
|
|
|
12283
12301
|
init_IsometricCanvas();
|
|
12284
12302
|
init_boardEntity();
|
|
12285
12303
|
init_isometric();
|
|
12304
|
+
BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
12305
|
+
BATTLE_GRID_W = 16;
|
|
12306
|
+
BATTLE_GRID_H = 16;
|
|
12307
|
+
BATTLE_TERRAIN_SPRITES = [
|
|
12308
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
12309
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
12310
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
|
|
12311
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
12312
|
+
`${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
|
|
12313
|
+
];
|
|
12314
|
+
DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
|
|
12286
12315
|
BattleBoard.displayName = "BattleBoard";
|
|
12287
12316
|
}
|
|
12288
12317
|
});
|
|
@@ -12290,7 +12319,7 @@ function BattleTemplate({
|
|
|
12290
12319
|
entity,
|
|
12291
12320
|
scale = 0.45,
|
|
12292
12321
|
unitScale = 1,
|
|
12293
|
-
tiles =
|
|
12322
|
+
tiles = DEFAULT_BATTLE_TILES2,
|
|
12294
12323
|
units = DEFAULT_BATTLE_UNITS,
|
|
12295
12324
|
features = DEFAULT_BATTLE_FEATURES,
|
|
12296
12325
|
assetManifest = DEFAULT_BATTLE_MANIFEST,
|
|
@@ -12319,12 +12348,12 @@ function BattleTemplate({
|
|
|
12319
12348
|
}
|
|
12320
12349
|
);
|
|
12321
12350
|
}
|
|
12322
|
-
var CDN,
|
|
12351
|
+
var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
|
|
12323
12352
|
var init_BattleTemplate = __esm({
|
|
12324
12353
|
"components/game/templates/BattleTemplate.tsx"() {
|
|
12325
12354
|
init_BattleBoard();
|
|
12326
12355
|
CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
12327
|
-
|
|
12356
|
+
DEFAULT_BATTLE_TILES2 = [
|
|
12328
12357
|
{ x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
12329
12358
|
{ x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
12330
12359
|
{ x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
|
|
@@ -42187,7 +42216,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42187
42216
|
selectedTileIds = [],
|
|
42188
42217
|
selectedUnitId = null,
|
|
42189
42218
|
unitScale = 1,
|
|
42190
|
-
scale = 0.45,
|
|
42191
42219
|
children
|
|
42192
42220
|
}, ref) => {
|
|
42193
42221
|
const containerRef = React82.useRef(null);
|
|
@@ -42634,7 +42662,7 @@ var init_GameCanvas3D2 = __esm({
|
|
|
42634
42662
|
fadeStrength: 1
|
|
42635
42663
|
}
|
|
42636
42664
|
),
|
|
42637
|
-
/* @__PURE__ */ jsxRuntime.jsxs("group", {
|
|
42665
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { children: [
|
|
42638
42666
|
tiles.map((tile, index) => {
|
|
42639
42667
|
const position = gridToWorld(
|
|
42640
42668
|
tile.x,
|
|
@@ -44777,6 +44805,35 @@ var init_PricingPageTemplate = __esm({
|
|
|
44777
44805
|
PricingPageTemplate.displayName = "PricingPageTemplate";
|
|
44778
44806
|
}
|
|
44779
44807
|
});
|
|
44808
|
+
function dungeonTerrain(x, y, stairsX, stairsY) {
|
|
44809
|
+
const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
|
|
44810
|
+
const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
|
|
44811
|
+
const isWall = isBorder || isPillar;
|
|
44812
|
+
if (x === stairsX && y === stairsY) {
|
|
44813
|
+
return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
|
|
44814
|
+
}
|
|
44815
|
+
if (isWall) {
|
|
44816
|
+
return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
|
|
44817
|
+
}
|
|
44818
|
+
const variant = (x * 3 + y * 7) % 5;
|
|
44819
|
+
const sprites = [
|
|
44820
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
|
|
44821
|
+
`${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
|
|
44822
|
+
`${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
|
|
44823
|
+
`${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
|
|
44824
|
+
`${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
|
|
44825
|
+
];
|
|
44826
|
+
return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
|
|
44827
|
+
}
|
|
44828
|
+
function buildDefaultDungeonTiles(stairsX, stairsY) {
|
|
44829
|
+
const tiles = [];
|
|
44830
|
+
for (let y = 0; y < DUNGEON_GRID_H; y++) {
|
|
44831
|
+
for (let x = 0; x < DUNGEON_GRID_W; x++) {
|
|
44832
|
+
tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
|
|
44833
|
+
}
|
|
44834
|
+
}
|
|
44835
|
+
return tiles;
|
|
44836
|
+
}
|
|
44780
44837
|
function RoguelikeBoard({
|
|
44781
44838
|
entity,
|
|
44782
44839
|
tiles: propTiles,
|
|
@@ -44792,7 +44849,7 @@ function RoguelikeBoard({
|
|
|
44792
44849
|
stairsX: propStairsX,
|
|
44793
44850
|
stairsY: propStairsY,
|
|
44794
44851
|
assetManifest: propAssetManifest,
|
|
44795
|
-
scale = 0.
|
|
44852
|
+
scale = 0.25,
|
|
44796
44853
|
unitScale = 1,
|
|
44797
44854
|
spriteHeightRatio = 1.5,
|
|
44798
44855
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -44802,7 +44859,9 @@ function RoguelikeBoard({
|
|
|
44802
44859
|
className
|
|
44803
44860
|
}) {
|
|
44804
44861
|
const board = boardEntity(entity) ?? {};
|
|
44805
|
-
const
|
|
44862
|
+
const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
|
|
44863
|
+
const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
|
|
44864
|
+
const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
|
|
44806
44865
|
const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
|
|
44807
44866
|
const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
|
|
44808
44867
|
const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
|
|
@@ -44812,8 +44871,8 @@ function RoguelikeBoard({
|
|
|
44812
44871
|
const depth = propDepth ?? num(board.depth, 1);
|
|
44813
44872
|
const result = propResult ?? (str(board.result) || "none");
|
|
44814
44873
|
const phase = propPhase ?? (str(board.phase) || "player_turn");
|
|
44815
|
-
propStairsX ?? num(board.stairsX,
|
|
44816
|
-
propStairsY ?? num(board.stairsY,
|
|
44874
|
+
propStairsX ?? num(board.stairsX, 14);
|
|
44875
|
+
propStairsY ?? num(board.stairsY, 14);
|
|
44817
44876
|
const eventBus = useEventBus();
|
|
44818
44877
|
const { t } = hooks.useTranslate();
|
|
44819
44878
|
const [hoveredTile, setHoveredTile] = React82.useState(null);
|
|
@@ -44989,7 +45048,7 @@ function RoguelikeBoard({
|
|
|
44989
45048
|
] }) })
|
|
44990
45049
|
] });
|
|
44991
45050
|
}
|
|
44992
|
-
var CDN4,
|
|
45051
|
+
var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
|
|
44993
45052
|
var init_RoguelikeBoard = __esm({
|
|
44994
45053
|
"components/game/organisms/RoguelikeBoard.tsx"() {
|
|
44995
45054
|
"use client";
|
|
@@ -45002,39 +45061,19 @@ var init_RoguelikeBoard = __esm({
|
|
|
45002
45061
|
init_IsometricCanvas();
|
|
45003
45062
|
init_boardEntity();
|
|
45004
45063
|
CDN4 = "https://almadar-kflow-assets.web.app/shared";
|
|
45005
|
-
|
|
45006
|
-
|
|
45007
|
-
|
|
45008
|
-
{ x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45009
|
-
{ x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45010
|
-
{ x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45011
|
-
{ x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45012
|
-
{ x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45013
|
-
{ x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45014
|
-
{ x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45015
|
-
{ x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45016
|
-
{ x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45017
|
-
{ x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45018
|
-
{ x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45019
|
-
{ x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45020
|
-
{ x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45021
|
-
{ x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45022
|
-
{ x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
|
|
45023
|
-
{ x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
|
|
45024
|
-
{ x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
|
|
45025
|
-
{ x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45026
|
-
{ x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45027
|
-
{ x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45028
|
-
{ x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45029
|
-
{ x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
|
|
45030
|
-
{ x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
|
|
45031
|
-
];
|
|
45064
|
+
DUNGEON_GRID_W = 16;
|
|
45065
|
+
DUNGEON_GRID_H = 16;
|
|
45066
|
+
buildDefaultDungeonTiles(14, 14);
|
|
45032
45067
|
DEFAULT_ENEMIES = [
|
|
45033
|
-
{ id: "e1", x:
|
|
45034
|
-
{ id: "e2", x:
|
|
45068
|
+
{ id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
|
|
45069
|
+
{ id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
|
|
45070
|
+
{ id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
|
|
45071
|
+
{ id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
|
|
45035
45072
|
];
|
|
45036
45073
|
DEFAULT_ITEMS = [
|
|
45037
|
-
{ id: "i1", x:
|
|
45074
|
+
{ id: "i1", x: 3, y: 3, kind: "health_potion" },
|
|
45075
|
+
{ id: "i2", x: 7, y: 9, kind: "sword" },
|
|
45076
|
+
{ id: "i3", x: 11, y: 5, kind: "shield" }
|
|
45038
45077
|
];
|
|
45039
45078
|
FEATURE_SPRITE = {
|
|
45040
45079
|
health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
|
|
@@ -49242,6 +49281,22 @@ var init_ToastSlot = __esm({
|
|
|
49242
49281
|
ToastSlot.displayName = "ToastSlot";
|
|
49243
49282
|
}
|
|
49244
49283
|
});
|
|
49284
|
+
function buildDefaultTDTiles() {
|
|
49285
|
+
const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
|
|
49286
|
+
const tiles = [];
|
|
49287
|
+
for (let y = 0; y < TD_GRID_H; y++) {
|
|
49288
|
+
for (let x = 0; x < TD_GRID_W; x++) {
|
|
49289
|
+
if (pathSet.has(`${x},${y}`)) {
|
|
49290
|
+
tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
|
|
49291
|
+
} else {
|
|
49292
|
+
const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
|
|
49293
|
+
const terrainKey = ["ground", "grass", "dirt"][variant];
|
|
49294
|
+
tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
|
|
49295
|
+
}
|
|
49296
|
+
}
|
|
49297
|
+
}
|
|
49298
|
+
return tiles;
|
|
49299
|
+
}
|
|
49245
49300
|
function tilesToIso(tiles) {
|
|
49246
49301
|
return tiles.map((t) => ({
|
|
49247
49302
|
x: t.x,
|
|
@@ -49297,7 +49352,7 @@ function TowerDefenseBoard({
|
|
|
49297
49352
|
result: propResult,
|
|
49298
49353
|
waveActive: propWaveActive,
|
|
49299
49354
|
towerCost = 25,
|
|
49300
|
-
scale = 0.
|
|
49355
|
+
scale = 0.25,
|
|
49301
49356
|
unitScale = 1,
|
|
49302
49357
|
spriteHeightRatio = 1.5,
|
|
49303
49358
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -49310,8 +49365,10 @@ function TowerDefenseBoard({
|
|
|
49310
49365
|
const board = boardEntity(entity) ?? {};
|
|
49311
49366
|
const eventBus = useEventBus();
|
|
49312
49367
|
const { t } = hooks.useTranslate();
|
|
49313
|
-
const
|
|
49314
|
-
const
|
|
49368
|
+
const rawTiles = propTiles ?? rows(board.tiles);
|
|
49369
|
+
const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
|
|
49370
|
+
const rawPath = propPath ?? rows(board.path);
|
|
49371
|
+
const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
|
|
49315
49372
|
const towers = propTowers ?? rows(board.towers);
|
|
49316
49373
|
const creeps = propCreeps ?? rows(board.creeps);
|
|
49317
49374
|
const gold = propGold ?? num(board.gold, 100);
|
|
@@ -49441,7 +49498,7 @@ function TowerDefenseBoard({
|
|
|
49441
49498
|
] }) })
|
|
49442
49499
|
] });
|
|
49443
49500
|
}
|
|
49444
|
-
var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49501
|
+
var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
|
|
49445
49502
|
var init_TowerDefenseBoard = __esm({
|
|
49446
49503
|
"components/game/organisms/TowerDefenseBoard.tsx"() {
|
|
49447
49504
|
"use client";
|
|
@@ -49454,11 +49511,67 @@ var init_TowerDefenseBoard = __esm({
|
|
|
49454
49511
|
init_IsometricCanvas();
|
|
49455
49512
|
init_boardEntity();
|
|
49456
49513
|
CDN6 = "https://almadar-kflow-assets.web.app/shared/";
|
|
49514
|
+
TD_GRID_W = 16;
|
|
49515
|
+
TD_GRID_H = 16;
|
|
49457
49516
|
TERRAIN_SPRITES = {
|
|
49458
49517
|
ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
|
|
49459
49518
|
path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
|
|
49460
|
-
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png
|
|
49461
|
-
|
|
49519
|
+
wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
|
|
49520
|
+
grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
|
|
49521
|
+
dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
|
|
49522
|
+
};
|
|
49523
|
+
DEFAULT_TD_PATH = [
|
|
49524
|
+
{ x: 2, y: 0 },
|
|
49525
|
+
{ x: 2, y: 1 },
|
|
49526
|
+
{ x: 2, y: 2 },
|
|
49527
|
+
{ x: 2, y: 3 },
|
|
49528
|
+
{ x: 3, y: 3 },
|
|
49529
|
+
{ x: 4, y: 3 },
|
|
49530
|
+
{ x: 5, y: 3 },
|
|
49531
|
+
{ x: 6, y: 3 },
|
|
49532
|
+
{ x: 7, y: 3 },
|
|
49533
|
+
{ x: 8, y: 3 },
|
|
49534
|
+
{ x: 9, y: 3 },
|
|
49535
|
+
{ x: 10, y: 3 },
|
|
49536
|
+
{ x: 11, y: 3 },
|
|
49537
|
+
{ x: 12, y: 3 },
|
|
49538
|
+
{ x: 13, y: 3 },
|
|
49539
|
+
{ x: 13, y: 4 },
|
|
49540
|
+
{ x: 13, y: 5 },
|
|
49541
|
+
{ x: 13, y: 6 },
|
|
49542
|
+
{ x: 13, y: 7 },
|
|
49543
|
+
{ x: 12, y: 7 },
|
|
49544
|
+
{ x: 11, y: 7 },
|
|
49545
|
+
{ x: 10, y: 7 },
|
|
49546
|
+
{ x: 9, y: 7 },
|
|
49547
|
+
{ x: 8, y: 7 },
|
|
49548
|
+
{ x: 7, y: 7 },
|
|
49549
|
+
{ x: 6, y: 7 },
|
|
49550
|
+
{ x: 5, y: 7 },
|
|
49551
|
+
{ x: 4, y: 7 },
|
|
49552
|
+
{ x: 3, y: 7 },
|
|
49553
|
+
{ x: 2, y: 7 },
|
|
49554
|
+
{ x: 2, y: 8 },
|
|
49555
|
+
{ x: 2, y: 9 },
|
|
49556
|
+
{ x: 2, y: 10 },
|
|
49557
|
+
{ x: 2, y: 11 },
|
|
49558
|
+
{ x: 3, y: 11 },
|
|
49559
|
+
{ x: 4, y: 11 },
|
|
49560
|
+
{ x: 5, y: 11 },
|
|
49561
|
+
{ x: 6, y: 11 },
|
|
49562
|
+
{ x: 7, y: 11 },
|
|
49563
|
+
{ x: 8, y: 11 },
|
|
49564
|
+
{ x: 9, y: 11 },
|
|
49565
|
+
{ x: 10, y: 11 },
|
|
49566
|
+
{ x: 11, y: 11 },
|
|
49567
|
+
{ x: 12, y: 11 },
|
|
49568
|
+
{ x: 13, y: 11 },
|
|
49569
|
+
{ x: 13, y: 12 },
|
|
49570
|
+
{ x: 13, y: 13 },
|
|
49571
|
+
{ x: 13, y: 14 },
|
|
49572
|
+
{ x: 13, y: 15 }
|
|
49573
|
+
];
|
|
49574
|
+
DEFAULT_TD_TILES = buildDefaultTDTiles();
|
|
49462
49575
|
TOWER_SPRITE = `${CDN6}units/guardian.png`;
|
|
49463
49576
|
CREEP_SPRITE = `${CDN6}units/scrapper.png`;
|
|
49464
49577
|
TowerDefenseBoard.displayName = "TowerDefenseBoard";
|
|
@@ -49735,6 +49848,17 @@ function heroPosition(h) {
|
|
|
49735
49848
|
function heroMovement(h) {
|
|
49736
49849
|
return num(h.movement);
|
|
49737
49850
|
}
|
|
49851
|
+
function buildDefaultWorldTiles() {
|
|
49852
|
+
const tiles = [];
|
|
49853
|
+
for (let y = 0; y < WORLD_GRID_H; y++) {
|
|
49854
|
+
for (let x = 0; x < WORLD_GRID_W; x++) {
|
|
49855
|
+
const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
|
|
49856
|
+
const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
|
|
49857
|
+
tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
|
|
49858
|
+
}
|
|
49859
|
+
}
|
|
49860
|
+
return tiles;
|
|
49861
|
+
}
|
|
49738
49862
|
function defaultIsInRange(from, to, range) {
|
|
49739
49863
|
return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
|
|
49740
49864
|
}
|
|
@@ -49745,7 +49869,7 @@ function WorldMapBoard({
|
|
|
49745
49869
|
features: propFeatures,
|
|
49746
49870
|
assetManifest: propAssetManifest,
|
|
49747
49871
|
isLoading,
|
|
49748
|
-
scale = 0.
|
|
49872
|
+
scale = 0.25,
|
|
49749
49873
|
unitScale = 2.5,
|
|
49750
49874
|
spriteHeightRatio = 1.5,
|
|
49751
49875
|
spriteMaxWidthRatio = 0.6,
|
|
@@ -49789,7 +49913,8 @@ function WorldMapBoard({
|
|
|
49789
49913
|
})),
|
|
49790
49914
|
[entityTiles]
|
|
49791
49915
|
);
|
|
49792
|
-
const
|
|
49916
|
+
const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
|
|
49917
|
+
const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
|
|
49793
49918
|
const baseUnits = React82.useMemo(
|
|
49794
49919
|
() => propUnits ?? entityUnits.map((u) => ({
|
|
49795
49920
|
id: str(u.id),
|
|
@@ -49999,6 +50124,7 @@ function WorldMapBoard({
|
|
|
49999
50124
|
footer && footer(ctx)
|
|
50000
50125
|
] });
|
|
50001
50126
|
}
|
|
50127
|
+
var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
|
|
50002
50128
|
var init_WorldMapBoard = __esm({
|
|
50003
50129
|
"components/game/organisms/WorldMapBoard.tsx"() {
|
|
50004
50130
|
"use client";
|
|
@@ -50009,6 +50135,17 @@ var init_WorldMapBoard = __esm({
|
|
|
50009
50135
|
init_IsometricCanvas();
|
|
50010
50136
|
init_boardEntity();
|
|
50011
50137
|
init_isometric();
|
|
50138
|
+
WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
|
|
50139
|
+
WORLD_GRID_W = 16;
|
|
50140
|
+
WORLD_GRID_H = 16;
|
|
50141
|
+
WORLD_TERRAIN_DEFS = [
|
|
50142
|
+
{ terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
|
|
50143
|
+
{ terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
|
|
50144
|
+
{ terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
|
|
50145
|
+
{ terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
|
|
50146
|
+
{ terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
|
|
50147
|
+
];
|
|
50148
|
+
DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
|
|
50012
50149
|
WorldMapBoard.displayName = "WorldMapBoard";
|
|
50013
50150
|
}
|
|
50014
50151
|
});
|