feat: trait outcome effects — FINDS HIDDEN THINGS + TALKS TO ANYONE (#43, v0.12.0) #50

Merged
kamilkrzywda merged 4 commits from feat/trait-outcome-effects into master 2026-10-04 23:24:31 +02:00
Owner

What

Implements #43 — the two remaining good traits get deterministic, seeded mechanical effects in the explore resolver (v0.12.0):

  • FINDS HIDDEN THINGS → exploration hauls gain +1 item: one extra rollExploration(rng) call on the same seeded per-planet stream, appended to the haul.
  • TALKS TO ANYONE → crew-recruit chance raised 18% → 30% (new optional chance param on rollCrewMember, defaulting to CREW_CHANCE).

Consumes the already-present RECRUIT_CHANCE_BASE / RECRUIT_CHANCE_TALKER constants from lib/game/crew-costs.ts. No new tables, no new constants.

Determinism

Outcome stays a pure function of (seed, planetId, assigned team). The no-trait path (leadCrewId=0 / empty helpers) is byte-identical to v0.11.0 — a single new unit test pins RECRUIT_CHANCE_BASE === CREW_CHANCE so the two 0.18 constants can't silently diverge and break that pin.

Tests

  • 3 new unit cases in lib/game/save.test.ts: no-trait regression pin; FHT "+1 item / haul-prefix / reproducible across independent runs"; TALKS-TO-ANYONE constant pins + end-to-end discrimination on a planet whose recruit gate falls in [0.18, 0.30).
  • OpenAPI prose updated (crewFound ~18% → 30% when the team has TALKS TO ANYONE); response shape unchanged, openapi.test.ts untouched.
  • Local (e2e is CI-only): tsc --noEmit clean, 185/185 vitest, playwright test --list OK.

Closes #43.

## What Implements #43 — the two remaining good traits get deterministic, seeded mechanical effects in the explore resolver (v0.12.0): - **FINDS HIDDEN THINGS** → exploration hauls gain +1 item: one extra `rollExploration(rng)` call on the same seeded per-planet stream, appended to the haul. - **TALKS TO ANYONE** → crew-recruit chance raised 18% → 30% (new optional `chance` param on `rollCrewMember`, defaulting to `CREW_CHANCE`). Consumes the already-present `RECRUIT_CHANCE_BASE` / `RECRUIT_CHANCE_TALKER` constants from `lib/game/crew-costs.ts`. No new tables, no new constants. ## Determinism Outcome stays a pure function of (seed, planetId, assigned team). The no-trait path (leadCrewId=0 / empty helpers) is **byte-identical to v0.11.0** — a single new unit test pins `RECRUIT_CHANCE_BASE === CREW_CHANCE` so the two 0.18 constants can't silently diverge and break that pin. ## Tests - 3 new unit cases in `lib/game/save.test.ts`: no-trait regression pin; FHT "+1 item / haul-prefix / reproducible across independent runs"; TALKS-TO-ANYONE constant pins + end-to-end discrimination on a planet whose recruit gate falls in [0.18, 0.30). - OpenAPI prose updated (crewFound ~18% → 30% when the team has TALKS TO ANYONE); response shape unchanged, `openapi.test.ts` untouched. - Local (e2e is CI-only): `tsc --noEmit` clean, 185/185 vitest, `playwright test --list` OK. Closes #43.
kamilkrzywda added 4 commits 2026-10-04 23:21:25 +02:00
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-10-04 23:21:26 +02:00
kamilkrzywda merged commit a593cd04cd into master 2026-10-04 23:24:31 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/SpaceWanderer#50