@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.
@@ -11866,13 +11866,29 @@ var init_boardEntity = __esm({
11866
11866
  "components/game/organisms/boardEntity.ts"() {
11867
11867
  }
11868
11868
  });
11869
+ function buildDefaultBattleTiles() {
11870
+ const tiles = [];
11871
+ for (let y = 0; y < BATTLE_GRID_H; y++) {
11872
+ for (let x = 0; x < BATTLE_GRID_W; x++) {
11873
+ const variant = (x * 3 + y * 7 + (x ^ y)) % BATTLE_TERRAIN_SPRITES.length;
11874
+ tiles.push({
11875
+ x,
11876
+ y,
11877
+ terrain: ["grass", "dirt", "planks", "stone", "stone"][variant],
11878
+ terrainSprite: BATTLE_TERRAIN_SPRITES[variant],
11879
+ passable: true
11880
+ });
11881
+ }
11882
+ }
11883
+ return tiles;
11884
+ }
11869
11885
  function BattleBoard({
11870
11886
  entity,
11871
11887
  tiles: propTiles,
11872
11888
  units: propUnits,
11873
11889
  features: propFeatures,
11874
11890
  assetManifest: propAssetManifest,
11875
- scale = 0.45,
11891
+ scale = 0.25,
11876
11892
  unitScale = 1,
11877
11893
  spriteHeightRatio = 1.5,
11878
11894
  spriteMaxWidthRatio = 0.6,
@@ -11899,10 +11915,11 @@ function BattleBoard({
11899
11915
  className
11900
11916
  }) {
11901
11917
  const board = boardEntity(entity) ?? {};
11902
- const tiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
11918
+ const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : []);
11919
+ const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
11903
11920
  const features = propFeatures ?? (Array.isArray(board.features) ? board.features : []);
11904
- const boardWidth = num(board.gridWidth ?? board.boardWidth, 8);
11905
- const boardHeight = num(board.gridHeight ?? board.boardHeight, 6);
11921
+ const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
11922
+ const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
11906
11923
  const assetManifest = propAssetManifest ?? board.assetManifest;
11907
11924
  const backgroundImage = board.backgroundImage;
11908
11925
  const units = rows(board.units);
@@ -12224,6 +12241,7 @@ function BattleBoard({
12224
12241
  ] }) }))
12225
12242
  ] });
12226
12243
  }
12244
+ var BATTLE_CDN, BATTLE_GRID_W, BATTLE_GRID_H, BATTLE_TERRAIN_SPRITES, DEFAULT_BATTLE_TILES;
12227
12245
  var init_BattleBoard = __esm({
12228
12246
  "components/game/organisms/BattleBoard.tsx"() {
12229
12247
  "use client";
@@ -12236,6 +12254,17 @@ var init_BattleBoard = __esm({
12236
12254
  init_IsometricCanvas();
12237
12255
  init_boardEntity();
12238
12256
  init_isometric();
12257
+ BATTLE_CDN = "https://almadar-kflow-assets.web.app/shared";
12258
+ BATTLE_GRID_W = 16;
12259
+ BATTLE_GRID_H = 16;
12260
+ BATTLE_TERRAIN_SPRITES = [
12261
+ `${BATTLE_CDN}/isometric-dungeon/Isometric/dirt_E.png`,
12262
+ `${BATTLE_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`,
12263
+ `${BATTLE_CDN}/isometric-dungeon/Isometric/planks_E.png`,
12264
+ `${BATTLE_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`,
12265
+ `${BATTLE_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`
12266
+ ];
12267
+ DEFAULT_BATTLE_TILES = buildDefaultBattleTiles();
12239
12268
  BattleBoard.displayName = "BattleBoard";
12240
12269
  }
12241
12270
  });
@@ -12243,7 +12272,7 @@ function BattleTemplate({
12243
12272
  entity,
12244
12273
  scale = 0.45,
12245
12274
  unitScale = 1,
12246
- tiles = DEFAULT_BATTLE_TILES,
12275
+ tiles = DEFAULT_BATTLE_TILES2,
12247
12276
  units = DEFAULT_BATTLE_UNITS,
12248
12277
  features = DEFAULT_BATTLE_FEATURES,
12249
12278
  assetManifest = DEFAULT_BATTLE_MANIFEST,
@@ -12272,12 +12301,12 @@ function BattleTemplate({
12272
12301
  }
12273
12302
  );
12274
12303
  }
12275
- var CDN, DEFAULT_BATTLE_TILES, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
12304
+ var CDN, DEFAULT_BATTLE_TILES2, DEFAULT_BATTLE_UNITS, DEFAULT_BATTLE_FEATURES, DEFAULT_BATTLE_MANIFEST;
12276
12305
  var init_BattleTemplate = __esm({
12277
12306
  "components/game/templates/BattleTemplate.tsx"() {
12278
12307
  init_BattleBoard();
12279
12308
  CDN = "https://almadar-kflow-assets.web.app/shared";
12280
- DEFAULT_BATTLE_TILES = [
12309
+ DEFAULT_BATTLE_TILES2 = [
12281
12310
  { x: 0, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
12282
12311
  { x: 1, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
12283
12312
  { x: 2, y: 0, terrain: "stone", passable: false, terrainSprite: `${CDN}/isometric-blocks/PNG/Abstract tiles/abstractTile_07.png` },
@@ -42140,7 +42169,6 @@ var init_GameCanvas3D2 = __esm({
42140
42169
  selectedTileIds = [],
42141
42170
  selectedUnitId = null,
42142
42171
  unitScale = 1,
42143
- scale = 0.45,
42144
42172
  children
42145
42173
  }, ref) => {
42146
42174
  const containerRef = useRef(null);
@@ -42587,7 +42615,7 @@ var init_GameCanvas3D2 = __esm({
42587
42615
  fadeStrength: 1
42588
42616
  }
42589
42617
  ),
42590
- /* @__PURE__ */ jsxs("group", { scale, children: [
42618
+ /* @__PURE__ */ jsxs("group", { children: [
42591
42619
  tiles.map((tile, index) => {
42592
42620
  const position = gridToWorld(
42593
42621
  tile.x,
@@ -44730,6 +44758,35 @@ var init_PricingPageTemplate = __esm({
44730
44758
  PricingPageTemplate.displayName = "PricingPageTemplate";
44731
44759
  }
44732
44760
  });
44761
+ function dungeonTerrain(x, y, stairsX, stairsY) {
44762
+ const isBorder = x === 0 || y === 0 || x === DUNGEON_GRID_W - 1 || y === DUNGEON_GRID_H - 1;
44763
+ const isPillar = x % 4 === 0 && y % 4 === 0 && !isBorder;
44764
+ const isWall = isBorder || isPillar;
44765
+ if (x === stairsX && y === stairsY) {
44766
+ return { terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` };
44767
+ }
44768
+ if (isWall) {
44769
+ return { terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` };
44770
+ }
44771
+ const variant = (x * 3 + y * 7) % 5;
44772
+ const sprites = [
44773
+ `${CDN4}/isometric-dungeon/Isometric/dirt_E.png`,
44774
+ `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png`,
44775
+ `${CDN4}/isometric-dungeon/Isometric/planks_E.png`,
44776
+ `${CDN4}/isometric-dungeon/Isometric/stoneTile_E.png`,
44777
+ `${CDN4}/isometric-dungeon/Isometric/dirt_E.png`
44778
+ ];
44779
+ return { terrain: "floor", passable: true, terrainSprite: sprites[variant] };
44780
+ }
44781
+ function buildDefaultDungeonTiles(stairsX, stairsY) {
44782
+ const tiles = [];
44783
+ for (let y = 0; y < DUNGEON_GRID_H; y++) {
44784
+ for (let x = 0; x < DUNGEON_GRID_W; x++) {
44785
+ tiles.push({ x, y, ...dungeonTerrain(x, y, stairsX, stairsY) });
44786
+ }
44787
+ }
44788
+ return tiles;
44789
+ }
44733
44790
  function RoguelikeBoard({
44734
44791
  entity,
44735
44792
  tiles: propTiles,
@@ -44745,7 +44802,7 @@ function RoguelikeBoard({
44745
44802
  stairsX: propStairsX,
44746
44803
  stairsY: propStairsY,
44747
44804
  assetManifest: propAssetManifest,
44748
- scale = 0.45,
44805
+ scale = 0.25,
44749
44806
  unitScale = 1,
44750
44807
  spriteHeightRatio = 1.5,
44751
44808
  spriteMaxWidthRatio = 0.6,
@@ -44755,7 +44812,9 @@ function RoguelikeBoard({
44755
44812
  className
44756
44813
  }) {
44757
44814
  const board = boardEntity(entity) ?? {};
44758
- const tiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles : DEFAULT_TILES2);
44815
+ const resolvedStairsX = propStairsX ?? num(board.stairsX, 14);
44816
+ const resolvedStairsY = propStairsY ?? num(board.stairsY, 14);
44817
+ const tiles = propTiles ?? (Array.isArray(board.tiles) && board.tiles.length >= DUNGEON_GRID_W * DUNGEON_GRID_H ? board.tiles : buildDefaultDungeonTiles(resolvedStairsX, resolvedStairsY));
44759
44818
  const enemies = propEnemies ?? (Array.isArray(board.enemies) ? board.enemies : DEFAULT_ENEMIES);
44760
44819
  const items = propItems ?? (Array.isArray(board.items) ? board.items : DEFAULT_ITEMS);
44761
44820
  const player = propPlayer ?? board.player ?? { x: 1, y: 1 };
@@ -44765,8 +44824,8 @@ function RoguelikeBoard({
44765
44824
  const depth = propDepth ?? num(board.depth, 1);
44766
44825
  const result = propResult ?? (str(board.result) || "none");
44767
44826
  const phase = propPhase ?? (str(board.phase) || "player_turn");
44768
- propStairsX ?? num(board.stairsX, 3);
44769
- propStairsY ?? num(board.stairsY, 3);
44827
+ propStairsX ?? num(board.stairsX, 14);
44828
+ propStairsY ?? num(board.stairsY, 14);
44770
44829
  const eventBus = useEventBus();
44771
44830
  const { t } = useTranslate();
44772
44831
  const [hoveredTile, setHoveredTile] = useState(null);
@@ -44942,7 +45001,7 @@ function RoguelikeBoard({
44942
45001
  ] }) })
44943
45002
  ] });
44944
45003
  }
44945
- var CDN4, DEFAULT_TILES2, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
45004
+ var CDN4, DUNGEON_GRID_W, DUNGEON_GRID_H, DEFAULT_ENEMIES, DEFAULT_ITEMS, FEATURE_SPRITE;
44946
45005
  var init_RoguelikeBoard = __esm({
44947
45006
  "components/game/organisms/RoguelikeBoard.tsx"() {
44948
45007
  "use client";
@@ -44955,39 +45014,19 @@ var init_RoguelikeBoard = __esm({
44955
45014
  init_IsometricCanvas();
44956
45015
  init_boardEntity();
44957
45016
  CDN4 = "https://almadar-kflow-assets.web.app/shared";
44958
- DEFAULT_TILES2 = [
44959
- { x: 0, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44960
- { x: 1, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44961
- { x: 2, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44962
- { x: 3, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44963
- { x: 4, y: 0, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44964
- { x: 0, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44965
- { x: 1, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
44966
- { x: 2, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
44967
- { x: 3, y: 1, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
44968
- { x: 4, y: 1, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44969
- { x: 0, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44970
- { x: 1, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
44971
- { x: 2, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
44972
- { x: 3, y: 2, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
44973
- { x: 4, y: 2, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44974
- { x: 0, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44975
- { x: 1, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirt_E.png` },
44976
- { x: 2, y: 3, terrain: "floor", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/dirtTiles_E.png` },
44977
- { x: 3, y: 3, terrain: "stairs", passable: true, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stairs_E.png` },
44978
- { x: 4, y: 3, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44979
- { x: 0, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44980
- { x: 1, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44981
- { x: 2, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44982
- { x: 3, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` },
44983
- { x: 4, y: 4, terrain: "wall", passable: false, terrainSprite: `${CDN4}/isometric-dungeon/Isometric/stoneInset_E.png` }
44984
- ];
45017
+ DUNGEON_GRID_W = 16;
45018
+ DUNGEON_GRID_H = 16;
45019
+ buildDefaultDungeonTiles(14, 14);
44985
45020
  DEFAULT_ENEMIES = [
44986
- { id: "e1", x: 3, y: 1, hp: 5, attack: 2 },
44987
- { id: "e2", x: 1, y: 3, hp: 4, attack: 1 }
45021
+ { id: "e1", x: 5, y: 2, hp: 5, attack: 2 },
45022
+ { id: "e2", x: 9, y: 6, hp: 4, attack: 1 },
45023
+ { id: "e3", x: 3, y: 10, hp: 6, attack: 2 },
45024
+ { id: "e4", x: 12, y: 8, hp: 5, attack: 3 }
44988
45025
  ];
44989
45026
  DEFAULT_ITEMS = [
44990
- { id: "i1", x: 2, y: 2, kind: "health_potion" }
45027
+ { id: "i1", x: 3, y: 3, kind: "health_potion" },
45028
+ { id: "i2", x: 7, y: 9, kind: "sword" },
45029
+ { id: "i3", x: 11, y: 5, kind: "shield" }
44991
45030
  ];
44992
45031
  FEATURE_SPRITE = {
44993
45032
  health_potion: `${CDN4}/isometric-dungeon/Isometric/chestClosed_E.png`,
@@ -49195,6 +49234,22 @@ var init_ToastSlot = __esm({
49195
49234
  ToastSlot.displayName = "ToastSlot";
49196
49235
  }
49197
49236
  });
49237
+ function buildDefaultTDTiles() {
49238
+ const pathSet = new Set(DEFAULT_TD_PATH.map((p2) => `${p2.x},${p2.y}`));
49239
+ const tiles = [];
49240
+ for (let y = 0; y < TD_GRID_H; y++) {
49241
+ for (let x = 0; x < TD_GRID_W; x++) {
49242
+ if (pathSet.has(`${x},${y}`)) {
49243
+ tiles.push({ x, y, terrain: "path", passable: false, terrainSprite: TERRAIN_SPRITES.path });
49244
+ } else {
49245
+ const variant = (x * 3 + y * 5 + (x ^ y)) % 3;
49246
+ const terrainKey = ["ground", "grass", "dirt"][variant];
49247
+ tiles.push({ x, y, terrain: terrainKey, passable: true, terrainSprite: TERRAIN_SPRITES[terrainKey] ?? TERRAIN_SPRITES.ground });
49248
+ }
49249
+ }
49250
+ }
49251
+ return tiles;
49252
+ }
49198
49253
  function tilesToIso(tiles) {
49199
49254
  return tiles.map((t) => ({
49200
49255
  x: t.x,
@@ -49250,7 +49305,7 @@ function TowerDefenseBoard({
49250
49305
  result: propResult,
49251
49306
  waveActive: propWaveActive,
49252
49307
  towerCost = 25,
49253
- scale = 0.45,
49308
+ scale = 0.25,
49254
49309
  unitScale = 1,
49255
49310
  spriteHeightRatio = 1.5,
49256
49311
  spriteMaxWidthRatio = 0.6,
@@ -49263,8 +49318,10 @@ function TowerDefenseBoard({
49263
49318
  const board = boardEntity(entity) ?? {};
49264
49319
  const eventBus = useEventBus();
49265
49320
  const { t } = useTranslate();
49266
- const tiles = propTiles ?? rows(board.tiles);
49267
- const path = propPath ?? rows(board.path);
49321
+ const rawTiles = propTiles ?? rows(board.tiles);
49322
+ const tiles = rawTiles.length >= TD_GRID_W * TD_GRID_H ? rawTiles : DEFAULT_TD_TILES;
49323
+ const rawPath = propPath ?? rows(board.path);
49324
+ const path = rawPath.length > 0 ? rawPath : DEFAULT_TD_PATH;
49268
49325
  const towers = propTowers ?? rows(board.towers);
49269
49326
  const creeps = propCreeps ?? rows(board.creeps);
49270
49327
  const gold = propGold ?? num(board.gold, 100);
@@ -49394,7 +49451,7 @@ function TowerDefenseBoard({
49394
49451
  ] }) })
49395
49452
  ] });
49396
49453
  }
49397
- var CDN6, TERRAIN_SPRITES, TOWER_SPRITE, CREEP_SPRITE;
49454
+ var CDN6, TD_GRID_W, TD_GRID_H, TERRAIN_SPRITES, DEFAULT_TD_PATH, DEFAULT_TD_TILES, TOWER_SPRITE, CREEP_SPRITE;
49398
49455
  var init_TowerDefenseBoard = __esm({
49399
49456
  "components/game/organisms/TowerDefenseBoard.tsx"() {
49400
49457
  "use client";
@@ -49407,11 +49464,67 @@ var init_TowerDefenseBoard = __esm({
49407
49464
  init_IsometricCanvas();
49408
49465
  init_boardEntity();
49409
49466
  CDN6 = "https://almadar-kflow-assets.web.app/shared/";
49467
+ TD_GRID_W = 16;
49468
+ TD_GRID_H = 16;
49410
49469
  TERRAIN_SPRITES = {
49411
49470
  ground: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_01.png`,
49412
49471
  path: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_09.png`,
49413
- wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`
49414
- };
49472
+ wall: `${CDN6}isometric-blocks/PNG/Platformer tiles/platformerTile_05.png`,
49473
+ grass: `${CDN6}isometric-dungeon/Isometric/dirt_E.png`,
49474
+ dirt: `${CDN6}isometric-dungeon/Isometric/dirtTiles_E.png`
49475
+ };
49476
+ DEFAULT_TD_PATH = [
49477
+ { x: 2, y: 0 },
49478
+ { x: 2, y: 1 },
49479
+ { x: 2, y: 2 },
49480
+ { x: 2, y: 3 },
49481
+ { x: 3, y: 3 },
49482
+ { x: 4, y: 3 },
49483
+ { x: 5, y: 3 },
49484
+ { x: 6, y: 3 },
49485
+ { x: 7, y: 3 },
49486
+ { x: 8, y: 3 },
49487
+ { x: 9, y: 3 },
49488
+ { x: 10, y: 3 },
49489
+ { x: 11, y: 3 },
49490
+ { x: 12, y: 3 },
49491
+ { x: 13, y: 3 },
49492
+ { x: 13, y: 4 },
49493
+ { x: 13, y: 5 },
49494
+ { x: 13, y: 6 },
49495
+ { x: 13, y: 7 },
49496
+ { x: 12, y: 7 },
49497
+ { x: 11, y: 7 },
49498
+ { x: 10, y: 7 },
49499
+ { x: 9, y: 7 },
49500
+ { x: 8, y: 7 },
49501
+ { x: 7, y: 7 },
49502
+ { x: 6, y: 7 },
49503
+ { x: 5, y: 7 },
49504
+ { x: 4, y: 7 },
49505
+ { x: 3, y: 7 },
49506
+ { x: 2, y: 7 },
49507
+ { x: 2, y: 8 },
49508
+ { x: 2, y: 9 },
49509
+ { x: 2, y: 10 },
49510
+ { x: 2, y: 11 },
49511
+ { x: 3, y: 11 },
49512
+ { x: 4, y: 11 },
49513
+ { x: 5, y: 11 },
49514
+ { x: 6, y: 11 },
49515
+ { x: 7, y: 11 },
49516
+ { x: 8, y: 11 },
49517
+ { x: 9, y: 11 },
49518
+ { x: 10, y: 11 },
49519
+ { x: 11, y: 11 },
49520
+ { x: 12, y: 11 },
49521
+ { x: 13, y: 11 },
49522
+ { x: 13, y: 12 },
49523
+ { x: 13, y: 13 },
49524
+ { x: 13, y: 14 },
49525
+ { x: 13, y: 15 }
49526
+ ];
49527
+ DEFAULT_TD_TILES = buildDefaultTDTiles();
49415
49528
  TOWER_SPRITE = `${CDN6}units/guardian.png`;
49416
49529
  CREEP_SPRITE = `${CDN6}units/scrapper.png`;
49417
49530
  TowerDefenseBoard.displayName = "TowerDefenseBoard";
@@ -49688,6 +49801,17 @@ function heroPosition(h) {
49688
49801
  function heroMovement(h) {
49689
49802
  return num(h.movement);
49690
49803
  }
49804
+ function buildDefaultWorldTiles() {
49805
+ const tiles = [];
49806
+ for (let y = 0; y < WORLD_GRID_H; y++) {
49807
+ for (let x = 0; x < WORLD_GRID_W; x++) {
49808
+ const isBorder = x === 0 || y === 0 || x === WORLD_GRID_W - 1 || y === WORLD_GRID_H - 1;
49809
+ const def = isBorder ? WORLD_TERRAIN_DEFS[3] : WORLD_TERRAIN_DEFS[(x * 5 + y * 3 + (x ^ y)) % (WORLD_TERRAIN_DEFS.length - 1)];
49810
+ tiles.push({ x, y, terrain: def.terrain, terrainSprite: def.sprite, passable: def.passable });
49811
+ }
49812
+ }
49813
+ return tiles;
49814
+ }
49691
49815
  function defaultIsInRange(from, to, range) {
49692
49816
  return Math.abs(from.x - to.x) + Math.abs(from.y - to.y) <= range;
49693
49817
  }
@@ -49698,7 +49822,7 @@ function WorldMapBoard({
49698
49822
  features: propFeatures,
49699
49823
  assetManifest: propAssetManifest,
49700
49824
  isLoading,
49701
- scale = 0.4,
49825
+ scale = 0.25,
49702
49826
  unitScale = 2.5,
49703
49827
  spriteHeightRatio = 1.5,
49704
49828
  spriteMaxWidthRatio = 0.6,
@@ -49742,7 +49866,8 @@ function WorldMapBoard({
49742
49866
  })),
49743
49867
  [entityTiles]
49744
49868
  );
49745
- const tiles = propTiles ?? derivedTiles;
49869
+ const rawTiles = propTiles ?? (derivedTiles.length > 0 ? derivedTiles : null);
49870
+ const tiles = rawTiles != null && rawTiles.length >= WORLD_GRID_W * WORLD_GRID_H ? rawTiles : DEFAULT_WORLD_TILES;
49746
49871
  const baseUnits = useMemo(
49747
49872
  () => propUnits ?? entityUnits.map((u) => ({
49748
49873
  id: str(u.id),
@@ -49952,6 +50077,7 @@ function WorldMapBoard({
49952
50077
  footer && footer(ctx)
49953
50078
  ] });
49954
50079
  }
50080
+ var WORLD_CDN, WORLD_GRID_W, WORLD_GRID_H, WORLD_TERRAIN_DEFS, DEFAULT_WORLD_TILES;
49955
50081
  var init_WorldMapBoard = __esm({
49956
50082
  "components/game/organisms/WorldMapBoard.tsx"() {
49957
50083
  "use client";
@@ -49962,6 +50088,17 @@ var init_WorldMapBoard = __esm({
49962
50088
  init_IsometricCanvas();
49963
50089
  init_boardEntity();
49964
50090
  init_isometric();
50091
+ WORLD_CDN = "https://almadar-kflow-assets.web.app/shared";
50092
+ WORLD_GRID_W = 16;
50093
+ WORLD_GRID_H = 16;
50094
+ WORLD_TERRAIN_DEFS = [
50095
+ { terrain: "grass", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirt_E.png`, passable: true },
50096
+ { terrain: "dirt", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/dirtTiles_E.png`, passable: true },
50097
+ { terrain: "forest", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/planks_E.png`, passable: true },
50098
+ { terrain: "stone", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneInset_E.png`, passable: false },
50099
+ { terrain: "castle", sprite: `${WORLD_CDN}/isometric-dungeon/Isometric/stoneTile_E.png`, passable: true }
50100
+ ];
50101
+ DEFAULT_WORLD_TILES = buildDefaultWorldTiles();
49965
50102
  WorldMapBoard.displayName = "WorldMapBoard";
49966
50103
  }
49967
50104
  });