From 5ad056292d91bd6a38299c5d890a975a435c8422 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 13:53:28 +0400 Subject: feat(player): lower the communicator field on capture Drive the original CTLD type-13 tracks from the local capture. The Constructor window replay shows the raised and lowered field and four player projectiles stop at the mesh. Leaving resumes the authored open pose. Motion timing and exit trigger remain approximate. --- crates/fparkan-runtime/src/projectile.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (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 48018933..fc9f6965 100644 --- a/crates/fparkan-runtime/src/projectile.rs +++ b/crates/fparkan-runtime/src/projectile.rs @@ -1,6 +1,6 @@ use crate::{ apply_loaded_mission_control_node_delta, - projectile_parts::{chassis_part_contact, root_model, root_triangle_hit}, + projectile_parts::{chassis_part_contact, root_model}, ControlResourceAccessError, Engine, MissionAssets, MissionControlNodeProviderTableStatus, TerrainWorld, CONTROL_CLASS_SOURCE_BULL, UNIT_DAT_CONTROL_CLASS_HIGH_BIT, }; @@ -189,6 +189,8 @@ pub enum ProjectileNode { Building(u32), /// A node of the warbot's chassis model. Chassis(u32), + /// An indestructible communicator field. + CaptureBarrier, } impl ProjectileContact { @@ -229,9 +231,10 @@ pub fn projectile_unit_hit( let (center, radius) = unit_sphere(&mission.mission_assets, index, state)?; let sphere_fraction = segment_sphere_fraction(segment, center, radius)?; let (fraction, node) = if building { - let (fraction, node) = - root_triangle_hit(&mission.mission_assets, index, state, segment, |_| true)?; - (fraction, Some(ProjectileNode::Building(node))) + let (fraction, node) = crate::capture_barrier::projectile_contact( + mission, index, handle, state, segment, + )?; + (fraction, Some(node)) } else if class == super::boarding::WARBOT_CLASS { chassis_part_contact( mission, @@ -279,6 +282,11 @@ pub fn apply_projectile_contact( contact: ProjectileContact, volume: f32, ) -> Result, ControlResourceAccessError> { + let key = match contact.node { + Some(ProjectileNode::CaptureBarrier) => return Ok(None), + None | Some(ProjectileNode::Chassis(0)) => None, + Some(ProjectileNode::Chassis(key) | ProjectileNode::Building(key)) => Some(key), + }; let volume = super::projectile_shield::absorb(engine, contact, volume); let table = engine.loaded.as_ref().and_then(|mission| { mission @@ -290,11 +298,8 @@ pub fn apply_projectile_contact( volume, table.and_then(|table| table.projectile_resistance_bits), ); - let key = match contact.node { - None | Some(ProjectileNode::Chassis(0)) => { - return apply_projectile_hit(engine, contact.handle, volume); - } - Some(ProjectileNode::Chassis(key) | ProjectileNode::Building(key)) => key, + let Some(key) = key else { + return apply_projectile_hit(engine, contact.handle, volume); }; let row = table.and_then(|table| super::control_node_provider_row(table, key).ok()); let Some(row) = row else { -- cgit v1.2.3