Tailor region guide counts and descriptions to civilization

This commit is contained in:
coyotte508 2026-10-13 02:37:11 +02:00
commit 0b3cb261f2
5 changed files with 16 additions and 5 deletions

View file

@ -311,3 +311,5 @@ Viewer 0.1.95 preserves played civil action-card identities in journal payments
Viewer 0.1.96 / engine 0.4.76 prefixes BGS platform move summaries with the acting civilization, including resource gains and fallback labels such as Ended turn. Other affected civilizations retain their recipient labels; the existing 240-character limit includes the prefix. Validated with five Rust platform-log tests and the WASM protocol integration test.
Viewer 0.1.97 / engine 0.4.77 adds a Regions map guide using the engine's public map setup. Region perimeters are outlined in both map views; the selected civilization's starting region is gold. The guide counts other regions containing that civilization's cities for Ruler of the World. The mobile map toolbar uses an icon-only Strategy toggle to keep the guides visible. Validated with 758 tests, type checks, map partition checks for 2/3/4 players, and desktop/mobile 3D plus Strategy browser checks.
Viewer 0.1.98 keeps the region city count inline and only shows that count and the Ruler of the World combat explanation for the selected Greek civilization. Persia instead shows its count including the starting region and explains King of Persia, including its city-size limit. The region boundary guide remains available to all civilizations. Engine remains 0.4.77.

View file

@ -1,12 +1,12 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.97",
"version": "0.1.98",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@boardgamers/clash-web-client",
"version": "0.1.97",
"version": "0.1.98",
"dependencies": {
"@boardgamers/protocol": "0.9.0",
"lucide-svelte": "^0.577.0",

View file

@ -1,6 +1,6 @@
{
"name": "@boardgamers/clash-web-client",
"version": "0.1.97",
"version": "0.1.98",
"private": true,
"type": "module",
"scripts": {

View file

@ -988,6 +988,8 @@
{#if $session.showRegions}
{@const regionPlayer = $session.regionPlayer ?? $session.seat ?? $session.view?.activePlayer ?? 0}
{@const cities = ($session.playback?.frame?.players ?? $session.game?.players ?? []).find(p=>p.id===regionPlayer)?.cities ?? []}
{@const regionCivilization = $session.view?.players.find(player => player.index === regionPlayer)?.civilization}
{@const allOccupied = ($session.view?.regions ?? []).filter(r=>cities.some(c=>r.tiles.includes(c.position)))}
{@const occupied = ($session.view?.regions ?? []).filter(r=>r.homePlayer !== regionPlayer && cities.some(c=>r.tiles.includes(c.position)))}
<div class="map-tooltip pirate-spawn-key" role="status" use:positionMapGuide>
<strong>Regions</strong>
@ -995,8 +997,13 @@
{#each $session.view?.players ?? [] as player}<option value={player.index}>{player.civilization}</option>{/each}
</select></label>
<p>Borders separate regions. Gold marks this civilization’s starting region.</p>
<p>Regions with your cities, excluding your starting region: <strong>{occupied.length}</strong></p>
<p>Ruler of the World: +{occupied.length} combat value in a land battle with the leader.</p>
{#if regionCivilization === 'Greece'}
<p class="region-city-count">City regions outside starting region: <strong>{occupied.length}</strong></p>
<p>Ruler of the World: +{occupied.length} combat value in a land battle with the leader.</p>
{:else if regionCivilization === 'Persia'}
<p class="region-city-count">Regions containing cities: <strong>{allOccupied.length}</strong></p>
<p>King of Persia: As an action, activate Cyrus’ city. Gain 1 mood or culture token per region containing your cities, up to the size of Cyrus’ city. Includes the starting region.</p>
{/if}
</div>
{/if}
</div>

View file

@ -6223,3 +6223,5 @@ small {
.game-shell .map-controls .map-view-toggle { width: 38px; padding: 8px; }
.game-shell .map-controls { max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: flex-end; }
}
.map-tooltip .region-city-count strong { display: inline; white-space: nowrap; }