From 3dd13b710e1e559ef3f5cf15f3c6b50e8377d161 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 06:52:25 +0400 Subject: feat(combat): activate mounted flash effects on autonomous shots Carry the prepared effect row with each shot. Use the existing mode 4 visual effect for that component at release, with its authored geometry, lights and CPT placement. Keep the one-shot sound on its existing event path. Verified stock AutoDemo shot frames submit the authored muzzle light with Vulkan validation clean. A matched on-screen comparison and the full flash curve remain open. --- apps/fparkan-game/src/main.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 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 6b337fc8..98a34f6e 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -8,7 +8,9 @@ mod camera_capture; mod chassis_animation; #[cfg(windows)] mod control_effects; -use control_effects::{advance_control_effect_instances, owner_control_capacity}; +use control_effects::{ + activate_firing_flashes, advance_control_effect_instances, owner_control_capacity, +}; mod mission_hints; mod mission_notices; mod mission_pause; @@ -11414,7 +11416,7 @@ impl StaticVulkanApp { } else { None }; - let control_effect_random_samples = advance_control_effect_instances( + let mut control_effect_random_samples = advance_control_effect_instances( &mut self.control_effect_instance_states, &self.ambient_effect_slots, &self.control_point_light_slots, @@ -11432,6 +11434,18 @@ impl StaticVulkanApp { ) }, ); + let firing_flashes = self + .mission_frame + .as_ref() + .map(|frame| { + activate_firing_flashes( + &mut control_effect_random_samples, + &self.ambient_effect_slots, + &self.control_point_light_slots, + &frame.autodemo_combat_events, + ) + }) + .unwrap_or_default(); let control_point_lights = update_control_point_lights( &mut self.control_point_light_slots, &mut self.op1_jitter, @@ -11628,6 +11642,10 @@ impl StaticVulkanApp { audio.stop_control_sound(id); continue; } + // The same firing event starts its one-shot directly. + if firing_flashes.contains(&slot.random_instance_key) { + continue; + } if slot.owner_component_is_mounted { slot.mount_pose = self .component_mount_poses -- cgit v1.2.3