Reputation drives the economy: purchase/fuel discounts + better jobs (ISS-072, v0.38.0) #76

Merged
kamilkrzywda merged 1 commits from feat/reputation-economy into master 2026-09-21 13:01:53 +02:00
Owner

Fixes #72

Reputation was a dead stat — displayed once in the left pane, no gameplay effect. Now it drives three economy levers via one shared pure formula repRate(reputation, perPoint, cap) (linear above the starting rep of 10, capped):

  • Plane purchases — effective price = catalog × (1 − rate), 1% per rep point, capped at 40%. The discounted cost is used for both the funds check and the deduction.
  • Refuel — fuel price term discounted 0.5% per rep point, capped at 20%. Burn math, wind factor and the ×1.5 for-flight margin are untouched (v0.36.0 work stays byte-identical).
  • Job quality — spawned package rewards scale by 1 + rate (1% per rep point, up to 2×), applied at generation time with no extra RNG draw; spawn sites thread the live account reputation into generatePackage.

UI: the market buy row and the refuel preview show the effective price plus a small "−N%" pill when the discount is non-zero (reuses the .special-badge style). Tech-spec cards keep showing list prices. OpenAPI: description-only updates — no schema change, rep was already in the snapshot.

Unit: +10 tests (repRate shape; buy/refuel at fixed rep with exact cash deltas; job bonus composition incl. special multiplier and draw-count pin). All pre-existing tests pass unmodified — at starting rep every rate is exactly 0. E2e: full-price pins now compute from the live snapshot's reputation via imported helpers (the suite accumulates rep across spec files); new pill assertion in the market test.

Fixes #72 Reputation was a dead stat — displayed once in the left pane, no gameplay effect. Now it drives three economy levers via one shared pure formula `repRate(reputation, perPoint, cap)` (linear above the starting rep of 10, capped): - **Plane purchases** — effective price = catalog × (1 − rate), 1% per rep point, capped at 40%. The discounted cost is used for both the funds check and the deduction. - **Refuel** — fuel price term discounted 0.5% per rep point, capped at 20%. Burn math, wind factor and the ×1.5 for-flight margin are untouched (v0.36.0 work stays byte-identical). - **Job quality** — spawned package rewards scale by 1 + rate (1% per rep point, up to 2×), applied at generation time with no extra RNG draw; spawn sites thread the live account reputation into `generatePackage`. UI: the market buy row and the refuel preview show the effective price plus a small "−N%" pill when the discount is non-zero (reuses the `.special-badge` style). Tech-spec cards keep showing list prices. OpenAPI: description-only updates — no schema change, rep was already in the snapshot. Unit: +10 tests (repRate shape; buy/refuel at fixed rep with exact cash deltas; job bonus composition incl. special multiplier and draw-count pin). All pre-existing tests pass unmodified — at starting rep every rate is exactly 0. E2e: full-price pins now compute from the live snapshot's reputation via imported helpers (the suite accumulates rep across spec files); new pill assertion in the market test.
kamilkrzywda added 1 commit 2026-09-21 12:52:49 +02:00
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-21 12:52:58 +02:00
kamilkrzywda merged commit 929452ca33 into master 2026-09-21 13:01:53 +02:00
Sign in to join this conversation.