Skip to content

Battleplan power & mcp - #127

Merged
pWn3d1337 merged 13 commits into
mainfrom
battleplan_power
Oct 18, 2026
Merged

pWn3d1337 merged 13 commits into
mainfrom
battleplan_power

Conversation

@pWn3d1337

Copy link
Copy Markdown
Collaborator

No description provided.

pWn3d1337 and others added 13 commits October 18, 2026 14:28
…ying when plans overlap

- localApplyBattlePlanBonusesToObject treated a plan value of 0 as "remove" and
  cleared that plan's weapon bonus flag. With the retail-compatible delta path,
  activating one plan cleared the weapon bonuses of every other active plan
  (e.g. two Strategy Centers on different plans). Only a negative delta clears now.
- BattlePlanBonusBehavior added effects that were already applied and removed
  effects that were never applied (Player::removeBattlePlanBonusesForObject uses
  -ALL_PLANS when an upgrade such as a science activates the module). This
  stacked or inverted armor, sight and speed scalars. Add/remove now check the
  applied state instead of asserting.
- Adds debug log lines for battle plan count changes and per-object add/remove.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-plans power

AllBattlePlansUpdate grants its owner the army bonuses of Bombardment, Hold the
Line and Search & Destroy while its object exists. It is an additional battle
plan source next to the Strategy Centers (reference counted through
Player::changeBattlePlan), so the plan a Strategy Center runs, plan switches and
the building-only plan effects are untouched. Bonus values and member KindOfs
are read from the BattlePlanUpdate of StrategyCenterTemplate so they match the
permanent plans exactly.

Intended use: an OCLSpecialPower spawns an invisible marker with this module and
a DeletionUpdate for the duration. Adds the SPECIAL_ALL_BATTLE_PLANS special
power enum (falls back to the no-target CIA Intelligence behavior).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game gets its own MCP bridge next; both bridges share the JSON value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lets other command line launchers start a skirmish with a human local player.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to helpers

Prepares writing a screenshot to a chosen file without the screenshot thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generalszh.exe started with -mcp listens on 127.0.0.1:47801 for JSON line
commands that pause and step the game, inspect objects and players, give
orders as any player, spawn and change objects, set player values, run
scripts, read flags and counters, move the camera and take screenshots.
-mcpGame and -mcpPlayers start a skirmish with a human local player, alone
in a sandbox or against AI players; -headless runs the logic only.

The bridge is compiled only with RTS_BUILD_OPTION_GAME_MCP (default ON).
Without -mcp nothing is created and every hook is a null check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
game_server.py exposes the in-game bridge as MCP tools (launch, time,
objects, players, orders, test changes, scripts, view) and is registered
in .mcp.json as "game". The bridge client is shared with WorldBuilder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… NONE for unused status entries

Unused StatusToSet/StatusToClear entries default to OBJECT_STATUS_NONE (0), but
add/remove checked them against -1. Every plan without a status entry therefore
set and cleared status bit 0, leaving it set after a plan was removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ame with active battle plans

Object::xfer restores the team after the saved vision range, and
Player::becomingTeamMember then applied the battle plan bonuses again. With
Search & Destroy active, every load multiplied vision and shroud clearing range
by the plan scalar once more, and the extra range stayed after the plan ended.
Loaded objects already carry their bonuses, so nothing is applied while loading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s.get

objects.get gets a bonuses section: weapon bonus conditions, weapon and armor
set flags, armor damage scalar, vision and shroud clearing range and the AI
speed multiplier. players.get reports the active battle plan sources per plan
and the accumulated armor and sight scalars. This makes battle plans, upgrades
and powers that change these values testable through the game MCP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Saves and loads save files in the save directory the way the in-game save/load
menu does, so behavior across a save/load can be tested. Loading pauses the
game afterwards. Both need a windowed game: a save also holds client state
(terrain visuals, particles) that a headless game does not have. A broken save
file returns an error instead of crashing the game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… power countdowns

OwnerOnlyTimer: a PublicTimer countdown is drawn only for the player that owns
it, and it is registered for any object carrying the power, not only
structures. FlashingTimer: the countdown is drawn bold and flashing like a
ready superweapon the whole time. Together they let a marker object show its
owner how long a temporary effect still lasts.

Adds SPECIAL_ALL_BATTLE_PLANS_ACTIVE for the countdown of the all-battle-plans
power.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

⚠️ Title/Commit Validation Failed

Invalid PR title:

type: Description
type(scope): Description

Allowed types: bugfix, build, chore, ci, docs, fix, feat, perf, refactor, revert, style, test, tweak, unify

See CONTRIBUTING.md for details.

@pWn3d1337
pWn3d1337 merged commit 46b601d into main Oct 18, 2026
1 check failed
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.

1 participant