Skip to content

feat(qra): player QRA scramble cue + AI-wingman option (§1, deferred bits)#337

Merged
bradyccox merged 2 commits into
mainfrom
claude/qra-package-player-manning-rmnwfl
Jun 29, 2026
Merged

feat(qra): player QRA scramble cue + AI-wingman option (§1, deferred bits)#337
bradyccox merged 2 commits into
mainfrom
claude/qra-package-player-manning-rmnwfl

Conversation

@bradyccox

@bradyccox bradyccox commented Jun 29, 2026

Copy link
Copy Markdown
Owner

What

Closes out the two deferred bits of player-manned QRA (§1, built on #336):

  1. "Raid inbound — scramble" cue (Phase 3) — a player manning a QRA alert gets a coalition call when a raid closes on the field, so they know when to launch (they still decide; it never auto-launches).
  2. AI-wingman option — a per-squadron toggle for how the alert flight is crewed.

How

Scramble cue

  • Python bridgespawn_intercept_templates emits a PlayerAlertEntry per blue player-manned base (even a fully manned base with no AI dispatcher entry); published 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> 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_qra marks member.pilot.player per slot. Pure crewing change — the alert flight is still qra_player_manned airframes and the dispatcher still debits that, so no accounting change.
  • UI: a "Fly lead, rest are AI wingmen" checkbox under the player-manned spinbox.

Testing

  • Lua syntax-checked via lupa (LuaJIT, mirrors CI luac -p); blocking Lua gate runs in CI.
  • Unit tests: PLAYER_ALERT serialization, qra_player_client_slots, and setstate defaults. Pure helper logic verified locally; mypy/pytest over game run in CI (pydcs unavailable in the sandbox). Black clean tree-wide.
  • Runtime needs an in-game pass — checklist A4 (scramble cue) and A3 (alert flight, incl. the wingman crewing).

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

claude added 2 commits June 29, 2026 18:13
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
@bradyccox bradyccox changed the title feat(qra): player QRA "raid inbound — scramble" cue (§1, Phase 3) feat(qra): player QRA scramble cue + AI-wingman option (§1, deferred bits) Jun 29, 2026
@bradyccox bradyccox marked this pull request as ready for review June 29, 2026 21:15
@bradyccox bradyccox merged commit 0268927 into main Jun 29, 2026
12 checks passed
@bradyccox bradyccox deleted the claude/qra-package-player-manning-rmnwfl branch June 29, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants