From e4b903c58c6a03e726cad6db0ecba9d319470911 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 10:41:04 +0400 Subject: feat(combat): spend directional shield charge before hull damage Resolve the nearest sector in the target basis and apply the Control 9/21 capacity before the hull modifiers. Verify power queries and depletion with the original Control DLL, then check live AutoDemo and Two Fortresses encounters from stock starts. --- crates/fparkan-runtime/src/projectile.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crates/fparkan-runtime/src/projectile.rs') diff --git a/crates/fparkan-runtime/src/projectile.rs b/crates/fparkan-runtime/src/projectile.rs index d4f23243..4ffb6fae 100644 --- a/crates/fparkan-runtime/src/projectile.rs +++ b/crates/fparkan-runtime/src/projectile.rs @@ -276,6 +276,7 @@ pub fn apply_projectile_contact( contact: ProjectileContact, volume: f32, ) -> Result, ControlResourceAccessError> { + let volume = super::projectile_shield::absorb(engine, contact, volume); let table = engine.loaded.as_ref().and_then(|mission| { mission .control_device_tables @@ -497,6 +498,19 @@ mod tests { ) .unwrap(); let plant = handle_by_original_id(&engine.world, OriginalObjectId(5)).unwrap(); + let table = engine + .loaded + .as_mut() + .unwrap() + .control_device_tables + .iter_mut() + .find(|table| table.handle == plant) + .unwrap(); + if let crate::MissionControlDeviceTableStatus::Available(devices) = &mut table.status { + for device in devices.iter_mut().filter(|device| device.factory_tag == 9) { + device.class9_values_bits = Some([0; 6]); + } + } let contact = ProjectileContact { handle: plant, fraction: 0.5, -- cgit v1.2.3