From b6b8e6a8d0a47de94afdcf2db137717539d78cdd Mon Sep 17 00:00:00 2001 From: yuni Date: Sun, 22 Sep 2024 07:15:29 +0200 Subject: [PATCH] add radiation damage --- src/actor.rs | 24 +++++++++++++++++++++--- src/game.rs | 9 ++++++++- src/hud.rs | 15 +++------------ 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index f5fcde8..63d9cee 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -71,7 +71,7 @@ pub enum DamageType { Asphyxiation, Depressurization, //Poison, - //Radiation, + Radiation, //Freeze, //Burn, } @@ -175,6 +175,7 @@ pub struct OrbitsJupiter; #[derive(Component)] pub struct LifeForm { pub is_alive: bool, + pub is_radioactively_damaged: bool, pub adrenaline: f32, pub adrenaline_baseline: f32, pub adrenaline_jolt: f32, @@ -183,6 +184,7 @@ impl Default for LifeForm { fn default() -> Self { Self { is_alive: true, + is_radioactively_damaged: false, adrenaline: 0.3, adrenaline_baseline: 0.3, adrenaline_jolt: 0.0, @@ -339,10 +341,12 @@ pub fn update_power( pub fn update_physics_lifeforms( time: Res