Spaces:
Running
Running
File size: 10,323 Bytes
8800c81 b53e6f3 8800c81 b53e6f3 8800c81 b53e6f3 8800c81 b53e6f3 8800c81 b53e6f3 8800c81 b53e6f3 8800c81 b53e6f3 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 abf7a4c 8800c81 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | 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: [],
};
|