streamline defs.txt

This commit is contained in:
yuni 2024-03-20 06:36:55 +01:00
parent 328b3a5c21
commit 37e0505839
2 changed files with 51 additions and 71 deletions

View file

@ -1,79 +1,29 @@
chat "hialien" chat "hialien"
name "Icarus" name "Icarus"
msg 2 "INIT" "hi" "Requesting permission to communicate..."
msg 2 "Requesting permission to communicate..."
label "INIT"
lvl "info" lvl "info"
goto "b" msg 4 "hi" "vr" "Oh hey there!"
choice 3 "vr" "vr1" "Uhm... hi"
msg 4 "Oh hey there!" msg 8 "vr1" "notsochatty" "Didn't even notice you! Was playing some VR Game! What's up?"
label "b" msg 8 "vr" "notsochatty" "Didn't even notice you! Was playing some VR Game! What's up?"
goto "c" choice 3 "notsochatty" "imgood" "I'm good, how are you?"
choice 3 "Uhm... hi" msg 5.5 "imgood" "pizza" "Are you sure? Your suit is sending a distress call. But whatever you say, have fun!"
label "c" choice 3 "notsochatty" "imbad" "Uhm... where am I? I don't feel so good."
goto "c1" msg 5.5 "imbad" "pizza" "Yeah I can imagine, looks like your suit is leaking. Take care!"
msg 8 "Didn't even notice you! Was playing some VR Game! What's up?" msg 3.5 "notsochatty" "pizza" "Not so chatty, huh? That's ok. See you around."
label "c1" msg 2.5 "pizza" "end" "Make sure to check out the Pizza place."
goto "d" choice 3 "end" "end1" "Will do, bye!"
msg 0 "end1" "EXIT" "Disconnected."
msg 8 "Didn't even notice you! Was playing some VR Game! What's up?" msg 0 "end" "EXIT" "Disconnected."
label "c"
goto "d"
choice "3" "I'm good, how are you?"
label "d"
goto "imgood"
choice 3 "Uhm... where am I? I don't feel so good."
label "d"
goto "imbad"
msg 3.5 "Not so chatty, huh? That's ok. See you around."
label "d"
goto "pizza"
msg 2.5 "Make sure to check out the Pizza place."
label "pizza"
goto "disco"
choice 3 "Will do, bye!"
label "disco"
goto "disco1"
msg 0 "Disconnected."
label "disco1"
goto "EXIT"
msg 0 "Disconnected."
label "disco"
goto "EXIT"
msg 5.5 "Are you sure? Your suit is sending a distress call. But whatever you say, have fun!"
label "imgood"
goto "pizza"
msg 5.5 "Yeah I can imagine, looks like your suit is leaking. Take care!"
label "imbad"
goto "pizza"
chat "pizzeria" chat "pizzeria"
name "Space Pizza™" name "Space Pizza™"
msg 2 "Requesting permission to communicate..." msg 2 "INIT" "hi" "Requesting permission to communicate..."
label "INIT"
lvl "info" lvl "info"
goto "b" msg 5 "hi" "order" "Welcome to Space Pizza™, best pizza all across the Jovian rings!"
msg 5 "Welcome to Space Pizza™, best pizza all across the Jovian rings!" msg 10 "order" "anyone" "Would you like to order today's special Miracle Spacefungi? Freshly blended pizza smoothie ready for your space suit feeding tube!"
label "b" choice 3 "anyone" "yourloss" "Pizza... smoothie? I think I'll pass..."
goto "c" msg 3 "yourloss" "end" "Your loss, mate"
msg 10 "Would you like to order today's special Miracle Spacefungi? Freshly blended pizza smoothie ready for your space suit feeding tube!" msg 10 "anyone" "end" "Hello? Is anyone there? Is this a prank?"
label "c" msg 0 "end" "EXIT" "Disconnected."
goto "d"
choice 3 "Pizza... smoothie? I think I'll pass..."
label "d"
goto "yourloss"
msg 3 "Your loss, mate"
label "yourloss"
goto "end"
msg 10 "Hello? Is anyone there? Is this a prank?"
label "d"
goto "end"
msg 0 "Disconnected."
label "end"
lvl "info" lvl "info"
goto "EXIT"

View file

@ -449,6 +449,21 @@ pub fn load_defs(
continue; continue;
} }
} }
["msg", sleep, label, goto, text] => {
debug!("Registering message (sleep={}): {}", sleep, text);
state.spawn_chatbranch(&mut commands);
if let Ok(sleep_float) = sleep.parse::<f64>() {
state.delay = sleep_float;
state.text = text.to_string();
state.stores_item = true;
state.is_choice = false;
state.goto = goto.to_string();
state.label = label.to_string();
} else {
error!("The 'sleep' value for this message is not a float: {}", line);
continue;
}
}
["choice", sleep, text] => { ["choice", sleep, text] => {
debug!("Registering choice (sleep={}): {}", sleep, text); debug!("Registering choice (sleep={}): {}", sleep, text);
state.spawn_chatbranch(&mut commands); state.spawn_chatbranch(&mut commands);
@ -462,6 +477,21 @@ pub fn load_defs(
continue; continue;
} }
} }
["choice", sleep, label, goto, text] => {
debug!("Registering choice (sleep={}): {}", sleep, text);
state.spawn_chatbranch(&mut commands);
if let Ok(sleep_float) = sleep.parse::<f64>() {
state.delay = sleep_float;
state.text = text.to_string();
state.stores_item = true;
state.is_choice = true;
state.goto = goto.to_string();
state.label = label.to_string();
} else {
error!("The 'sleep' value for this message is not a float: {}", line);
continue;
}
}
["goto", label] => { ["goto", label] => {
debug!("Registering goto: {}", label); debug!("Registering goto: {}", label);
state.goto = label.to_string(); state.goto = label.to_string();