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_damage.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crates/fparkan-runtime/src/projectile_damage.rs') diff --git a/crates/fparkan-runtime/src/projectile_damage.rs b/crates/fparkan-runtime/src/projectile_damage.rs index 0231306f..7214f636 100644 --- a/crates/fparkan-runtime/src/projectile_damage.rs +++ b/crates/fparkan-runtime/src/projectile_damage.rs @@ -66,13 +66,18 @@ mod tests { .expect("the stock warbot with the protection measured in Control"); let root = control_node_provider_row(table, 0).unwrap(); let remaining = f32::from_bits(root.current_amount_bits) - f32::from_bits(0x42b5_e63f); + let pose = transform_state(&engine.world, table.handle).unwrap(); + let index = table.original_id.unwrap().0 as usize; + let (center, _) = crate::projectile::unit_sphere( + &engine.loaded.as_ref().unwrap().mission_assets, + index, + pose, + ) + .unwrap(); let contact = ProjectileContact { handle: table.handle, fraction: 0.5, - position: transform_state(&engine.world, table.handle) - .unwrap() - .position - .map(f32::from_bits), + position: center, node: None, }; assert_eq!( -- cgit v1.2.3