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
|
2026-10-29 15:17:00 +00:00
|
|
|
|
return r ? reportSubject(r, t) : ''
|
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
|
|
|
|
})
|
2026-10-31 10:07:33 +00:00
|
|
|
|
const fight = computed(() => (report.value && (report.value.type === 'attack' || report.value.type === 'defense') ? report.value.payload : null))
|
2026-10-29 15:17:00 +00:00
|
|
|
|
const battle = computed(() => (fight.value && !('scattered' in fight.value) ? fight.value : null))
|
|
|
|
|
|
const scattered = computed(() => (fight.value && 'scattered' in fight.value ? fight.value : null))
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
<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">
|
2026-10-31 09:57:07 +00:00
|
|
|
|
<ReportBattle v-if="battle" :report="battle" :world-id="worldId" :defense="report.type === 'defense'" />
|
2026-10-29 15:17:00 +00:00
|
|
|
|
<p v-else-if="scattered" class="text-sm">{{ $t('reports.scattered', { from: villageLabel(scattered.attacker.village) }) }}</p>
|
|
|
|
|
|
<div v-else-if="report.type === 'support'" class="space-y-3 text-sm">
|
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>{{ $t('reports.support.arrived', { to: villageLabel(report.payload.to) }) }}</p>
|
|
|
|
|
|
<ReportUnits :units="report.payload.units" :lost="null" />
|
|
|
|
|
|
</div>
|
2026-10-31 10:07:33 +00:00
|
|
|
|
<ReportTrade v-else-if="report.type === 'trade'" :report="report.payload" :world-id="worldId" />
|
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>
|
|
|
|
|
|
</section>
|
|
|
|
|
|
<p v-else-if="!error" class="py-6 text-center text-sm text-ink-500">{{ $t('common.loading') }}</p>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|