Raid planner: plan over several ticks at full detail instead of in one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-28 23:37:14 +03:00
parent bf966a4dbe
commit f0fbc397d8
3 changed files with 186 additions and 54 deletions
+7 -1
View File
@@ -618,7 +618,7 @@ impl DroneKind {
/// Height over the target where the Oreshnik's blocks release their submunitions.
const BLOCK_SPLIT: f64 = 300.0;
#[derive(PartialEq)]
#[derive(PartialEq, Clone, Copy)]
enum Flight {
Cruise,
Dive,
@@ -628,6 +628,7 @@ enum Flight {
Falling,
}
#[derive(Clone)]
pub struct Drone {
pub id: u32,
pub kind: DroneKind,
@@ -1118,6 +1119,8 @@ pub struct Sim {
later: Vec<(u64, DVec3, u32, bool)>,
/// A planned raid's drones waiting for their launch tick.
pub queue: Vec<(u64, Drone)>,
/// A raid being planned.
plan: Option<raid::Plan>,
/// Each marked object's health, 0 to 100 (`targets`' order).
pub target_health: Vec<f64>,
/// The raid in progress, for its report.
@@ -1153,6 +1156,7 @@ impl Sim {
horizons: HashMap::new(),
later: Vec::new(),
queue: Vec::new(),
plan: None,
target_health: Vec::new(),
wave: None,
rec: None,
@@ -1241,12 +1245,14 @@ impl Sim {
self.fx.clear();
self.blasts.clear();
self.queue.clear();
self.plan = None;
self.wave = None;
}
/// One game tick.
pub fn step(&mut self, ground: &mut Ground, player: Option<DVec3>, out: &mut Out) {
self.tick += 1;
self.plan_step(out);
self.release_queue();
self.step_drones(ground, player, out);
self.step_later(ground, player, out);