diff --git a/src/board/BuildingTile.svelte b/src/board/BuildingTile.svelte index 42144ed..cabb4c9 100644 --- a/src/board/BuildingTile.svelte +++ b/src/board/BuildingTile.svelte @@ -9,6 +9,7 @@ $: isUpgrading = building.state.upgrade.isUpgrading; $: canUpgrade = !isUpgrading && canPayBuildingCost($village, building); + $: maxLevelReached = building.level === building.maxLevel; function upgradeBuilding() { @@ -24,6 +25,7 @@ class="level" class:can-upgrade={ canUpgrade } class:is-upgrading={ isUpgrading } + class:max-level={ maxLevelReached } on:click|stopPropagation={ upgradeBuilding } > { building.level } @@ -59,4 +61,8 @@ .level.is-upgrading { border-color: hsl(56, 99%, 43%); } + + .level.max-level { + border-color: hsl(209, 70%, 52%); + } diff --git a/src/data/buildings.ts b/src/data/buildings.ts index f00b359..de61db6 100644 --- a/src/data/buildings.ts +++ b/src/data/buildings.ts @@ -8,6 +8,7 @@ export default [ type: 'townhall', name: 'Town Hall', autoBuilt: true, + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -31,6 +32,7 @@ export default [ type: 'woodcutter', name: 'Woodcutter', autoBuilt: true, + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -56,6 +58,7 @@ export default [ type: 'mine', name: 'Mine', autoBuilt: true, + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -81,6 +84,7 @@ export default [ type: 'pit', name: 'Pit', autoBuilt: true, + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -106,6 +110,7 @@ export default [ type: 'field', name: 'Field', autoBuilt: true, + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -126,6 +131,7 @@ export default [ { type: 'warehouse', name: 'Warehouse', + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -150,6 +156,7 @@ export default [ { type: 'granary', name: 'Granary', + maxLevel: 20, cost: (level: number) => { return { wood: level * 10, @@ -174,6 +181,7 @@ export default [ { type: 'university', name: 'University', + maxLevel: 20, cost: (level: number) => { return { wood: level * 100, @@ -198,6 +206,7 @@ export default [ { type: 'barracks', name: 'Barracks', + maxLevel: 20, cost: (level: number) => { return { wood: level * 100, diff --git a/src/hud/BuildingPanel.svelte b/src/hud/BuildingPanel.svelte index 297e144..e7db7b1 100644 --- a/src/hud/BuildingPanel.svelte +++ b/src/hud/BuildingPanel.svelte @@ -1,9 +1,10 @@