From 010b635784866cfada6b10485794b6a1dacf0179 Mon Sep 17 00:00:00 2001 From: yuni Date: Wed, 20 Nov 2024 02:40:29 +0100 Subject: [PATCH] get shot in the head if you steal oxygen from cryopreserved drifter --- src/actor.rs | 1 + src/chat.rs | 5 +++++ src/chats/fastravel.yaml | 4 ++++ src/game.rs | 7 +++++++ 4 files changed, 17 insertions(+) diff --git a/src/actor.rs b/src/actor.rs index da16791..7b5621e 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -86,6 +86,7 @@ pub enum DamageType { Unknown, Mental, Trauma, + Bullet, GForce, Asphyxiation, Depressurization, diff --git a/src/chat.rs b/src/chat.rs index bd06047..5d3dd87 100644 --- a/src/chat.rs +++ b/src/chat.rs @@ -905,6 +905,7 @@ pub fn handle_chat_scripts( mut ew_sfx: EventWriter, mut ew_effect: EventWriter, mut ew_achievement: EventWriter, + mut ew_playerdies: EventWriter, id2pos: Res, id2v: Res, mut prefs: ResMut, @@ -1049,6 +1050,10 @@ pub fn handle_chat_scripts( prefs.luna_backup = true; prefs.save() } + "bullet" => { + ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Crash)); + ew_playerdies.send(game::PlayerDiesEvent(actor::DamageType::Bullet)); + } _ => { error!("Error, undefined chat script {name}"); } diff --git a/src/chats/fastravel.yaml b/src/chats/fastravel.yaml index ef7faf4..8071834 100644 --- a/src/chats/fastravel.yaml +++ b/src/chats/fastravel.yaml @@ -14,6 +14,10 @@ - if: "$$quest_pizza_obtained" Did you order pizza by any chance?: - system: "[ERROR: no response]" +- "[Leave]": + - goto: EXIT +- "[Harvest some oxygen]": + - script: bullet --- diff --git a/src/game.rs b/src/game.rs index affb813..12d480f 100644 --- a/src/game.rs +++ b/src/game.rs @@ -368,6 +368,13 @@ fn handle_player_death( duration: 4.0, }); } + actor::DamageType::Bullet => { + settings.death_cause = "Traumatic brain injury due to a projectile wound.".to_string(); + ew_effect.send(visual::SpawnEffectEvent { + class: visual::Effects::FadeIn(css::MAROON.into()), + duration: 1.0, + }); + } actor::DamageType::Mental => { settings.death_cause = "Brain Damage".to_string(); ew_effect.send(visual::SpawnEffectEvent {