From d12443bf181f3aba9268d1d323ab4ababd9bf508 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Thu, 29 Oct 2026 00:16:06 +0100 Subject: [PATCH] feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename Send attacks and support from the rally point with a live travel-time preview, see own commands and spotted incoming attacks with countdowns and call-back, send support home or withdraw it, read battle and support reports with an unread badge, run the battle simulator, rename villages, and send troops straight from the map. The watchtower gets a diorama model; the mock server answers every new intent. Co-Authored-By: Claude Opus 5.5 --- app/app.vue | 12 +- app/components/icon/Building.vue | 6 + app/components/icon/Ui.vue | 38 +- app/components/icon/Unit.vue | 6 + app/components/map/InfoCard.vue | 9 + app/components/report/Battle.vue | 110 ++++ app/components/report/Units.vue | 39 ++ app/components/village/Movements.vue | 89 ++++ app/components/village/OverviewSidebar.vue | 15 + app/components/village/SendTroops.vue | 187 +++++++ app/components/village/Simulator.vue | 136 +++++ app/components/village/SupportPanel.vue | 55 ++ app/composables/useReports.ts | 50 ++ app/composables/useVillage.ts | 27 +- app/diorama/models.ts | 40 ++ app/mock/catalog.ts | 46 +- app/mock/server.ts | 582 +++++++++++++++++++-- app/pages/reports/[worldId]/[id].vue | 45 ++ app/pages/reports/[worldId]/index.vue | 85 +++ app/pages/village/[id].vue | 38 +- app/pages/village/[id]/index.vue | 1 + app/pages/village/[id]/rally.vue | 43 ++ app/types/game.ts | 145 +++++ app/utils/military.ts | 59 +++ app/utils/palette.ts | 1 + i18n/locales/en.ts | 21 + i18n/messageloader.ts | 3 +- i18n/pages/map.ts | 1 + i18n/pages/reports.ts | 55 ++ i18n/pages/village.ts | 72 +++ 30 files changed, 1965 insertions(+), 51 deletions(-) create mode 100644 app/components/report/Battle.vue create mode 100644 app/components/report/Units.vue create mode 100644 app/components/village/Movements.vue create mode 100644 app/components/village/SendTroops.vue create mode 100644 app/components/village/Simulator.vue create mode 100644 app/components/village/SupportPanel.vue create mode 100644 app/composables/useReports.ts create mode 100644 app/pages/reports/[worldId]/[id].vue create mode 100644 app/pages/reports/[worldId]/index.vue create mode 100644 app/pages/village/[id]/rally.vue create mode 100644 app/utils/military.ts create mode 100644 i18n/pages/reports.ts diff --git a/app/app.vue b/app/app.vue index 26ceff1..a88ee73 100644 --- a/app/app.vue +++ b/app/app.vue @@ -4,9 +4,10 @@ const { user, logout } = useAuth() const notices = useNotices() const route = useRoute() const { current } = useCurrentWorld() +const unreadReports = useUnreadReports() -/** Inside a world (village or map) the header is that world's navigation. */ -const inWorld = computed(() => !!current.value && /^\/(village|map)\//.test(route.path)) +/** Inside a world (village, map or reports) the header is that world's navigation. */ +const inWorld = computed(() => !!current.value && /^\/(village|map|reports)\//.test(route.path)) const home = computed(() => inWorld.value && current.value?.villageId ? `/village/${current.value.villageId}` : '/worlds', ) @@ -57,6 +58,13 @@ useHead({ title: () => t('app.title') }) {{ t('app.map') }} + + + + + {{ unreadReports }} + +
diff --git a/app/components/icon/Building.vue b/app/components/icon/Building.vue index 7424d33..98fe1f2 100644 --- a/app/components/icon/Building.vue +++ b/app/components/icon/Building.vue @@ -76,6 +76,12 @@ defineProps<{ type: BuildingType }>() + + + + + + diff --git a/app/components/icon/Ui.vue b/app/components/icon/Ui.vue index 05eafcc..747e69e 100644 --- a/app/components/icon/Ui.vue +++ b/app/components/icon/Ui.vue @@ -1,5 +1,21 @@ @@ -41,6 +57,26 @@ defineProps<{ name: UiIconName }>() + + + + + + + + + + + + + + + + + + + + diff --git a/app/components/icon/Unit.vue b/app/components/icon/Unit.vue index 02ce40f..f174e6b 100644 --- a/app/components/icon/Unit.vue +++ b/app/components/icon/Unit.vue @@ -36,6 +36,12 @@ defineProps<{ unit: UnitType | 'militia' }>() + + + + + + diff --git a/app/components/map/InfoCard.vue b/app/components/map/InfoCard.vue index e37fcd6..092a28d 100644 --- a/app/components/map/InfoCard.vue +++ b/app/components/map/InfoCard.vue @@ -6,6 +6,7 @@ defineProps<{ at: { x: number; y: number } | null }>() const emit = defineEmits<{ center: [at: { x: number; y: number }] }>() +const { current } = useCurrentWorld() const continentOf = (x: number, y: number) => `K${Math.floor(y / 100)}${Math.floor(x / 100)}` @@ -28,6 +29,14 @@ const continentOf = (x: number, y: number) => `K${Math.floor(y / 100)}${Math.flo
{{ $t('map.info.open') }} + + + {{ $t('map.info.send') }} + diff --git a/app/components/report/Battle.vue b/app/components/report/Battle.vue new file mode 100644 index 0000000..a8f4312 --- /dev/null +++ b/app/components/report/Battle.vue @@ -0,0 +1,110 @@ + + + + diff --git a/app/components/report/Units.vue b/app/components/report/Units.vue new file mode 100644 index 0000000..a6c6043 --- /dev/null +++ b/app/components/report/Units.vue @@ -0,0 +1,39 @@ + + + + diff --git a/app/components/village/Movements.vue b/app/components/village/Movements.vue new file mode 100644 index 0000000..68eabfb --- /dev/null +++ b/app/components/village/Movements.vue @@ -0,0 +1,89 @@ + + + + diff --git a/app/components/village/OverviewSidebar.vue b/app/components/village/OverviewSidebar.vue index b1db347..8749d73 100644 --- a/app/components/village/OverviewSidebar.vue +++ b/app/components/village/OverviewSidebar.vue @@ -13,6 +13,8 @@ const production = computed(() => (['wood', 'clay', 'iron', 'food'] as const).ma const troops = computed(() => (Object.entries(props.village.troops) as [UnitType, number][]).filter(([, n]) => n > 0)) const idle = computed(() => props.village.population.villagers - props.village.population.workers - props.village.levy.militia) const spaceShare = computed(() => props.village.space.used / props.village.space.max) +const incoming = computed(() => props.village.movements.filter((m) => m.direction === 'in' && m.type === 'attack')) +const commands = computed(() => props.village.movements.filter((m) => m.direction !== 'in').length) function order(o: BuildOrder) { const type = t(`buildings.${o.type}`) @@ -24,6 +26,17 @@ function order(o: BuildOrder) {