diff --git a/engine/src/achievements.spec.ts b/engine/src/achievements.spec.ts index 9bcc523..3059ed1 100644 --- a/engine/src/achievements.spec.ts +++ b/engine/src/achievements.spec.ts @@ -164,6 +164,14 @@ describe('achievements', function () { } } + it('gives a community custom map (HawaiiCustom) the win predicates but no map badge', () => { + const state = finalState(6, 'HawaiiCustom'); + expect(state.map.name).to.equal('HawaiiCustom'); + state.players[1].citiesPowered = 1; + expect(earned(state, 1)).to.deep.equal(['grid-champion', 'full-table']); + expect(earned(state, 0)).to.deep.equal([]); + }); + for (const unsupported of ['Atlantis', 'Random', 'toString', '__proto__']) { it(`does not award a map badge for unsupported resolved map ${unsupported}`, () => { const state = finalState(); diff --git a/engine/src/achievements.ts b/engine/src/achievements.ts index 11eb0f8..10cac0f 100644 --- a/engine/src/achievements.ts +++ b/engine/src/achievements.ts @@ -4,7 +4,13 @@ import { GameState, MapName, Player, PowerPlantType } from './gamestate'; // Explicit stable IDs, not generated slugs. Match the resolved map name, never // the requested option (which may be Random). Original/Recharged share a badge. -const mapAchievements: Record = { +// Community custom maps (selectable by name, never drawn by 'Random') get no +// Champion badge: a badge needs its own artwork and a manifest publication. A +// custom map that graduates gets one then. A new custom map must be added here, +// so the choice is made on purpose. The lookup below already handles a map +// with no badge. +type CustomMapName = 'HawaiiCustom'; +const mapAchievements: Record, string> = { Germany: 'germany-champion', USA: 'usa-champion', France: 'france-champion', diff --git a/engine/src/available-moves.ts b/engine/src/available-moves.ts index c40c863..086b046 100644 --- a/engine/src/available-moves.ts +++ b/engine/src/available-moves.ts @@ -724,9 +724,11 @@ export function computeRegionGraph(map: Pick) const regions = map.cities .filter((c, i) => c.region && map.cities.findIndex((cc) => cc.region == c.region) == i) .map((c) => c.region); - const connections = map.connections.map((con) => - con.nodes.map((n) => map.cities.find((city) => city.name == n)!.region) - ); + // A link flagged ignoreForRegions (HawaiiCustom's ferry) never makes two regions + // neighbours, so it can't be the only bridge holding a dealt region set together. + const connections = map.connections + .filter((con) => !con.ignoreForRegions) + .map((con) => con.nodes.map((n) => map.cities.find((city) => city.name == n)!.region)); const regionConnections = regions.map((region) => regions.filter( (area2) => region != area2 && connections.some((con) => con.includes(region) && con.includes(area2)) diff --git a/engine/src/engine.ts b/engine/src/engine.ts index 996c730..b092686 100644 --- a/engine/src/engine.ts +++ b/engine/src/engine.ts @@ -39,7 +39,7 @@ import { SingleDeck, } from './gamestate'; import { LogItem } from './log'; -import { City, GameMap, maps, mapsRecharged } from './maps'; +import { City, customMaps, GameMap, maps, mapsRecharged } from './maps'; import { Move, MoveName, Moves } from './move'; import { availableDecks, @@ -201,7 +201,7 @@ export function setup( const pool = variantMaps.filter((m) => m.name != 'Chile'); map = pool[Math.floor(mapRng() * pool.length)].name as MapName; } - const chosenMapRaw = variantMaps.find((m) => m.name == map); + const chosenMapRaw = variantMaps.find((m) => m.name == map) ?? customMaps.find((m) => m.name == map); if (!chosenMapRaw) { throw new Error(`Map "${map}" not found for variant "${variant}"`); } @@ -597,7 +597,7 @@ export function setup( `[${coalResupplyNorth[p][2]}, ${oilResupplyNorth[p][2]}, ${garbageResupplyNorth[p][2]}]`, ] : undefined, - paymentTable: cityIncome, + paymentTable: (forceMap || finalMap).paymentTable ?? cityIncome, variant, minimunBid: 0, plantDiscountActive: diff --git a/engine/src/gamestate.ts b/engine/src/gamestate.ts index a3b3b62..bff9218 100644 --- a/engine/src/gamestate.ts +++ b/engine/src/gamestate.ts @@ -34,7 +34,8 @@ export type MapName = | 'Australia' | 'Bremen' | 'Manhattan' - | 'Chile'; + | 'Chile' + | 'HawaiiCustom'; export type Variant = 'original' | 'recharged'; // 'standard' is the base game's deck; deck1 and deck2 are The New Power Plants // (Set 1) and Set 2. 'shuffled' plays every plant of all three decks together; diff --git a/engine/src/hawaii-custom.spec.ts b/engine/src/hawaii-custom.spec.ts new file mode 100644 index 0000000..880b421 --- /dev/null +++ b/engine/src/hawaii-custom.spec.ts @@ -0,0 +1,83 @@ +import { expect } from 'chai'; +import { setup } from './engine'; +import { ResourceType } from './gamestate'; +import { map as hawaii, Regions } from './maps/hawaii'; +import prices from './prices'; + +// The islands in chain order. Region sets must always be a run of neighbours along +// this chain: the Kauai-Big Island ferry never counts as a border (ignoreForRegions). +const CHAIN = [Regions.Green, Regions.Yellow, Regions.Red, Regions.Purple, Regions.Blue, Regions.Brown] as string[]; +const STANDARD_PAY = [ + 10, 22, 33, 44, 54, 64, 73, 82, 90, 98, 105, 112, 118, 124, 129, 134, 138, 142, 145, 148, 150, 150, +]; + +describe('HawaiiCustom', () => { + it('is never dealt by Random', () => { + for (let s = 0; s < 300; s++) { + for (const variant of ['original', 'recharged'] as const) { + expect(setup(3, { map: 'Random', variant }, 'r' + s).map.name).to.not.equal('HawaiiCustom'); + } + } + }); + + for (let players = 2; players <= 6; players++) { + it(`deals ${players} players a run of neighbouring islands, never one held only by the ferry`, () => { + const seen = new Set(); + for (let s = 0; s < 400; s++) { + const G = setup(players, { map: 'HawaiiCustom', variant: 'original' }, 'h' + s); + const idx = [...new Set(G.map.cities.map((c) => c.region))] + .map((r) => CHAIN.indexOf(r)) + .sort((a, b) => a - b); + expect(idx[idx.length - 1] - idx[0], `seed h${s}: ${idx}`).to.equal(idx.length - 1); + seen.add(idx.join(',')); + + const names = new Set(G.map.cities.map((c) => c.name)); + const ferry = G.map.connections.some((c) => c.nodes.includes('Poipu') && c.nodes.includes('Kona')); + expect(ferry).to.equal(names.has('Poipu') && names.has('Kona')); + } + // Every contiguous run of the right length should turn up. + const want = players <= 3 ? 3 : players === 4 ? 4 : 5; + expect(seen.size).to.equal(CHAIN.length - want + 1); + }); + } + + it('pays one Elektro more than the standard table at every step', () => { + const G = setup(4, { map: 'HawaiiCustom', variant: 'original' }, 'pay'); + expect(G.paymentTable).to.deep.equal(STANDARD_PAY.map((v) => v + 1)); + // Every other map keeps the standard table. + expect(setup(4, { map: 'Germany', variant: 'original' }, 'pay').paymentTable).to.deep.equal(STANDARD_PAY); + }); + + it('prices houses by island', () => { + const price = (region: string) => hawaii.cities.find((c) => c.region === region)!.slotCosts; + expect(price(Regions.Purple)).to.deep.equal([12, 18, 24]); + expect(price(Regions.Red)).to.deep.equal([11, 17, 22]); + expect(price(Regions.Yellow)).to.deep.equal([11, 17, 22]); + expect(price(Regions.Green)).to.deep.equal([10, 15, 20]); + for (const r of [Regions.Blue, Regions.Brown]) expect(price(r)).to.deep.equal([8, 13, 18]); + // every city in a region shares its region's price + for (const c of hawaii.cities) expect(c.slotCosts, c.name).to.deep.equal(price(c.region)); + }); + + it('starts coal at 2 and oil at 4, garbage and uranium as standard, in both variants', () => { + const cheapest = (r: ResourceType, inMarket: number) => prices[r][prices[r].length - inMarket]; + for (const variant of ['original', 'recharged'] as const) { + const G = setup(4, { map: 'HawaiiCustom', variant }, 'fuel'); + expect(cheapest(ResourceType.Coal, G.coalMarket), variant).to.equal(2); + expect(cheapest(ResourceType.Oil, G.oilMarket), variant).to.equal(4); + const std = setup(4, { map: 'Germany', variant }, 'fuel'); + expect(G.garbageMarket, variant).to.equal(std.garbageMarket); + expect(G.uraniumMarket, variant).to.equal(std.uraniumMarket); + // the six tokens left out stay in the supply + expect(G.coalMarket + G.coalSupply, variant).to.equal(std.coalMarket + std.coalSupply); + expect(G.oilMarket + G.oilSupply, variant).to.equal(std.oilMarket + std.oilSupply); + } + }); + + it('gives every city at least two links on the full board', () => { + for (const city of hawaii.cities) { + const links = hawaii.connections.filter((c) => c.nodes.includes(city.name)).length; + expect(links, city.name).to.be.at.least(2); + } + }); +}); diff --git a/engine/src/maps.ts b/engine/src/maps.ts index 293fb99..413f1d7 100644 --- a/engine/src/maps.ts +++ b/engine/src/maps.ts @@ -12,6 +12,7 @@ import { map as china } from './maps/china'; import { map as europe } from './maps/europe'; import { map as france } from './maps/france'; import { map as germany, mapRecharged as germanyRecharged } from './maps/germany'; +import { map as hawaii } from './maps/hawaii'; import { map as indian } from './maps/indian'; import { map as italy } from './maps/italy'; import { map as japan, mapRecharged as japanRecharged } from './maps/japan'; @@ -68,6 +69,14 @@ export interface City { export interface Connection { nodes: string[]; cost: number; + // Purely visual: when set, the viewer draws this link as a curve bending toward + // this control point (map coords) instead of a straight line. Pricing is unchanged. + via?: [number, number]; + // Purely visual: a sea crossing, drawn as a dashed blue line. Pricing is unchanged. + sea?: boolean; + // Does not count when deciding which regions are neighbours (region selection). + // The link itself still exists whenever both of its cities are in play. + ignoreForRegions?: boolean; } export interface Polygon { @@ -177,8 +186,16 @@ export interface GameMap { // to [1,1] and `mapRotation` to 0 while picking so the logged coords are // in the same space you'll save them in. devBackdrop?: { src: string; width: number; height: number; opacity?: number }; + // Map-specific payout table (cities powered -> Elektro). Defaults to the standard table. + paymentTable?: number[]; + // A house-price key drawn on the board (map coords), one row per named region. + // For maps whose slotCosts differ by region. + houseLegend?: { position: [number, number]; names: Record }; } +// Community custom maps: selectable by name, never drawn by 'Random'. +export const customMaps: GameMap[] = [hawaii]; + export const maps: GameMap[] = [ america, germany, diff --git a/engine/src/maps/hawaii.ts b/engine/src/maps/hawaii.ts new file mode 100644 index 0000000..8544f17 --- /dev/null +++ b/engine/src/maps/hawaii.ts @@ -0,0 +1,217 @@ +import { GameMap } from './../maps'; + +// HawaiiCustom: a community custom map (draft). Six regions across the island chain, +// warped as a fan (Kauai at the tip, the Big Island across the wide end). +// Twist = Hawaii's real economics: house prices by island, a higher payout, and +// sea crossings priced by real channel width. Generated from the layout draft. + +export enum Regions { + Green = 'green', // Kauai + Red = 'red', // Oahu: Honolulu + Windward + Yellow = 'yellow', // Oahu: North Shore + West + Purple = 'purple', // Maui Nui + Blue = 'blue', // Big Island West + Brown = 'brown', // Big Island East +} + +export enum Cities { + Hanalei = 'Hanalei', + NaPali = 'Na Pali', + KalalauLookout = 'Kalalau Lookout', + Kapaa = 'Kapaa', + WaimeaCanyon = 'Waimea Canyon', + Lihue = 'Lihue', + Poipu = 'Poipu', + Waianae = 'Waianae', + Haleiwa = 'Haleiwa', + WaimeaBay = 'Waimea Bay', + SunsetBeach = 'Sunset Beach', + Kahuku = 'Kahuku', + Wahiawa = 'Wahiawa', + KoOlina = 'Ko Olina', + Kualoa = 'Kualoa', + Kaneohe = 'Kaneohe', + PearlHarbor = 'Pearl Harbor', + Kailua = 'Kailua', + Honolulu = 'Honolulu', + Waikiki = 'Waikiki', + HanaumaBay = 'Hanauma Bay', + Kalaupapa = 'Kalaupapa', + Lanai = 'Lanai', + Kaanapali = 'Kaanapali', + IaoValley = 'Iao Valley', + Paia = 'Paia', + Kihei = 'Kihei', + Wailea = 'Wailea', + Haleakala = 'Haleakala', + Hana = 'Hana', + Hawi = 'Hawi', + Kamuela = 'Kamuela', + Hapuna = 'Hapuna', + Waikoloa = 'Waikoloa', + Kona = 'Kona', + CaptainCook = 'Captain Cook', + PuuhonuaoHonaunau = 'Puuhonua o Honaunau', + Waipio = 'Waipio', + AkakaFalls = 'Akaka Falls', + MaunaKea = 'Mauna Kea', + Hilo = 'Hilo', + Volcano = 'Volcano', + Pahoa = 'Pahoa', + Punaluu = 'Punaluu', +} + +// House prices by island (standard is 10/15/20). Maui and Oahu are dear, the Big +// Island cheap. Kauai is standard: it already has the cheapest links on the board, +// so cheap houses on top made it too strong (BootlegTampico, Discord, 2026-11-17). +const MAUI = [12, 18, 24]; +const OAHU = [11, 17, 22]; +const KAUAI = [10, 15, 20]; +const CHEAP = [8, 13, 18]; + +// Payout one Elektro higher at every step than the standard table: Hawaii's +// electricity is the most expensive in the US. +const paymentTable = [ + 10, 22, 33, 44, 54, 64, 73, 82, 90, 98, 105, 112, 118, 124, 129, 134, 138, 142, 145, 148, 150, 150, +].map((v) => v + 1); + +export const map: GameMap = { + name: 'HawaiiCustom', + cities: [ + { name: Cities.Hanalei, region: Regions.Green, slotCosts: KAUAI, x: 189, y: 115 }, + { name: Cities.NaPali, region: Regions.Green, slotCosts: KAUAI, x: 110, y: 161 }, + { name: Cities.KalalauLookout, region: Regions.Green, slotCosts: KAUAI, x: 112, y: 243 }, + { name: Cities.Kapaa, region: Regions.Green, slotCosts: KAUAI, x: 285, y: 137 }, + { name: Cities.WaimeaCanyon, region: Regions.Green, slotCosts: KAUAI, x: 174, y: 295 }, + { name: Cities.Lihue, region: Regions.Green, slotCosts: KAUAI, x: 297, y: 217 }, + { name: Cities.Poipu, region: Regions.Green, slotCosts: KAUAI, x: 255, y: 302 }, + { name: Cities.Waianae, region: Regions.Yellow, slotCosts: OAHU, x: 356, y: 392 }, + { name: Cities.Haleiwa, region: Regions.Yellow, slotCosts: OAHU, x: 379, y: 314 }, + { name: Cities.WaimeaBay, region: Regions.Yellow, slotCosts: OAHU, x: 416, y: 242 }, + { name: Cities.SunsetBeach, region: Regions.Yellow, slotCosts: OAHU, x: 453, y: 169 }, + { name: Cities.Kahuku, region: Regions.Yellow, slotCosts: OAHU, x: 531, y: 148 }, + { name: Cities.Wahiawa, region: Regions.Yellow, slotCosts: OAHU, x: 454, y: 348 }, + { name: Cities.KoOlina, region: Regions.Yellow, slotCosts: OAHU, x: 425, y: 439 }, + { name: Cities.Kualoa, region: Regions.Red, slotCosts: OAHU, x: 581, y: 212 }, + { name: Cities.Kaneohe, region: Regions.Red, slotCosts: OAHU, x: 627, y: 279 }, + { name: Cities.PearlHarbor, region: Regions.Red, slotCosts: OAHU, x: 513, y: 411 }, + { name: Cities.Kailua, region: Regions.Red, slotCosts: OAHU, x: 708, y: 281 }, + { name: Cities.Honolulu, region: Regions.Red, slotCosts: OAHU, x: 593, y: 400 }, + { name: Cities.Waikiki, region: Regions.Red, slotCosts: OAHU, x: 675, y: 400 }, + { name: Cities.HanaumaBay, region: Regions.Red, slotCosts: OAHU, x: 749, y: 351 }, + { name: Cities.Kalaupapa, region: Regions.Purple, slotCosts: MAUI, x: 711, y: 497 }, + { name: Cities.Lanai, region: Regions.Purple, slotCosts: MAUI, x: 700, y: 620 }, + { name: Cities.Kaanapali, region: Regions.Purple, slotCosts: MAUI, x: 791, y: 516 }, + { name: Cities.IaoValley, region: Regions.Purple, slotCosts: MAUI, x: 855, y: 567 }, + { name: Cities.Paia, region: Regions.Purple, slotCosts: MAUI, x: 934, y: 551 }, + { name: Cities.Kihei, region: Regions.Purple, slotCosts: MAUI, x: 835, y: 646 }, + { name: Cities.Wailea, region: Regions.Purple, slotCosts: MAUI, x: 865, y: 722 }, + { name: Cities.Haleakala, region: Regions.Purple, slotCosts: MAUI, x: 946, y: 636 }, + { name: Cities.Hana, region: Regions.Purple, slotCosts: MAUI, x: 1031, y: 609 }, + { name: Cities.Hawi, region: Regions.Blue, slotCosts: CHEAP, x: 912, y: 788 }, + { name: Cities.Kamuela, region: Regions.Blue, slotCosts: CHEAP, x: 932, y: 867 }, + { name: Cities.Hapuna, region: Regions.Blue, slotCosts: CHEAP, x: 821, y: 879 }, + { name: Cities.Waikoloa, region: Regions.Blue, slotCosts: CHEAP, x: 779, y: 961 }, + { name: Cities.Kona, region: Regions.Blue, slotCosts: CHEAP, x: 744, y: 1042 }, + { name: Cities.CaptainCook, region: Regions.Blue, slotCosts: CHEAP, x: 689, y: 1102 }, + { name: Cities.PuuhonuaoHonaunau, region: Regions.Blue, slotCosts: CHEAP, x: 787, y: 1125 }, + { name: Cities.Waipio, region: Regions.Brown, slotCosts: CHEAP, x: 1015, y: 792 }, + { name: Cities.AkakaFalls, region: Regions.Brown, slotCosts: CHEAP, x: 1126, y: 830 }, + { name: Cities.MaunaKea, region: Regions.Brown, slotCosts: CHEAP, x: 1011, y: 921 }, + { name: Cities.Hilo, region: Regions.Brown, slotCosts: CHEAP, x: 1236, y: 865 }, + { name: Cities.Volcano, region: Regions.Brown, slotCosts: CHEAP, x: 1110, y: 1007 }, + { name: Cities.Pahoa, region: Regions.Brown, slotCosts: CHEAP, x: 1280, y: 944 }, + { name: Cities.Punaluu, region: Regions.Brown, slotCosts: CHEAP, x: 980, y: 1105 }, + ], + connections: [ + { nodes: [Cities.Hanalei, Cities.NaPali], cost: 4 }, + { nodes: [Cities.Hanalei, Cities.Kapaa], cost: 5 }, + { nodes: [Cities.NaPali, Cities.KalalauLookout], cost: 3 }, + { nodes: [Cities.KalalauLookout, Cities.WaimeaCanyon], cost: 3 }, + { nodes: [Cities.WaimeaCanyon, Cities.Poipu], cost: 4 }, + { nodes: [Cities.Poipu, Cities.Lihue], cost: 4 }, + { nodes: [Cities.Lihue, Cities.Kapaa], cost: 3 }, + { nodes: [Cities.KalalauLookout, Cities.Kapaa], cost: 9 }, + { nodes: [Cities.WaimeaCanyon, Cities.Lihue], cost: 7 }, + { nodes: [Cities.Lihue, Cities.Waianae], cost: 12, sea: true }, + { nodes: [Cities.Kapaa, Cities.Haleiwa], cost: 12, sea: true }, + { nodes: [Cities.Waianae, Cities.Haleiwa], cost: 6 }, + { nodes: [Cities.Haleiwa, Cities.WaimeaBay], cost: 4 }, + { nodes: [Cities.WaimeaBay, Cities.SunsetBeach], cost: 5 }, + { nodes: [Cities.SunsetBeach, Cities.Kahuku], cost: 5 }, + { nodes: [Cities.Kahuku, Cities.Kualoa], cost: 5 }, + { nodes: [Cities.Kualoa, Cities.Kaneohe], cost: 5 }, + { nodes: [Cities.Kaneohe, Cities.Kailua], cost: 5 }, + { nodes: [Cities.Kailua, Cities.HanaumaBay], cost: 5 }, + { nodes: [Cities.HanaumaBay, Cities.Waikiki], cost: 6 }, + { nodes: [Cities.Waikiki, Cities.Honolulu], cost: 5 }, + { nodes: [Cities.Honolulu, Cities.PearlHarbor], cost: 6 }, + { nodes: [Cities.PearlHarbor, Cities.KoOlina], cost: 6 }, + { nodes: [Cities.KoOlina, Cities.Waianae], cost: 6 }, + { nodes: [Cities.Wahiawa, Cities.Haleiwa], cost: 5 }, + { nodes: [Cities.Wahiawa, Cities.WaimeaBay], cost: 8 }, + { nodes: [Cities.Wahiawa, Cities.PearlHarbor], cost: 6 }, + { nodes: [Cities.Honolulu, Cities.Kaneohe], cost: 10 }, + { nodes: [Cities.HanaumaBay, Cities.Kalaupapa], cost: 8, sea: true }, + { nodes: [Cities.Honolulu, Cities.Lanai], cost: 10, sea: true }, + { nodes: [Cities.Kalaupapa, Cities.Lanai], cost: 4, sea: true }, + { nodes: [Cities.Kalaupapa, Cities.Kaanapali], cost: 4, sea: true }, + { nodes: [Cities.Lanai, Cities.Kaanapali], cost: 4, sea: true }, + { nodes: [Cities.Kaanapali, Cities.IaoValley], cost: 5 }, + { nodes: [Cities.IaoValley, Cities.Paia], cost: 6 }, + { nodes: [Cities.IaoValley, Cities.Kihei], cost: 5 }, + { nodes: [Cities.Kihei, Cities.Wailea], cost: 4 }, + { nodes: [Cities.Wailea, Cities.Haleakala], cost: 8 }, + { nodes: [Cities.Paia, Cities.Haleakala], cost: 6 }, + { nodes: [Cities.Paia, Cities.Hana], cost: 9 }, + { nodes: [Cities.Haleakala, Cities.Hana], cost: 7 }, + { nodes: [Cities.Kihei, Cities.Haleakala], cost: 7 }, + { nodes: [Cities.Hana, Cities.Hawi], cost: 9, sea: true }, + { nodes: [Cities.Wailea, Cities.Hapuna], cost: 10, sea: true }, + { nodes: [Cities.Hawi, Cities.Kamuela], cost: 7 }, + { nodes: [Cities.Hawi, Cities.Hapuna], cost: 11 }, + { nodes: [Cities.Kamuela, Cities.Hapuna], cost: 10 }, + { nodes: [Cities.Hapuna, Cities.Waikoloa], cost: 8 }, + { nodes: [Cities.Kamuela, Cities.Waikoloa], cost: 16 }, + { nodes: [Cities.Waikoloa, Cities.Kona], cost: 8 }, + { nodes: [Cities.Kona, Cities.CaptainCook], cost: 7 }, + { nodes: [Cities.CaptainCook, Cities.PuuhonuaoHonaunau], cost: 8 }, + { nodes: [Cities.Kamuela, Cities.Waipio], cost: 9 }, + { nodes: [Cities.Waipio, Cities.AkakaFalls], cost: 10 }, + { nodes: [Cities.AkakaFalls, Cities.Hilo], cost: 10 }, + { nodes: [Cities.Kamuela, Cities.MaunaKea], cost: 9 }, + { nodes: [Cities.MaunaKea, Cities.Hilo], cost: 20 }, + { nodes: [Cities.MaunaKea, Cities.Waikoloa], cost: 20 }, + { nodes: [Cities.Hilo, Cities.Pahoa], cost: 8 }, + { nodes: [Cities.Hilo, Cities.Volcano], cost: 16 }, + { nodes: [Cities.Pahoa, Cities.Volcano], cost: 16 }, + { nodes: [Cities.Volcano, Cities.Punaluu], cost: 14 }, + { nodes: [Cities.Punaluu, Cities.PuuhonuaoHonaunau], cost: 17 }, + // The ferry: Kauai and the Big Island sit at the two ends of the chain, so they + // get a direct (and dear) crossing, drawn as a curve over open water. + { nodes: [Cities.Poipu, Cities.Kona], cost: 31, sea: true, ignoreForRegions: true, via: [65, 672] }, + ], + paymentTable, + // Fuel is shipped in: the market starts with the three cheapest coal and the three + // cheapest oil left in the supply, so coal starts at 2 and oil at 4. Garbage and + // uranium start as each variant has them (Recharged fills garbage to 9). + startingResources: { original: [21, 15, 6, 2], recharged: [21, 15, 9, 2] }, + mapSpecificRules: + 'House prices differ by island (see the key on the board). Payout is 1 Elektro higher at every step. ' + + 'Fuel is shipped in: at the start, coal begins at 2 and oil at 4. ' + + 'Dashed blue links are sea crossings. The Kauai-Big Island ferry (31) is a direct link, but it never ' + + 'counts as a border when regions are chosen: regions in play always join up over land and short crossings.', + houseLegend: { + position: [950, 150], + names: { + [Regions.Green]: 'Kauai', + [Regions.Yellow]: 'Oahu North & West', + [Regions.Red]: 'Oahu Honolulu', + [Regions.Purple]: 'Maui Nui', + [Regions.Blue]: 'Big Island West', + [Regions.Brown]: 'Big Island East', + }, + }, + // Portrait frame: the board gets the tall left side, the supply sits bottom-middle. + layout: 'Portrait', +}; diff --git a/viewer/src/components/Game.vue b/viewer/src/components/Game.vue index fd62ce3..e193f94 100644 --- a/viewer/src/components/Game.vue +++ b/viewer/src/components/Game.vue @@ -215,6 +215,7 @@ :blockedCities="G.blockedCities" :pickableRegions="getPickableRegions()" :noUraniumRegions="G.map.noUraniumRegions" + :houseLegend="G.map.houseLegend" :devBackdrop="G.map.devBackdrop" :mapRotation="mapRotation" @build="build($event)" diff --git a/viewer/src/components/boards/Map.vue b/viewer/src/components/boards/Map.vue index 7f46cea..101a02c 100644 --- a/viewer/src/components/boards/Map.vue +++ b/viewer/src/components/boards/Map.vue @@ -84,23 +84,46 @@ @@ -242,16 +265,16 @@ :key="connection.nodes[0] + '_' + connection.nodes[1] + '_border'" stroke="black" :r="10 + (connection.cost * 10) / 28" - :cx="(getX1(connection) + getX2(connection)) / 2" - :cy="(getY1(connection) + getY2(connection)) / 2" + :cx="linkMidX(connection)" + :cy="linkMidY(connection)" :fill="connection.cost > 15 ? 'gold' : connection.cost > 10 ? 'lightgray' : 'tan'" /> @@ -261,19 +284,48 @@ text-anchor="middle" :style="`font-size: ${12 + (connection.cost * 6) / 28}px`" fill="black" - :x="(getX1(connection) + getX2(connection)) / 2" - :y="(getY1(connection) + getY2(connection)) / 2" + :x="linkMidX(connection)" + :y="linkMidY(connection)" :transform=" mapRotation - ? `rotate(${-mapRotation}, ${(getX1(connection) + getX2(connection)) / 2}, ${ - (getY1(connection) + getY2(connection)) / 2 - })` + ? `rotate(${-mapRotation}, ${linkMidX(connection)}, ${linkMidY(connection)})` : undefined " > {{ connection.cost }} + + + + House prices + + + {{ row.name }} + + {{ row.costs }} + + + +