powergrid/engine
mmunson99 c50b5951a1
Add an alternate power plant deck option for Europe and North America (#159)
* Add an alternate power plant deck option for Europe and North America

New game option `alternatePowerPlants`. On the Europe and North America maps it
replaces the standard deck with the alternate deck: same card numbers, new
fuels and outputs. The option is ignored on every other map.

The deck adds a garbage/oil hybrid plant type (plants 8, 22 and 35). It burns
any mix of garbage and oil and has one shared storage tank, like the coal/oil
hybrid. Buying, storage, discarding, powering and end-game scoring all handle
the shared tank. Players without that plant keep the existing coal/oil logic
unchanged, and games without the option keep their exact state shape.

* Draw alternate-deck plants in the journal from the alternate deck

The journal drew every plant through getPowerPlant(number, mapName), which
only knew the India and standard catalogues. In an alternate-deck game the
journal showed the standard card for each number: 22 appeared as a wind 2,
27 as a wind 3 and 33 as a wind 4.

getPowerPlant now looks plants up through plantCatalogue, so it takes an
alternatePowerPlants flag. The journal passes the game's option through.
Every other caller passes no flag and gets the same card as before.

Found in a hand playtest of this PR on Europe.

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

---------

Co-authored-by: John Gold <goldjohn6@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:55:02 -07:00
..
.vscode ✨ (all) Add Germany map, update map structure 2021-10-27 22:49:46 -03:00
src Add an alternate power plant deck option for Europe and North America (#159) 2026-10-11 19:55:02 -07:00
.eslintignore 💚 (engine) add dist folder to eslint ignore 2021-10-29 18:30:11 -03:00
.eslintrc.js China: correct seven city names and the Changchun-Jilin cost (#59) (#117) 2026-08-14 09:26:23 -07:00
.gitignore Initial 2021-10-13 00:09:21 -03:00
.pnpm-debug.log Initial 2021-10-13 00:09:21 -03:00
.travis.yml Initial 2021-10-13 00:09:21 -03:00
index.ts feat: allow revising sealed bids and powered plants 2026-10-05 01:36:01 +02:00
LICENSE Initial 2021-10-13 00:09:21 -03:00
package-lock.json 🚨 (engine) Fix lint 2022-02-04 09:38:54 -03:00
package.json Add a Random map option that picks a map at setup 2026-10-07 22:56:43 +02:00
pnpm-lock.yaml Revert "add devcontainer and specify pnpm version" 2025-08-09 20:52:36 +00:00
README.md Running pretter, fixing names 2021-10-22 19:29:36 -03:00
tsconfig.json ✅ (engine) add full game tests 2021-11-21 15:04:44 -03:00
wrapper.ts fix: replace pending powering choices without growing history 2026-10-05 02:10:09 +02:00

powergrid-engine

Typescript engine for Power Grid.

Setup

Requirements

Recent version of node / pnpm.

Dependencies

In the project's folder:

pnpm

Build

To compile Typescript into javascript:

pnpm build

Test

pnpm test