diff --git a/src/actor.rs b/src/actor.rs index e15ee62..a601eaf 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -17,9 +17,11 @@ impl Plugin for ActorPlugin { handle_send_messages, handle_conversations, handle_input, + handle_chat_scripts, )); app.add_event::(); app.add_event::(); + app.add_event::(); } } @@ -35,6 +37,12 @@ pub struct SendMessageEvent { pub text: String, } +#[derive(Event)] +pub struct ChatScriptEvent { + name: String, + param: String, +} + #[derive(Component)] pub struct Actor { pub hp: f32, @@ -74,6 +82,8 @@ pub struct ChatBranch { pub reply: String, pub goto: String, pub choice: String, + pub script: String, + pub script_parameter: String, } #[derive(Component)] @@ -266,6 +276,7 @@ pub fn handle_send_messages( mut commands: Commands, mut er_sendmsg: EventReader, mut ew_sfx: EventWriter, + mut ew_chatscript: EventWriter, mut q_conv: Query<(Entity, &mut Chat)>, time: Res