Crookfinger's voice: he babbles in a squeaky imp language in the rhythm of his hints, important messages and the mission briefings (can be switched off in the sound settings)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-04 08:25:31 +01:00
1 parent 776c9ad9de
commit ada14951c4
9 files changed
+118 -3

No files matched your search

+19
View File
@@ -30,6 +30,7 @@ mod sound;
mod spells;
mod touch;
mod ui;
mod voice;
mod wilds;
mod xm;
@@ -402,6 +403,8 @@ async fn main() {
// until the mouse has really moved its position is (0, 0): no edge scrolling before that
let mut mouse_moved = false; // automatic mode: touch interface after a touch, desktop after a mouse click
let mut autosave_t = 0.0f32;
let mut voice = voice::Voice::new();
let mut was_briefing = false;
let mut cache_t = 0.0f32;
loop {
@@ -1028,8 +1031,24 @@ async fn main() {
);
music.update(&app.game, on_title, (app.cam.tx, app.cam.tz));
for m in app.game.msgs.drain(..) {
if app.settings.voice && voice::speaks(m.key) {
voice.say(&i18n::trf(m.key, &m.args), now, 12);
}
ui.log.push((m, now));
}
// a briefing opens: Crookfinger tells the story
let briefing = matches!(menu.page, Some(Page::Briefing { .. }));
if briefing && !was_briefing && app.settings.voice {
if let Some(Page::Briefing { mission, .. }) = menu.page {
let key = campaign::missions().get(mission).map(|d| format!("camp.{}.story", d.key)).unwrap_or_default();
voice.say(&i18n::tr(&key), now, 22);
}
}
if !briefing && was_briefing {
voice.stop();
}
was_briefing = briefing;
voice.update(now, if app.settings.muted { 0.0 } else { app.settings.volume });
draw_frame(&mut app, &gfx, &mut r3d, &mut ui, &mut menu, &cloud, &inp, (mx, my), touch_mode, now);
next_frame().await