Observe emitting radars and expose emission control

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
2026-11-02 23:51:21 +03:00
parent 26b258f00f
commit 0df225a2de
7 changed files with 86 additions and 27 deletions
+4 -4
View File
@@ -137,7 +137,8 @@ impl Sim {
/// Units the enemy knows of and would go for, newest first: (id, where).
pub(super) fn known_units(&self) -> Vec<(u32, DVec3)> {
let mut out: Vec<(u32, DVec3)> = Vec::new();
for &(id, at, _) in self.intel.revealed.iter().rev() {
for &(id, at, observed) in self.intel.revealed.iter().rev() {
if self.tick.saturating_sub(observed) >= 6000 { continue; }
if !out.iter().any(|o| o.0 == id) && self.sams.iter().any(|s| s.id == id && s.alive()) {
out.push((id, at));
}
@@ -145,10 +146,9 @@ impl Sim {
out
}
/// Whether the enemy has this unit in its intelligence: a radar emits, so it is known; the rest only once
/// they gave themselves away (a launch, jamming) and are in `known`.
/// Whether an observation or another disclosure placed this unit in enemy intelligence.
pub(super) fn enemy_knows(s: &Sam, known: &[(u32, DVec3)]) -> bool {
s.alive() && (s.kind == SamKind::Radar || known.iter().any(|k| k.0 == s.id))
s.alive() && known.iter().any(|k| k.0 == s.id)
}
/// During a smart raid: its drones not yet launched go for what just gave itself away (a jamming station