Represent damage diagnostics as typed reasons

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
2026-11-04 15:57:46 +03:00
parent eea1b3692e
commit 0c870c10d5
8 changed files with 127 additions and 31 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ pub use airdef_core::sim;
mod scenario;
mod wave;
mod world_view;
mod why_view;
use sim::{Class, DroneKind, Ground, Out, Sam, SamKind, Sim};
const ITEMS: [&str; sim::catalog::INVENTORY_COUNT] = sim::catalog::INVENTORY;
@@ -2371,7 +2372,7 @@ impl Mod for AirDef {
return Err("Нет такой техники".into());
}
for c in self.sim.why(i) {
say(&format!("{} {}", if c.ok { "+" } else { "-" }, c.text));
say(&format!("{} {}", if c.ok { "+" } else { "-" }, why_view::reason(&c.reason)));
}
None
}