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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
<script setup lang="ts">
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
import type { UnitType } from '~/types/game'
|
|
|
|
|
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
const route = useRoute()
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
const router = useRouter()
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
const v = useVillageContext()
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
const { t } = useI18n()
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
const village = computed(() => v.village.value!)
|
|
|
|
|
|
|
|
|
|
/** `?x=&y=` from the map fills in the target. */
|
|
|
|
|
const initialTarget = computed(() => (route.query.x && route.query.y ? { x: Number(route.query.x), y: Number(route.query.y) } : null))
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
const rallyPoint = computed(() => village.value.buildings.find((b) => b.type === 'rally_point') ?? null)
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
|
|
|
|
|
// Like the rally point in Die Stämme, its parts are tabs: commands, troops, simulator.
|
|
|
|
|
type Tab = 'commands' | 'troops' | 'simulator'
|
|
|
|
|
const tab = computed<Tab>({
|
|
|
|
|
get: () => (['troops', 'simulator'].includes(String(route.query.tab)) ? (route.query.tab as Tab) : 'commands'),
|
|
|
|
|
set: (value) => router.replace({ query: { ...route.query, tab: value === 'commands' ? undefined : value } }),
|
|
|
|
|
})
|
|
|
|
|
const incoming = computed(() => village.value.movements.filter((m) => m.direction === 'in').length)
|
|
|
|
|
const tabs = computed(() => [
|
|
|
|
|
{ key: 'commands' as const, label: t('village.rally.tabs.commands'), icon: 'attack' as const, count: incoming.value },
|
|
|
|
|
{ key: 'troops' as const, label: t('village.rally.tabs.troops'), icon: 'users' as const },
|
|
|
|
|
{ key: 'simulator' as const, label: t('village.rally.tabs.simulator'), icon: 'support' as const },
|
|
|
|
|
])
|
|
|
|
|
const home = computed(() => unitRows(village.value.troops))
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
</script>
|
|
|
|
|
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
<!-- The rally point: send troops and follow them, see where the troops are, and simulate battles. -->
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
<template>
|
2026-10-29 00:26:08 +00:00
|
|
|
<div class="space-y-3 p-2.5">
|
2026-10-29 13:38:34 +00:00
|
|
|
<VillageBuildingHeader
|
|
|
|
|
v-if="rallyPoint"
|
|
|
|
|
:building="rallyPoint"
|
|
|
|
|
:title="buildingName(village, rallyPoint, t)"
|
|
|
|
|
:resources="v.resources.value!"
|
|
|
|
|
:can-afford="v.canAfford"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
@upgrade="v.upgrade"
|
|
|
|
|
@demolish="v.demolish"
|
|
|
|
|
@priority="v.setPriority"
|
|
|
|
|
/>
|
|
|
|
|
<VillageScreenHeader v-else type="rally_point" :level="null" :title="$t('buildings.rally_point')" :description="$t('village.about.rally')" />
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
<UiSubTabs v-model="tab" :tabs="tabs" />
|
|
|
|
|
|
2026-10-29 09:56:52 +00:00
|
|
|
<div v-if="tab === 'commands'" class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
<VillageSendTroops
|
|
|
|
|
:key="`${route.query.x}|${route.query.y}`"
|
|
|
|
|
class="self-start"
|
|
|
|
|
:village="village"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
:initial-target="initialTarget"
|
|
|
|
|
:now="v.now.value"
|
|
|
|
|
:preview="v.preview"
|
|
|
|
|
:send="v.send"
|
|
|
|
|
/>
|
|
|
|
|
<VillageMovements
|
|
|
|
|
class="self-start"
|
|
|
|
|
:movements="village.movements"
|
|
|
|
|
:world-id="village.world_id"
|
|
|
|
|
:now="v.now.value"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
@cancel="v.cancelMovement"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-29 09:56:52 +00:00
|
|
|
<div v-else-if="tab === 'troops'" class="grid gap-3 @4xl:grid-cols-[18rem_minmax(0,1fr)]">
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
<section class="panel self-start">
|
|
|
|
|
<div class="panel-head">
|
|
|
|
|
<h2 class="panel-title">{{ $t('village.rally.at_home') }}</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
<ul v-if="home.length" class="divide-y divide-parchment-300 text-sm">
|
|
|
|
|
<li v-for="[unit, count] in home" :key="unit" class="flex items-center gap-2 py-1">
|
|
|
|
|
<IconUnit :unit="unit as UnitType" class="size-5 text-wood-800" />
|
|
|
|
|
<span class="flex-1">{{ $t(`units.${unit}`) }}</span>
|
|
|
|
|
<span class="font-semibold tabular-nums">{{ count }}</span>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p v-else class="text-sm text-ink-500">{{ $t('village.troops.none') }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
<VillageSupportPanel
|
|
|
|
|
class="self-start"
|
|
|
|
|
:here="village.support.here"
|
|
|
|
|
:away="village.support.away"
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
:world-id="village.world_id"
|
|
|
|
|
:busy="v.busy.value"
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
@send-home="v.sendHome"
|
|
|
|
|
@withdraw="v.withdraw"
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
/>
|
|
|
|
|
</div>
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
|
|
|
|
|
<VillageSimulator v-else :world-id="village.world_id" :troops="village.troops" open />
|
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 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|