From 2b0de07427933c021ea5058876ea32d1b9ab21c7 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 13 Apr 2024 15:34:35 +0200 Subject: [PATCH] remove TIMEOUT "choices", handle it with labels instead --- src/chat.rs | 7 +++++-- src/chats/serenity.yaml | 30 +++++++++++++----------------- src/chats/startrans.yaml | 2 -- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/src/chat.rs b/src/chat.rs index 164d87f..42109cd 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -16,11 +16,13 @@ pub const TOKEN_IF: &str = "if"; pub const TOKEN_GOTO: &str = "goto"; pub const TOKEN_LABEL: &str = "label"; pub const TOKEN_SCRIPT: &str = "script"; -//pub const TOKEN_TIMEOUT: &str = "TIMEOUT"; + +pub const NAME_FALLBACK: &str = "Unknown"; + +pub const CHOICE_TIMER: f64 = 40.0 * settings::DEFAULT_CHAT_SPEED as f64; pub const LETTERS_PER_SECOND: f32 = 17.0; pub const TALKER_SPEED_FACTOR: f32 = settings::DEFAULT_CHAT_SPEED / LETTERS_PER_SECOND; pub const CHAT_SPEED_MIN_LEN: f32 = 40.0; -pub const NAME_FALLBACK: &str = "Unknown"; pub const NON_CHOICE_TOKENS: &[&str] = &[ TOKEN_CHAT, @@ -268,6 +270,7 @@ pub fn handle_chat_events( key: *key, } )); + chat.timer = now + CHOICE_TIMER / settings.chat_speed as f64; } } } diff --git a/src/chats/serenity.yaml b/src/chats/serenity.yaml index ed317f0..b5d62ea 100644 --- a/src/chats/serenity.yaml +++ b/src/chats/serenity.yaml @@ -41,8 +41,6 @@ - goto: thx - Whatever... I didn't ask for this.: - goto: didntask - - TIMEOUT: -- TIMEOUT: - How are you feeling? @@ -76,10 +74,12 @@ - What year is this?: - Oh, is your Augmented Reality deactivated? - Push the TAB button, your space suit's AR will show you the date and time. + - goto: help - Why am I here?: - That's a very philosophical question. - I don't know. - It's probably related to the choices you made in your life so far. + - goto: help - What should I do?: - Ah, that's the beauty of life. - You can just do whatever you want. @@ -92,6 +92,7 @@ - You're too kind!: - Ah, don't mention it! - There's also a half-decent pizza restaurant over there, look for the neon sign. + - goto: help - Do you have some money for me?: - Huh? What is money? - Currency? Flat round things that you can exchange for goods and services?: @@ -100,11 +101,11 @@ - But there's a pizza place right over there, look for the neon sign. - goto: help - Well, anyway, need anything else? + - goto: help - I just want to be alone right now: - Oh, sure. Ping me if you need anything. I'll go back to playing my VR game. - goto: EXIT -- TIMEOUT: - - Well, I hope you're ok. +- Well, I hope you're ok. - label: chocolate @@ -112,8 +113,10 @@ - Oh yes! Please!: - Here you go, my friend! - system: Received 1x ChuggaChug™ Instant Hot Chocolate -- TIMEOUT: - - I guess not. Well. I think I'll go back to playing my VR game. Ping me if you need anything. + - goto: pizzaplace +- No, thank you.: +- Well. I think I'll go back to playing my VR game. Ping me if you need anything. +- label: pizzaplace - Oh and make sure to check out the pizza place! - Will do, bye!: - system: Disconnected. @@ -133,13 +136,10 @@ - Our pizza smoothies are freshly blended every day - Wait... pizza smoothie?: - Huh? Of course, smoothie! How else do you want to get that pizza down your spacesuit feeding tube? - - An emulsion of deliciousness! - - TIMEOUT: - - Deliciousness for your spacesuit feeding tube! + - An emulsion of deliciousness! - I think I'll pass...: - Your loss, mate - - TIMEOUT: - - Hey? Are you still there? + - goto: EXIT - Wh... what's a pizzeria doing here?: - Hah, beautiful, right? I carved it out this asteroid myself! - You know how much work it was to neutralize the rotation of the asteroid, so my valued customers don't bang against the walls while drinking my pizza? @@ -160,12 +160,8 @@ - "[GRANT ACCESS TO SPACESUIT WIFI]": - goto hack - "[DENY ACCESS TO SPACESUIT WIFI]": + - Great, the first customer in ages, and they're brain damaged... - Fuck off!: - - TIMEOUT: - - goto: noreply - - Great, the first customer in ages, and they're brain damaged... + - Great, the first customer in ages, and they're brain damaged... - goto: EXIT - - TIMEOUT: -- TIMEOUT: -- label: noreply - Hey, are you still there? Is this a prank? diff --git a/src/chats/startrans.yaml b/src/chats/startrans.yaml index 75d5199..7e4d545 100644 --- a/src/chats/startrans.yaml +++ b/src/chats/startrans.yaml @@ -84,6 +84,4 @@ - Is there anything interesting to do around here?: - goto: interesting - No, thank you.: -- TIMEOUT: - Feel free to come back any time. -- system: Connection terminated.