Fixes from review: one missile per target when systems fire in the same tick, moves and ammunition saved, searchlight spot and lighting once the beam is on, retargeting only for smart raids, no free reloads after the last depot falls, fork rebuilt when its commit or patches change
build / mod (push) Successful in 2m24s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 14:25:14 +03:00
parent f2838a8f08
commit bb35975642
7 changed files with 121 additions and 21 deletions
+3 -3
View File
@@ -145,7 +145,7 @@ impl Sim {
out
}
/// During a raid: drones not yet launched go for what just gave itself away (a jamming station
/// During a smart raid: its drones not yet launched go for what just gave itself away (a jamming station
/// first, then systems that fired), and drones whose system target is gone pick another.
pub(super) fn adapt(&mut self) {
if self.tick % 40 != 0 {
@@ -160,7 +160,7 @@ impl Sim {
}
let pick = |i: usize, list: &[(u32, DVec3)]| list[i % list.len()].1;
let mut n = 0usize;
for (_, d) in self.queue.iter_mut() {
for (_, d) in self.queue.iter_mut().filter(|(_, d)| d.smart) {
let hunter = matches!(d.kind, DroneKind::Lancet | DroneKind::Kh22 | DroneKind::Zircon);
if !hunter && !(d.kind == DroneKind::Shahed && n % 4 == 0) {
n += 1;
@@ -176,7 +176,7 @@ impl Sim {
n += 1;
}
// In flight: a target system destroyed — the next known one, or keep going.
for d in self.drones.iter_mut().filter(|d| d.alive()) {
for d in self.drones.iter_mut().filter(|d| d.alive() && d.smart) {
let aimed_at_wreck = self.sams.iter().any(|s| !s.alive() && s.pos.distance(d.target) < 6.0);
if aimed_at_wreck {
let next = known.iter().min_by(|a, b| a.1.distance(d.pos).total_cmp(&b.1.distance(d.pos)));