diff --git a/app/components/game/MenuBar.vue b/app/components/game/MenuBar.vue index 731f258..ef98818 100644 --- a/app/components/game/MenuBar.vue +++ b/app/components/game/MenuBar.vue @@ -154,6 +154,7 @@ watch(() => route.fullPath, () => menuKey.value++)
diff --git a/app/components/game/VillageFrame.vue b/app/components/game/VillageFrame.vue index 7a9aca2..7bbc878 100644 --- a/app/components/game/VillageFrame.vue +++ b/app/components/game/VillageFrame.vue @@ -1,5 +1,6 @@ + + + +{{ error }}
+{{ $t('common.loading') }}
+ +| {{ $t('account.world') }} | +{{ $t('account.villages') }} | +{{ $t('account.points') }} | +{{ $t('account.tribe') }} | +
|---|---|---|---|
| {{ w.world.name }} | +{{ w.villages }} | +{{ w.points }} | +{{ w.tribe ? `${w.tribe.name} [${w.tribe.tag}]` : '' }} | +
{{ $t('worlds.subtitle') }}
@@ -44,8 +72,17 @@ async function resetMock() {{{ $t('worlds.speed_value', { speed: w.speed }) }} {{ $t('worlds.joined') }} + {{ $t('worlds.fallen') }} {{ w.winner ? $t('worlds.won_by', { player: w.winner.name }) : $t('worlds.ended') }}
++ {{ $t('worlds.stats', { players: w.players, villages: w.villages, tribes: w.tribes, days: age(w.started_at) }) }} +
++ {{ $t('worlds.holds', { player: w.holder.name, time: span(until(w.ends_at)) }) }} + {{ $t('worlds.crowns_in', { time: span(until(w.crowns_at)) }) }} + {{ $t('worlds.crowns_stand') }} +
{{ $t('common.loading') }}
+{{ $t('worlds.start') }}
diff --git a/app/types/game.ts b/app/types/game.ts index ec432e3..c7c63f9 100644 --- a/app/types/game.ts +++ b/app/types/game.ts @@ -63,11 +63,54 @@ export interface WorldSummary { slug: string speed: number village_id: number | null + /** Joined once and lost every village: a fresh start is open. */ + fallen: boolean + started_at: string + players: number + villages: number + tribes: number + /** When the crown forts appear, or appeared. */ + crowns_at: string + holder: { id: number; name: string } | null + /** When the holder wins if they keep the crowns. */ + ends_at: string | null /** Set once someone won the world; it stays readable. */ ended_at: string | null winner: { id: number; name: string } | null } +/** `world.settings`: the rules in plain units; durations in seconds at the world's speed. */ +export interface WorldSettings { + id: number + name: string + settings: { + pace: { speed: number; unit_speed: number; protection: number; inactive: number } + village: { space: number; space_per_hq_level: number; builders: number; map_size: number } + combat: { morale: boolean; luck: number; night: { start: number; end: number; factor: number } | null; noble_distance: number; loyalty_drop: [number, number]; loyalty_regen: number } + raids: { every: [number, number]; warning: number; range: number } | null + tribes: { max_members: number; notice: number } + season: { crowns: number; needed: number; crowns_after: number; hold: number } | null + } +} + +/** `account.show`. */ +export interface AccountState { + name: string + email: string + since: string + worlds: { world: { id: number; name: string }; villages: number; points: number; tribe: TribeRef | null }[] +} + +/** Push `village:lost` to the old owner of a village that was taken. */ +export interface VillageLost { + world_id: number + village_id: number + name: string + x: number + y: number + by: string | null +} + /** A world as a season: crown forts appear round 0|0, holding most of them long enough wins. */ export interface SeasonState { /** When the crowns appear, or appeared. */ diff --git a/i18n/messageloader.ts b/i18n/messageloader.ts index 26e75d9..2e471fe 100644 --- a/i18n/messageloader.ts +++ b/i18n/messageloader.ts @@ -1,6 +1,7 @@ import { mergeMessages } from '@blax-software/i18n' import networking from '@blax-software/networking/i18n' import en from './locales/en' +import account from './pages/account' import auth from './pages/auth' import chat from './pages/chat' import landing from './pages/landing' @@ -15,6 +16,6 @@ import worlds from './pages/worlds' // Explicit imports instead of import.meta.glob: @nuxtjs/i18n also loads this file in the // Nitro build, where glob imports don't exist. Add new page files here, in path order. -export default mergeMessages({ en }, [auth, chat, landing, legal, map, quests, ranking, reports, tribe, village, worlds], { packages: [networking] }) as { +export default mergeMessages({ en }, [account, auth, chat, landing, legal, map, quests, ranking, reports, tribe, village, worlds], { packages: [networking] }) as { en: Record