Playtest fixes: smoke by engine, searchlights, far launch sites that load their chunks, air defence balance, last chance and radar-cued shots, radars in smart raids, echo, Windows release build from a tag
Smoke: one rule by engine, no heat on trails, no trail on P1-SUN. Searchlights: two lamps a target, off with an empty sky. Halos fade before their reach and their sum is limited. Launch sites load chunks through the server thread, go off-map as a last resort, and reach 4000 blocks. Air defence: ranges x1.5, shots grow with urgency, claims released, /airdef lastchance, long shots on a big radar's tracks. Build: rust-toolchain.toml, airdef.py check, generator manifest and --check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+30
-3
@@ -453,6 +453,7 @@ impl AirDef {
|
||||
let id = 0x6200_0000 | (f.id & 0x00ff_ffff);
|
||||
add(id, f.at + DVec3::Y * 1.2, (1.0, 0.5, 0.17), 70.0 * f.size * glow * flicker(f.id), 20.0 + 10.0 * f.size);
|
||||
}
|
||||
let mut spotted: Vec<u32> = Vec::new();
|
||||
for s in &self.sim.sams {
|
||||
if !s.alive() && s.burning() {
|
||||
add(s.id + 15, s.pos + DVec3::Y * 1.5, (1.0, 0.5, 0.18), 80.0 * flicker(s.id), 30.0);
|
||||
@@ -462,7 +463,9 @@ impl AirDef {
|
||||
&& s.kind == SamKind::Light
|
||||
&& let Some(t) = s.target.and_then(|t| self.sim.drones.iter().find(|d| d.id == t))
|
||||
&& self.sim.lit.contains(&t.id)
|
||||
&& !spotted.contains(&t.id)
|
||||
{
|
||||
spotted.push(t.id);
|
||||
add(s.id + 14, t.pos, (0.95, 0.97, 1.0), 220.0, 30.0);
|
||||
}
|
||||
}
|
||||
@@ -494,7 +497,7 @@ impl AirDef {
|
||||
dy: b.dir.y as f32,
|
||||
dz: b.dir.z as f32,
|
||||
color: (0.95, 0.97, 1.0),
|
||||
intensity: 90_000.0,
|
||||
intensity: 12_000.0,
|
||||
range: (b.free + 3.5).min(1024.0) as f32,
|
||||
inner_angle: sim::lights::BEAM_INNER as f32,
|
||||
outer_angle: sim::lights::BEAM_OUTER as f32,
|
||||
@@ -857,6 +860,7 @@ impl AirDef {
|
||||
text += &format!("target {} {} {} {h}\n", t.x, t.y, t.z);
|
||||
}
|
||||
text += &format!("damage {}\n", self.sim.damage);
|
||||
text += &format!("lastchance {}\n", self.sim.last_chance);
|
||||
if view {
|
||||
text += &format!("far {}\n", self.far);
|
||||
text += &format!("effects {} {}\n", self.sim.shader, self.hd);
|
||||
@@ -945,6 +949,9 @@ impl AirDef {
|
||||
if let Some(d) = layout.damage {
|
||||
self.sim.damage = d;
|
||||
}
|
||||
if let Some(l) = layout.last_chance {
|
||||
self.sim.last_chance = l;
|
||||
}
|
||||
// A scenario's: the random generator, and the wave menu's raid.
|
||||
if let Some(v) = layout.seed {
|
||||
self.sim.reseed(v);
|
||||
@@ -1617,6 +1624,11 @@ impl Mod for AirDef {
|
||||
if !wanted.is_empty() {
|
||||
render::query_ground(&wanted);
|
||||
}
|
||||
// The chunks the launch-site search is looking at: the game loads them for a few seconds (API 22).
|
||||
let chunks = self.ground.take_chunks();
|
||||
if !chunks.is_empty() {
|
||||
render::load_chunks(&chunks);
|
||||
}
|
||||
let rays: Vec<render::Ray> = self
|
||||
.ground
|
||||
.world
|
||||
@@ -1891,7 +1903,7 @@ impl Mod for AirDef {
|
||||
}
|
||||
["wave", kind, rest @ ..] => {
|
||||
let count = rest.first().and_then(|v| v.parse().ok()).unwrap_or(5u32).clamp(1, 80);
|
||||
let dist = rest.get(1).and_then(|v| v.parse().ok()).unwrap_or(260.0f64).clamp(60.0, 800.0);
|
||||
let dist = rest.get(1).and_then(|v| v.parse().ok()).unwrap_or(260.0f64).clamp(wave::DIST_MIN, wave::DIST_MAX);
|
||||
let p = player().ok_or("Нет игрока")?;
|
||||
let target = self
|
||||
.sim
|
||||
@@ -1904,7 +1916,9 @@ impl Mod for AirDef {
|
||||
let kind = DroneKind::from_key(kind).ok_or(
|
||||
"Тип: shahed, geran3, lancet, gerbera, kh101, kalibr, kh22, zircon, iskander, kinzhal, oreshnik или mix",
|
||||
)?;
|
||||
self.sim.raid(kind, target, count, dist, &mut out);
|
||||
// Through the menu's path (`order_raid`), so every drone leaves a launch site.
|
||||
let order = sim::RaidOrder { kinds: vec![(kind, count)], approach: sim::Approach::Sector, dist, aim: sim::Aim::Objects };
|
||||
self.sim.order_raid(&order, &[target], &mut out);
|
||||
}
|
||||
None
|
||||
}
|
||||
@@ -1999,6 +2013,10 @@ impl Mod for AirDef {
|
||||
let names: Vec<&str> = Class::ALL.iter().filter(|c| r & c.bit() != 0).map(|c| c.name()).collect();
|
||||
say(&format!("{}: {}", kind.name(), if names.is_empty() { "ничего".into() } else { names.join(", ") }));
|
||||
}
|
||||
say(&format!(
|
||||
"Последний шанс: {} (комплекс стреляет и по классу вне ролей, если цель вот-вот попадёт; /airdef lastchance on|off)",
|
||||
if self.sim.last_chance { "вкл" } else { "выкл" }
|
||||
));
|
||||
Some("Классы: drone, jet, cruise, supersonic, ballistic (или all). /airdef roles <комплекс|all> <классы|default>".into())
|
||||
}
|
||||
["roles", who, what] => {
|
||||
@@ -2025,6 +2043,15 @@ impl Mod for AirDef {
|
||||
self.dirty = true;
|
||||
Some("Роли ПВО обновлены".into())
|
||||
}
|
||||
["lastchance", v @ ("on" | "off")] => {
|
||||
self.sim.last_chance = *v == "on";
|
||||
self.dirty = true;
|
||||
Some(if self.sim.last_chance {
|
||||
"Последний шанс: вкл — комплекс стреляет и по классу вне ролей, если цель вот-вот попадёт".into()
|
||||
} else {
|
||||
"Последний шанс: выкл — комплексы стреляют только по своим ролям".into()
|
||||
})
|
||||
}
|
||||
["hold", v @ ("on" | "off")] => {
|
||||
self.sim.hold = *v == "on";
|
||||
Some(if self.sim.hold { "ПВО: огонь запрещён".into() } else { "ПВО: огонь разрешён".into() })
|
||||
|
||||
Reference in New Issue
Block a user