aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/projectile_damage.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 09:41:04 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 09:41:04 +0300
commite4b903c58c6a03e726cad6db0ecba9d319470911 (patch)
tree436a587d402f535418986772ad4390dc7ca432cb /crates/fparkan-runtime/src/projectile_damage.rs
parenta1e8e2fd3be9a4c761fed1e8a40c322e2d7d42d2 (diff)
downloadfparkan-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_damage.rs')
-rw-r--r--crates/fparkan-runtime/src/projectile_damage.rs13
1 files changed, 9 insertions, 4 deletions
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!(