fix: require terraforming for Mars credit action

This commit is contained in:
coyotte508 2026-10-24 16:51:38 +02:00
commit ddc17d71b6
6 changed files with 56 additions and 3 deletions

View file

@ -253,6 +253,8 @@ yellow = Credit action.** Source for C1–C4 effects/costs below: owner board-re
still cost their normal building/ore price — the 3 credits replace only the ore cost of the first
step (owner-confirmed 2026-06-28: "the 3 coins only covers 1 terraforming step. You still have to
pay for the mine itself and any additional terraforming steps").
At least one terraforming step must be used, so Gaia and home planets are not legal targets,
as for the base-game power action (`RULEBOOK-TEXT` p.14; [rules clarification #76](https://github.com/boardgamers/gaia-project/issues/76)).
- Standard-tech slots: 1 — same mechanism, see the assignment note under C4. Source: `RULEBOOK-TEXT`
p.6. CONFIRMED.

View file

@ -1,6 +1,6 @@
{
"name": "@gaia-project/engine",
"version": "4.15.15",
"version": "4.15.16",
"description": "Javascript engine for project gaia",
"main": "dist/index.js",
"types": "index.ts",

View file

@ -188,6 +188,11 @@ export function possibleSpaceshipBuildMine(
if (data.ship === Spaceship.TFMars) {
const planet = hex.occupied() ? pl.planet : hex.data.planet;
steps = terraformingStepsRequired(pl.faction, planet, pl.data.lostFleetCost3Planets);
// Mars follows the base-game terraforming action: at least one step must be used.
// Gaia and home planets cannot use it. Keep past moves replayable at their original cost.
if (steps === 0 && !engine.replay) {
continue;
}
const oreCost = terraformingCost(pl.data, Math.max(steps - 1, 0), engine.replay);
if (oreCost === null) {
continue;

View file

@ -1,5 +1,7 @@
import { expect } from "chai";
import "mocha";
import { possibleBuildings } from "../available/buildings";
import { possibleSpaceshipBuildMine } from "../available/spaceship-actions";
import { AvailableCommand } from "../available/types";
import { qicForDistance, terraformingCost } from "../cost";
import Engine from "../engine";
@ -540,6 +542,50 @@ describe("Lost Fleet spaceship board actions", () => {
expect(target.hex.data.player).to.equal(PlayerEnum.Player1);
});
for (const analysis of [false, true]) {
it(`requires terraforming for Mars's Credit action in ${analysis ? "simulation" : "regular play"}`, () => {
const engine = createLostFleetRoundMoveEngine(3);
const player = engine.player(PlayerEnum.Player1);
player.data.analysis = analysis;
occupyPlanetsOfDistinctTypes(engine, PlayerEnum.Player1, 1);
const gaia = [...engine.map.grid.values()].find(
(hex) =>
hex.data.planet === Planet.Gaia &&
!hex.occupied() &&
qicForDistance(engine.map, hex, player, engine.replay).amount === 1
);
expect(gaia, "need a Gaia planet costing 1 QIC for range").to.not.equal(undefined);
const normalBuild = possibleBuildings(engine, PlayerEnum.Player1)[0].data.buildings.find(
(build) => build.coordinates === gaia.toString()
);
expect(normalBuild.cost).to.equal("2c,o,2q");
const marsBuilds = possibleSpaceshipBuildMine(engine, PlayerEnum.Player1, { ship: Spaceship.TFMars })[0].data
.buildings;
expect(marsBuilds.some((build) => build.coordinates === gaia.toString())).to.equal(false);
expect(marsBuilds.every((build) => build.steps > 0)).to.equal(true);
expect(marsBuilds.some((build) => build.steps === 1)).to.equal(true);
});
}
it("keeps historical Mars builds on Gaia planets replayable at their original cost", () => {
const engine = createLostFleetRoundMoveEngine(3);
const player = engine.player(PlayerEnum.Player1);
occupyPlanetsOfDistinctTypes(engine, PlayerEnum.Player1, 1);
engine.replay = true;
const gaia = [...engine.map.grid.values()].find(
(hex) =>
hex.data.planet === Planet.Gaia &&
!hex.occupied() &&
qicForDistance(engine.map, hex, player, engine.replay).amount === 1
);
const build = possibleSpaceshipBuildMine(engine, PlayerEnum.Player1, {
ship: Spaceship.TFMars,
})[0].data.buildings.find((build) => build.coordinates === gaia.toString());
expect(build.cost).to.equal("2c,o,q");
});
it("grants the Protoplanet's 6 VP when building via T F Mars's Credit action", () => {
const engine = createLostFleetRoundMoveEngine(3);
const player = engine.player(PlayerEnum.Player1);

View file

@ -1,6 +1,6 @@
{
"name": "@gaia-project/old-ui",
"version": "1.0.32",
"version": "1.0.33",
"scripts": {
"serve": "vite --port 5193",
"build": "vite build",

View file

@ -1,6 +1,6 @@
{
"name": "@gaia-project/viewer",
"version": "5.20.66",
"version": "5.20.67",
"description": "Functions to visualize the map and boards for gaia project inside html canvas",
"contributors": [
"coyotte508",