[PR] Apparel: insulated parka & frontier duster (#50) #51

Open
agent-claude wants to merge 1 commit from claude/50-apparel into claude/48-systems-overhaul
Collaborator

Fixes #50. Stacked on PR #49 (claude/48-systems-overhaul). This PR targets that branch so the diff only shows apparel. Retarget it to main once #49 merges.

What

Gives cold and hot biomes a gear answer besides heated rooms, and gives cloth a use.

Garment Recipe (campfire hearth) Comfort band Exposure band
(charter thermal suit) — 10…30°C −2…36°C
Insulated Parka 5 cloth + 2 timber −8…26°C −20…32°C
Frontier Duster 4 cloth 7…40°C −5…46°C
  • sim-core
    • APPAREL_STATS and PawnEntity.apparelId (types.ts).
    • thermalBand() and apparelClimateScore() (survival.ts).
    • stepExposure, the Chilly/Sweltering thoughts and the slept-in-cold memory now use per-pawn bands.
  • Auto-equip: tryAssignWearJob mirrors tryAssignEquipJob. It reuses the equip job type, which now handles apparel. A colonist puts on a stocked garment only if it scores strictly better for the season's climate. The old garment drops back into stock.
  • Sewing:
    • A garment recipe runs only while more colonists want it as their best option than the colony has in stock. It then outranks routine cooking at the hearth, which otherwise kept the hearth reserved all the time.
    • Temperate colonies don't spend cloth in spring or summer, and they dress for winter. targetStock: 3 caps spares.
  • Cloth supply: cotton won't grow below 6°C, so tundra colonies had no cloth. The crashlanded start kit now has 15 cloth (three parkas), and cargo pods can drop cloth.
  • Persistence: apparelId is in computeStateHash, the RELOCATE_COLONY carry-over and map-gen custom pawns. JSON snapshots carry it automatically.
  • Client: the Gear tab shows an Apparel card with the garment and the colonist's comfy and safe temperature bands. Parka and duster have item icons.
  • Docs: docs/GAME_DESIGN.md §6.2 has a new "Apparel" subsection.

Done criterion

sim-core/tests/apparel.test.ts drafts a colonist standing in the open, away from any fire or room, at a biome base of −15°C, for one full day (outdoor −19…−10°C):

  • Unclothed: about 1,200 bp of hypothermia.
  • In a parka: 0 bp, with no Freezing or Hypothermic thoughts.

Tests

  • npm test: sim-core 79/79 (14 new apparel tests) and server 5/5 pass. This includes the determinism replay and replica-hash tests.
  • npm run typecheck passes, and npm run build -w client builds.
  • New tests cover:
    • content and thermal bands
    • parka and duster survival
    • Chilly thought removal
    • auto-equip in tundra, desert and temperate climates
    • garment swap with drop-back
    • sewing three parkas from 15 cloth
    • a temperate colony keeping its cloth
    • snapshot and state-hash round trip
    • two-sim hash parity

Notes

  • The Gear tab card was checked by typecheck and build only. I didn't drive it in a browser.
  • Sewing happens at the campfire hearth so cold colonies can make parkas without research. A dedicated tailoring bench could come later; it needs a sprite and an architect tool.
  • Colonists dress for the current season, so they won't sew parkas in late autumn ahead of winter.

🤖 Generated with Claude Code

Fixes #50. **Stacked on PR #49** (`claude/48-systems-overhaul`). This PR targets that branch so the diff only shows apparel. Retarget it to `main` once #49 merges. ## What Gives cold and hot biomes a gear answer besides heated rooms, and gives cloth a use. | Garment | Recipe (campfire hearth) | Comfort band | Exposure band | | :--- | :--- | :--- | :--- | | *(charter thermal suit)* | — | 10…30°C | −2…36°C | | **Insulated Parka** | 5 cloth + 2 timber | −8…26°C | −20…32°C | | **Frontier Duster** | 4 cloth | 7…40°C | −5…46°C | - **sim-core** - `APPAREL_STATS` and `PawnEntity.apparelId` (`types.ts`). - `thermalBand()` and `apparelClimateScore()` (`survival.ts`). - `stepExposure`, the Chilly/Sweltering thoughts and the slept-in-cold memory now use per-pawn bands. - **Auto-equip:** `tryAssignWearJob` mirrors `tryAssignEquipJob`. It reuses the `equip` job type, which now handles apparel. A colonist puts on a stocked garment only if it scores strictly better for the season's climate. The old garment drops back into stock. - **Sewing:** - A garment recipe runs only while more colonists want it as their best option than the colony has in stock. It then outranks routine cooking at the hearth, which otherwise kept the hearth reserved all the time. - Temperate colonies don't spend cloth in spring or summer, and they dress for winter. `targetStock: 3` caps spares. - **Cloth supply:** cotton won't grow below 6°C, so tundra colonies had no cloth. The crashlanded start kit now has 15 cloth (three parkas), and cargo pods can drop cloth. - **Persistence:** `apparelId` is in `computeStateHash`, the RELOCATE_COLONY carry-over and `map-gen` custom pawns. JSON snapshots carry it automatically. - **Client:** the Gear tab shows an Apparel card with the garment and the colonist's comfy and safe temperature bands. Parka and duster have item icons. - **Docs:** `docs/GAME_DESIGN.md` §6.2 has a new "Apparel" subsection. ## Done criterion `sim-core/tests/apparel.test.ts` drafts a colonist standing in the open, away from any fire or room, at a biome base of −15°C, for one full day (outdoor −19…−10°C): - **Unclothed:** about 1,200 bp of hypothermia. - **In a parka:** 0 bp, with no Freezing or Hypothermic thoughts. ## Tests - `npm test`: sim-core 79/79 (14 new apparel tests) and server 5/5 pass. This includes the determinism replay and replica-hash tests. - `npm run typecheck` passes, and `npm run build -w client` builds. - New tests cover: - content and thermal bands - parka and duster survival - Chilly thought removal - auto-equip in tundra, desert and temperate climates - garment swap with drop-back - sewing three parkas from 15 cloth - a temperate colony keeping its cloth - snapshot and state-hash round trip - two-sim hash parity ## Notes - The Gear tab card was checked by typecheck and build only. I didn't drive it in a browser. - Sewing happens at the campfire hearth so cold colonies can make parkas without research. A dedicated tailoring bench could come later; it needs a sprite and an architect tool. - Colonists dress for the *current* season, so they won't sew parkas in late autumn ahead of winter. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- APPAREL_STATS + PawnEntity.apparelId; thermalBand() shifts per-pawn
  comfort/exposure bands used by stepExposure, mood thoughts and the
  slept-in-cold memory.
- Craftable at the campfire hearth from cloth (parka: 5 cloth + 2 timber,
  duster: 4 cloth). Sewing only happens while a colonist needs that garment
  as their best option, and then outranks routine cooking at the hearth.
- Colonists auto-wear stocked apparel that strictly suits the season's
  climate better (apparelClimateScore); the old garment returns to stock.
- Crashlanded start kit adds 15 cloth; cargo pods can drop cloth (cotton
  cannot grow in cold biomes).
- apparelId included in the state hash, relocation carry-over and snapshots.
- Client Gear tab shows the worn garment and the colonist's comfy/safe bands.
- New sim-core/tests/apparel.test.ts (14 tests), incl. parka at ~-15°C:
  0 hypothermia vs ~1,200 bp/day unclothed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Collaborator

Merge approved by @johnw via Claude Code chat on 2026-10-20: "approve/merge and deploy all"

Merge approved by @johnw via Claude Code chat on 2026-10-20: "approve/merge and deploy all"
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin claude/50-apparel:claude/50-apparel
git switch claude/50-apparel

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch claude/48-systems-overhaul
git merge --no-ff claude/50-apparel
git switch claude/50-apparel
git rebase claude/48-systems-overhaul
git switch claude/48-systems-overhaul
git merge --ff-only claude/50-apparel
git switch claude/50-apparel
git rebase claude/48-systems-overhaul
git switch claude/48-systems-overhaul
git merge --no-ff claude/50-apparel
git switch claude/48-systems-overhaul
git merge --squash claude/50-apparel
git switch claude/48-systems-overhaul
git merge --ff-only claude/50-apparel
git switch claude/48-systems-overhaul
git merge claude/50-apparel
git push origin claude/48-systems-overhaul
Sign in to join this conversation.
No description provided.