diff --git a/AGENTS.md b/AGENTS.md index 9a099605..5561f7b7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,7 @@ ## Authority and scope -- This is U-Jagd 1.3.174 (`src/core/version.py`); saves are written as v50 and older saves from v38 on are lifted to v50 on load (`src/core/save_migrate.py`). Treat these as compatibility contracts, not changelog entries. +- This is U-Jagd 1.3.175 (`src/core/version.py`); saves are written as v50 and older saves from v38 on are lifted to v50 on load (`src/core/save_migrate.py`). Treat these as compatibility contracts, not changelog entries. - Resolve conflicts in this order: executable code and focused tests; packaged JSON/runtime resources; `pyproject.toml` and provenance/license notices; `README.md`; design/history documents under `docs/`. A plan or old comment is not an implementation contract. - Preserve explicit compatibility tests and user data unless a task intentionally changes the contract. Add a regression test for behavior changes. - Older phase/milestone labels under `docs/GDD.md`, `docs/implementation-plan.md`, `docs/plan-0.1.6.md`, and `docs/plan-0.1.7.md` are historical. Current resumable work is tracked in `docs/plan-1.3.md` and `docs/resume.md`. diff --git a/CHANGELOG.de.md b/CHANGELOG.de.md index 9666cd91..78976595 100644 --- a/CHANGELOG.de.md +++ b/CHANGELOG.de.md @@ -4,6 +4,24 @@ Alle Versionen von U-Jagd, die neueste zuerst. Die [README](README.de.md) zeigt nur die neueste. +## 1.3.175 + +Version 1.3.175 folgt aus einer Prüfung des ganzen Codes. Waffentasten mit +Umschalt oder Strg feuern nicht mehr versehentlich: Umschalt+A (Ping) startet +an der Waffenstation keinen ASROC mehr und Strg+R (Luftfahrzeug-Radar) feuert +keinen Raketenwerfer mehr, und Umschalt+A schaltet auf dem U-Boot nicht mehr +die Schleichfahrt. Ein lauerndes U-Boot hält jetzt auch gegen einen Nord- oder +Südstrom, statt mit ihm zu treiben, und der Doppler eines Täuschkörpers rechnet +seine Fahrt in Knoten. Die Host-Seite im Browser kann die Beobachterrolle +vergeben und der Waffenstation des U-Boots das Direktfeuer entziehen, die +Browser-Stationen des U-Boots haben eigene Kurzhilfen und Handbuch-Links, und +vier Auswahllisten an Sonar und Heli springen beim Bedienen nicht mehr zurück. +Ein Spielstand, gespeichert während die Fregatte auf einer Untiefe +saß, lädt wieder, auch wenn die Flut inzwischen gestiegen ist. +Hilfetexte wurden berichtigt (Seite Aufträge, OPZ-Zoom, Tasten der +Nachbesprechung, deutsche Begriffe, „U-Boot“ statt „Boot“), und ungenutzter +Code ist entfernt. Spielstände sind v50; v38 bis v49 lassen sich weiter laden. + ## 1.3.174 Version 1.3.174 füllt das Einsatzprotokoll der Remote Crew. Es zeigte bisher diff --git a/CHANGELOG.md b/CHANGELOG.md index 98a5f05d..45b1faba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,22 @@ Every U-Jagd release, newest first. The [README](README.md) shows only the latest one. +## 1.3.175 + +Release 1.3.175 comes out of a review of the whole code. Weapon keys with +Shift or Ctrl no longer fire by mistake: Shift+A (ping) no longer launches an +ASROC and Ctrl+R (aircraft radar) no longer fires the rocket launcher at +Weapons, and Shift+A on the submarine no longer switches silent running. A +lurking submarine now stems a north or south current instead of drifting with +it, and a decoy's Doppler shift counts its speed in knots. The browser host page +can grant the observer role and withdraw direct fire from the submarine's +weapons station, the submarine's browser stations have their own short help +and manual link, and four sonar and helicopter drop-downs no longer jump back +while in use. A save made while the frigate sat on a shoal now loads again +after the tide has risen. Help texts were corrected (tasks page, OPZ zoom, debrief keys, +German wording, "submarine" instead of "boat"), and unused code went. Saves +are v50; v38 to v49 saves still load. + ## 1.3.174 Release 1.3.174 fills the Remote Crew operational log. It used to show only a diff --git a/README.de.md b/README.de.md index a3fa7e18..8ed58ccc 100644 --- a/README.de.md +++ b/README.de.md @@ -14,15 +14,23 @@ Sie führen eine fiktive Fregatte und wechseln zwischen neun Arbeitsplätzen, um zu navigieren, zu suchen, Kontakte zu klassifizieren, Ziele zu bekämpfen und das Schiff einsatzfähig zu halten. -Aktuelle Version: **1.3.174** +Aktuelle Version: **1.3.175** -Version 1.3.174 füllt das Einsatzprotokoll der Remote Crew: jede -Browser-Station listet jetzt dieselben Einträge wie F11 auf der uConsole, das -Neueste oben mit Uhrzeit und Kategoriekürzel, die Stationen der Fregatte das -Log der Fregatte und die Stationen des U-Boots das Bootslog. Bisher zeigte es -nur wenige Alarme und wirkte leer. Ein langes Protokoll scrollt in seiner -Leiste, und auf der uConsole öffnet F11 jetzt auch auf der U-Boot-Seite das -Bootslog. Spielstände sind v50; v38 bis v49 lassen sich weiter laden. +Version 1.3.175 folgt aus einer Prüfung des ganzen Codes. Waffentasten mit +Umschalt oder Strg feuern nicht mehr versehentlich: Umschalt+A (Ping) startet +an der Waffenstation keinen ASROC mehr und Strg+R (Luftfahrzeug-Radar) feuert +keinen Raketenwerfer mehr, und Umschalt+A schaltet auf dem U-Boot nicht mehr +die Schleichfahrt. Ein lauerndes U-Boot hält jetzt auch gegen einen Nord- oder +Südstrom, statt mit ihm zu treiben, und der Doppler eines Täuschkörpers rechnet +seine Fahrt in Knoten. Die Host-Seite im Browser kann die Beobachterrolle +vergeben und der Waffenstation des U-Boots das Direktfeuer entziehen, die +Browser-Stationen des U-Boots haben eigene Kurzhilfen und Handbuch-Links, und +vier Auswahllisten an Sonar und Heli springen beim Bedienen nicht mehr zurück. +Ein Spielstand, gespeichert während die Fregatte auf einer Untiefe +saß, lädt wieder, auch wenn die Flut inzwischen gestiegen ist. +Hilfetexte wurden berichtigt (Seite Aufträge, OPZ-Zoom, Tasten der +Nachbesprechung, deutsche Begriffe, „U-Boot“ statt „Boot“), und ungenutzter +Code ist entfernt. Spielstände sind v50; v38 bis v49 lassen sich weiter laden. Frühere Versionen: [CHANGELOG.de.md](CHANGELOG.de.md). diff --git a/README.md b/README.md index d931d33d..2e939a21 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,21 @@ around the ClockworkPi uConsole's 1280 x 720 workspace. You command a fictional frigate and move between nine workstations to navigate, search, classify, engage, and keep the ship operational. -Current release: **1.3.174** +Current release: **1.3.175** -Release 1.3.174 fills the Remote Crew operational log: every browser station -now lists the same entries as F11 on the uConsole, newest first with time and -category tag, the frigate's stations the frigate's log and the submarine's -stations the boat log. Before, it showed only a few alerts and looked empty. -A long log scrolls inside its drawer, and on the uConsole F11 now opens the -boat log on the submarine side too. Saves are v50; v38 to v49 saves still -load. +Release 1.3.175 comes out of a review of the whole code. Weapon keys with +Shift or Ctrl no longer fire by mistake: Shift+A (ping) no longer launches an +ASROC and Ctrl+R (aircraft radar) no longer fires the rocket launcher at +Weapons, and Shift+A on the submarine no longer switches silent running. A +lurking submarine now stems a north or south current instead of drifting with +it, and a decoy's Doppler shift counts its speed in knots. The browser host page +can grant the observer role and withdraw direct fire from the submarine's +weapons station, the submarine's browser stations have their own short help +and manual link, and four sonar and helicopter drop-downs no longer jump back +while in use. A save made while the frigate sat on a shoal now loads again +after the tide has risen. Help texts were corrected (tasks page, OPZ zoom, debrief keys, +German wording, "submarine" instead of "boat"), and unused code went. Saves +are v50; v38 to v49 saves still load. Earlier releases: [CHANGELOG.md](CHANGELOG.md). diff --git a/data/commander/admin.js b/data/commander/admin.js index e78563f6..f7785db5 100644 --- a/data/commander/admin.js +++ b/data/commander/admin.js @@ -69,7 +69,7 @@ function render(room) { if (detail.leased) { row.append(button("admin_revoke",()=>action("revoke",client.client_id,station))); for (const capability of ["command","direct_fire","sonar_audio"]) { - if (capability==="direct_fire" && !["weapons","opz","helicopter","uboot"].includes(station)) continue; + if (capability==="direct_fire" && !["weapons","opz","helicopter","uboot_weapons"].includes(station)) continue; if (capability==="sonar_audio" && !["sonar","helicopter","uboot_sonar"].includes(station)) continue; const current=detail.grants[capability]; const control=button(current?"admin_disable":"admin_enable", diff --git a/data/commander/js/stations/helicopter.js b/data/commander/js/stations/helicopter.js index 49cb7791..79f43fea 100644 --- a/data/commander/js/stations/helicopter.js +++ b/data/commander/js/stations/helicopter.js @@ -99,7 +99,7 @@ export function renderHelicopterStation(payload) { if (S.helicopterAudioSource !== null && S.helicopterAudioSource !== payload.acoustic.source && S.sonarAudioEnabled) stopSonarAudio("sonar_live_waiting"); S.helicopterAudioSource = payload.acoustic.source; - if (!S.stationDrafts.has("helicopter-buoy-mode")) $("helicopter-buoy-mode").value = asset.buoy_mode; + setControlValue($("helicopter-buoy-mode"), asset.buoy_mode); const listen = $("helicopter-listen-source"); setOptions(listen, payload.acoustic.sources.map((source) => [source, source === "DIP" ? t("helicopter_dip_picture") : source])); setControlValue(listen, payload.acoustic.source); diff --git a/data/commander/js/stations/sonar.js b/data/commander/js/stations/sonar.js index 795879b2..5d92b884 100644 --- a/data/commander/js/stations/sonar.js +++ b/data/commander/js/stations/sonar.js @@ -1,7 +1,7 @@ import { S } from "../state/store.js"; import { $ } from "../core/base.js"; import { enumText, finite, number, stateText, t, unit } from "../core/format.js"; -import { inUse, metrics, setOptions, sonarEntries, stationRows, yesNo } from "../views/dom.js"; +import { inUse, metrics, setControlValue, setOptions, sonarEntries, stationRows, yesNo } from "../views/dom.js"; import { renderLamps } from "../views/console-kit.js"; // The listening console's annunciator lamps: what the operator has switched on. @@ -57,9 +57,10 @@ export function renderSonarStation(payload) { ? settings.tools.library.map((row) => `${number(row.fit * 100, 0)}% ${row.name}`).join(" · ") : t("sonar_library_none")], ["sonar_assist", yesNo(settings.tools.assist)]]); - if (!S.stationDrafts.has("sonar-integration")) $("sonar-integration").value = String(settings.tools.integration_s); - if (!S.stationDrafts.has("sonar-demon-band")) $("sonar-demon-band").value = settings.tools.demon_band_hz.map((value) => number(value, 0).replace(/\D/g, "")).join("-"); - if (!S.stationDrafts.has("sonar-heterodyne")) $("sonar-heterodyne").value = String(Math.round(settings.tools.heterodyne_hz)); + // These drop-downs apply on change; a push only catches them up when not in use. + setControlValue($("sonar-integration"), String(settings.tools.integration_s)); + setControlValue($("sonar-demon-band"), settings.tools.demon_band_hz.map((value) => number(value, 0).replace(/\D/g, "")).join("-")); + setControlValue($("sonar-heterodyne"), String(Math.round(settings.tools.heterodyne_hz))); $("sonar-vernier").checked = settings.tools.vernier; const live = !settings.station_down; if (!S.stationDrafts.has("sonar-array-mode")) $("sonar-array-mode").value = settings.mode; diff --git a/data/commander/js/views/station-view.js b/data/commander/js/views/station-view.js index 472b7138..c72c0a96 100644 --- a/data/commander/js/views/station-view.js +++ b/data/commander/js/views/station-view.js @@ -22,6 +22,10 @@ import { activateTab } from "./lobby.js"; import { queueVisualDraw, renderRoleVisuals } from "./role-visuals.js"; import { canvas, lookoutCanvas } from "./canvases.js"; +// Each submarine station's section of the manual's submarine chapter. +const SUB_MANUAL = {uboot: "sub-command", uboot_sonar: "sub-sonar", uboot_weapons: "sub-weapons", + uboot_engine: "sub-engine", uboot_esm: "sub-esm", uboot_nav: "sub-nav", uboot_radio: "sub-radio"}; + export function renderStationView() { const active = S.v2State?.role; document.body.classList.toggle("workstation-mode", Boolean(active)); @@ -35,7 +39,7 @@ export function renderStationView() { if (active) { $("workstation-guide-title").textContent = t(`station_${active}`); $("workstation-guide-body").textContent = t(`workstation_help_${active}`); - $("workstation-manual-link").href = `/manual-${S.language}#${opforRoles.has(active) ? "ref-opfor" : `station-${active}`}`; + $("workstation-manual-link").href = `/manual-${S.language}#${opforRoles.has(active) ? SUB_MANUAL[active] || "submarine" : `station-${active}`}`; } if (active) { const grid = $(`station-${panelRole(active)}`).querySelector(".station-grid"); diff --git a/data/i18n/de.json b/data/i18n/de.json index 062c9e33..e518e596 100644 --- a/data/i18n/de.json +++ b/data/i18n/de.json @@ -96,7 +96,7 @@ "runtime.helo.dip_depth": "HSP-5 Tauchsonar-Solltiefe: {depth} m", "runtime.sonar.release": "Sonarkontakt K{contact} an OPZ freigegeben", "runtime.sonar.withdraw": "Sonarkontakt K{contact} aus OPZ zurückgezogen", - "help.control.sonar_release": "Gewählt Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen", + "help.control.sonar_release": "Gewählten Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen", "help.control.dip_toggle": "Hubschrauber-Tauchsonar absenken / einholen", "help.control.dip_depth": "Solltiefe des Tauchsonars heben / senken", "help.control.dip_ping": "Aktiven Ping vom abgesenkten Tauchsonar senden", @@ -2287,7 +2287,7 @@ "help.global.telegraph": "Telegraph (an jeder Station verfügbar)", "help.global.display": "Hilfe (diese Anzeige)", "help.global.analyzer": "Taktischer Einheitenanalysator (Katalog, nur lesend)", - "help.global.simlog_view": "Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte)", + "help.global.simlog_view": "Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte, F auf der Karte: Einheiten oder ganze Welt einpassen)", "help.global.autocrew_toggle": "Autocrew der aktuellen Station umschalten", "help.global.autocrew_overview": "Autocrew-Übersicht öffnen", "help.global.commander": "Lokale Commander-LAN-Verwaltung öffnen", @@ -2309,9 +2309,9 @@ "runtime.opz.no_blip": "OPZ: kein frisches Radarecho zum Markieren.", "help.control.opz_blip": "Neuestes bloßes Radarecho als Track markieren (oder das Echo anklicken)", "help.global.nations": "Nationen & Einheiten; im Sonar: Notchfilter", - "help.global.map_zoom": "Kartenzoom nur auf Brücke, Waffen und Helikopter", - "help.global.map_pan": "Karte verschieben (Brücke, Waffen und Helikopter)", - "help.global.map_follow": "Kamera-Follow nur auf sichtbaren Karten (Drag schaltet es aus)", + "help.global.map_zoom": "Kartenzoom auf Brücke, Waffen, Helikopter und OPZ-Karte (dort stellen Q/E den Radarbereich)", + "help.global.map_pan": "Karte verschieben (Brücke, Waffen, Helikopter und OPZ)", + "help.global.map_follow": "Karte folgt nur auf sichtbaren Karten (Ziehen schaltet es aus)", "help.global.plot": "Plotmodus auf Brücken-/Waffen-/Helo-Karte und OPZ-Karte: Marken, Lineal, Peillinien, Kreise, Koppellinien (für alle Stationen, wird gespeichert)", "help.global.plot_keys": "Im Plotmodus: Werkzeug wählen, Punkt mit Enter oder Klick setzen (Pfeile bewegen den Cursor, Shift schneller), nächstes Objekt löschen (Shift: alle)", "help.global.mission_end": "Nach Missionsende: Neustart mit gleichem Seed / Hauptmenü", @@ -2319,7 +2319,7 @@ "help.sonar.intro": "Sonarzentrale – LOFAR-Wasserfall, Kontakte, Peilungen, Ping, TMA.", "help.weapons.intro": "Waffenzentrale – Ziel, Torpedotiefe, Start, HSP-5.", "help.damage.intro": "Schadensbekämpfung – Kompartimente, Flutung, Brand, Reparaturteams.", - "help.opz.intro": "OPZ / CIC – frei navigierbare Karte über volle Höhe (Mausrad bis 5 NM Radius, Ziehen, K Follow); Q/E ändern nur den schiffszentrierten Radarbereich, Bild auf/ab die Seite. Feed und Telemetrie laufen weiter, sind hier aber ausgeblendet.", + "help.opz.intro": "OPZ / CIC – frei navigierbare Karte über volle Höhe (Mausrad bis 0,25 sm Radius, Ziehen, K folgt); Q/E ändern nur den schiffszentrierten Radarbereich, Bild auf/ab die Seite. Feed und Telemetrie laufen weiter, sind hier aber ausgeblendet.", "help.radio.intro": "Funkraum – HFDF-Peilungen, Teletype (HQ), Funkverkehr.", "help.engine.intro": "Maschinenraum – Telegraph, RPM, Lärm, Maschinerie-Status.", "help.helo.intro": "Helikopter-Deck – HSP-5, Sonarbojen und Lufttorpedos.", @@ -2329,9 +2329,9 @@ "help.control.course_input": "Direkten Zielkurs eingeben (000-359)", "help.control.speed_input": "Direkte Zielgeschwindigkeit eingeben (0-31 kn)", "help.control.engine_order": "Telegraph: Motorenbefehl (ASTERN-STOP-SLOW-HALF-FULL-FLANK)", - "help.control.mouse_map": "Mausrad: Zoom, Maus-Drag: Pan", + "help.control.mouse_map": "Mausrad: Zoom, Ziehen mit der Maus: verschieben", "help.control.zoom": "Karte in Stufen zoomen, 500 bis 0,5 sm", - "help.control.follow": "Kamera-Follow an/aus", + "help.control.follow": "Karte folgt dem eigenen Schiff an/aus", "help.control.active_ping": "Aktiv-Ping abfeuern (Kühlzeit, verrät Position!)", "help.control.array": "Empfangsarray wechseln: HMS, TAS, VDS", "help.control.tas": "TAS ausbringen / einholen (nur bei 3-12 kn)", @@ -2840,7 +2840,7 @@ "help.key.station_number": "Nummer der aktiven Station", "help.repeat_station": "Erneut drücken, um die Seite dieser Station weiterzuschalten", "help.global.pages": "Vorige / nächste Seite der Station (jede Station mit mehreren Seiten)", - "help.global.fire": "Waffe abfeuern (nur diese Kombination feuert, an jeder Station und auf dem U-Boot)", + "help.global.fire": "Torpedo oder Flugkörper abfeuern (Enter allein feuert nie; an der Waffenstation haben ASROC A, Wasserbomben Z, Raketenwerfer R und Lufttorpedo D eigene Tasten)", "help.control.repeat_sonar_page": "2 erneut drücken, um die Sonarseite weiterzuschalten", "help.page_hint": "Seite {page}/{pages} | Links/Rechts/Tab: Seite | F1/Esc: zurück", "help.unknown_station": "Unbekannte Station.", @@ -4341,7 +4341,12 @@ "commander.web.tab_uboot_engine": "U-MASCH.", "commander.web.tab_uboot_esm": "U-ESM", "commander.web.tab_uboot_nav": "U-NAV", - "commander.web.workstation_help_uboot": "Sie führen das feindliche U-Boot. Kurs, Fahrt und Tiefe befehlen; das U-Boot folgt im Rahmen seiner Manövrierfähigkeit und fährt Batterie- und Schnorchelzyklus selbst. Ihr einziges Lagebild ist das eigene Sonar: Torpedo auf die gemessene Peilung eines Kontakts schießen (mit Ping-Fix oder TMA-Lösung, solange aktuell) oder auf eine freie Peilung. Täuschkörper und Notanblasen sind begrenzt.", + "commander.web.workstation_help_uboot": "Sie führen das U-Boot. Kurs, Fahrt und Tiefe befehlen, mit den Vorwahlen auf Sehrohr-, Schnorchel- oder Schichttiefe gehen, auf Grund legen, auftauchen oder alarmtauchen. Die Bedrohungskarte nennt den jüngsten Alarm und schlägt ein Ausweichmanöver vor. Ihr Lagebild sind eigenes Sonar, Sehrohr und ESM: auf die gemessene Peilung eines Kontakts oder eine freie Peilung schießen.", + "commander.web.workstation_help_uboot_weapons": "Kontakt wählen oder Peilung, Entfernung und Lauftiefe eingeben, Einzelschuss oder Fächer wählen und schießen. Rohre beim Fluten und Nachladen beobachten. Vor dem Schuss Suchmuster und Scharfschaltpunkt setzen und Übernehmen drücken; danach einen drahtgelenkten Torpedo auf eine neue Peilung steuern oder den Draht kappen. Täuschkörper sind begrenzt.", + "commander.web.workstation_help_uboot_engine": "Telegraph, Schleichfahrt und Schnorchel fahren, Laderate wählen und Batterie, Kraftstoff und Luft im Blick behalten. Trimm, Regelzelle und Notanblasen liegen hier. Die Leckwehrkarte schickt beide Trupps zum Abdichten, Lenzen oder Löschen und schließt Schotten.", + "commander.web.workstation_help_uboot_esm": "Auf Sehrohrtiefe den Mast ausfahren, auf der ESM-Rose nach Radaren horchen, Emitter klassifizieren und ihre Peilungen ins Plot geben. Das Sehrohr mit den Pfeiltasten schwenken, Sichtungen für den Angriffsrechner markieren und den Mast nur so lange oben lassen wie nötig: Radar sieht ihn.", + "commander.web.workstation_help_uboot_nav": "Kurs und Tiefe befehlen, Wasser unter dem Kiel und Untiefen voraus am Echolot beobachten und den Koppelfehler mit einem GPS-Fix auf Sehrohrtiefe klein halten. Wegpunkte auf der Karte setzen oder eine Zickzack- oder Quadratsuche legen.", + "commander.web.workstation_help_uboot_radio": "Mit ausgefahrenem Mast oder Funkboje die Sendungen des Stabs aufnehmen, Befehle und Kontaktmeldungen lesen und eine Lagemeldung senden. Jede eigene Sendung kann der Gegner einpeilen.", "commander.web.workstation_help_uboot_sonar": "Das Rumpfsonar des U-Boots horcht in der eigenen Tauchtiefe, die Sprungschicht wirkt also für und gegen Sie. Kontakte klassifizieren, TMA erstellen und Ziele für den Kommandanten zuweisen. Es gibt keine Schleppantenne und keine Freigabe an die OPZ.", "commander.web.uboot_side": "Gegenseite", "commander.web.uboot_navigation": "U-Boot", @@ -4700,7 +4705,7 @@ "welcome.frigate": "Fregatte: das U-Boot jagen", "welcome.frigate.note": "Ausbildung ab Lektion 1: horchen, verfolgen, angreifen.", "welcome.submarine": "U-Boot: gejagt werden", - "welcome.submarine.note": "Ausbildung ab Lektion 5: das Boot führen und entkommen.", + "welcome.submarine.note": "Ausbildung ab Lektion 5: das U-Boot führen und entkommen.", "welcome.remote_crew": "Remote Crew: im Browser spielen", "welcome.remote_crew.note": "Öffnet die Mehrspieler-Lobby: Browser im LAN treten bei und wählen Stationen.", "welcome.menu": "Hauptmenü", @@ -4745,8 +4750,8 @@ "help.uboot.wire_cut": "Draht des neuesten Torpedos kappen (Waffen)", "help.uboot.silent": "Schleichfahrt ein/aus, höchstens 5 kn (Führung, Maschine)", "help.uboot.bottom": "Auf Grund legen / abheben (Führung, Navigation)", - "help.uboot.surface": "Auftauchen: an die Oberfläche, Brückenwache, Diesel an der Luft (Kommando, Navigation)", - "help.uboot.crash_dive": "Von der Oberfläche: Alarmtauchen, Flutventile auf, äußerste Kraft (Kommando, Navigation)", + "help.uboot.surface": "Auftauchen: an die Oberfläche, Brückenwache, Diesel an der Luft (Führung, Navigation)", + "help.uboot.crash_dive": "Von der Oberfläche: Alarmtauchen, Flutventile auf, äußerste Kraft (Führung, Navigation)", "help.uboot.snorkel": "Schnorchel aus-/einfahren, Diesel laden auf Schnorcheltiefe (Maschine)", "help.uboot.mast": "Mast aus-/einfahren auf Sehrohrtiefe: ESM hört Radare, das Sehrohr sieht, die Funkantenne ist klar (Führung, Mast & ESM, Funkraum)", "help.uboot.scope_turn": "Sehrohrseite: Rohr 2° schwenken (Umschalt: 10°) (Führung, Mast & ESM)", @@ -5494,11 +5499,11 @@ "task.verdict.suspect_gone": "HQ: {task}: {name} war verdächtig, die Spur ist aber kalt.", "end.tasks": "HQ-Aufträge: {done} erfüllt, {failed} gescheitert, {declined} abgelehnt", "help.control.task_select": "HQ-Auftrag wählen (Seite Aufträge)", - "help.control.task_accept": "Gewählten Auftrag annehmen", - "help.control.task_decline": "Gewählten Auftrag ablehnen", - "help.control.ras_request": "Versorger bei der HQ anfordern", - "help.control.contact_report": "Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar)", - "help.control.request_support": "Unterstützung bei HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar)", + "help.control.task_accept": "Seite Aufträge: gewählten Auftrag annehmen", + "help.control.task_decline": "Seite Aufträge: gewählten Auftrag ablehnen", + "help.control.ras_request": "Seite Aufträge: Versorger beim HQ anfordern", + "help.control.contact_report": "Seite Aufträge: Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar)", + "help.control.request_support": "Seite Aufträge: Unterstützung beim HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar)", "help.note.tasking": "HQ-Aufträge kommen per Fernschreiber: Seenotrufe, zu identifizierende Handelsschiffe, U-Boot-Datums, Versorgung und Radarstille. Innerhalb von 5 Minuten auf der Seite Aufträge antworten; keine Antwort gilt als Ablehnung. Angenommene Positionen stehen in der Seekarte. R fordert bei knappen Vorräten einen Versorger an.", "commander.web.radio_tasks_title": "HQ-Aufträge", "commander.web.radio_task_count": "{open} offen", @@ -5601,8 +5606,8 @@ "uboot.dc.crew_action": "GEFECHTSSTATIONEN", "uboot.footer.watch": "ABLÖSEN", "help.uboot.watch_change": "Maschine, Seite Leckwehr: Wache jetzt ablösen", - "help.uboot.casualty_medic": "Maschine, Seite Schaden: Sanitätstrupp zur nächsten Station mit Verwundeten", - "help.uboot.casualty_reassign": "Maschine, Seite Schaden: Leute aus den Freiwachen zur am schwersten getroffenen Station", + "help.uboot.casualty_medic": "Maschine, Seite Leckwehr: Sanitätstrupp zur nächsten Station mit Verwundeten", + "help.uboot.casualty_reassign": "Maschine, Seite Leckwehr: Leute aus den Freiwachen zur am schwersten getroffenen Station", "help.uboot.action_stations": "Gefechtsstationen an/aus (alle Wachen im Dienst, aufmerksam, aber ermüdend)", "help.uboot.clear_baffles": "Toten Winkel klären: zwei Minuten 60° nach Steuerbord, dann zurück (das Rumpfsonar ist achtern taub)", "uboot.local.baffles_rejected": "Toten Winkel jetzt nicht klärbar.", @@ -5754,7 +5759,7 @@ "debrief.event.ship_sunk": "Eigenes Schiff gesunken", "debrief.event.missed": "U-Boot {minutes} min lang bis {range} sm nah ohne Kontakt ({layer})", "debrief.event.mission_end": "Missionsende: {result}", - "help.global.debrief": "Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×)", + "help.global.debrief": "Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×, Pos1/Ende Anfang/Ende, B Bericht des Sprachmodells, wenn eingeschaltet)", "menu.training": "Ausbildung", "menu.logbook": "Einsatzbuch", "logbook.title.frigate": "Einsatzbuch - Fregatte", @@ -5886,7 +5891,7 @@ "campaign.outcome_text.victory": "Die entscheidende Operation ist gelungen; der Gegner gibt das Seegebiet auf.", "campaign.outcome_text.cleared": "Der Gegner hat im Seegebiet keine Kräfte mehr.", "campaign.outcome_text.supremacy": "Die Lage hat 100 erreicht: das Seegebiet gehört Ihnen.", - "campaign.outcome_text.sunk": "Schiff oder Boot ging verloren und mit ihm der Feldzug.", + "campaign.outcome_text.sunk": "Schiff oder U-Boot ging verloren und mit ihm der Feldzug.", "campaign.outcome_text.defeat": "Die Lage ist auf 0 gefallen.", "campaign.outcome_text.overrun": "Vier Verteidigungseinsätze gingen verloren oder blieben liegen.", "campaign.outcome_text.relieved": "Das Ansehen bei der Führung fiel unter 10.", diff --git a/data/i18n/en.json b/data/i18n/en.json index c9feeb6d..07c422ea 100644 --- a/data/i18n/en.json +++ b/data/i18n/en.json @@ -2287,7 +2287,7 @@ "help.global.telegraph": "Telegraph (available at every station)", "help.global.display": "Help (this display)", "help.global.analyzer": "Tactical Unit Analyzer (read-only catalog)", - "help.global.simlog_view": "Simulation log view (live; requires simlog option; M: map of all contacts)", + "help.global.simlog_view": "Simulation log view (live; requires simlog option; M: map of all contacts, F on the map: fit units or world)", "help.global.autocrew_toggle": "Toggle Autocrew for the current station", "help.global.autocrew_overview": "Open Autocrew overview", "help.global.commander": "Open local Commander LAN administration", @@ -2309,8 +2309,8 @@ "runtime.opz.no_blip": "OPZ: no fresh radar blip to mark.", "help.control.opz_blip": "Mark the newest bare radar blip as a track (or click the blip)", "help.global.nations": "Nations & units; in sonar: notch filter", - "help.global.map_zoom": "Chart zoom only on bridge, weapons, and helicopter", - "help.global.map_pan": "Pan chart (bridge, weapons, and helicopter)", + "help.global.map_zoom": "Chart zoom on bridge, weapons, helicopter and the OPZ chart (there Q/E set the radar range)", + "help.global.map_pan": "Pan chart (bridge, weapons, helicopter and OPZ)", "help.global.map_follow": "Camera follow only on visible charts (drag disables it)", "help.global.plot": "Plot mode on the Bridge/Weapons/Helo map and OPZ chart: marks, rulers, bearing lines, circles, DR lines (shared by all stations, saved)", "help.global.plot_keys": "In plot mode: choose tool, place point with Enter or click (arrows move the cursor, Shift faster), delete the nearest object (Shift: all)", @@ -2319,7 +2319,7 @@ "help.sonar.intro": "Sonar center - LOFAR waterfall, contacts, bearings, ping, TMA.", "help.weapons.intro": "Weapons center - target, torpedo depth, launch, HSP-5.", "help.damage.intro": "Damage control - compartments, flooding, fire, repair teams.", - "help.opz.intro": "Operations / CIC - full-height free chart (wheel zoom to 5 NM radius, drag pan, K follow); Q/E change only the ship-centred radar range, Page Up/Down the page. Feed and telemetry remain active but hidden here.", + "help.opz.intro": "Operations / CIC - full-height free chart (wheel zoom to 0.25 NM radius, drag pan, K follow); Q/E change only the ship-centred radar range, Page Up/Down the page. Feed and telemetry remain active but hidden here.", "help.radio.intro": "Radio room - HFDF bearings, teletype (HQ), radio traffic.", "help.engine.intro": "Engine room - telegraph, RPM, noise, machinery status.", "help.helo.intro": "Helicopter deck - HSP-5, sonobuoys, and air-launched torpedoes.", @@ -2840,7 +2840,7 @@ "help.key.station_number": "Active station number", "help.repeat_station": "Press again to advance that station's page", "help.global.pages": "Previous / next page of the station (every station with several pages)", - "help.global.fire": "Fire the weapon (only this combination fires, at every station and on the submarine)", + "help.global.fire": "Fire the torpedo or missile (Enter alone never fires; at Weapons ASROC A, depth charges Z, rocket launcher R and air torpedo D have their own keys)", "help.control.repeat_sonar_page": "Press 2 again to advance the sonar page", "help.page_hint": "Page {page}/{pages} | Left/Right/Tab: page | F1/Esc: back", "help.unknown_station": "Unknown station.", @@ -4341,7 +4341,12 @@ "commander.web.tab_uboot_engine": "SUB ENG", "commander.web.tab_uboot_esm": "SUB ESM", "commander.web.tab_uboot_nav": "SUB NAV", - "commander.web.workstation_help_uboot": "You command the hostile submarine. Order course, speed and depth; the submarine follows within its handling limits and runs its battery and snorkel cycle itself. Your only picture is your own sonar: fire down a contact's measured bearing (using its ping fix or TMA solution while current) or down a free bearing. Decoy and emergency blow are limited.", + "commander.web.workstation_help_uboot": "You command the submarine. Order course, speed and depth, use the presets for periscope, snorkel and layer depth, lie on the bottom, surface or crash dive. The threat card names the freshest alarm and offers an evasion. Your picture is your own sonar, the periscope and the ESM: fire down a contact's measured bearing or a free bearing.", + "commander.web.workstation_help_uboot_weapons": "Choose a contact or enter a bearing, range and run depth, set single shot or spread and fire. Watch the tubes flood and reload. Before the shot set the seeker pattern and enable point and press Apply; after it steer a wired torpedo onto a new bearing or cut the wire. Decoys are limited.", + "commander.web.workstation_help_uboot_engine": "Run the telegraph, silent running and the snorkel, choose the charge rate and keep battery, fuel and air in view. Trim and ballast are here, the emergency blow too. The damage-control card sends both teams to seal, pump or fight fire and closes bulkheads.", + "commander.web.workstation_help_uboot_esm": "Raise the mast at periscope depth, listen for radars on the ESM rose, classify emitters and send their bearings to the plot. Train the periscope with the arrow buttons, mark sightings for the attack computer and keep the mast up no longer than needed: radar sees it.", + "commander.web.workstation_help_uboot_nav": "Order course and depth, watch the keel depth and shoals ahead on the echo sounder and keep the dead-reckoning error small with a GPS fix at periscope depth. Set waypoints on the chart or lay a zigzag or expanding-square search.", + "commander.web.workstation_help_uboot_radio": "Copy HQ's broadcasts with the mast or the radio buoy up, read HQ's orders and contact reports and send a situation report. Every transmission can be direction-found by the enemy.", "commander.web.workstation_help_uboot_sonar": "The submarine's hull sonar listens at the submarine's own depth, so the layer works for and against you. Classify contacts, build the TMA and designate targets for your commander. There is no towed array and no OPZ release.", "commander.web.uboot_side": "Opposing force", "commander.web.uboot_navigation": "Submarine", @@ -4437,11 +4442,11 @@ "uboot.event.hq_hint_fox": "HQ: The frigate's captain counts as a fox: approaches quietly and pings rarely.", "uboot.event.hq_hint_cautious": "HQ: The frigate's captain counts as cautious: keeps distance and shoots late.", "uboot.event.hq_hint_hunter": "HQ: The frigate's captain counts as a stubborn hunter: runs a lost bearing down for a long time.", - "uboot.event.crew_mishap_tool": "Noise in the boat: a tool fell on the deck plates. The enemy may have heard it.", - "uboot.event.crew_mishap_hatch": "Noise in the boat: a hatch slammed shut. The enemy may have heard it.", - "uboot.event.crew_mishap_pot": "Noise in the boat: a pot crashed down in the galley. The enemy may have heard it.", - "uboot.event.crew_mishap_chain": "Noise in the boat: a chain struck the hull. The enemy may have heard it.", - "uboot.event.voice_far": "Quiet in the boat! The crew is too loud, the enemy can hear us.", + "uboot.event.crew_mishap_tool": "Noise in the submarine: a tool fell on the deck plates. The enemy may have heard it.", + "uboot.event.crew_mishap_hatch": "Noise in the submarine: a hatch slammed shut. The enemy may have heard it.", + "uboot.event.crew_mishap_pot": "Noise in the submarine: a pot crashed down in the galley. The enemy may have heard it.", + "uboot.event.crew_mishap_chain": "Noise in the submarine: a chain struck the hull. The enemy may have heard it.", + "uboot.event.voice_far": "Quiet aboard! The crew is too loud, the enemy can hear us.", "uboot.event.transient_heard": "Metallic transient from the surface, bearing {bearing}°.", "uboot.event.voices_heard": "Voices and noise from the surface ship, bearing {bearing}°.", "uboot.event.torpedo_locked": "Torpedo has locked on, bearing {bearing}°! Impact in about {tti} s.", @@ -4700,7 +4705,7 @@ "welcome.frigate": "Frigate: hunt the submarine", "welcome.frigate.note": "Training from lesson 1: listen, track and attack.", "welcome.submarine": "Submarine: be hunted", - "welcome.submarine.note": "Training from lesson 5: command the boat and slip away.", + "welcome.submarine.note": "Training from lesson 5: command the submarine and slip away.", "welcome.remote_crew": "Remote Crew: play from browsers", "welcome.remote_crew.note": "Opens the multiplayer lobby: browsers on the LAN join and pick stations.", "welcome.menu": "Main menu", @@ -4845,7 +4850,7 @@ "runtime.helo.mad_off": "MAD run ended", "runtime.helo.mad_dip": "Recover the dipping sonar before a MAD run", "runtime.helo.mad_contact": "MAD contact K{contact:02d}", - "runtime.helo.mad_anomaly": "MAD anomaly under the helicopter, bearing {bearing}: no contact on it (wreck or boat?)", + "runtime.helo.mad_anomaly": "MAD anomaly under the helicopter, bearing {bearing}: no contact on it (wreck or submarine?)", "enum.buoy_pattern.single": "SINGLE", "enum.buoy_pattern.field": "FIELD", "enum.buoy_pattern.barrier": "BARRIER", @@ -5494,11 +5499,11 @@ "task.verdict.suspect_gone": "HQ: {task}: {name} was suspect, but the trail is cold.", "end.tasks": "HQ tasks: {done} done, {failed} failed, {declined} declined", "help.control.task_select": "Select HQ task (Tasks page)", - "help.control.task_accept": "Accept the selected task", - "help.control.task_decline": "Decline the selected task", - "help.control.ras_request": "Request a supply ship from HQ", - "help.control.contact_report": "Contact report to HQ (the freshest fix; HF call, can be DF'd)", - "help.control.request_support": "Request support from HQ (the patrol aircraft; HF call, can be DF'd)", + "help.control.task_accept": "Tasks page: accept the selected task", + "help.control.task_decline": "Tasks page: decline the selected task", + "help.control.ras_request": "Tasks page: request a supply ship from HQ", + "help.control.contact_report": "Tasks page: contact report to HQ (the freshest fix; HF call, can be DF'd)", + "help.control.request_support": "Tasks page: request support from HQ (the patrol aircraft; HF call, can be DF'd)", "help.note.tasking": "HQ tasks arrive by teletype: distress calls, merchants to identify, submarine datums, replenishment and radar silence. Answer within 5 minutes on the Tasks page; no answer counts as declined. Accepted positions are plotted on the chart. R asks HQ for a supply ship when stores run low.", "commander.web.radio_tasks_title": "HQ tasks", "commander.web.radio_task_count": "{open} open", @@ -5651,7 +5656,7 @@ "mpa.mad_on": "Patrol aircraft MAD passes over its waypoint: 60 m, 180 kn", "mpa.mad_off": "Patrol aircraft MAD passes ended", "mpa.mad_contact": "Patrol aircraft MAD contact K{contact:02d}", - "mpa.mad_anomaly": "Patrol aircraft MAD anomaly, bearing {bearing}: no contact on it (wreck or boat?)", + "mpa.mad_anomaly": "Patrol aircraft MAD anomaly, bearing {bearing}: no contact on it (wreck or submarine?)", "opz.mpa.mad_run": "MAD passes over the waypoint", "help.control.mpa_mad": "Aircraft MAD passes over its waypoint on/off (low and slower, radar horizon shrinks)", "commander.web.mpa_mad": "MAD passes", @@ -5754,7 +5759,7 @@ "debrief.event.ship_sunk": "Our ship sank", "debrief.event.missed": "Submarine within {range} NM for {minutes} min without contact ({layer})", "debrief.event.mission_end": "Mission end: {result}", - "help.global.debrief": "After the mission ends: debrief with the truth beside what the crew knew (Space plays it back, Tab 10×/60×)", + "help.global.debrief": "After the mission ends: debrief with the truth beside what the crew knew (Space plays it back, Tab 10×/60×, Home/End start/end, B the language model's report when switched on)", "menu.training": "Training", "menu.logbook": "Logbook", "logbook.title.frigate": "Logbook - frigate", @@ -5886,7 +5891,7 @@ "campaign.outcome_text.victory": "The decisive operation succeeded; the enemy gives up the sea area.", "campaign.outcome_text.cleared": "The enemy has no strength left in the sea area.", "campaign.outcome_text.supremacy": "The front situation reached 100: the sea area is yours.", - "campaign.outcome_text.sunk": "The ship or boat was lost, and the campaign with it.", + "campaign.outcome_text.sunk": "The ship or submarine was lost, and the campaign with it.", "campaign.outcome_text.defeat": "The front situation fell to 0.", "campaign.outcome_text.overrun": "Four defence missions were lost or left unanswered.", "campaign.outcome_text.relieved": "Standing with command fell below 10.", @@ -7115,8 +7120,8 @@ "scenario.free.win": "No victory: collect points as long as the frigate stays afloat", "scenario.free.lose": "Frigate sunk / civilian loss", "scenario.free_boat.title": "Free patrol", - "scenario.free_boat.brief": "Submarine on a free patrol without a time limit. HQ's broadcasts carry orders (proceed to an area, send a report, keep radio silence, sink a named merchant, land swimmers off a coast, meet a supply boat, sight and report the frigate); copy them with the antenna up and carry them out. The hunting frigate gets leads on the boat from time to time, merchants pass, and incidents at sea happen more often than in a scenario. Points for orders done and ships sunk, deductions for failed orders. The patrol ends when the boat is lost or sinks the frigate.", - "scenario.free_boat.win": "No victory: collect points as long as the boat stays afloat", + "scenario.free_boat.brief": "Submarine on a free patrol without a time limit. HQ's broadcasts carry orders (proceed to an area, send a report, keep radio silence, sink a named merchant, land swimmers off a coast, meet a supply boat, sight and report the frigate); copy them with the antenna up and carry them out. The hunting frigate gets leads on the submarine from time to time, merchants pass, and incidents at sea happen more often than in a scenario. Points for orders done and ships sunk, deductions for failed orders. The patrol ends when the submarine is lost or sinks the frigate.", + "scenario.free_boat.win": "No victory: collect points as long as the submarine stays afloat", "scenario.free_boat.lose": "Submarine sunk", "mission.free": "Free patrol", "mission.free_boat": "Free patrol", @@ -7165,7 +7170,7 @@ "uboot.event.route_waypoint": "Navigation: waypoint {number} set, bearing {bearing}°.", "uboot.event.route_pattern_zigzag": "Navigation: zigzag search from the ordered course.", "uboot.event.route_pattern_square": "Navigation: expanding square from the ordered course.", - "uboot.event.route_cancelled": "Navigation: route off, the helm has the boat.", + "uboot.event.route_cancelled": "Navigation: route off, the helm has the submarine.", "uboot.event.route_complete": "Navigation: route complete, holding course.", "uboot.event.route_reached": "Navigation: waypoint {number} reached.", "commander.web.reason_uboot_route_full": "The route is full.", diff --git a/docs/manual/manual.de.md b/docs/manual/manual.de.md index 0fe942f1..cc89dcc0 100644 --- a/docs/manual/manual.de.md +++ b/docs/manual/manual.de.md @@ -44,7 +44,7 @@ Globale Tasten (alle Stationen): | `9` | Elektronische Kampfführung / ESM | | `Nummer der aktiven Station` | Erneut drücken, um die Seite dieser Station weiterzuschalten | | `Bild Auf / Ab` | Vorige / nächste Seite der Station (jede Station mit mehreren Seiten) | -| `Strg+Enter` | Waffe abfeuern (nur diese Kombination feuert, an jeder Station und auf dem U-Boot) | +| `Strg+Enter` | Torpedo oder Flugkörper abfeuern (Enter allein feuert nie; an der Waffenstation haben ASROC A, Wasserbomben Z, Raketenwerfer R und Lufttorpedo D eigene Tasten) | | `Pfeiltasten` | Stationsbezogene Auswahl oder Einstellung | | `+ / -` | Telegraph (an jeder Station verfügbar) | | `F1 / ?` | Hilfe (diese Anzeige) | @@ -54,23 +54,23 @@ Globale Tasten (alle Stationen): | `0` | Wetter- & Sonar-Analyse | | `F7` | Erster Offizier (optionales Sprachmodell) | | `F8` | Taktischer Einheitenanalysator (Katalog, nur lesend) | -| `F4` | Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte) | +| `F4` | Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte, F auf der Karte: Einheiten oder ganze Welt einpassen) | | `F9` | Lokale Commander-LAN-Verwaltung öffnen | | `F10` | Optionen: Sprache, Vollbild, Audio, großer Text, Tooltips, Bildrate | | `F11` | Ereignislog und volle Telemetrie einblenden (Station bleibt bedienbar) | | `N` | Nationen & Einheiten; im Sonar: Notchfilter | | `S / L` | Speichern / Laden (Slots 1-5) | | `Alt+Enter` | Vollbild (alle Stationen) | -| `Q / E oder Mausrad` | Kartenzoom nur auf Brücke, Waffen und Helikopter | -| `Drag` | Karte verschieben (Brücke, Waffen und Helikopter) | -| `K` | Kamera-Follow nur auf sichtbaren Karten (Drag schaltet es aus) | +| `Q / E oder Mausrad` | Kartenzoom auf Brücke, Waffen, Helikopter und OPZ-Karte (dort stellen Q/E den Radarbereich) | +| `Drag` | Karte verschieben (Brücke, Waffen, Helikopter und OPZ) | +| `K` | Karte folgt nur auf sichtbaren Karten (Ziehen schaltet es aus) | | `Linksklick` | Angeklickte Taste, Lampe, Hinweis, Reiter, Scheibe oder Zeile | | `Rechtsklick` | Abbrechen wie Esc in Menüs und Eingaben | | `P` | Plotmodus auf Brücken-/Waffen-/Helo-Karte und OPZ-Karte: Marken, Lineal, Peillinien, Kreise, Koppellinien (für alle Stationen, wird gespeichert) | | `M R B C D · Enter · Rück` | Im Plotmodus: Werkzeug wählen, Punkt mit Enter oder Klick setzen (Pfeile bewegen den Cursor, Shift schneller), nächstes Objekt löschen (Shift: alle) | | `Esc` | Eingabe abbrechen oder Beenden-Dialog öffnen | | `R / M` | Nach Missionsende: Neustart mit gleichem Seed / Hauptmenü | -| `D` | Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×) | +| `D` | Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×, Pos1/Ende Anfang/Ende, B Bericht des Sprachmodells, wenn eingeschaltet) | Im Remote-Crew-Browser (Commander, `F9`) werden Stationen mit Schaltflächen bedient; die Tastatur hilft bei der Navigation: @@ -216,9 +216,9 @@ Das Ruder kann einer Route aus bis zu 8 Wegpunkten folgen. Auf der Navigationsse | `C` | Direkten Zielkurs eingeben (000-359) | | `V` | Direkte Zielgeschwindigkeit eingeben (0-31 kn) | | `+ / -` | Telegraph: Motorenbefehl (ASTERN-STOP-SLOW-HALF-FULL-FLANK) | -| `Karte` | Mausrad: Zoom, Maus-Drag: Pan | +| `Karte` | Mausrad: Zoom, Ziehen mit der Maus: verschieben | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `, / .` | Ausguck-Seite: Radius kleiner / größer | | `B` | Ausguck-Seite: Fernglas über der Karte ein/aus | | `↑/↓ · ←/→ · Q/E · Space` | Fernglas oben (wie das Sehrohr): ↑/↓ neigen 2° (Umschalt: 10°) statt Maschinentelegraf, ←/→ schwenken 5° (Umschalt: 20°) statt Ruder, Q/E Zoom (16°, 8°, 4° Feld), Leertaste Stabilisierung | @@ -405,7 +405,7 @@ Die Anzeige zeigt gemessene Modulation, keine Identität. Nach einer Peilungsän | `SPACE` | LOFAR Peak-Hold ein/aus | | `T` | TMA für ausgewählten Kontakt ein/aus | | `C` | Kontakt klassifizieren (U-Boot / Kampfschiff / Biologisch / Fahrzeug / Flugzeug / Torpedo) | -| `G` | Gewählt Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen | +| `G` | Gewählten Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen | | `M` | Ausgewählten Kontakt als Ziel setzen | ### Standardablauf @@ -512,7 +512,7 @@ Beide Seiten sind wie ein Feuerleitpult aufgebaut: Auf Seite 1 hat jedes Rohr ei | `R` | U-Jagd-Raketensalve auf das Ziel (frische Entfernung, 0,4-3 sm) | | `Shift+R` | Raketen-Abwehrsalve in Richtung der Torpedowarnung | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `F` | Flak-Feuerfreigabe umschalten (gesperrt = feuert nie auf Angreifer) | ### Standardablauf @@ -730,7 +730,7 @@ Zwei Schalter oben links in der Karte schalten auf jeder Seite Seeradar und Luft | `Backspace` | Alle markierten Meldungen abwählen | | `B` | Neuestes bloßes Radarecho als Track markieren (oder das Echo anklicken) | | `Eingabe` | Angriff nach Feind-Einstufung eines realen Kontakts bestätigen | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `H` | OPZ Seite 3: Seefernaufklärer anfordern / heimschicken (Tasten wie beim Helikopter) | | `W` | Suchgebiet auf die gewählte Spur (sonst eigenes Schiff); Klick in die Karte für einen Punkt | | `X / Shift+X` | Bojenmuster um das Suchgebiet wechseln / Shift bricht ab | @@ -861,11 +861,11 @@ Auf der Aufträge-Seite kann der Funkraum HQ selbst rufen, höchstens alle 10 Mi | `Auf / Ab` | HFDF-Signal auswählen | | `Eingabe` | Peilung mit eigener Position protokollieren | | `Auf / Ab` | HQ-Auftrag wählen (Seite Aufträge) | -| `A` | Gewählten Auftrag annehmen | -| `D` | Gewählten Auftrag ablehnen | -| `R` | Versorger bei der HQ anfordern | -| `K` | Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar) | -| `H` | Unterstützung bei HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar) | +| `A` | Seite Aufträge: gewählten Auftrag annehmen | +| `D` | Seite Aufträge: gewählten Auftrag ablehnen | +| `R` | Seite Aufträge: Versorger beim HQ anfordern | +| `K` | Seite Aufträge: Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar) | +| `H` | Seite Aufträge: Unterstützung beim HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar) | ### Standardablauf @@ -1015,7 +1015,7 @@ Seite 3 zeigt das Tauchsonar wie eine Konsole: Lampen für Dom (grün im Wasser, | `Shift+A` | Aktiven Ping vom abgesenkten Tauchsonar senden | | `Ctrl+Enter / D` | Leichttorpedo abwerfen | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `Akustik: Bild Auf / Ab` | Akustikseite: Breitband / LOFAR / DEMON | | `Akustik: ← / →` | Hubschrauber-Horchpeilung -/+ 5 Grad | | `Akustik: R` | Horchpeilung auf automatisch zurücksetzen | @@ -1420,8 +1420,8 @@ Die obere Leiste zeigt die sieben Stationen des U-Boots als Reiter: `1` Führung | `Shift+W` | Draht des neuesten Torpedos kappen (Waffen) | | `A` | Schleichfahrt ein/aus, höchstens 5 kn (Führung, Maschine) | | `Shift+G` | Auf Grund legen / abheben (Führung, Navigation) | -| `Shift+H` | Auftauchen: an die Oberfläche, Brückenwache, Diesel an der Luft (Kommando, Navigation) | -| `H` | Von der Oberfläche: Alarmtauchen, Flutventile auf, äußerste Kraft (Kommando, Navigation) | +| `Shift+H` | Auftauchen: an die Oberfläche, Brückenwache, Diesel an der Luft (Führung, Navigation) | +| `H` | Von der Oberfläche: Alarmtauchen, Flutventile auf, äußerste Kraft (Führung, Navigation) | | `N` | Schnorchel aus-/einfahren, Diesel laden auf Schnorcheltiefe (Maschine) | | `P` | Mast aus-/einfahren auf Sehrohrtiefe: ESM hört Radare, das Sehrohr sieht, die Funkantenne ist klar (Führung, Mast & ESM, Funkraum) | | `Pfeiltasten` | Seite Mast & ESM: Emitter wählen | @@ -1446,8 +1446,8 @@ Die obere Leiste zeigt die sieben Stationen des U-Boots als Reiter: `1` Führung | `Eingabe` | Funkraum: Lagemeldung an die Führung senden (Mast auf Sehrohrtiefe ausgefahren; die Fregatte kann die KW-Sendung peilen) | | `B` | Funkraum: Bojenantenne ausbringen oder einholen (Rundspruch bis 60 m bei höchstens 6 kn; reißt über 10 kn ab) | | `W` | Maschine, Seite Leckwehr: Wache jetzt ablösen | -| `M` | Maschine, Seite Schaden: Sanitätstrupp zur nächsten Station mit Verwundeten | -| `U` | Maschine, Seite Schaden: Leute aus den Freiwachen zur am schwersten getroffenen Station | +| `M` | Maschine, Seite Leckwehr: Sanitätstrupp zur nächsten Station mit Verwundeten | +| `U` | Maschine, Seite Leckwehr: Leute aus den Freiwachen zur am schwersten getroffenen Station | | `G` | Gefechtsstationen an/aus (alle Wachen im Dienst, aufmerksam, aber ermüdend) | | `Ctrl+B` | Toten Winkel klären: zwei Minuten 60° nach Steuerbord, dann zurück (das Rumpfsonar ist achtern taub) | | `Rechtsklick` | Routen-Wegpunkt auf der Karte setzen (Navigation) | diff --git a/docs/manual/manual.en.md b/docs/manual/manual.en.md index 250c70c4..2cab0562 100644 --- a/docs/manual/manual.en.md +++ b/docs/manual/manual.en.md @@ -44,7 +44,7 @@ Global keys (all stations): | `9` | Electronic warfare / ESM | | `Active station number` | Press again to advance that station's page | | `Page Up / Down` | Previous / next page of the station (every station with several pages) | -| `Ctrl+Enter` | Fire the weapon (only this combination fires, at every station and on the submarine) | +| `Ctrl+Enter` | Fire the torpedo or missile (Enter alone never fires; at Weapons ASROC A, depth charges Z, rocket launcher R and air torpedo D have their own keys) | | `Arrow keys` | Station-specific selection or adjustment | | `+ / -` | Telegraph (available at every station) | | `F1 / ?` | Help (this display) | @@ -54,15 +54,15 @@ Global keys (all stations): | `0` | Weather & sonar analysis panel | | `F7` | Executive officer (optional language model) | | `F8` | Tactical Unit Analyzer (read-only catalog) | -| `F4` | Simulation log view (live; requires simlog option; M: map of all contacts) | +| `F4` | Simulation log view (live; requires simlog option; M: map of all contacts, F on the map: fit units or world) | | `F9` | Open local Commander LAN administration | | `F10` | Options: language, fullscreen, audio, large text, tooltips, frame rate | | `F11` | Event log and full telemetry overlay (station stays live) | | `N` | Nations & units; in sonar: notch filter | | `S / L` | Save / load (slots 1-5) | | `Alt+Enter` | Fullscreen (all stations) | -| `Q / E or mouse wheel` | Chart zoom only on bridge, weapons, and helicopter | -| `Drag` | Pan chart (bridge, weapons, and helicopter) | +| `Q / E or mouse wheel` | Chart zoom on bridge, weapons, helicopter and the OPZ chart (there Q/E set the radar range) | +| `Drag` | Pan chart (bridge, weapons, helicopter and OPZ) | | `K` | Camera follow only on visible charts (drag disables it) | | `Left click` | Press the clicked key, lamp, hint, tab, dial or row | | `Right click` | Cancel like Esc in menus and entries | @@ -70,7 +70,7 @@ Global keys (all stations): | `M R B C D · Enter · Bksp` | In plot mode: choose tool, place point with Enter or click (arrows move the cursor, Shift faster), delete the nearest object (Shift: all) | | `Esc` | Cancel input or open exit dialog | | `R / M` | After the mission ends: restart with the same seed / main menu | -| `D` | After the mission ends: debrief with the truth beside what the crew knew (Space plays it back, Tab 10×/60×) | +| `D` | After the mission ends: debrief with the truth beside what the crew knew (Space plays it back, Tab 10×/60×, Home/End start/end, B the language model's report when switched on) | In the Remote Crew browser (Commander, `F9`) stations are operated with buttons; the keyboard helps with navigation: @@ -860,11 +860,11 @@ On the Tasks page the radio room can call HQ itself, at most once every 10 minut | `Up / Down` | Select HFDF signal | | `Enter` | Log bearing with own position | | `Up / Down` | Select HQ task (Tasks page) | -| `A` | Accept the selected task | -| `D` | Decline the selected task | -| `R` | Request a supply ship from HQ | -| `K` | Contact report to HQ (the freshest fix; HF call, can be DF'd) | -| `H` | Request support from HQ (the patrol aircraft; HF call, can be DF'd) | +| `A` | Tasks page: accept the selected task | +| `D` | Tasks page: decline the selected task | +| `R` | Tasks page: request a supply ship from HQ | +| `K` | Tasks page: contact report to HQ (the freshest fix; HF call, can be DF'd) | +| `H` | Tasks page: request support from HQ (the patrol aircraft; HF call, can be DF'd) | ### Standard procedure diff --git a/docs/station-shortcuts.de.md b/docs/station-shortcuts.de.md index 2b2a95ab..6886f7e5 100644 --- a/docs/station-shortcuts.de.md +++ b/docs/station-shortcuts.de.md @@ -1,4 +1,4 @@ -# U-Jagd 1.3.174 - Stations- und Tastenkürzel +# U-Jagd 1.3.175 - Stations- und Tastenkürzel Druckfassung: [`station-shortcuts.de.pdf`](station-shortcuts.de.pdf). Maßgeblich ist die implementierte lokale Bedienung. Stationsnummern und @@ -15,7 +15,7 @@ Berechtigungsprüfungen bleiben wirksam. | `9` | Elektronische Kampfführung / ESM | | `Nummer der aktiven Station` | Erneut drücken, um die Seite dieser Station weiterzuschalten | | `Bild Auf / Ab` | Vorige / nächste Seite der Station (jede Station mit mehreren Seiten) | -| `Strg+Enter` | Waffe abfeuern (nur diese Kombination feuert, an jeder Station und auf dem U-Boot) | +| `Strg+Enter` | Torpedo oder Flugkörper abfeuern (Enter allein feuert nie; an der Waffenstation haben ASROC A, Wasserbomben Z, Raketenwerfer R und Lufttorpedo D eigene Tasten) | | `Pfeiltasten` | Stationsbezogene Auswahl oder Einstellung | | `+ / -` | Telegraph (an jeder Station verfügbar) | | `F1 / ?` | Hilfe (diese Anzeige) | @@ -25,23 +25,23 @@ Berechtigungsprüfungen bleiben wirksam. | `0` | Wetter- & Sonar-Analyse | | `F7` | Erster Offizier (optionales Sprachmodell) | | `F8` | Taktischer Einheitenanalysator (Katalog, nur lesend) | -| `F4` | Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte) | +| `F4` | Simulationsprotokoll-Ansicht (live; benötigt simlog-Option; M: Karte aller Kontakte, F auf der Karte: Einheiten oder ganze Welt einpassen) | | `F9` | Lokale Commander-LAN-Verwaltung öffnen | | `F10` | Optionen: Sprache, Vollbild, Audio, großer Text, Tooltips, Bildrate | | `F11` | Ereignislog und volle Telemetrie einblenden (Station bleibt bedienbar) | | `N` | Nationen & Einheiten; im Sonar: Notchfilter | | `S / L` | Speichern / Laden (Slots 1-5) | | `Alt+Enter` | Vollbild (alle Stationen) | -| `Q / E oder Mausrad` | Kartenzoom nur auf Brücke, Waffen und Helikopter | -| `Drag` | Karte verschieben (Brücke, Waffen und Helikopter) | -| `K` | Kamera-Follow nur auf sichtbaren Karten (Drag schaltet es aus) | +| `Q / E oder Mausrad` | Kartenzoom auf Brücke, Waffen, Helikopter und OPZ-Karte (dort stellen Q/E den Radarbereich) | +| `Drag` | Karte verschieben (Brücke, Waffen, Helikopter und OPZ) | +| `K` | Karte folgt nur auf sichtbaren Karten (Ziehen schaltet es aus) | | `Linksklick` | Angeklickte Taste, Lampe, Hinweis, Reiter, Scheibe oder Zeile | | `Rechtsklick` | Abbrechen wie Esc in Menüs und Eingaben | | `P` | Plotmodus auf Brücken-/Waffen-/Helo-Karte und OPZ-Karte: Marken, Lineal, Peillinien, Kreise, Koppellinien (für alle Stationen, wird gespeichert) | | `M R B C D · Enter · Rück` | Im Plotmodus: Werkzeug wählen, Punkt mit Enter oder Klick setzen (Pfeile bewegen den Cursor, Shift schneller), nächstes Objekt löschen (Shift: alle) | | `Esc` | Eingabe abbrechen oder Beenden-Dialog öffnen | | `R / M` | Nach Missionsende: Neustart mit gleichem Seed / Hauptmenü | -| `D` | Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×) | +| `D` | Nach Missionsende: Nachbesprechung mit der Wahrheit neben dem Wissen der Crew (Leertaste spielt ab, Tab 10×/60×, Pos1/Ende Anfang/Ende, B Bericht des Sprachmodells, wenn eingeschaltet) | ## 1 Brücke @@ -52,9 +52,9 @@ Berechtigungsprüfungen bleiben wirksam. | `C` | Direkten Zielkurs eingeben (000-359) | | `V` | Direkte Zielgeschwindigkeit eingeben (0-31 kn) | | `+ / -` | Telegraph: Motorenbefehl (ASTERN-STOP-SLOW-HALF-FULL-FLANK) | -| `Karte` | Mausrad: Zoom, Maus-Drag: Pan | +| `Karte` | Mausrad: Zoom, Ziehen mit der Maus: verschieben | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `, / .` | Ausguck-Seite: Radius kleiner / größer | | `B` | Ausguck-Seite: Fernglas über der Karte ein/aus | | `↑/↓ · ←/→ · Q/E · Space` | Fernglas oben (wie das Sehrohr): ↑/↓ neigen 2° (Umschalt: 10°) statt Maschinentelegraf, ←/→ schwenken 5° (Umschalt: 20°) statt Ruder, Q/E Zoom (16°, 8°, 4° Feld), Leertaste Stabilisierung | @@ -108,7 +108,7 @@ Berechtigungsprüfungen bleiben wirksam. | `SPACE` | LOFAR Peak-Hold ein/aus | | `T` | TMA für ausgewählten Kontakt ein/aus | | `C` | Kontakt klassifizieren (U-Boot / Kampfschiff / Biologisch / Fahrzeug / Flugzeug / Torpedo) | -| `G` | Gewählt Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen | +| `G` | Gewählten Kontakt unabhängig von der Klassifikation an OPZ freigeben / zurückziehen | | `M` | Ausgewählten Kontakt als Ziel setzen | ## 3 Waffenzentrale @@ -133,7 +133,7 @@ Berechtigungsprüfungen bleiben wirksam. | `R` | U-Jagd-Raketensalve auf das Ziel (frische Entfernung, 0,4-3 sm) | | `Shift+R` | Raketen-Abwehrsalve in Richtung der Torpedowarnung | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `F` | Flak-Feuerfreigabe umschalten (gesperrt = feuert nie auf Angreifer) | ## 4 Schadensabwehr @@ -175,7 +175,7 @@ Berechtigungsprüfungen bleiben wirksam. | `Backspace` | Alle markierten Meldungen abwählen | | `B` | Neuestes bloßes Radarecho als Track markieren (oder das Echo anklicken) | | `Eingabe` | Angriff nach Feind-Einstufung eines realen Kontakts bestätigen | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `H` | OPZ Seite 3: Seefernaufklärer anfordern / heimschicken (Tasten wie beim Helikopter) | | `W` | Suchgebiet auf die gewählte Spur (sonst eigenes Schiff); Klick in die Karte für einen Punkt | | `X / Shift+X` | Bojenmuster um das Suchgebiet wechseln / Shift bricht ab | @@ -199,11 +199,11 @@ Berechtigungsprüfungen bleiben wirksam. | `Auf / Ab` | HFDF-Signal auswählen | | `Eingabe` | Peilung mit eigener Position protokollieren | | `Auf / Ab` | HQ-Auftrag wählen (Seite Aufträge) | -| `A` | Gewählten Auftrag annehmen | -| `D` | Gewählten Auftrag ablehnen | -| `R` | Versorger bei der HQ anfordern | -| `K` | Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar) | -| `H` | Unterstützung bei HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar) | +| `A` | Seite Aufträge: gewählten Auftrag annehmen | +| `D` | Seite Aufträge: gewählten Auftrag ablehnen | +| `R` | Seite Aufträge: Versorger beim HQ anfordern | +| `K` | Seite Aufträge: Kontaktmeldung an HQ (der frischeste Fix; KW-Ruf, anpeilbar) | +| `H` | Seite Aufträge: Unterstützung beim HQ anfordern (der Seefernaufklärer; KW-Ruf, anpeilbar) | ## 7 Maschinenraum @@ -238,7 +238,7 @@ Berechtigungsprüfungen bleiben wirksam. | `Shift+A` | Aktiven Ping vom abgesenkten Tauchsonar senden | | `Ctrl+Enter / D` | Leichttorpedo abwerfen | | `Q / E` | Karte in Stufen zoomen, 500 bis 0,5 sm | -| `K` | Kamera-Follow an/aus | +| `K` | Karte folgt dem eigenen Schiff an/aus | | `Akustik: Bild Auf / Ab` | Akustikseite: Breitband / LOFAR / DEMON | | `Akustik: ← / →` | Hubschrauber-Horchpeilung -/+ 5 Grad | | `Akustik: R` | Horchpeilung auf automatisch zurücksetzen | diff --git a/docs/station-shortcuts.de.pdf b/docs/station-shortcuts.de.pdf index 7a43cfbc..a992ec51 100644 Binary files a/docs/station-shortcuts.de.pdf and b/docs/station-shortcuts.de.pdf differ diff --git a/src/commander/projections.py b/src/commander/projections.py index bae3a933..82f1a9f1 100644 --- a/src/commander/projections.py +++ b/src/commander/projections.py @@ -18,8 +18,7 @@ from src.sonar import analysis_tools from src.ship.ship import NOISE_LEVEL_MAX from src.core.i18n import localize from src.core.version import APP_VERSION -from src.commander.server import (CHART_MAX_BYTES, OPFOR_ROLES, STATE_MAX_BYTES, - STATIONS) +from src.commander.server import OPFOR_ROLES, STATE_MAX_BYTES, STATIONS from src.sensors.esm import ( ESMCorrelationEvidence, ESM_BROADBAND_SENSOR_COUNT, @@ -1751,7 +1750,7 @@ def _uboot_esm(game, boat): """The boat's own ESM picture: mast time and the crew's emitter list (measured parameters, own-position bearing history, crew cross-fix and library classification; never an emitter's identity or position).""" - esm, sub, now = boat.esm, boat.sub, game.sim_t + esm, now = boat.esm, game.sim_t sea = float(getattr(game.world, "effective_sea_state", game.world.sea_state)) rain = config.clamp(float(getattr(game.world, "rain_intensity", 0.0)), 0.0, 1.0) mast_range = boat_esm.mast_radar_nm(sea, rain) diff --git a/src/commander/server.py b/src/commander/server.py index f9d7afc9..9b1dd9ed 100644 --- a/src/commander/server.py +++ b/src/commander/server.py @@ -797,10 +797,6 @@ class CommanderServer(AudioStreamServerMixin, StationLeaseServerMixin, return phones < len(LOOKOUT_ROLES) return len(self._sessions_v2) - phones < 1 - def web_host_session(self): - with self._lock: - self._expire_locked() - return self._sessions_v2.get(self._web_host_digest) def _web_grant_available_locked(self, session): for station in STATIONS: diff --git a/src/commander/v2/routes.py b/src/commander/v2/routes.py index e7637195..16a13e84 100644 --- a/src/commander/v2/routes.py +++ b/src/commander/v2/routes.py @@ -57,7 +57,6 @@ from src.commander.v2.wire import ( _V2_COMMAND_GLOBAL_LIMIT, _V2_COMMAND_MAX_AGE_S, _V2_COOKIE, - _V2_SESSION_LIMIT, _V2_SONAR_AUDIO_FIELDS, _WEBSOCKET_GUID, _audio_resume_cursor, @@ -1162,7 +1161,7 @@ class _Handler(BaseHTTPRequestHandler): or type(body["action"]) is not str or body["action"] not in { "assign", "revoke", "revoke_client", "command", "direct_fire", - "sonar_audio", "simlog", "rotate_code", "accept_target", + "sonar_audio", "simlog", "observer", "rotate_code", "accept_target", "reject_target", "accept_navigation", "reject_navigation", "shutdown"} or type(body["client_id"]) is not str diff --git a/src/core/boat_threat.py b/src/core/boat_threat.py index 4267e84a..d3f3e33c 100644 --- a/src/core/boat_threat.py +++ b/src/core/boat_threat.py @@ -90,7 +90,7 @@ def picture(game, boat) -> dict: def advice(game, boat, layer: str, noise: str) -> list[str]: """Short crew recommendations (catalog keys), most urgent first.""" - sub, orders = boat.sub, boat.orders + orders = boat.orders keys = [] source = alarm_source(boat) if source is not None and source[0] == "torpedo": diff --git a/src/core/config.py b/src/core/config.py index 833131f9..b35712a5 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -46,7 +46,6 @@ SIM_FRAME_DT_MAX = 0.1 SIM_CATCHUP_MAX_S = 2.5 AUDIO_ENABLED = True AUDIO_SAMPLE_RATE = 22050 -AUDIO_UPDATE_S = 0.25 # Solo Remote Crew: while the paired browser is live the uConsole only redraws a # small status screen (display only; the simulation is unaffected). ECO_REDRAW_S = 0.25 @@ -120,9 +119,7 @@ SHIP_SPEED_MAX_KN = 31.0 # only grow further between 25 kn and SHIP_SPEED_MAX_KN. SHIP_SPEED_REFERENCE_KN = 25.0 SHIP_SPEED_START_KN = 12.0 -SHIP_TUR_RATE_DEG_PER_S = 0.8 # max. Kurssatz des Schiffes SHIP_TURN_INPUT_DEG_PER_S = 75.0 # Zielkurs-Drehung bei gedrückter Taste -SHIP_SPEED_RESP_KN_PER_S = 0.08 # ca. 2-4 min bis volle Fahrt (Legacy-Name) # W2: hydrodynamische Fahrtantwort - Exponential-Verzug statt fixer Rampe # (Schub/Widerstand-Gleichgewicht: schnelle Anfangsbeschleunigung, die sich # asymptotisch dem Zielwert naehert, statt linear bis zum Anschlag zu laufen). @@ -141,10 +138,7 @@ PING_INTERCEPT_SIGMA_DEG = 2.0 SONAR_PING_RANGE_ERROR_NM = 0.18 # max. gleichverteilter Messfehler SONAR_PING_DEPTH_ERROR_M = 12.0 # max. gleichverteilter Messfehler SONAR_ECHO_HISTORY_MAX = 80 # persistente ACTIVE-Beobachtungen -SONAR_THERMO_PASSIVE_ABOVE = 1.15 # Ziel über Thermokline: besser -SONAR_THERMO_PASSIVE_BELOW = 0.55 # Ziel unter Thermokline: schlechter SONAR_THERMO_ACTIVE_BELOW = 0.35 # Ping in Schattenzone -SONAR_PASSIVE_RANGE_ERR = 0.25 # passive Distanz-Schätzung +/-25 % SONAR_CONF_PASSIVE_PER_S = 0.012 # Verarbeitung braucht belastbare Historie SONAR_CONF_PING_BONUS = 0.30 # Konfidenz-Sprung pro Echo SONAR_CONF_DECAY_PER_S = 0.003 # langsames Auslaufen einer Spur @@ -152,21 +146,17 @@ SONAR_CONTACT_LOST_S = 120.0 # taktisch nutzbare Track-Historie # W1: SNR-/Peilmodell (faktorielle Dekomposition der passiven Reichweite) # SNR_dB = 20*log10(R_eff/d) – R_eff aus folgenden Faktoren: -SONAR_SNR_DETECT_DB = 0.0 # Grenzwert: SNR >= 0 dB = detektiert SONAR_SNR_QUALITY_SPAN_DB = 14.0 # SNR bei dem Qualität=1.0 (0 dB = ~0) # (Peilfehler: siehe unten, Block "W1: TMA" – BEARING_ERR_*) # W2: Schallausbreitung (Captain's Log §1) SOUND_SPEED_M_S = 1500.0 # Schall in Salzwasser -THERMO_SHADOW_BONUS_DB = 22.0 # Brechung an Sprungschicht: Schattenzone -CZ_CONVERGENCE_GAIN_DB = 8.0 # Konvergenzzone: Fokus unterhalb/oberhalb # U-Boot-KI (M2: Patrouille + Ausweichen; sim-Sekunden) SUB_EVADE_DURATION_S = 240.0 # W2: Tiefenaenderung mit Traegheit statt sofort voller Rate (Auftrieb/ # Anstellwinkel-Ersatz) - begrenzt, wie schnell sich depth_rate_mps aendert. SUB_DEPTH_ACCEL_MPS2 = 0.15 -SUB_PATROL_TURN_PERIOD_S = 600.0 # W2: Taktik-Erweiterung SUB_LUER_DURATION_S = (300.0, 900.0) # LAUER: still liegen + lauschen SUB_LUER_DIST_NM = 25.0 # LAUER nur, wenn Fregatte naeher @@ -180,13 +170,10 @@ SUB_ACTIVE_PING_CHANCE_PER_S = 0.01 SUB_ACTIVE_PING_COOLDOWN_S = 120.0 # Kompatibilitaetsnamen; das geladene JSON-Profil ist die Laufzeitquelle. SUB_DECOY_CHANCE = _DECOY_PROFILE.chance -SUB_DECOY_LIFE_S = _DECOY_PROFILE.life_s SUB_DECOY_COOLDOWN_S = _DECOY_PROFILE.cooldown_s -SUB_DECOY_SPEED_KN = _DECOY_PROFILE.speed_kn # M4: Zivile Schiffe & Radar CIVILIAN_HIT_RADIUS_NM = 0.2 # Torpedo-Annäherung, die als Vorfall zählt -RADAR_RANGE_NM = 40.0 # Kompatibilitaetswert RADAR_SURFACE_RANGE_NM = 30.0 RADAR_AIR_RANGE_NM = 100.0 @@ -204,8 +191,6 @@ DMG_DESTROY_FLOOD = 70.0 # % Flutung -> Kompartiment ZERSTOERT DMG_SHIP_SINK_TOTAL = 540.0 # 60 % mittlere Flutung über neun Räume DMG_SONAR_DEGRADED_FACTOR = 0.5 # Sonar-Reichweitenfaktor bei gestörter Sonarzentrale ENEMY_TORP_SPEED_KN = 40.0 -ENEMY_TORP_RANGE_NM = 20.0 -ENEMY_TORP_HIT_DIST_NM = 0.25 ENEMY_TORP_QUIET = 0.10 # laut – passiv gut auffindbar SUB_ATTACK_COOLDOWN_S = 90.0 # An AI boat with a located frigate this close attacks even a quiet frigate @@ -218,7 +203,6 @@ SUB_SOLUTION_ATTACK_RATE = 0.003 # ESM: nur Peilung von Radargeräten ziviler Schiffe. ESM_RANGE_NM = 150.0 # ESM-"Reichweite" (Peilung von Radargeräten) ESM_BEARING_ERR_DEG = 3.0 # ESM-Peilungsfehler (± Grad) -ESM_EMITTER_PROB = 0.6 # Anteil ziviler Schiffe mit aktivem Radargerät # Bridge lookout: explicit horizon/recognition assumptions. A submarine is # visually surfaced only at or above 2 m; at periscope or snorkel depth only # its raised mast and feather are seen (LOOKOUT_FEATHER_RANGE_NM for the full @@ -235,7 +219,6 @@ LOOKOUT_NIGHT_FACTOR = 0.35 DAYLIGHT_START_H = 5.5 DAYLIGHT_END_H = 19.5 DUSK_HALF_WIDTH_H = 1.0 # chart tint: "dusk" this close to either edge -LOOKOUT_SEA_STATE_LOSS = 0.08 LOOKOUT_BEARING_ERR_DEG = 0.6 LOOKOUT_RANGE_ERR_FRAC = 0.06 LOOKOUT_EPOCH_S = 0.5 @@ -290,7 +273,6 @@ MISSION_AIRCRAFT_LOITER_NM = 10.0 MISSION_GROUP_DEPTH_M = 60.0 UBOOT_SNORKEL_NOISE_DB = 12.0 UBOOT_SNORKEL_LINES = ((50.0, 0.85, 2.0), (100.0, 0.55, 1.5)) # (Hz, amp, width) -UBOOT_SNORKEL_QUIET_LOSS = 0.25 # Snorkel charge rate of a crewed diesel boat (the AI always charges at full # rate): fraction of generator power, radiated-level and quietness penalty, # and diesel-line amplitude. "vent" runs only the fans through the snorkel @@ -598,12 +580,6 @@ PLAYER_CLASS_LABELS = { # OPZ/CIC: manuell gesetzte NATO-Zugehoerigkeit. Die Domaene (See, Luft, # Flugkoerper) stammt nur aus dem beobachteten Sensor-Track. NATO_AFFILIATIONS = ("UNKNOWN", "FRIEND", "NEUTRAL", "HOSTILE") -NATO_AFFILIATION_LABELS = { - "UNKNOWN": "Unbekannt", - "FRIEND": "Freund", - "NEUTRAL": "Neutral", - "HOSTILE": "Feind", -} OPZ_FUSION_MAX = 32 OPZ_FUSION_MEMBER_MIN = 2 OPZ_FUSION_MEMBER_MAX = 8 @@ -658,8 +634,6 @@ TELEGRAPH_ORDERS = ( ) TELEGRAPH_DEFAULT = 2 # Index (HALF) ASTERN_SPEED_KN = 3.0 # Fiktive Bergungsfahrt; separater Zustand -SHIP_RPM_MIN = 20.0 # Leerlauf-RPM -SHIP_RPM_PER_KN = 2.4 SHIP_FUEL_CAPACITY_KG = 500_000.0 SHIP_FUEL_HOTEL_KG_H = 400.0 SHIP_FUEL_MAX_PROPULSION_KG_H = 14_110.0 @@ -674,7 +648,6 @@ SHIP_YAW_DAMPING = 2.0 # straight course - a small, bounded game model of a real damage-control # effect, derived purely from the existing hull_left/hull_right flood state # (no new persisted ship state). -SHIP_LIST_DEG_PER_FLOOD_PCT = 0.15 SHIP_MAX_LIST_DEG = 15.0 SHIP_LIST_YAW_GAIN = 0.05 # deg/s of persistent yaw pull per degree of list TAS_AMBIGUITY_RESOLVE_DEG = 20.0 # own turn that resolves TAS left/right @@ -683,7 +656,6 @@ CAVITATION_PASSIVE_FACTOR = 0.35 # passives Sonar bei Kavitation: Sensor "bric SEA_STATE_SONAR_FACTOR = 0.06 # passiver Reichweiten-Abzug pro Seegang-Grad # M11: Sonar-Suite (Bug-/Towed-Array, Konvergenzzone) -SONAR_ARRAY_BOW_PASSIVE = 1.0 SONAR_ARRAY_BOW_PING = 1.0 SONAR_ARRAY_TOWED_PASSIVE = 1.4 # Towed-Array: besser, verliert aber mit Fahrt SONAR_ARRAY_TOWED_PING = 0.8 @@ -741,13 +713,11 @@ SONAR_BT_COOLDOWN_S = 60.0 SONAR_BT_MAX_DEPTH_M = 1500.0 SONAR_PAGE_COUNT = 6 CZ_BANDS = ((40.0, 70.0), (90.0, 130.0)) # Konvergenzzonen (NM, vom Schallfenster) -CZ_BONUS_NM = 25.0 # zusätzliche passive Reichweite in der Zone # W1: LOFAR-Wasserfall (hohe Auflösung im niedrigen Hz-Bereich) LOFAR_FMAX_HZ = 300.0 LOFAR_BINS = 110 # 0-40 Hz @1 Hz, 40-100 Hz @2 Hz, 100-300 Hz @5 Hz LOFAR_HISTORY_COLS = 80 -LOFAR_SAMPLE_S = 0.25 # sim-Sekunden pro Wasserfall-Spalte # Display-only, decimated histories. The fine receiver history remains the # save-compatible 20 s buffer above; these bounded rings provide operator time # context without changing detections or the v10 save schema. @@ -784,7 +754,6 @@ SUB_SURFACED_RCS_FACTOR = 0.1 # a surfaced boat's hull and conning tower SUB_SURFACED_HEIGHT_M = 3.0 RADAR_BLIP_LIFE_S = 6.0 RADAR_BLIP_MAX = 24 -RADAR_BLIP_GATE_NM = 1.0 RADAR_BEARING_ERR_DEG = 0.8 RADAR_RANGE_ERR_FRAC = 0.015 # Air-search radar height estimate: a game model of a 3D radar's altitude @@ -794,7 +763,6 @@ RADAR_ALTITUDE_ERR_M = 60.0 OBS_ALTITUDE_SMOOTH = 0.35 # Observation filters operate on sensor epochs, not render/physics substeps. OBS_RADAR_EPOCH_S = 0.5 -OBS_BEARING_EPOCH_S = 5.0 OBS_RADAR_SMOOTH_TAU_S = 1.5 OBS_BEARING_SMOOTH_TAU_S = 4.0 # 12 fixes at the 0.5s epoch above is only a 6s regression window - far too @@ -933,9 +901,7 @@ HELO_SPEED_KN = 120.0 # W3: Luftfahrt & Airbases (physikalische Knoten) FLIGHT_SPEED_KN = 200.0 -FLIGHT_CIVIL_SPEED_KN = 450.0 FLIGHT_LOITER_NM = (15.0, 30.0) # Patrouillen-Kreis um Airbase -FLIGHT_ATTACK_RANGE_NM = 35.0 # Abschussentfernung für ASM # Zivile Routen werden geometrisch an die Fregatte angebunden, damit sie # radar-einsehbar bleiben: liegt die Gerade Basis->Ziel innerhalb von # FLIGHT_CIVIL_PASS_NM an ihr, bleibt die Route direkt; sonst lenkt ein @@ -949,7 +915,6 @@ TMA_MIN_SPAN_S = 180.0 # mehrere Minuten Peilungsbaseline TMA_RESOLVE_EVERY_S = 4.0 # max. TMA-Re-Solve-Rate pro Ziel (sim-s, CPU-Schutz) TMA_MIN_COURSE_CHG_DEG = 6.0 # Fregatte muss manövrieren (Beobachtbarkeit) TMA_MAX_RANGE_NM = 45.0 # Lösungsraum -TMA_SEARCH_STEP_S = 1.5 # Zeit-Schritt der Geschwindigkeits-Suche TMA_QUALITY_DB = 8.0 # Peil-RMSE (°), ab dem Qualität 0 wird TMA_RANGE_MIN_QUALITY = 0.35 # TMA-Range erst ab dieser Qualität nutzen TMA_FINE_COURSE_STEP_DEG = 3 @@ -1221,7 +1186,6 @@ MPA_RADAR_RANGE_ERR_FRAC = 0.02 MPA_RELAY_NM = 50.0 # buoys heard only this close to the aircraft MPA_DATALINK_NM = 250.0 # aircraft to ship link (line of sight at altitude) MPA_DROP_NM = 2.0 # torpedo release this close to the datum -MPA_NO_BASE_OFFSET_NM = 150.0 # no friendly airfield: arrives from the map edge # Group hunt (src/core/consort.py): the consort destroyer of scenarios 21 and 22. CONSORT_PROFILE = "warship_01" # catalog key: hull sonar and ASROC CONSORT_CALLSIGN = "LUETJENS" @@ -1350,14 +1314,6 @@ def radar_horizon_nm(height_a_m: float, height_b_m: float) -> float: return 2.2256 * (math.sqrt(max(0.0, height_a_m)) + math.sqrt(max(0.0, height_b_m))) -def nm_to_px(nm: float, nm_per_px: float = NM_PER_PX_MAP) -> float: - return nm / nm_per_px - - -def km_to_nm(km: float) -> float: - return km / 1.852 - - def kn_to_nm_per_s(kn: float) -> float: """Knoten -> NM pro (Spiel-)Sekunde.""" return kn / 3600.0 diff --git a/src/core/game_draw.py b/src/core/game_draw.py index 47471f4a..88bfaa8a 100644 --- a/src/core/game_draw.py +++ b/src/core/game_draw.py @@ -99,7 +99,6 @@ _STATION_VIEWS = { } - # Telemetry readings and the station (number key) each belongs to, frigate # and submarine; a click on a reading opens that station. TELEMETRY_STATION = { @@ -809,15 +808,6 @@ class DrawMixin: rect.w - label_w, pitch), colors[level], size=16) - def _ticker_telemetry_text(self, width: int | None = None, rows=None, - keys=None) -> str: - """Compact telemetry for the ticker, most important readings first. - - Readings that do not fit are left out whole (never clipped); the - F11 overlay always shows all of them. - """ - return " \u00b7 ".join(text for _key, text in - self._ticker_telemetry_parts(width, rows, keys)) def _ticker_telemetry_parts(self, width: int | None = None, rows=None, keys=None) -> list: diff --git a/src/core/game_events.py b/src/core/game_events.py index f71423bd..9bb91f3b 100644 --- a/src/core/game_events.py +++ b/src/core/game_events.py @@ -956,7 +956,9 @@ class EventMixin(AdminKeysMixin, PointerMixin, StationKeysMixin): self.flash(message("runtime.helo.dip_ping_sent" if result is True else "runtime.helo.dip_ping_unavailable")) elif self.station is Station.WEAPONS: - self.fire_own_asroc() + # Shift+A is the ping key elsewhere: it never launches. + if not getattr(e, "mod", 0) & (pygame.KMOD_SHIFT | pygame.KMOD_CTRL): + self.fire_own_asroc() elif self.station is Station.ELOKA: self.set_ecm_auto(not self.ecm_jammer.auto_enabled) self.flash(message("runtime.eloka.auto_on" @@ -973,7 +975,9 @@ class EventMixin(AdminKeysMixin, PointerMixin, StationKeysMixin): elif self.station is Station.HELICOPTER and self.station_page == 3: self.set_helicopter_listen_bearing(None) elif self.station is Station.WEAPONS: - if getattr(e, "mod", 0) & pygame.KMOD_SHIFT: + if getattr(e, "mod", 0) & pygame.KMOD_CTRL: + pass # Ctrl+R is the aircraft radar key; it never fires + elif getattr(e, "mod", 0) & pygame.KMOD_SHIFT: self.fire_rbu_defence() else: self.fire_rbu() @@ -1045,7 +1049,8 @@ class EventMixin(AdminKeysMixin, PointerMixin, StationKeysMixin): self.deploy_buoys() elif self.station is Station.OPZ: self._mark_newest_blip() - elif e.key == pygame.K_z and self.station is Station.WEAPONS: + elif (e.key == pygame.K_z and self.station is Station.WEAPONS + and not getattr(e, "mod", 0) & pygame.KMOD_CTRL): self.drop_depth_charges() elif e.key == pygame.K_y and self.station is Station.WEAPONS: self._cycle_torpedo_salvo() diff --git a/src/core/game_incidents.py b/src/core/game_incidents.py index 2c555e84..21bb91db 100644 --- a/src/core/game_incidents.py +++ b/src/core/game_incidents.py @@ -521,16 +521,3 @@ class IncidentsMixin: segments_cross(x1, y1, x2, y2, item["x"], item["y"], item["x2"], item["y2"]) for item in board.active("net")) - def incident_view(self) -> list: - """Detached rows of the current incidents (the radio room's list).""" - rows = [] - for item in reversed(self.incidents.items): - if not item["active"]: - continue - row = dict(id=item["id"], kind=item["kind"], label=self._incident_label(item), - start_t=item["start_t"], end_t=item["end_t"], - weather=item["weather"]) - if item["kind"] == "net": - row.update(x=item["x"], y=item["y"], x2=item["x2"], y2=item["y2"]) - rows.append(row) - return rows diff --git a/src/core/game_operator.py b/src/core/game_operator.py index 0f1b22e3..40adb9f2 100644 --- a/src/core/game_operator.py +++ b/src/core/game_operator.py @@ -640,24 +640,6 @@ class OperatorMixin(WeaponOrdersMixin): self.target = contact return True - def _feed_ping(self, tgt, contact) -> None: - """W1/W2: Ping-Echo-Feed inkl. Echolatenz (W3: Salzwasser-Schallfeld).""" - dist = tgt.distance_nm(self.ship) - mx, my = (self.ship.x + tgt.x) * .5, (self.ship.y + tgt.y) * .5 - latenz = self.world.echo_delay_s(dist, mx, my) - klass = {"diesel_alt": "Diesel", "aip_modern": "AIP", - "ssn": "Nuclear propulsion?"}.get( - getattr(tgt, "stype", None) and tgt.stype.key or "", - "unknown") if getattr(tgt, "stype", None) else \ - ("Decoy?" if getattr(tgt, "kind", "") == "decoy" - else ("biological" if hasattr(tgt, "atype") else "vessel")) - self.feed.add(self.world.format_time(), "sonar", - message("runtime.ping.feed", contact=tgt.id, - bearing=f"{contact.bearing:4.0f}", - range=f"{contact.range_est:4.1f}", - latency=f"{latenz:3.1f}", - speed=f"{self.world.mean_sound_speed_m_s(mx, my):.0f}", - classification=klass)) # --- Display (M8): Letterbox-Scaling + Vollbild --- diff --git a/src/core/game_radar.py b/src/core/game_radar.py index 57e5b7db..dcdfff3b 100644 --- a/src/core/game_radar.py +++ b/src/core/game_radar.py @@ -281,14 +281,6 @@ class RadarPictureMixin: break self.ecm_jammer.deploy_jamming(track, self.sim_t, automatic=True) - def _emitter_profile(self, profile_key: str): - systems = self.runtime_catalog.profile_systems.get(profile_key) - if systems is None: - return None - return next((self.runtime_catalog.emitters[key] - for key in sorted(systems.emitter_keys) - if key in self.runtime_catalog.emitters - and self.runtime_catalog.emitters[key].domain == "radar"), None) @staticmethod def _asm_radar_horizon_nm(asm) -> float: @@ -374,35 +366,6 @@ class RadarPictureMixin: operational=not self.damage.station_down("opz"), burn_through_nm=asm.profile["jam_break_nm"]) - def _esm_measurement(self, actor, bearing: float, distance: float, - emitter, namespace: int) -> ESMMeasurement: - import random - - seed = int(getattr(actor, "sensor_seed", 0)) + namespace - rng = random.Random(seed * 65537 + 0x45534D) - if emitter is None: - frequency = rng.uniform(2e9, 12e9) - prf = rng.uniform(200.0, 1500.0) - modulation = "unknown" - else: - frequency = rng.uniform(*emitter.frequency_band_hz) - prf = (rng.uniform(*emitter.prf_band_hz) - if emitter.prf_band_hz is not None else None) - modulation = rng.choice(emitter.modulation_codes) - uncertainty = config.ESM_BEARING_ERR_DEG / math.sqrt(3.0) - noise = self._smooth_sensor_noise(seed * 1009, self.sim_t, 5.0) - return ESMMeasurement( - observer_x=self.ship.x, - observer_y=self.ship.y, - bearing=(bearing + noise * config.ESM_BEARING_ERR_DEG) % 360.0, - bearing_uncertainty_deg=uncertainty, - frequency_hz=frequency, - prf_hz=prf, - modulation_code=modulation, - quality=config.clamp(.9 - .45 * distance / config.ESM_RANGE_NM, - .35, .9), - observed_at=self.sim_t, - ) def _update_esm_picture(self) -> None: """Publish passive intercepts independently from own-radar evidence.""" diff --git a/src/core/game_save.py b/src/core/game_save.py index cec134c6..1b868c94 100644 --- a/src/core/game_save.py +++ b/src/core/game_save.py @@ -14,7 +14,7 @@ import weakref import pygame from src.audio.receiver import AcousticReceiver -from src.core import config, free_roam +from src.core import config, crashlog, free_roam from src.core.plot import PlotLayer from src.core.autocrew import AutocrewController from src.core.i18n import message @@ -1776,7 +1776,10 @@ class SaveMixin: if not _same_save_value(canonical, data): return False restored = True - except Exception: + except Exception as exc: + # A restore bug must not look like a merely invalid save. + crashlog.record_fault(type(exc), exc, exc.__traceback__, + where="load") return False finally: groups = (("sub", candidate.subs), ("animal", candidate.animals), diff --git a/src/core/game_sim.py b/src/core/game_sim.py index 97d5a094..9c140bb3 100644 --- a/src/core/game_sim.py +++ b/src/core/game_sim.py @@ -946,15 +946,6 @@ class SimMixin: return (config.clamp(forward / scale / half_length, -1.0, 1.0), config.clamp(starboard / scale / half_beam, -1.0, 1.0)) - def _incoming_hit_zone(self, torpedo) -> str: - """Naehert die getroffene Schiffszone aus der Angriffsrichtung an.""" - source_bearing = (torpedo.course + 180.0) % 360.0 - relative = config.angle_diff_deg(source_bearing, self.ship.course) - if abs(relative) <= 45.0: - return "bow" - if abs(relative) >= 135.0: - return "stern" - return "starboard" if relative > 0.0 else "port" def _sub_hears_torpedo(self, sub, torpedo, distance_nm: float) -> bool: """Passive sonar equation for a running torpedo heard by a boat. diff --git a/src/core/mission_definition.py b/src/core/mission_definition.py index c3ea1d78..6492a2ba 100644 --- a/src/core/mission_definition.py +++ b/src/core/mission_definition.py @@ -9,7 +9,7 @@ from dataclasses import dataclass from typing import Any, Iterable, Mapping from src.data.validation import (ValidationIssue, enum, finite_number, integer, - issue, pair, sequence, text, unique, + issue, pair, text, unique, validate_user_key) diff --git a/src/core/opfor.py b/src/core/opfor.py index 249e8d53..ad2f0065 100644 --- a/src/core/opfor.py +++ b/src/core/opfor.py @@ -343,7 +343,6 @@ def tubes_flooded(sub) -> int: return sum(state == "flooded" for state, _left in tube_states(sub)) - class CrewedBoat: """One crewed submarine: the boat, its sonar workstation and its feed.""" @@ -1155,9 +1154,3 @@ def send_ping(game, boat: CrewedBoat): return True -def boat_is_alive(boat) -> bool: - return boat is not None and not boat.sub.sunk - - -def contact_lost(game, contact) -> bool: - return not 0 <= game.sim_t - contact.last_seen < config.SONAR_CONTACT_LOST_S diff --git a/src/core/sight_events.py b/src/core/sight_events.py index eec2ac3d..147f8718 100644 --- a/src/core/sight_events.py +++ b/src/core/sight_events.py @@ -171,7 +171,7 @@ def frigate_rows(game) -> list[dict]: def boat_rows(game, boat) -> list[dict]: """What the crewed boat's periscope can see happen (scope up only).""" - from src.core import config, opfor + from src.core import opfor events = getattr(game, "sight_events", None) if events is None or not opfor.scope_available(boat): return [] diff --git a/src/core/uboot_local.py b/src/core/uboot_local.py index caa13e57..587e0174 100644 --- a/src/core/uboot_local.py +++ b/src/core/uboot_local.py @@ -586,7 +586,7 @@ def _key_action(key, mods, station=None, page=None): if key == pygame.K_g: # G as on the frigate: action stations; Shift+G lies on the bottom. return "uboot_bottom" if mods & pygame.KMOD_SHIFT else "uboot_action_stations" - if key == pygame.K_a: + if key == pygame.K_a and not mods & (pygame.KMOD_SHIFT | pygame.KMOD_CTRL): return "uboot_silent" # A: silent running, the frigate's quiet mode if key == pygame.K_o and mods & pygame.KMOD_SHIFT: return "uboot_absorber" @@ -811,7 +811,7 @@ def _command_key(game, current, key, mods) -> None: elif key == pygame.K_g: on = not current.orders.bottomed _mode_notice(game, "bottom", on, sub.command_bottom(on)) - elif key == pygame.K_a: + elif action == "uboot_silent": # plain A; Shift+A is the ping key on = not current.orders.silent _mode_notice(game, "silent", on, sub.command_silent(on)) elif key == pygame.K_p: diff --git a/src/core/version.py b/src/core/version.py index df3ae16f..fb20c215 100644 --- a/src/core/version.py +++ b/src/core/version.py @@ -4,7 +4,7 @@ This module is deliberately dependency-free because setuptools imports the version while building the project. """ -APP_VERSION = "1.3.174" +APP_VERSION = "1.3.175" SAVE_VERSION = 50 SAVE_SCHEMA = "u-jagd-save-v50" SPLASH_TEXT = ( diff --git a/src/enemies/sub.py b/src/enemies/sub.py index 3532d9c2..8e591018 100644 --- a/src/enemies/sub.py +++ b/src/enemies/sub.py @@ -160,7 +160,6 @@ class Sub: endurance_profile = runtime_catalog.endurances.get(f"endurance.{source.key}") self.endurance = (SubmarineEndurance(endurance_profile) if endurance_profile is not None else None) - systems = runtime_catalog.profile_systems.get(source.key) # Every submarine now senses through its own sensor suite (passive # bearings, own TMA, ESM at periscope depth, hostile datalink). self.legacy_observation_model = False @@ -1088,7 +1087,7 @@ class Sub: cu, cv = current(self.x, self.y) if current is not None else (0.0, 0.0) drift = math.hypot(cu, cv) if drift > 0.05: - self.target_course = math.degrees(math.atan2(-cu, cv)) % 360.0 + self.target_course = math.degrees(math.atan2(-cu, -cv)) % 360.0 diff = config.angle_diff_deg(self.target_course, self.course) self.course = (self.course + config.clamp( diff, -self.motion.turn_rate_deg_s * dt, @@ -1279,14 +1278,6 @@ class Sub: def noise_level(self) -> float: return 1.0 - self.quiet_factor() - def torpedo_notice_range_nm(self) -> float: - """Graduated passive notice of a running torpedo's own machinery - noise: short of the launch-transient alert (SUB_TORPEDO_ALERT_NM) and - beyond pure terminal homing range (TORP_HOME_RANGE_NM), scaled by the - sub's own noise the same way Ship.passive_sonar_range_nm penalises - self-noise - a sub running loud hears less of its surroundings.""" - own_penalty = 1.0 - 0.8 * self.noise_level() - return config.TORP_RUNNING_NOISE_RANGE_NM * own_penalty def acoustic_signature(self) -> str: """M9: Hörbare Geräusch-Signatur für manuelle Klassifizierung. diff --git a/src/network/connectivity.py b/src/network/connectivity.py index 29a05b4d..40299f33 100644 --- a/src/network/connectivity.py +++ b/src/network/connectivity.py @@ -9,8 +9,6 @@ from __future__ import annotations import socket import threading -import time - _PROBE_HOST = "1.1.1.1" _PROBE_PORT = 443 _RECHECK_INTERVAL_S = 15.0 diff --git a/src/ship/damage.py b/src/ship/damage.py index 26392a75..b271c352 100644 --- a/src/ship/damage.py +++ b/src/ship/damage.py @@ -414,19 +414,6 @@ class DamageModel: return self.team_eta[team] = self._travel_s(self.team_position[team], destination) - def assign_team_cycle(self, team: int) -> str | None: - """Team auf das nächste (oder weitere) betroffene Kompartiment.""" - cands = self.repair_candidates() - if not cands: - self._send(team, None) - return None - cur = self.teams.get(team) - if cur in cands: - nxt = cands[(cands.index(cur) + 1) % len(cands)] - else: - nxt = cands[0] - self._send(team, nxt) - return nxt def assign_team(self, team: int, destination: str) -> bool: """Assign explicitly without silently displacing another team.""" diff --git a/src/ship/ship.py b/src/ship/ship.py index 89c56d07..871ec9c9 100644 --- a/src/ship/ship.py +++ b/src/ship/ship.py @@ -5,7 +5,7 @@ import math from src.core import config from src.physics import ship_dynamics as dyn -from src.world.grounding import DEFAULT_HULL_SPEC, HullSpec +from src.world.grounding import DEFAULT_HULL_SPEC KN = dyn.KN @@ -398,8 +398,6 @@ class Ship: # --- Status --- - def pos_nm(self) -> tuple: - return self.x, self.y @property def course_error_deg(self) -> float: diff --git a/src/sonar/equation.py b/src/sonar/equation.py index 0e4be2d9..69c603ea 100644 --- a/src/sonar/equation.py +++ b/src/sonar/equation.py @@ -291,14 +291,6 @@ SOUND_SPEED_M_S = 1500.0 DOPPLER_FREE_KN = 0.5 -def range_resolution_m(pulse: str) -> float: - """Range resolution of a pulse: c T / 2 for CW, c / 2B for LFM.""" - duration, bandwidth = PULSES[pulse] - if pulse == "CW": - return SOUND_SPEED_M_S * duration / 2.0 - return SOUND_SPEED_M_S / (2.0 * bandwidth) - - def echo_merges_with_clutter(target_range_m: float, target_bearing_deg: float, target_radial_kn: float, clutter_range_m: float, clutter_bearing_deg: float, pulse: str, @@ -400,6 +392,7 @@ def active_terms(*, distance_nm: float, target_ts_db: float, legacy_range_factor def range_resolution_m(pulse: str) -> float: + """Range resolution of a pulse: c T / 2 for CW, c / 2B for LFM.""" tau, bandwidth = PULSES[pulse] if bandwidth > 1.0 / tau: return config.SOUND_SPEED_M_S / (2.0 * bandwidth) diff --git a/src/sonar/propagation.py b/src/sonar/propagation.py index ddbb6b21..12f6ef86 100644 --- a/src/sonar/propagation.py +++ b/src/sonar/propagation.py @@ -253,16 +253,6 @@ def representative_frequency_hz(signature) -> float: key=lambda candidate: abs(candidate - midpoint)) -def passive_range_factor(result: PropagationResult, direct_range_nm: float) -> float: - """Convert modeled excess loss into a range multiplier without re-spreading.""" - distance = _number("direct_range_nm", direct_range_nm, 0.0, MAX_RANGE_NM) - if result.best_path is None: - return 0.0 - baseline_loss = 20.0 * math.log10(1.0 + distance) - excess_loss = max(0.0, result.best_path.loss_db - baseline_loss) - return 10.0 ** (-excess_loss / 20.0) - - # --- ray-traced transmission loss (physics upgrade, phase 4) ----------------- RAY_REFERENCE_KEY = (5.0, 60.0, 13.0, 1000.0, "sand", 10.0) diff --git a/src/sonar/sonar.py b/src/sonar/sonar.py index 3f6d8e35..16aa0cef 100644 --- a/src/sonar/sonar.py +++ b/src/sonar/sonar.py @@ -162,9 +162,10 @@ def doppler_factor(tgt, observer) -> float: if distance < 1e-6: return 1.0 ux, uy = dx / distance, dy / distance - speed_t = getattr(tgt, "speed", None) + # A decoy keeps ``speed`` in NM/s and exposes knots as ``speed_kn``. + speed_t = getattr(tgt, "speed_kn", None) if speed_t is None: - speed_t = getattr(tgt, "speed_kn", 0.0) + speed_t = getattr(tgt, "speed", 0.0) course_t = math.radians(getattr(tgt, "course", 0.0)) course_o = math.radians(getattr(observer, "course", 0.0)) speed_o = getattr(observer, "speed", 0.0) or 0.0 @@ -1334,9 +1335,9 @@ class SonarSystem(ArrayHandlingMixin): to_observer = math.degrees(math.atan2(frigate.x - tgt.x, -(frigate.y - tgt.y))) % 360.0 aspect = config.angle_diff_deg(to_observer, getattr(tgt, "course", 0.0)) - speed = getattr(tgt, "speed", None) + speed = getattr(tgt, "speed_kn", None) # knots, also for a decoy if speed is None: - speed = getattr(tgt, "speed_kn", 0.0) + speed = getattr(tgt, "speed", 0.0) radial = speed * math.cos(math.radians(aspect)) mx, my = (frigate.x + tgt.x) * .5, (frigate.y + tgt.y) * .5 return equation.active_terms( diff --git a/src/ui/map_view.py b/src/ui/map_view.py index a32683a3..696677bf 100644 --- a/src/ui/map_view.py +++ b/src/ui/map_view.py @@ -162,7 +162,6 @@ def map_hit_target(game, pos): contact = getattr(game, "selected_contact", None) or getattr(game, "target", None) if contact is not None: bearing = observations.bearing(contact, game.ship) - estimated_range = getattr(contact, "range_est", None) observed_x, observed_y = contact_position(contact, game.ship) if observed_x is not None and observed_y is not None: point = view.world_to_screen(observed_x, observed_y) @@ -521,8 +520,6 @@ def draw_map_view(game, tr=None) -> None: r = config.MAP_RECT view = copy.copy(game.map_view) view.set_rect(r) - w = game.world - coast = w.coast # See-Hintergrund; bleibt auch ausserhalb der Weltgrenzen sichtbar. pygame.draw.rect(s, chart_background(game), r) diff --git a/src/ui/quality.py b/src/ui/quality.py index f621ff2b..9f553fc3 100644 --- a/src/ui/quality.py +++ b/src/ui/quality.py @@ -32,11 +32,6 @@ LEVEL = "normal" LOW_BACKDROP_FPS = 4.0 -def default_level() -> str: - """Windows PCs get the full level, the uConsole and others normal.""" - return "full" if sys.platform == "win32" else "normal" - - def configure(level: str) -> str: """Set the active level (unknown values fall back to normal).""" from src.ui import lines diff --git a/src/ui/sonar_data.py b/src/ui/sonar_data.py index 6781f2a3..f41bf8f3 100644 --- a/src/ui/sonar_data.py +++ b/src/ui/sonar_data.py @@ -292,13 +292,6 @@ def active_echoes(sonar, now, window_s=ACTIVE_HISTORY_WINDOW_S): return result -def _harmonic_candidates(sonar): - """Expose bounded receiver peaks as operator-selectable hypotheses.""" - peaks = getattr(getattr(sonar, "receiver", None), "peaks", []) - return sorted({float(hz) for hz, _ in list(peaks)[:6] - if np.isfinite(hz) and 0 < float(hz) <= config.LOFAR_FMAX_HZ}) - - def _selected_harmonic(game): """The operator's fundamental (placed with the cursor), if any.""" selected = getattr(game, "sonar_harmonic_hz", None) diff --git a/src/ui/sonar_view.py b/src/ui/sonar_view.py index 403a2e23..a10a74ce 100644 --- a/src/ui/sonar_view.py +++ b/src/ui/sonar_view.py @@ -20,7 +20,7 @@ from src.ui.sonar_data import ( # noqa: F401 _circular_broadband, _linear_lofar, _lofar_frequencies, _process_lofar_rows, _waterfall_controls, _display_controls, spectrum_peaks, peak_label, place_peak_labels, _translator, _tow_status, - _vds_status, active_echoes, _harmonic_candidates, _selected_harmonic, + _vds_status, active_echoes, _selected_harmonic, _demon_evidence, _bearing_series, tma_observation_summary, tma_closing_rate_kn, _detail_evidence, _array_state_line, _ping_line, _console_lamps) diff --git a/src/ui/stations/engine.py b/src/ui/stations/engine.py index 1d5927f4..bc99a38b 100644 --- a/src/ui/stations/engine.py +++ b/src/ui/stations/engine.py @@ -6,7 +6,7 @@ import math import pygame from src.core import config -from src.core.i18n import display_message, display_value, localized, localize, raw_text +from src.core.i18n import display_message, display_value, localized, raw_text from src.core.station import Station from src.ship.ship import NOISE_LEVEL_MAX, PLANT_DIESEL_MAX_KN, Ship from src.ui import console, layout diff --git a/src/ui/stations/radio.py b/src/ui/stations/radio.py index e80e6139..ddd7eb68 100644 --- a/src/ui/stations/radio.py +++ b/src/ui/stations/radio.py @@ -18,8 +18,7 @@ from src.ui.stations.common import ( _panel, _shortcut_footer, _station_content_top, - draw_station_page_tabs, - message) + draw_station_page_tabs) # --- Funkraum (M13) -------------------------------------------------------- diff --git a/src/ui/uboot_damage.py b/src/ui/uboot_damage.py index 1a6e9ce2..5e33caf8 100644 --- a/src/ui/uboot_damage.py +++ b/src/ui/uboot_damage.py @@ -12,7 +12,7 @@ import pygame from src.core import config from src.core.i18n import message, raw_text from src.enemies.damage_control import COMPARTMENTS, TASKS, capacity_kg -from src.ui import console, damage_section, layout, pointer +from src.ui import console, damage_section, layout diff --git a/src/ui/uboot_scope.py b/src/ui/uboot_scope.py index d13ca793..bb86fccf 100644 --- a/src/ui/uboot_scope.py +++ b/src/ui/uboot_scope.py @@ -24,11 +24,6 @@ def _fmt(value, pattern="{:.0f}"): return "--" if value is None or not math.isfinite(value) else pattern.format(value) -def draw_silhouette(s, cls: str, cx: int, base_y: int, width: int, color) -> None: - """Kept for callers: the shared outline renderer.""" - draw_outline(s, cls, cx, base_y, width, color) - - def scope_outlines(game, boat) -> list: """Detached ``(bearing, span_deg, cls, stale, lights, elevation_deg, aob_deg, model, way, range_nm)`` rows of the sightings (``lights``: the ``nav_lights`` code diff --git a/src/ui/uboot_view.py b/src/ui/uboot_view.py index 4fc5eaf8..ac08bfbe 100644 --- a/src/ui/uboot_view.py +++ b/src/ui/uboot_view.py @@ -1087,12 +1087,6 @@ def _hours_text(seconds): return f"{minutes // 60}:{minutes % 60:02d}" -def _supply_bar(s, x, y, w, label, text, fraction, low, empty) -> None: - color = (config.COLOR_DANGER if fraction is not None and fraction <= empty else - config.COLOR_WARN if fraction is not None and fraction <= low else config.COLOR_OK) - layout.gauge(s, (x, y, w, 30), fraction, label=label, value=text, color=color, size=15) - - def _draw_supply_page(s, game, boat, x, y, w, h) -> None: """Engine room stores: energy balance, endurance dived by speed, diesel and air.""" sub = boat.sub diff --git a/src/ui/unit_editor.py b/src/ui/unit_editor.py index 202998aa..cdf10170 100644 --- a/src/ui/unit_editor.py +++ b/src/ui/unit_editor.py @@ -5,7 +5,7 @@ from __future__ import annotations import copy from dataclasses import asdict, dataclass, is_dataclass from pathlib import Path -from typing import Any, Iterable, Mapping +from typing import Any, Mapping from urllib.parse import urlsplit import pygame diff --git a/src/ui/viewport.py b/src/ui/viewport.py index 15ecc70b..067cdd30 100644 --- a/src/ui/viewport.py +++ b/src/ui/viewport.py @@ -28,12 +28,6 @@ class Viewport: def rect(self) -> tuple: return self._rect - def fits_world(self) -> None: - """Zurück auf 'ganze Welt sichtbar'.""" - x, y, w, h = self._rect - self.scale = min(w / self.world_size, h / self.world_size) - self.cx = self.world_size / 2.0 - self.cy = self.world_size / 2.0 # --- Transformationen --- diff --git a/src/ui/weather_station.py b/src/ui/weather_station.py index 21795df3..b60d81a3 100644 --- a/src/ui/weather_station.py +++ b/src/ui/weather_station.py @@ -9,8 +9,6 @@ shadow zone, SOFAR axis and a few sound rays. from __future__ import annotations -import math - import pygame from src.core import config diff --git a/src/weapons/air_defense.py b/src/weapons/air_defense.py index cb9f5a4e..3823b9af 100644 --- a/src/weapons/air_defense.py +++ b/src/weapons/air_defense.py @@ -111,7 +111,7 @@ def validate_air_defense_loadout(value): if not isinstance(duration, list) or len(duration) != 2: raise ValueError("air_defense.softkill.effect_duration_s: pair expected") low = _number(duration[0], .000001, 3600, "air_defense.softkill.duration") - high = _number(duration[1], low, 3600, "air_defense.softkill.duration") + _number(duration[1], low, 3600, "air_defense.softkill.duration") if softkill["effect_type"] not in ("chaff", "rf_softkill"): raise ValueError("air_defense.softkill.effect_type: invalid type") raider = _object(value["raider"], { @@ -232,9 +232,9 @@ def valid_air_defense_state(value, *, vls_cells, ciws_ammo, ciws_cooldown_s, return False expected_cd = min(store["loading"], default=0.0) aa_profile = loadout["aa_gun"] - aa_ammo = _number(value["aa_ammo"], 0, aa_profile["ammo"], + _number(value["aa_ammo"], 0, aa_profile["ammo"], "air_defense_state.aa_ammo", integer=True) - aa_cd = _number(value["aa_cooldown_s"], 0, aa_profile["cycle_s"], + _number(value["aa_cooldown_s"], 0, aa_profile["cycle_s"], "air_defense_state.aa_cooldown_s") raiders = value["raiders"] if (not isinstance(raiders, list) or len(raiders) > MAX_RAIDERS diff --git a/src/world/grounding.py b/src/world/grounding.py index 0c7f0789..9d9050e1 100644 --- a/src/world/grounding.py +++ b/src/world/grounding.py @@ -41,6 +41,10 @@ class HullSpec: DEFAULT_HULL_SPEC = HullSpec() +# Largest amount the ship's dynamic draft exceeds the static hull draft: +# hydrostatic draft at full flooding (+0.7 m) and Barrass squat at 32 kn +# (4.9 m), rounded up. +DYNAMIC_DRAFT_ALLOWANCE_M = 6.0 @dataclass(frozen=True) @@ -486,8 +490,12 @@ def grounding_contact_is_consistent(world, pose, hull, contact) -> bool: if contact.kind == "shallow": return (world.coast.has_bathymetry and not world.on_land(contact.x_nm, contact.y_nm) - and world.physical_depth_m(contact.x_nm, contact.y_nm) - <= hull.minimum_depth_m + 1e-6) + # Same measure as the detection: the raw bathymetry, not the + # tide-adjusted depth (a rising tide must not make a saved + # grounding unloadable). The ship detects with its dynamic + # draft (load and squat), which the saved static hull lacks. + and world.coast.physical_depth_m(contact.x_nm, contact.y_nm) + <= hull.minimum_depth_m + DYNAMIC_DRAFT_ALLOWANCE_M + 1e-6) return False diff --git a/tests/test_decoy_speed_units.py b/tests/test_decoy_speed_units.py new file mode 100644 index 00000000..ff138122 --- /dev/null +++ b/tests/test_decoy_speed_units.py @@ -0,0 +1,16 @@ +"""A decoy keeps its speed in NM/s; sonar must read its knots.""" + +import random +from types import SimpleNamespace + +from src.enemies.decoy import Decoy +from src.sonar import sonar + + +def test_decoy_doppler_uses_knots_not_nm_per_second(): + decoy = Decoy(10.0, 10.0, 50.0, random.Random(4)) + decoy.course = 0.0 # running north, at the observer + observer = SimpleNamespace(x=10.0, y=5.0, course=0.0, speed=0.0) + expected = 1.0 + decoy.speed_kn / sonar.SOUND_SPEED_KN + assert decoy.speed_kn > 1.0 + assert abs(sonar.doppler_factor(decoy, observer) - expected) < 1e-9 diff --git a/tests/test_grounding_r18.py b/tests/test_grounding_r18.py index dd199b76..27dde821 100644 --- a/tests/test_grounding_r18.py +++ b/tests/test_grounding_r18.py @@ -416,3 +416,19 @@ def test_physical_api_is_acoustically_separate_and_controls_are_localized(): game.station = Station.ENGINE game._joy_step(-1) assert not game.ship.astern and game.ship.order_idx == 0 + + +def test_shallow_contact_stays_consistent_when_the_tide_rises(monkeypatch): + """A save made on a shoal loads although the tide has risen since.""" + world = _world(depths=[[100.0, 100.0, 100.0], + [100.0, 5.0, 100.0], + [100.0, 100.0, 100.0]]) + hull = HullSpec(length_m=40.0, beam_m=10.0) + sweep = swept_grounding(world, (.2, 1.0, 90.0), (1.0, 1.0, 90.0), hull) + assert sweep.contact.kind == "shallow" + pose = (sweep.safe_x_nm, sweep.safe_y_nm, 90.0) + monkeypatch.setattr(world.ocean, "tide_m", lambda *args: 20.0) + assert world.physical_depth_m(sweep.contact.x_nm, sweep.contact.y_nm) \ + > hull.minimum_depth_m + + assert grounding_contact_is_consistent(world, pose, hull, sweep.contact) diff --git a/tests/test_hostile_platform_physics.py b/tests/test_hostile_platform_physics.py index abac2604..df44cef5 100644 --- a/tests/test_hostile_platform_physics.py +++ b/tests/test_hostile_platform_physics.py @@ -110,8 +110,10 @@ def test_pressure_hull_fatigue_and_crush_depth(): assert sub.state == "SINKING" -def test_lurking_boat_holds_station_against_the_current(): - world = Ocean(current=(1.0, 0.0)) +@pytest.mark.parametrize("current", [(1.0, 0.0), (0.0, 1.0), (-0.7, -0.7)]) +def test_lurking_boat_holds_station_against_the_current(current): + # (east, north) knots: a north set used to be followed, not stemmed. + world = Ocean(current=current) sub = _sub() sub.state = "LAUER" sub.evac_left = 1e6 diff --git a/tests/test_key_scheme.py b/tests/test_key_scheme.py index 23170eac..5e1d8a1d 100644 --- a/tests/test_key_scheme.py +++ b/tests/test_key_scheme.py @@ -147,3 +147,32 @@ def test_help_tables_name_the_unified_keys(): assert boat["help.uboot.silent"] == "A" assert boat["help.uboot.decoy"] == keys(STATION_HELP[Station.WEAPONS][1])[ "help.control.nixie"] == "V" + + +def test_shift_a_and_ctrl_r_at_weapons_never_fire(monkeypatch): + # Shift+A is the ping key and Ctrl+R the aircraft radar key everywhere. + game = _frigate() + game.station = Station.WEAPONS + fired = [] + for name in ("fire_own_asroc", "fire_rbu", "fire_rbu_defence", "drop_depth_charges"): + monkeypatch.setattr(game, name, lambda name=name: fired.append(name)) + _key(game, pygame.K_a, pygame.KMOD_SHIFT) + _key(game, pygame.K_a, pygame.KMOD_CTRL) + _key(game, pygame.K_r, pygame.KMOD_CTRL) + _key(game, pygame.K_z, pygame.KMOD_CTRL) + assert fired == [] + _key(game, pygame.K_a) + _key(game, pygame.K_r) + _key(game, pygame.K_r, pygame.KMOD_SHIFT) + _key(game, pygame.K_z) + assert fired == ["fire_own_asroc", "fire_rbu", "fire_rbu_defence", "drop_depth_charges"] + + +def test_submarine_shift_a_never_toggles_silent_running(): + game, boat = _local_boat() + uboot_local.set_local_station(game, "uboot") + before = boat.orders.silent + _key(game, pygame.K_a, pygame.KMOD_SHIFT) + assert boat.orders.silent == before + _key(game, pygame.K_a) + assert boat.orders.silent != before diff --git a/tests/test_packaging.py b/tests/test_packaging.py index 7c632da1..0c2cfa24 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -86,7 +86,7 @@ def test_source_and_wheel_contain_editor_templates(tmp_path): (ROOT / "data/contact_analysis" / name).read_bytes() assert any(name.endswith(".dist-info/licenses/THIRD_PARTY_NOTICES.md") for name in wheel_names) - assert any(name.endswith("-1.3.174.dist-info/METADATA") for name in wheel_names) + assert any(name.endswith("-1.3.175.dist-info/METADATA") for name in wheel_names) source = next(tmp_path.glob("u_jagd-*.tar.gz")) with tarfile.open(source) as archive: @@ -139,7 +139,7 @@ def test_source_and_wheel_contain_editor_templates(tmp_path): [sys.executable, "-c", "from importlib import resources; " "assert resources.files('data.editor_templates').joinpath('mission.json').is_file(); " - "from src.core.version import APP_VERSION; assert APP_VERSION == '1.3.174'; " + "from src.core.version import APP_VERSION; assert APP_VERSION == '1.3.175'; " "from src.commander.server import CommanderServer; " "server=CommanderServer(); server.start('127.0.0.1',0); server.stop(); " "from src.core import manual; page=manual.html_page('de'); assert 'station-sonar' in page; " diff --git a/tests/test_startup.py b/tests/test_startup.py index 82310697..dec92f24 100644 --- a/tests/test_startup.py +++ b/tests/test_startup.py @@ -14,9 +14,9 @@ from src.world.real_coast import sector_for_seed def test_release_version_and_exact_splash_text(): - assert APP_VERSION == "1.3.174" + assert APP_VERSION == "1.3.175" assert SPLASH_TEXT == ( - "Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.174" + "Anti Sub Marine Warfare on uConsole by Dominik Bornhäußer Version 1.3.175" ) diff --git a/tests/test_web_host.py b/tests/test_web_host.py index a2f27f38..faec406a 100644 --- a/tests/test_web_host.py +++ b/tests/test_web_host.py @@ -167,6 +167,12 @@ def test_host_setup_login_and_station_transfer(tmp_path): item = server.drain_web_admin()[0] assert item[0] == result["id"] assert server.drain_web_admin() == [] + # The admin page's observer switch is an accepted host action. + status, _, observed = request(server, "/api/v2/web/admin", "POST", { + "action": "observer", "client_id": crew["client_id"], "station": "", + "value": True}, cookie=host_cookie, csrf=host_session["csrf"], + request_id="5f0c8f53-2a9e-4c6e-9d43-1b0b8f7e2c11") + assert status == 202 and server.drain_web_admin()[0][0] == observed["id"] assert server.grant_station(crew["client_id"], "sonar") server.finish_web_admin(result["id"], True) assert request(server, "/api/v2/web/admin", "POST", { diff --git a/tools/gen_unit_reference_pdf.py b/tools/gen_unit_reference_pdf.py index 8973f536..813930c8 100644 --- a/tools/gen_unit_reference_pdf.py +++ b/tools/gen_unit_reference_pdf.py @@ -113,17 +113,6 @@ def _vline(pixels, x, y0, y1, color, thickness=1): _fill_col(pixels, x + offset, y0, y1, color) -def _hatch(pixels, x0, x1, y0, y1, color, step=9): - """Sparse dot fill (roughly 1/step of the area) for shaded regions - - walked directly at `step` stride rather than visiting and rejecting every - pixel in the box.""" - width, height = PRINT_SIZE - for y in range(max(0, y0), min(height - 1, y1) + 1): - start = x0 + ((-(x0 + y)) % step) - for x in range(start, x1 + 1, step): - _pixel(pixels, width, height, x, y, color) - - def _label(pixels, value, x, y, *, align="center", color=_LABEL, scale=FONT_SCALE): advance = 4 * scale label_width = len(value) * advance - scale