Skip to content

Fix Japan free jump indicator and clarify map rules - #94

Merged
goldjohn6 merged 1 commit into
boardgamers:masterfrom
mmunson99:japan-freejump-fix
Jun 15, 2026
Merged

goldjohn6 merged 1 commit into
boardgamers:masterfrom
mmunson99:japan-freejump-fix

Conversation

@mmunson99

Copy link
Copy Markdown
Contributor

Summary

  • Fix the Japan free-jump indicator showing a jump as "used" when it wasn't.
    playerHasUsedFreeJump inferred usage from network topology
    (countNetworks >= 2), but countNetworks only traverses a player's own
    cities — so any two non-adjacent owned cities looked like two separate
    networks even when connected via the normal map (e.g. JapanJune11). Replaced
    that heuristic with a log scan that only counts an explicit Build move
    recorded with freeJump: true, alongside the authoritative
    player.usedFreeJump engine flag.
  • Reframed the Japan rules text as "one network with one free jump" rather than
    "two separate networks", which better matches how the mechanic actually works.

Test plan

  • prettier --check clean, engine eslint 0 errors, engine tests pass (36), viewer build succeeds
  • In JapanJune11, the red player (no jump used) shows the indicator as available
  • After a player makes a free jump, the indicator dims to "used"
  • Japan rules text renders correctly in-game

Fix the free-jump indicator showing a jump as "used" when it wasn't:
playerHasUsedFreeJump previously inferred usage from network topology
(countNetworks >= 2), but countNetworks only traverses a player's own
cities, so any two non-adjacent owned cities looked like two separate
networks even when connected via the normal map. Replace that heuristic
with a log scan that only counts an explicit Build move recorded with
freeJump: true, plus the authoritative player.usedFreeJump engine flag.

Also reframe the Japan rules text as "one network with one free jump"
rather than "two separate networks", which better matches the mechanic.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@goldjohn6
goldjohn6 merged commit ef5ffb2 into boardgamers:master Jun 15, 2026
3 checks passed
goldjohn6 added a commit that referenced this pull request Jun 16, 2026
…emen rules dialog (#95)

* Fix Japan free jump: track usage explicitly, not via network topology

Free-jump availability was gated on countNetworks(ownedCities) < 2 as a
proxy for "has the player started a second network". But Power Grid networks
connect *through* unowned cities, so a single intended network routinely
shows as multiple components — wrongly hiding the free jump even though the
player never spent it (Sapporo unreachable while the indicator still showed
the jump as available). Prior fixes (#89, #94) layered more detection
heuristics on top; this removes the proxy and relies solely on the explicit
player.usedFreeJump flag.

- available-moves: offer the jump whenever !usedFreeJump
- undo: return the jump only when the undone build was the one that spent it
  (a round-1 second starting-city build, or a freeJump:true move), fixing a
  latent bug where undoing any normal build could hand the jump back once the
  network had become fully connected
- remove the now-unused countNetworks import
- add regression tests for both availability and post-use suppression

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Bremen: clarify asymmetric district-cost example, drop confusing river note

The flat district-cost connection rules confused players, especially the
direction-dependent (asymmetric) cost. Add a short worked example to the
in-game rules dialog. Also remove the "Weser and Lesum rivers can be crossed
without extra cost" line: the online map shows no rivers, so the note caused
confusion rather than clarity (the zero-cost crossings remain in the map
data and code comments).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
goldjohn6 added a commit to mmunson99/powergrid that referenced this pull request Jun 23, 2026
Brings Mike's chooseRegions region-draft branch up to date with master
(which advanced through the Japan free-jump fixes boardgamers#94/boardgamers#95 and boardgamers#96).

Conflicts resolved:
- engine.ts import: keep computeRegionGraph + regionPickable (Mike's new
  shared helpers); drop countNetworks, which master removed as unused here.
- engine.spec.ts: keep both test blocks — Mike's four chooseRegions draft
  tests and master's Japan free-jump tests were inserted at the same spot.

tsc clean, 45/45 engine specs pass, 0 lint errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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