feat(qra): player QRA scramble cue + AI-wingman option (§1, deferred bits)#337
Merged
Merged
Conversation
Adds the scramble message a player-manned QRA flight gets when a raid closes on its field, so the human knows when to launch (they still decide — it never auto-launches). - Python bridge: spawn_intercept_templates emits a PlayerAlertEntry per blue manned base (even when the base is fully player-manned and so has no AI dispatcher entry); populate_intercept_lua publishes them under dcsRetribution.Intercept.PLAYER_ALERT; carried on mission_data. - Lua (intercept-config.lua): a periodic per-base scan calls the player to scramble (outTextForCoalition, "QRA SCRAMBLE — base: bandits BRG/range, angels N") when a hostile aircraft closes inside the cue radius = the AI GCI radius + PLAYER_SCRAMBLE_LEAD_NM (30 NM), so a cold start has time. Debounced per base; player-facing only. Lua syntax-checked via lupa (LuaJIT, mirrors the CI luac gate). Tests for the PLAYER_ALERT serialization added. Runtime needs an in-game pass (A4). Docs: features §1, design note (Phase 3 landed), README, CLAUDE.md/ AGENTS.md, checklist A4 (added to Session 2). Still deferred: an AI-wingman option for a manned 2-ship. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zZxHmTaatxo9WhBGLy88P
Adds a per-squadron toggle for how the player QRA alert flight is crewed, without changing its size or the AI-dispatcher debit: - Squadron.qra_player_ai_wingman (default False, __setstate__ migrates old saves). Off = every alert airframe is a client slot (multi-human co-op alert, the prior behaviour); on = the player flies lead and the rest are AI wingmen (single-player section). - intercept_reserve.qra_player_client_slots() centralises the rule (whole flight vs. lead-only); Coalition._plan_player_qra marks member.pilot.player per slot from it. A single-ship alert is lead-only either way. - SquadronDialog: a "Fly lead, rest are AI wingmen" checkbox under the player-manned spinbox. Pure crewing change — the alert flight is still `qra_player_manned` airframes and the dispatcher still debits that, so no accounting change. Tests for the helper + setstate default. Black clean; mypy/pytest in CI. Docs: features §1, design note (nothing deferred now beyond the in-game pass), README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zZxHmTaatxo9WhBGLy88P
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes out the two deferred bits of player-manned QRA (§1, built on #336):
How
Scramble cue
spawn_intercept_templatesemits aPlayerAlertEntryper blue player-manned base (even a fully manned base with no AI dispatcher entry); published underdcsRetribution.Intercept.PLAYER_ALERT; carried onmission_data.intercept-config.lua) — a periodic per-base scan calls the player to scramble (outTextForCoalition, "QRA SCRAMBLE —<base>: bandits<brg>for<rng>nm, angels<N>") when a hostile closes inside the cue radius = AI GCI radius +PLAYER_SCRAMBLE_LEAD_NM(30 NM) — fires before the AI scramble so a cold start has time. Debounced per base.AI-wingman
Squadron.qra_player_ai_wingman(default False, migrated). Off = every alert airframe is a client slot (multi-human co-op alert — prior behaviour); on = the player flies lead and the rest are AI wingmen (single-player section).intercept_reserve.qra_player_client_slots()centralises the rule;Coalition._plan_player_qramarksmember.pilot.playerper slot. Pure crewing change — the alert flight is stillqra_player_mannedairframes and the dispatcher still debits that, so no accounting change.Testing
lupa(LuaJIT, mirrors CIluac -p); blocking Lua gate runs in CI.PLAYER_ALERTserialization,qra_player_client_slots, and setstate defaults. Pure helper logic verified locally; mypy/pytest overgamerun in CI (pydcs unavailable in the sandbox). Black clean tree-wide.Docs
Features §1, design note (nothing deferred now beyond the in-game pass), README, CLAUDE.md/AGENTS.md §1, checklist A4 (Session 2).
🤖 Generated with Claude Code
https://claude.ai/code/session_012zZxHmTaatxo9WhBGLy88P