diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 09:41:04 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 09:41:04 +0300 |
| commit | e4b903c58c6a03e726cad6db0ecba9d319470911 (patch) | |
| tree | 436a587d402f535418986772ad4390dc7ca432cb /crates/fparkan-runtime/src/projectile.rs | |
| parent | a1e8e2fd3be9a4c761fed1e8a40c322e2d7d42d2 (diff) | |
| download | fparkan-e4b903c58c6a03e726cad6db0ecba9d319470911.tar.xz fparkan-e4b903c58c6a03e726cad6db0ecba9d319470911.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/projectile.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/projectile.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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<Option<(f32, bool)>, 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, |
