algospaced-dsa / algospaced-ui /src /data /companionData.ts
iamfebin's picture
feat(companion): enhance traveling princess lore immersion, deflect technical queries, and sanitize choice suggestions
abf7a4c
Raw History Blame Contribute Delete
10.3 kB
export type PrincessEmotion =
| 'concerned'
| 'excited_expression'
| 'fear'
| 'neutral'
| 'sad_expression'
| 'smiling_warmly'
| 'thinking_expression';
export interface EmotionMeta {
id: PrincessEmotion;
label: string;
imagePath: string;
}
export const PRINCESS_EMOTIONS: Record<PrincessEmotion, EmotionMeta> = {
neutral: {
id: 'neutral',
label: 'Calm',
imagePath: '/sprites/princess/neutral.webp',
},
smiling_warmly: {
id: 'smiling_warmly',
label: 'Smiling Warmly',
imagePath: '/sprites/princess/smiling_warmly.webp',
},
excited_expression: {
id: 'excited_expression',
label: 'Excited',
imagePath: '/sprites/princess/excited_expression.webp',
},
thinking_expression: {
id: 'thinking_expression',
label: 'Thinking',
imagePath: '/sprites/princess/thinking_expression.webp',
},
concerned: {
id: 'concerned',
label: 'Concerned',
imagePath: '/sprites/princess/concerned.webp',
},
fear: {
id: 'fear',
label: 'Startled',
imagePath: '/sprites/princess/fear.webp',
},
sad_expression: {
id: 'sad_expression',
label: 'Melancholy',
imagePath: '/sprites/princess/sad_expression.webp',
},
};
export type DialogueContext =
| 'break_reminder'
| 'problem_correct'
| 'problem_incorrect'
| 'streak_milestone'
| 'study_start'
| 'idle_motivation'
| 'tower_milestone'
| 'chat_response';
export interface CompanionMessage {
id: string;
text: string;
emotion: PrincessEmotion;
context: DialogueContext;
floorRequirement?: number; // mile / problem milestone requirement
timestamp?: number;
}
export interface TowerProgress {
currentFloor: number; // 0 to 150 problems solved / leagues traveled
maxFloor: number; // 150
totalSolved: number;
unlockedMilestones: number[];
}
export interface CompanionSettings {
enabled: boolean;
name: string;
backstory: string;
breakIntervalMinutes: number; // 0 for off, 25, 45, 60
soundEnabled: boolean;
autoPopupEnabled: boolean;
}
export const DEFAULT_COMPANION_SETTINGS: CompanionSettings = {
enabled: true,
name: 'Princess Aurelia',
backstory:
'Princess Aurelia is suffering from a severe, fatal illness, traveling alongside you across 150 leagues toward the ancient Tower where the mythical Elixir of Life can cure her. As her sworn guardian and companion, you journey together across dangerous wilderness, facing grueling trials to reach the Elixir before time runs out.',
breakIntervalMinutes: 25,
soundEnabled: true,
autoPopupEnabled: true,
};
export interface TowerChapter {
floorRange: [number, number];
title: string;
description: string;
bgLore: string;
}
export const TOWER_CHAPTERS: TowerChapter[] = [
{
floorRange: [1, 30],
title: 'The Sunlit Plains',
description: 'Rolling green meadows and ancient cobblestone roads where our journey begins.',
bgLore: 'Looking out toward the distant horizon, the silhouette of the Ancient Tower pierces the morning sky.',
},
{
floorRange: [31, 60],
title: 'The Whispering Forest',
description: 'Winding paths through dense emerald groves where gentle streams and leafy canopies shade our travel.',
bgLore: 'Resting in the wagon beneath tall pines, Aurelia listens to the wind and dreams of the healing elixir.',
},
{
floorRange: [61, 90],
title: 'The Grand Caverns',
description: 'Bioluminescent caves with branching crystal arches and ancient subterranean passages.',
bgLore: 'Halfway to the Tower! The gentle warmth of glowing crystals brings solace as we push through the deep caverns.',
},
{
floorRange: [91, 120],
title: 'The High Mountain Passes',
description: 'Perilous alpine ridges and snowy peaks overlooking the great valley below.',
bgLore: 'From the highest ridge through the swirling mist, the Sanctuary Tower rises majestically ahead.',
},
{
floorRange: [121, 149],
title: 'The Enchanted Valley',
description: 'Shimmering mystical grounds and flowering sanctuaries that surround the final approach.',
bgLore: 'The final leagues! The Tower gates are within sight, where the Elixir of Life awaits.',
},
{
floorRange: [150, 150],
title: 'The Tower of the Elixir',
description: 'Crossing the threshold of the Ancient Sanctuary to claim the Elixir of Life and cure Aurelia!',
bgLore: 'All 150 leagues conquered! The Elixir of Life is in your hands, and Aurelia’s life is saved!',
},
];
export const SCRIPTED_DIALOGUES: Record<DialogueContext, CompanionMessage[]> = {
break_reminder: [
{
id: 'br-1',
text: 'Brave friend! You have traveled many leagues today. Even the swiftest travelers rest by the campfire—shall we pause for a stretch and some cool water?',
emotion: 'concerned',
context: 'break_reminder',
},
{
id: 'br-2',
text: 'The road stretches far ahead across the plains. Please rest your eyes for a moment; a steady mind travels swiftest.',
emotion: 'smiling_warmly',
context: 'break_reminder',
},
{
id: 'br-3',
text: 'The evening breeze carries the quiet scent of the hills. Take five minutes to rest—I will tend the campfire embers.',
emotion: 'thinking_expression',
context: 'break_reminder',
},
{
id: 'br-4',
text: 'Do not exhaust yourself on the road, my guardian! Pacing our stamina is the secret to enduring this journey. Let us pause for a short rest.',
emotion: 'concerned',
context: 'break_reminder',
},
],
problem_correct: [
{
id: 'pc-1',
text: 'Magnificent! You conquered that obstacle and advanced another league closer to the Tower!',
emotion: 'excited_expression',
context: 'problem_correct',
},
{
id: 'pc-2',
text: 'A flawless victory! With every trial you master, the distance to the Elixir of Life grows shorter.',
emotion: 'smiling_warmly',
context: 'problem_correct',
},
{
id: 'pc-3',
text: 'Incredible skill and elegance! Seeing your resolve brings warmth and hope to my heart as we cross another milestone.',
emotion: 'excited_expression',
context: 'problem_correct',
},
{
id: 'pc-4',
text: 'You handled that trial with true mastery. Step by step, league by league, we are approaching the Tower gates!',
emotion: 'smiling_warmly',
context: 'problem_correct',
},
],
problem_incorrect: [
{
id: 'pi-1',
text: 'Do not despair, noble friend! The road to the Tower has rough terrain. Catch your breath and let us push forward together.',
emotion: 'concerned',
context: 'problem_incorrect',
},
{
id: 'pi-2',
text: 'Every misstep on the trail teaches us the layout of the land. Take a breath—we will find our way.',
emotion: 'thinking_expression',
context: 'problem_incorrect',
},
{
id: 'pi-3',
text: 'Stay steadfast! I believe in your courage and intellect. Together, we will conquer this pass.',
emotion: 'smiling_warmly',
context: 'problem_incorrect',
},
{
id: 'pi-4',
text: 'A challenging trial! But overcoming difficult obstacles is what makes a legendary guardian. Keep your head high.',
emotion: 'neutral',
context: 'problem_incorrect',
},
],
streak_milestone: [
{
id: 'sm-1',
text: 'A glorious travel streak! Your daily dedication across the realms is inspiring. Hope burns bright in our camp!',
emotion: 'excited_expression',
context: 'streak_milestone',
},
{
id: 'sm-2',
text: 'Look at that continuous march! Consistency is the true magic that brings us across all 150 leagues to the Tower.',
emotion: 'smiling_warmly',
context: 'streak_milestone',
},
],
study_start: [
{
id: 'ss-1',
text: 'Welcome back to the trail, brave friend! Which territories shall we cross together today on our way to the Tower?',
emotion: 'smiling_warmly',
context: 'study_start',
},
{
id: 'ss-2',
text: 'I saw you preparing our travel gear! Ready to conquer today’s journey and draw closer to the Elixir?',
emotion: 'excited_expression',
context: 'study_start',
},
],
idle_motivation: [
{
id: 'im-1',
text: 'Whenever the trail seems daunting, take it one step at a time. Every stride counts toward our destination!',
emotion: 'thinking_expression',
context: 'idle_motivation',
},
{
id: 'im-2',
text: 'I am so grateful for your guidance and companionship. Your quest brings life and hope back to me.',
emotion: 'smiling_warmly',
context: 'idle_motivation',
},
{
id: 'im-3',
text: 'One hundred and fifty leagues is a grand quest, but you have the strength and heart to reach the Sanctuary gates!',
emotion: 'neutral',
context: 'idle_motivation',
},
],
tower_milestone: [
{
id: 'tm-1',
text: 'You have crossed the Sunlit Plains! 30 leagues traversed—the first realm is behind us!',
emotion: 'excited_expression',
context: 'tower_milestone',
floorRequirement: 30,
},
{
id: 'tm-2',
text: 'You emerged from the Whispering Forest! 60 leagues traversed—I can see the foothills rising ahead!',
emotion: 'excited_expression',
context: 'tower_milestone',
floorRequirement: 60,
},
{
id: 'tm-3',
text: 'Through the Grand Caverns! 90 leagues conquered—more than halfway to the Tower!',
emotion: 'smiling_warmly',
context: 'tower_milestone',
floorRequirement: 90,
},
{
id: 'tm-4',
text: 'You crested the High Mountain Passes! 120 leagues conquered—the Sanctuary valley is right before us!',
emotion: 'excited_expression',
context: 'tower_milestone',
floorRequirement: 120,
},
{
id: 'tm-5',
text: 'WE HAVE REACHED THE TOWER OF THE ELIXIR! All 150 leagues conquered! The Elixir of Life is in your hands, the illness is cured, and we walk into the sunlight together!',
emotion: 'excited_expression',
context: 'tower_milestone',
floorRequirement: 150,
},
],
chat_response: [],
};