Skip to content

Blockilization: a Great Engineer hurries only what's being built, Civ V style - #42

Merged
Potrock merged 1 commit into
mainfrom
claude/project-thread-cc1fse
Oct 25, 2026
Merged

Potrock merged 1 commit into
mainfrom
claude/project-thread-cc1fse

Conversation

@Potrock

@Potrock Potrock commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Requested by Patrick · project thread

What this is

A fix. After a Great Engineer's hurry, everything a city built took one turn each, for many builds in a row.

Why: the hurry added 300 + 30 × pop straight to city.prod with no cap. When the current item finished, whatever was over its cost carried on to the next item, and only one item finishes a turn. A pop-10 city hurrying a Monument (26 production on quick) got 600, so about 570 was left over, enough for a long run of 1-turn builds.

Fix (rules/game.ts): as in Civ V (CvUnit::getHurryProduction takes the min of the hurry and what's left on the current build), the engineer now puts in no more than the current build still needs. With nothing being built, or the build already paid for (a unit waiting for room), the order fails and the engineer is kept. A costly build like a wonder still gets the full amount.

The Hurry production button's tooltip (client/more.ts) now says it's as much as the build needs and no more.

Test (tests/cases.ts): "a Great Engineer hurries what's being built now and no more". A pop-10 city hurries a Monument with warriors queued after it. The Monument is paid exactly, only one turn's production carries over, and the next warrior takes more than a turn. It also checks that hurrying with nothing being built fails and keeps the engineer, and that a CN Tower gets the full 300 + 30 a citizen. Before the fix it fails with as much as the monument needs: expected 26, got 600.

Screenshot or clip

None. This is a rules change.

Checklist

  • npm run build passes (type-check, the boundary check, the bundle). Passed in CI's "Build and headless tests" job.
  • npm run test:headless passes. Passed in CI. The rules' behaviour tests (tests/effects.ts) also pass locally, 259 of 259.
  • A game imports only from @platform / @platform/client (no new imports)
  • Names are original
  • Assets: none added

Unrelated to this PR: tests/effects-coverage.ts crashes in sweep (Cannot read properties of undefined (reading 'feature')), and it does the same on main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HaXWkqcsX9gsXphN4egMc1

… V style

The hurry added 300 + 30 a citizen straight to the city's production with
no cap, and what was over the current build's cost carried on to the next
item, one finished a turn. A big city's engineer on a cheap build left
hundreds of production over, so everything after it took a turn each for
many builds. Now, as in Civ V, it puts in no more than the current build
still needs (and fails, keeping the engineer, with nothing to hurry).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HaXWkqcsX9gsXphN4egMc1
@Potrock Potrock self-assigned this Oct 25, 2026
@Potrock
Potrock merged commit 0d38ca4 into main Oct 25, 2026
3 checks passed
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