feat(world): serve local location view content from the API
Adds the server side of the local location view: location_definitions carries region naming, a location type, a scene-level description and artwork, plus JSONB points of interest, primary actions and a reward preview. Locations become content, so a second location renders through the same components with different data. GET /api/world/current-location gains those fields, a recommendation label and a danger rating derived from the weighted average of the location's own monster pool — a rare elite no longer makes a beginner road read as lethal. The encounter preview is derived from that same pool rather than duplicating it. POST /api/world/current-location/interactions/:key reveals a hotspot's authored result. The location is resolved from the character, never from the request, and result text never ships with the location payload, so a caller cannot read or trigger a hotspot it has not travelled to. Seeds the Verbrannte Straße with its four hotspots and the Südtor with its own transition content. Adds Verwilderter Straßenhund and Verkohlter Plünderer to the road's pool, including combat sprites, so the preview shows encounters the hunt can actually roll. Medallion icons move to images/monsters/icons, where both combat and the location view read them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
204
apps/api/src/database/seeds/local-location.content.ts
Normal file
204
apps/api/src/database/seeds/local-location.content.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import type {
|
||||
LocationPointOfInterestContent,
|
||||
LocationPrimaryActionContent,
|
||||
LocationRewardPreviewContent,
|
||||
LocationType,
|
||||
} from '../../world/local-location.types';
|
||||
|
||||
/**
|
||||
* Authored local-view content per location (plan §7–§11).
|
||||
*
|
||||
* Coordinates are percentages of the artwork box, so a hotspot stays on the
|
||||
* same painted detail at every viewport width. They are tuned against the real
|
||||
* artwork in `apps/web/public/images/backgrounds/`, not against the
|
||||
* composition mockup in `docs/references/`.
|
||||
*/
|
||||
export interface LocalLocationContent {
|
||||
regionName: string;
|
||||
regionTierLabel: string;
|
||||
locationType: LocationType;
|
||||
localDescription: string;
|
||||
localArtworkPath: string;
|
||||
localPointsOfInterest: LocationPointOfInterestContent[];
|
||||
localPrimaryActions: LocationPrimaryActionContent[];
|
||||
localRewardPreview: LocationRewardPreviewContent[];
|
||||
}
|
||||
|
||||
export const BURNED_ROAD_LOCAL_CONTENT: LocalLocationContent = {
|
||||
regionName: 'Aschenfelder',
|
||||
regionTierLabel: 'Gebiet 1',
|
||||
locationType: 'HUNTING_GROUND',
|
||||
localDescription:
|
||||
'Ein alter Handelsweg, der durch Feuer und Krieg in Asche gelegt wurde. Verbrannte Karren, zerbrochene Waffen und verstummte Schreie säumen den Pfad in die Aschenfelder.',
|
||||
localArtworkPath: '/images/backgrounds/Aschestrasse.png',
|
||||
localPointsOfInterest: [
|
||||
{
|
||||
key: 'hunt-area',
|
||||
title: 'Jagdgebiet',
|
||||
actionLabel: 'Jagd beginnen',
|
||||
type: 'HUNT',
|
||||
iconKey: 'hunt',
|
||||
xPercent: 52,
|
||||
yPercent: 44,
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
key: 'wounded-scout',
|
||||
title: 'Verwundeter Kundschafter',
|
||||
actionLabel: 'Sprechen',
|
||||
type: 'NPC',
|
||||
iconKey: 'speak',
|
||||
xPercent: 20,
|
||||
yPercent: 60,
|
||||
enabled: true,
|
||||
resultTitle: 'Verwundeter Kundschafter',
|
||||
resultText:
|
||||
'„Die Straße ist nicht mehr sicher. Die Plünderer kommen aus Richtung des alten Wachtpostens. Wenn du weitergehst, halte die Augen offen."',
|
||||
},
|
||||
{
|
||||
key: 'inspect-tracks',
|
||||
title: 'Verdächtige Spuren',
|
||||
actionLabel: 'Untersuchen',
|
||||
type: 'INVESTIGATE',
|
||||
iconKey: 'investigate',
|
||||
xPercent: 32,
|
||||
yPercent: 78,
|
||||
enabled: true,
|
||||
resultTitle: 'Verdächtige Spuren',
|
||||
resultText:
|
||||
'Zwischen Asche und zerbrochenen Steinen erkennst du mehrere frische Stiefelabdrücke. Sie führen nach Osten, in Richtung des verlassenen Wachtpostens.',
|
||||
},
|
||||
{
|
||||
key: 'search-abandoned-wagon',
|
||||
title: 'Verlassener Wagen',
|
||||
actionLabel: 'Durchsuchen',
|
||||
type: 'SEARCH',
|
||||
iconKey: 'search',
|
||||
xPercent: 80,
|
||||
yPercent: 68,
|
||||
enabled: true,
|
||||
resultTitle: 'Verlassener Wagen',
|
||||
resultText:
|
||||
'Der Wagen wurde gründlich geplündert. Zwischen verbrannten Brettern findest du nur leere Kisten und Spuren eines hastigen Aufbruchs.',
|
||||
},
|
||||
],
|
||||
localPrimaryActions: [
|
||||
{
|
||||
key: 'start-hunt',
|
||||
label: 'Jagd beginnen',
|
||||
description: 'Im Gebiet jagen',
|
||||
type: 'HUNT',
|
||||
iconKey: 'hunt',
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
key: 'investigate-tracks',
|
||||
label: 'Spuren untersuchen',
|
||||
description: 'Hinweise finden',
|
||||
type: 'INVESTIGATE',
|
||||
iconKey: 'investigate',
|
||||
enabled: true,
|
||||
poiKey: 'inspect-tracks',
|
||||
},
|
||||
{
|
||||
key: 'search-surroundings',
|
||||
label: 'Umgebung durchsuchen',
|
||||
description: 'Beute finden',
|
||||
type: 'SEARCH',
|
||||
iconKey: 'search',
|
||||
enabled: true,
|
||||
poiKey: 'search-abandoned-wagon',
|
||||
},
|
||||
{
|
||||
key: 'open-map',
|
||||
label: 'Zur Karte',
|
||||
description: 'Gebiet wechseln',
|
||||
type: 'MAP',
|
||||
iconKey: 'map',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
// Only what the game actually grants today. Combat hands out silver and
|
||||
// experience; there is no loot system yet, so nothing else is promised
|
||||
// (spec §8, "Mögliche Belohnungen").
|
||||
localRewardPreview: [
|
||||
{ key: 'silver', label: 'Silber', iconKey: 'silver' },
|
||||
{ key: 'experience', label: 'Erfahrung', iconKey: 'experience' },
|
||||
],
|
||||
};
|
||||
|
||||
export const SOUTH_GATE_LOCAL_CONTENT: LocalLocationContent = {
|
||||
regionName: 'Aschenfelder',
|
||||
regionTierLabel: 'Gebiet 1',
|
||||
locationType: 'TRANSITION',
|
||||
localDescription:
|
||||
'Am schwarzen Südtor endet der Schutz Graufurts. Hinter den Wachtfeuern beginnt die stille Weite der Aschenfelder.',
|
||||
localArtworkPath: '/images/backgrounds/Suedtor.png',
|
||||
localPointsOfInterest: [
|
||||
{
|
||||
key: 'gate-notice',
|
||||
title: 'Aushangtafel',
|
||||
actionLabel: 'Lesen',
|
||||
type: 'INVESTIGATE',
|
||||
iconKey: 'investigate',
|
||||
xPercent: 22,
|
||||
yPercent: 42,
|
||||
enabled: true,
|
||||
resultTitle: 'Aushangtafel',
|
||||
resultText:
|
||||
'Verwitterte Anschläge flattern im Wind. Ein frischer Zettel warnt vor Plünderern auf der Verbrannten Straße und verspricht Silber für jeden erlegten Räuber.',
|
||||
},
|
||||
{
|
||||
key: 'gate-watch',
|
||||
title: 'Torwache',
|
||||
actionLabel: 'Sprechen',
|
||||
type: 'NPC',
|
||||
iconKey: 'speak',
|
||||
xPercent: 45,
|
||||
yPercent: 52,
|
||||
enabled: true,
|
||||
resultTitle: 'Torwache',
|
||||
resultText:
|
||||
'„Hinter dem Tor endet Graufurts Schutz. Wer nach Süden geht, geht auf eigene Gefahr — und kommt selten so zurück, wie er gegangen ist."',
|
||||
},
|
||||
{
|
||||
key: 'south-road',
|
||||
title: 'Straße nach Süden',
|
||||
actionLabel: 'Zur Karte',
|
||||
type: 'MAP',
|
||||
iconKey: 'map',
|
||||
xPercent: 66,
|
||||
yPercent: 72,
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
localPrimaryActions: [
|
||||
{
|
||||
key: 'talk-to-watch',
|
||||
label: 'Wache ansprechen',
|
||||
description: 'Lage erfragen',
|
||||
type: 'NPC',
|
||||
iconKey: 'speak',
|
||||
enabled: true,
|
||||
poiKey: 'gate-watch',
|
||||
},
|
||||
{
|
||||
key: 'read-notice',
|
||||
label: 'Aushang lesen',
|
||||
description: 'Hinweise finden',
|
||||
type: 'INVESTIGATE',
|
||||
iconKey: 'investigate',
|
||||
enabled: true,
|
||||
poiKey: 'gate-notice',
|
||||
},
|
||||
{
|
||||
key: 'open-map',
|
||||
label: 'Zur Karte',
|
||||
description: 'Gebiet wechseln',
|
||||
type: 'MAP',
|
||||
iconKey: 'map',
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
localRewardPreview: [],
|
||||
};
|
||||
Reference in New Issue
Block a user