Separate search and engagement roles, support launcher-only SAMs, animate individual tube lids and delay ground strike spending until ejection. Preserve battery configuration and launch poses in saves and replay. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -279,7 +279,7 @@ impl SamKind {
|
||||
const S: SamSpec = SamSpec {
|
||||
name: "С-500",
|
||||
key: "s500",
|
||||
missile: Some(MissileLoad { kind: MissileKind::M77n6, magazine: 4, min: 40.0, max: 1050.0, interval: 20 }),
|
||||
missile: Some(MissileLoad { kind: MissileKind::M77n6, magazine: 2, min: 40.0, max: 1050.0, interval: 20 }),
|
||||
gun: None,
|
||||
reload: 520,
|
||||
scale: 1.6,
|
||||
@@ -681,6 +681,7 @@ pub(super) fn draw_sam_model(sam: &Sam, rng: &mut Rng, out: &mut Out) {
|
||||
}
|
||||
Family::Static | Family::Truck => {}
|
||||
}
|
||||
if sam.mode != battery::SamMode::LauncherOnly {
|
||||
if let Some((model, h, f, tilt)) = parts.dish {
|
||||
part(out, model, mount + turret * DVec3::new(0.0, h * s, f * s), DQuat::from_rotation_y(sam.dish) * DQuat::from_rotation_x(tilt), s);
|
||||
}
|
||||
@@ -688,9 +689,19 @@ pub(super) fn draw_sam_model(sam: &Sam, rng: &mut Rng, out: &mut Out) {
|
||||
part(out, model, sam.pos + up + DVec3::Y * h * s + base * DVec3::new(0.0, 0.0, back * s), base, s);
|
||||
}
|
||||
if let Some((model, h, back, size, tilt)) = parts.spinner {
|
||||
let at = sam.pos + up + DVec3::Y * h * s + base * DVec3::new(0.0, 0.0, back * s);
|
||||
part(out, model, at, DQuat::from_rotation_y(sam.dish * 0.6) * DQuat::from_rotation_x(tilt), s * size);
|
||||
let extra = if sam.kind == SamKind::Radar && sam.radar_role == battery::RadarRole::Height { 8.0 } else { 0.0 };
|
||||
let foot = sam.pos + up + DVec3::Y * h * s + base * DVec3::new(0.0, 0.0, back * s);
|
||||
for segment in 0..(extra as u32 / 2) {
|
||||
part(out, "airdef:radar_mast", foot + DVec3::Y * (segment as f64 * 2.0 + 0.5), base, 1.0);
|
||||
}
|
||||
let at = foot + DVec3::Y * extra;
|
||||
let heading = if sam.kind == SamKind::Radar && sam.radar_role == battery::RadarRole::Engagement {
|
||||
sam.tracks.first().map_or(sam.dish * 0.6, |t| heading_of(t.pos - sam.pos))
|
||||
} else { sam.dish * 0.6 };
|
||||
part(out, model, at, DQuat::from_rotation_y(heading) * DQuat::from_rotation_x(tilt), s * size);
|
||||
}
|
||||
}
|
||||
launch::draw_caps(sam, out);
|
||||
if sam.flash > 0 {
|
||||
let barrels: &[DVec3] = match sam.kind {
|
||||
SamKind::Pantsir => &[DVec3::new(-0.95, 0.33, -1.7), DVec3::new(0.95, 0.33, -1.7)],
|
||||
|
||||
Reference in New Issue
Block a user