diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-01 17:38:40 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-01 17:38:40 +0300 |
| commit | 5f4850555ac2fd62009cffd5e98ea04c081bbaf7 (patch) | |
| tree | 3345de4620581dc074e59b2727e174102671f289 /apps/fparkan-game | |
| parent | 18be5a8bf2249e2cff89038e8180e9db9581d71b (diff) | |
| download | fparkan-5f4850555ac2fd62009cffd5e98ea04c081bbaf7.tar.xz fparkan-5f4850555ac2fd62009cffd5e98ea04c081bbaf7.zip | |
feat(audio): announce exhausted weapon ammunition
Diffstat (limited to 'apps/fparkan-game')
| -rw-r--r-- | apps/fparkan-game/src/player_fire.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs index cf24da35..aa861fc5 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -5,6 +5,7 @@ use super::{ use fparkan_runtime::{ loaded_mission_assets, projectile_sight_target, turret_sight_points, FiringEffectInstance, + PlayerWeaponWarning, }; impl StaticVulkanApp { @@ -40,15 +41,19 @@ impl StaticVulkanApp { if let Some(engine) = &mut self.mission_engine { weapons.publish_control_energy(engine, cockpit.handle); } - for slot in weapons.take_low_charge_warnings() { + for (slot, warning) in weapons.take_warnings() { if let Some(audio) = &mut self.audio { - match audio.queue_game_voice("VOICE_WEAP_ENERGY_OUT") { + let notice = match warning { + PlayerWeaponWarning::AmmoEmpty => "VOICE_WEAP_AMMO_OUT", + PlayerWeaponWarning::LowCharge => "VOICE_WEAP_ENERGY_OUT", + }; + match audio.queue_game_voice(notice) { Ok(resource) => eprintln!( "player_weapon_voice slot={} resource={resource} queue_time_ms={clock_ms}", slot + 1 ), Err(error) => eprintln!( - "sim_coverage mission_voice_unavailable=1 notice=VOICE_WEAP_ENERGY_OUT reason={error}" + "sim_coverage mission_voice_unavailable=1 notice={notice} reason={error}" ), } } |
