diff --git a/.gitignore b/.gitignore index b6b279f..1803bb0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ target assets/tmp +*.blend +*.blend1 diff --git a/assets/models/pizzeria.glb b/assets/models/pizzeria.glb new file mode 100644 index 0000000..5d11c4d Binary files /dev/null and b/assets/models/pizzeria.glb differ diff --git a/assets/scenes/conversations.scn.ron b/assets/scenes/conversations.scn.ron index 6160804..074e101 100644 --- a/assets/scenes/conversations.scn.ron +++ b/assets/scenes/conversations.scn.ron @@ -40,21 +40,33 @@ ), }, ), - 4294967299: ( components: { "outfly::actor::ChatBranch": ( id: "hialien", name: "Icarus", label: "reply1", - delay: 1.5, + delay: 3.5, sound: "chat", reply: "Not so chatty, huh? That's ok. See you around.", - goto: "disco", + goto: "pizza", ), }, ), 4294967300: ( + components: { + "outfly::actor::ChatBranch": ( + id: "hialien", + name: "Icarus", + label: "pizza", + delay: 1.5, + sound: "chat", + reply: "Make sure to check out the Pizza place.", + goto: "disco", + ), + }, + ), + 4294967301: ( components: { "outfly::actor::ChatBranch": ( id: "hialien", @@ -67,5 +79,70 @@ ), }, ), + 4294967400: ( + components: { + "outfly::actor::ChatBranch": ( + id: "pizzeria", + name: "Space Pizza™", + label: "INIT", + delay: 1.0, + sound: "ping", + reply: "Requesting permission to communicate...", + goto: "requested", + ), + }, + ), + 4294967401: ( + components: { + "outfly::actor::ChatBranch": ( + id: "pizzeria", + name: "Space Pizza™", + label: "requested", + delay: 5.0, + sound: "connect", + reply: "Welcome to Space Pizza™, best pizza all across the Jovian rings!", + goto: "ask", + ), + }, + ), + 4294967402: ( + components: { + "outfly::actor::ChatBranch": ( + id: "pizzeria", + name: "Space Pizza™", + label: "ask", + delay: 10.0, + sound: "chat", + reply: "Would you like to order today's special Miracle Spacefungi? Freshly blended pizza smoothie ready for your space suit feeding tube!", + goto: "hello?", + ), + }, + ), + 4294967403: ( + components: { + "outfly::actor::ChatBranch": ( + id: "pizzeria", + name: "Space Pizza™", + label: "hello?", + delay: 10.0, + sound: "chat", + reply: "Hello? Are you still there?", + goto: "disco", + ), + }, + ), + 4294967304: ( + components: { + "outfly::actor::ChatBranch": ( + id: "pizzeria", + name: "Space Pizza™", + label: "disco", + delay: 0.0, + sound: "ping", + reply: "Disconnected.", + goto: "EXIT", + ), + }, + ), }, ) diff --git a/src/actor.rs b/src/actor.rs index eb61f48..acbb3ac 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -25,7 +25,7 @@ impl Plugin for ActorPlugin { #[derive(Event)] pub struct StartConversationEvent { - pub conv: String + pub talker: Talker, } #[derive(Component)] @@ -80,8 +80,9 @@ pub struct Chat { } #[derive(Component)] +#[derive(Clone)] pub struct Talker { - pub conv: String, + pub conv_id: String, } #[derive(Component)] @@ -166,7 +167,7 @@ pub fn handle_input( if let Ok(player) = player.get_single() { for (talker, transform) in &query { if transform.translation.distance_squared(player.translation) <= mindist { - ew_conv.send(StartConversationEvent{conv: talker.conv.clone()}); + ew_conv.send(StartConversationEvent{talker: talker.clone()}); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Ping)); break; } @@ -182,11 +183,11 @@ pub fn handle_new_conversations( q_conv: Query<&Chat>, time: Res