feat: add shared radar batteries and animated cold launch
build / mod (push) Failing after 18s

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:
2026-11-02 23:40:40 +03:00
parent d4adbb1e47
commit 966b52f9fc
41 changed files with 2534 additions and 509 deletions
+36 -6
View File
@@ -33,9 +33,10 @@ NS = "airdef"
# ---------------------------------------------------------------- модели
def el(frm, to, tex, faces=None, rot=None):
def el(frm, to, tex, faces=None, rot=None, omit_faces=()):
"""Элемент; rot = (ось, угол) — поворот вокруг центра элемента."""
return {"from": [float(v) for v in frm], "to": [float(v) for v in to], "tex": tex, "faces": faces, "rot": rot}
return {"from": [float(v) for v in frm], "to": [float(v) for v in to], "tex": tex,
"faces": faces, "rot": rot, "omit_faces": tuple(omit_faces)}
def mx(e):
@@ -90,6 +91,8 @@ def model(parts, burnt=False):
for p in parts:
faces = {}
for f in ("north", "south", "east", "west", "up", "down"):
if f in p.get("omit_faces", ()):
continue
tex = (p["faces"] or {}).get(f, p["tex"])
uv = face_uv(p["from"], p["to"], f)
dx, dy, dz = (abs(p["to"][i] - p["from"][i]) for i in range(3))
@@ -394,7 +397,7 @@ def maz_chassis(tex):
return p + wheels((-14, -5, 13, 22))
def tubes(n_wide, n_high, size, tex="tube"):
def tubes(n_wide, n_high, size, tex="tube", front_cap=True):
"""Пакет ТПК: n_wide × n_high труб сечением size, от z=-16 до 32. Ось подъёма — задняя нижняя кромка."""
p = []
w = n_wide * size + (n_wide - 1)
@@ -403,7 +406,12 @@ def tubes(n_wide, n_high, size, tex="tube"):
for j in range(n_high):
x = x0 + i * (size + 1)
y = j * (size + 1)
p.append(el((x, y, -16), (x + size, y + size, 32), tex, {"north": "tube_cap", "south": "tube_cap"}))
if front_cap:
p.append(el((x, y, -16), (x + size, y + size, 32), tex,
{"north": "tube_cap", "south": "tube_cap"}))
else:
p.append(el((x, y, -16), (x + size, y + size, 32), tex,
{"south": "tube_cap"}, omit_faces=("north",)))
p += [el((x0 - 1, 0, 26), (x0 + w + 1, n_high * (size + 1) - 1, 28), "dark_metal"),
el((x0 - 1, 0, -2), (x0 + w + 1, n_high * (size + 1) - 1, 0), "dark_metal")]
return p
@@ -421,6 +429,26 @@ def big_radar_panel():
el((6, -6, 8), (10, 0, 12), "metal")]
def tpk_cap():
"""Reusable stylized octagonal cap, centered at (8, 8, 8), for animated TPK covers."""
z0, z_face, z1 = 7.7, 8.25, 8.3
# Three cuboids form a flat octagonal silhouette while keeping the geometry blocky.
return [el((2.5, 0, z0), (13.5, 16, z_face), "tube_cap"),
el((0, 2.5, z0), (2.5, 13.5, z_face), "tube_cap"),
el((13.5, 2.5, z0), (16, 13.5, z_face), "tube_cap"),
el((5, 5, z_face), (11, 11, z1), "dark_metal")]
def radar_mast():
"""Generic two-block telescoping radar mast segment; stackable for role-based height."""
return [el((4, 0, 4), (12, 3, 12), "dark_metal"),
el((5.5, 3, 5.5), (10.5, 18, 10.5), "metal"),
el((4.5, 18, 4.5), (11.5, 21, 11.5), "dark_metal"),
el((6.5, 21, 6.5), (9.5, 30, 9.5), "dark_metal"),
el((5.5, 30, 5.5), (10.5, 32, 10.5), "metal"),
el((7, 31.5, 7), (9, 32, 9), "dark_metal")]
def missile_57e6():
p = taper("missile_ru", -16, -12, 0.5, 2, 0.5, 2, 2)
p += [el((7, 7, -12), (9, 9, 4), "missile_ru"), el((6.4, 6.4, 4), (9.6, 9.6, 28), "booster")]
@@ -997,7 +1025,9 @@ MODELS = {
"s400_chassis": (lambda: maz_chassis("ru_green"), "Шасси С-400"),
"s400_tubes": (lambda: tubes(2, 2, 7), "ТПК 48Н6"),
"s500_chassis": (lambda: maz_chassis("ru_khaki"), "Шасси С-500"),
"s500_tubes": (lambda: tubes(2, 1, 9.5), "ТПК 77Н6"),
"s500_tubes": (lambda: tubes(2, 1, 9.5, front_cap=False), "ТПК 77Н6"),
"tpk_cap": (tpk_cap, "Крышка ТПК (анимация)"),
"radar_mast": (radar_mast, "Радиомачта (секция высоты)"),
"radar_trailer": (radar_trailer, "Прицеп РЛС"),
"radar_panel": (big_radar_panel, "РЛС обзора"),
"m57e6": (missile_57e6, "57Э6"),
@@ -1039,7 +1069,7 @@ MODELS = {
}
WRECKS = ["patriot_trailer", "patriot_launcher", "gepard_hull", "gepard_turret", "gepard_guns", "pantsir_truck",
"pantsir_turret", "pantsir_pack", "s400_chassis", "s400_tubes", "s500_chassis", "s500_tubes",
"pantsir_turret", "pantsir_pack", "s400_chassis", "s400_tubes", "s500_chassis", "s500_tubes", "tpk_cap", "radar_mast",
"irist_chassis", "irist_tubes", "nasams_trailer", "nasams_launcher", "buk_chassis", "buk_turret",
"buk_rails", "tor_chassis", "tor_turret", "p1sun_launcher", "radar_truck", "depot", "tzm_truck",
"ew_truck", "searchlight", "searchlight_head"]
+1 -1
View File
@@ -56,7 +56,7 @@ def s400_tubes():
for lo, hi, width in [(-1, -.6, .6), (-.6, -.2, .92), (-.2, .2, 1), (.2, .6, .92), (.6, 1, .6)]:
parts.append(g.el((x + 3.5 - 3.5 * width, y + 3.5 + lo * 3.5, -16),
(x + 3.5 + 3.5 * width, y + 3.5 + hi * 3.5, 32),
"tube", {"north": "tube_cap", "south": "tube_cap"}))
"tube", {"south": "tube_cap"}, omit_faces=("north",)))
for z in [-1, 26]:
parts.append(g.el((x - .15, y + 2.6, z), (x + 7.15, y + 4.4, z + 1), "dark_metal"))
parts += [g.el((-.5, 0, 26), (16.5, 1, 29), "dark_metal")]