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">
|
|
|
|
|
|
import type { Report } from '~/types/game'
|
|
|
|
|
|
|
2026-10-28 23:38:54 +00:00
|
|
|
|
definePageMeta({ layout: '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()
|
|
|
|
|
|
const worldId = Number(route.params.worldId)
|
|
|
|
|
|
const { error, show } = useReports(worldId)
|
|
|
|
|
|
useCurrentWorld().enter(worldId)
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
const clock = useNow()
|
|
|
|
|
|
|
|
|
|
|
|
const report = ref<Report | null>(null)
|
|
|
|
|
|
watch(
|
|
|
|
|
|
() => route.params.id,
|
|
|
|
|
|
async (id) => (report.value = await show(Number(id))),
|
|
|
|
|
|
{ immediate: true },
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const subject = computed(() => {
|
|
|
|
|
|
const r = report.value
|
|
|
|
|
|
if (!r) return ''
|
|
|
|
|
|
if (r.type === 'support') return t('reports.title_support', { from: villageLabel(r.payload.from), to: villageLabel(r.payload.to) })
|
|
|
|
|
|
return t('reports.title_attack', { from: villageLabel(r.payload.attacker.village), to: villageLabel(r.payload.defender.village) })
|
|
|
|
|
|
})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-10-29 00:26:08 +00:00
|
|
|
|
<div class="p-2.5">
|
2026-10-29 13:09:03 +00:00
|
|
|
|
<NuxtLink :to="`/reports/${worldId}`" class="btn btn-outline mb-3">‹ {{ $t('reports.back') }}</NuxtLink>
|
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
|
|
|
|
<p v-if="error" class="alert mb-3" role="alert">{{ error }}</p>
|
|
|
|
|
|
<section v-if="report" class="panel">
|
|
|
|
|
|
<div class="panel-head">
|
|
|
|
|
|
<h1 class="panel-title">{{ subject }}</h1>
|
|
|
|
|
|
<span class="text-sm whitespace-nowrap text-ink-700 tabular-nums">{{ formatArrival(Date.parse(report.happened_at), clock, t) }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="panel-body">
|
|
|
|
|
|
<ReportBattle v-if="report.type !== 'support'" :report="report.payload" :world-id="worldId" />
|
|
|
|
|
|
<div v-else class="space-y-3 text-sm">
|
|
|
|
|
|
<p>{{ $t('reports.support.arrived', { to: villageLabel(report.payload.to) }) }}</p>
|
|
|
|
|
|
<ReportUnits :units="report.payload.units" :lost="null" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
<p v-else-if="!error" class="py-6 text-center text-sm text-ink-500">{{ $t('common.loading') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|