From 16d25bd46e16d38e22cab7972ae6ac65196b3e0f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 13:45:03 +0400 Subject: feat(player): announce a successful building capture Resolve the neutral or enemy cue through the original voice table. In a stock Constructor window replay the factory capture queues vc_nb_capt.wav before the objective notice. --- apps/fparkan-game/src/main.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'apps/fparkan-game/src/main.rs') diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 6c33404a..25b89354 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -105,7 +105,7 @@ use fparkan_render_vulkan::{ VulkanStaticTexture, VulkanStaticTextureMip, VulkanStaticVertex, }; use fparkan_runtime::{ - apply_projectile_contact, autodemo_camera, board_friendly_warbot, capture_building, + apply_projectile_contact, autodemo_camera, board_friendly_warbot, capture_building_with_notice, capture_neutral_warbot, create, deploy_mine, disembark_warbot, frame as step_mission_frame, frame_with_player_motion, load_gameplay_mission, load_mission_static_preview, load_mission_static_preview_roots, loaded_mission_assets, loaded_mission_object_drafts, @@ -11109,6 +11109,7 @@ impl StaticVulkanApp { } } } + let mut capture_notice = None; if let (true, Some(cockpit), false) = ( std::mem::take(&mut self.player_capture_pressed), self.cockpit, @@ -11148,9 +11149,10 @@ impl StaticVulkanApp { "player_capture object={} queue_time_ms={control_clock_ms}", target.0 ); - } else if let Some(target) = - capture_building(engine, cockpit).map_err(|error| error.to_string())? + } else if let Some((target, notice)) = capture_building_with_notice(engine, cockpit) + .map_err(|error| error.to_string())? { + capture_notice = Some(notice); eprintln!( "player_building_capture object={} queue_time_ms={control_clock_ms}", target.0 @@ -11250,10 +11252,9 @@ impl StaticVulkanApp { eprintln!("mission_patrol_order unit={} target=[{x},{y}] queue_time_ms={control_clock_ms}", handle.slot); } } - for ¬ice in frame - .mission_event + for ¬ice in capture_notice .iter() - .flat_map(|tick| &tick.notices) + .chain(frame.mission_event.iter().flat_map(|tick| &tick.notices)) .chain(&frame.clan_notices) { self.present_mission_notice(notice, control_clock_ms); -- cgit v1.2.3