From d7d51ac4bdedad7c9d611c343877b54468c9ea4d Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 16:49:49 +0400 Subject: feat(combat): damage the building part struck by a projectile --- crates/fparkan-runtime/src/player_status.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-runtime/src/player_status.rs') diff --git a/crates/fparkan-runtime/src/player_status.rs b/crates/fparkan-runtime/src/player_status.rs index 52af212c..637f5254 100644 --- a/crates/fparkan-runtime/src/player_status.rs +++ b/crates/fparkan-runtime/src/player_status.rs @@ -1,5 +1,5 @@ use crate::{Engine, MissionControlNodeProviderTableStatus}; -use fparkan_world::{identity_metadata, ObjectHandle}; +use fparkan_world::{handle_by_original_id, identity_metadata, ObjectHandle}; /// Current values for the player's controlled unit and clan. #[derive(Clone, Copy, Debug, PartialEq)] @@ -10,6 +10,8 @@ pub struct PlayerStatus { pub ore_in_buffer: Option, /// Available power and total power demand. pub power: Option<(f32, f32)>, + /// Combined current and initial health of the clan's live factories. + pub factory_health: Option<(f32, f32)>, } /// Reads the values used by combat and the clan's current distributor. @@ -40,6 +42,26 @@ pub fn player_status(engine: &Engine, controlled: ObjectHandle) -> Option Option 0.0).then_some(factory_health), }) } -- cgit v1.2.3