From d154efdd050e730c4072e5f53843cf3610651d00 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 21:55:38 +0400 Subject: feat(player): announce vehicle capture when the hero stays outside Restore the original warbot and mobile command centre acknowledgement bank. A capture that also seats the hero remains silent. The bank and non-repeat selection were checked against the native DLL, and a walk from the normal Teleport start queued the authored voice before the objective notice. --- crates/fparkan-runtime/src/boarding.rs | 9 +++++++++ crates/fparkan-runtime/src/lib.rs | 1 + crates/fparkan-runtime/src/mission_events.rs | 2 ++ 3 files changed, 12 insertions(+) (limited to 'crates') diff --git a/crates/fparkan-runtime/src/boarding.rs b/crates/fparkan-runtime/src/boarding.rs index c1b3651e..9d15fedd 100644 --- a/crates/fparkan-runtime/src/boarding.rs +++ b/crates/fparkan-runtime/src/boarding.rs @@ -20,6 +20,14 @@ pub struct VehicleEntry { pub cockpit: Option, } +impl VehicleEntry { + /// Captures that leave the player outside the machine receive a spoken acknowledgement. + pub fn capture_notice(&self) -> Option { + (self.captured.is_some() && self.cockpit.is_none()) + .then_some(crate::MissionNotice::VehicleCaptured) + } +} + #[derive(Clone, Copy)] pub(super) struct Boarding { pub(super) cockpit: StartingCockpit, @@ -248,6 +256,7 @@ mod tests { let entry = enter_vehicle(&mut engine, hero, None).unwrap(); assert_eq!(entry.captured, Some(id)); assert_eq!(entry.cockpit.unwrap().handle, target); + assert_eq!(entry.capture_notice(), None); assert_eq!(player_vehicle(&engine), entry.cockpit); } } diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 0cc01d72..0f2b7e49 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -18023,6 +18023,7 @@ mod tests { let entry = enter_vehicle(&mut engine, cockpit, None).unwrap(); assert_eq!(entry.captured, Some(OriginalObjectId(0))); assert_eq!(entry.cockpit, None); + assert_eq!(entry.capture_notice(), Some(MissionNotice::VehicleCaptured)); assert_eq!( mission_object_handle(&engine, OriginalObjectId(0)), Some(hq) diff --git a/crates/fparkan-runtime/src/mission_events.rs b/crates/fparkan-runtime/src/mission_events.rs index 1275ea93..a017eada 100644 --- a/crates/fparkan-runtime/src/mission_events.rs +++ b/crates/fparkan-runtime/src/mission_events.rs @@ -53,6 +53,8 @@ pub enum MissionNotice { ObjectiveComplete(u32), /// The player's capture took a building from a neutral or enemy clan. BuildingCaptured { neutral: bool }, + /// The player captured a neutral vehicle and stayed outside it. + VehicleCaptured, /// Mission completed. Completed, /// Mission failed. -- cgit v1.2.3