fix: debuff corruption + persist playTime (#64) #67

Merged
Timmy merged 2 commits from burn/20260411-1507-fix-debuff-corruption into main 2026-04-11 21:44:50 +00:00
Owner

Closes #64

Changes

1. Fixed debuff corruption bug

community_drama debuff's applyFn was doing G.codeBoost *= 0.7 — directly mutating the persistent boost multiplier. Since updateRates() runs on every building purchase, project buy, and click, this stacked the penalty exponentially (0.7^n after n calls). After ~10 actions with the debuff active, codeBoost was effectively zero.

Fix: Changed to G.codeRate *= 0.7 — applies the 30% penalty to the computed per-tick rate only. When the debuff is resolved and removed, the rate returns to normal since boost state was never touched.

2. Persisted playTime across sessions

playTime was defined in globals but never incremented and never saved/loaded. Now:

  • Incremented by dt each tick in tick()
  • Included in saveGame() save data
  • Added to loadGame() whitelist for restoration
Closes #64 ## Changes **1. Fixed debuff corruption bug** `community_drama` debuff's `applyFn` was doing `G.codeBoost *= 0.7` — directly mutating the persistent boost multiplier. Since `updateRates()` runs on every building purchase, project buy, and click, this stacked the penalty exponentially (0.7^n after n calls). After ~10 actions with the debuff active, `codeBoost` was effectively zero. Fix: Changed to `G.codeRate *= 0.7` — applies the 30% penalty to the computed per-tick rate only. When the debuff is resolved and removed, the rate returns to normal since boost state was never touched. **2. Persisted playTime across sessions** `playTime` was defined in globals but never incremented and never saved/loaded. Now: - Incremented by `dt` each tick in `tick()` - Included in `saveGame()` save data - Added to `loadGame()` whitelist for restoration
Timmy added 2 commits 2026-04-11 19:09:49 +00:00
applyFn was multiplying G.codeBoost by 0.7 on every updateRates() call
(building purchase, project, click, etc.), permanently degrading it.
After 10 calls the boost was effectively zero.

Fix: apply penalty to G.codeRate (computed per-tick) instead of
G.codeBoost (persistent multiplier). Debuffs must never mutate boost state.
fix: persist playTime across sessions
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Failing after 2s
Smoke Test / smoke (pull_request) Failing after 3s
ae09fe6d11
playTime was defined in globals but never incremented and never
included in save/load. Now incremented each tick and persisted
in localStorage via the whitelist and save data.
Author
Owner

🤖 Timmy PR Review Bot

Merge is blocked — Smoke Test and Accessibility Checks are both failing. Please fix and push again.

🤖 **Timmy PR Review Bot** Merge is blocked — Smoke Test and Accessibility Checks are both failing. Please fix and push again.
codex-agent was assigned by Rockachopa 2026-04-11 20:58:18 +00:00
Timmy merged commit 6f07ef4df2 into main 2026-04-11 21:44:50 +00:00
Sign in to join this conversation.