diff --git a/README.md b/README.md index aded3c6..346f012 100644 --- a/README.md +++ b/README.md @@ -1,145 +1,28 @@ -# Chick Sorter v23.0 Phase 2 Routefix Hotfix +# Chick Sorter v27.0 Cleanup Build +Open `index.html` in a browser. -This build changes the SHREDDER Improvement payout rule. +## Current baseline -## v18 changes -- `SHREDDER Improvement` now uses one payout roll per processed item. -- Probability after n cards: `((√n / 2) × n)%`. -- Maximum SHREDDER Improvement cards counted: 30. -- At 30 cards, the chance is about 82.16%, so the expected payout is about ¥0.8216 per processed item. +- Build, move, box-select, sell, and repair factory equipment during Build phase. +- Start the next day only when at least one EGG route reaches a scanner and then any valid exit. +- Fairies tribute is paid after day-end settlement and before the next Build phase. +- Bankruptcy is checked only at that day-end transition. Temporary negative cash during production does not immediately end the game. +- Cards use English names and descriptions with numeric effect summaries. +- `poop.png` is the only bundled image asset currently used by default; other art falls back to canvas drawing. -## SHREDDER Improvement expected value +## Controls -```text -n = min(SHREDDER Improvement cards, 30) -p = ((√n / 2) × n)% = n√n / 200 -Per item payout X ~ Bernoulli(p) -E[X] = p yen = n√n / 200 yen -``` +- S1 manual scanner: `A` = left / `D` = right. +- S2 manual scanner: `←` = left / `→` = right. +- Build phase: left-drag empty map for box selection; drag selected equipment to move it. +- Right-drag: pan. +- `Ctrl+Z` / `Ctrl+Y`: undo / redo. +- `Esc`: cancel upgrade-card target selection. -For k shredded items, expected total bonus is `k × n√n / 200` yen. +## Cleanup in this build ---- - -# Previous build notes - -# Chick Sorter v17.0 Shredder Card and Cleanup - -This build adjusts selling constraints, timeout cleanup, settlement UI, and adds the SHREDDER improvement card. - -## v17 changes -- The last EGG FARM, MIXER, SHREDDER, and TRUCK can no longer be sold. -- Non-last equipment still follows the existing rule: same Build phase removal refunds 100%, older equipment sells for 50%. -- When the day timer and shutdown grace expire, remaining chicks/poop are blown off the conveyors with no equipment damage. -- Settlement appears 1 second after that cleanup. -- The day settlement modal is reduced to two lines: one simple formula and final profit. -- Added `SHREDDER Improvement` card. - - Each card adds one independent trial per shredded item. - - Each trial has a 1/3 chance to pay ¥1. - - Expected value per processed item after n cards: n / 3 yen. -- EGG FARM price remains ¥250. - -## SHREDDER Improvement expected value - -```text -Per item payout X ~ Binomial(n, 1/3) -E[X] = n × 1/3 = n/3 yen -``` - -For k shredded items, expected total bonus is `k × n / 3` yen. - ---- - -## Previous notes - -This build refines the v15 card and tax system. - -## v16.1 changes -- Fixed equipment improvement target-picking overlay by importing the target bounds helper into the renderer. -- Non-candidate equipment now receives a full dark overlay, and valid upgrade candidates are explicitly white-highlighted. -- Added a fallback message when a target picker has no valid target, so the game no longer appears frozen. - -## v16 changes - -- `Extra Cards` is now immediate. - - Selecting it consumes the current card pick, then grants 2 more card selections in the same draft. - - It no longer increases future draft size. -- Equipment improvement cards now target machines on the map. - - Valid targets are highlighted in white. - - Non-target areas are darkened. - - Click a highlighted machine to apply the upgrade. - - `Esc` cancels target selection and returns to the card draft. -- ZUNDA TAX and Fairies tribute no longer contaminate the next day’s profit display. - - They are still paid when `Next Day` is pressed. - - They still affect cash and total outflow. - - They are not counted inside the new day’s `Turn Profit`. -- ZUNDA TAX exemption / Legal Work behavior was rechecked and kept explicit. - - Base exemption: ¥500. - - `Legal Work`: exemption +¥250 and 95% cap point +¥250. - - Tax rate: 5% from the first yen above the exemption. - - +5% per ¥500 taxable band. - - Maximum rate: 95%. -- EGG FARM price remains ¥250. - -## Active ZUNDA TAX formula - -```text -taxable = max(0, cash - exemption) -rate = min(95%, ceil(taxable / 500) × 5%) -ZUNDA TAX = ceil(taxable × rate) -``` - -With no `Legal Work`, `exemption = ¥500`, so ¥501 starts at 5% and ¥10,000 reaches 95%. - -## v19 changes -- Added collapsed bottom-left debug panel: infinite cash, day override, free upgrade purchase. -- Added `src/core/balance.js` as the primary balance-tuning sheet for prices, income, penalties, timing, card rates, and caps. -- Increased UI text size. -- Auto Scanner base cooldown is now 2.25 seconds. -- High-Quality Bearing now adds +7.5% conveyor speed per card. -- Equipment click popover removed; hover now shows flavor text and equipment information. -- ERASE button renamed to SELL. -- Card drafts can contain up to 2 dud cards; each slot has a 30% dud chance. Dud cards can be clicked away without spending a pick. - -## v20 Phase 1 structural changes -- Added a canonical FactoryGraph in `src/systems/routing.js`. - - Build/edit operations invalidate the graph. - - Route planning, connection validation, congestion component lookup, and debug metrics now read from the same graph model. - - Scanner and facility ports are exact grid cells; visual adjacency is not accepted as connectivity. -- `Next Day` now commits the current FactoryGraph before fees and day start. - - The committed snapshot records conveyor cells, edges, components, port counts, farm outputs, and validation issues. -- Added `src/systems/gameEvents.js`. - - Major lifecycle, cash, build/sell, move, cleanup, and jam events are stored in a bounded run log. -- Expanded the debug panel from cheats only into an observability panel. - - Shows FactoryGraph size, components, port status, farm outputs, dead ends, active/queued items, max congestion, and recent events. -- This is a structural pass, not a content/balance pass. It is meant to make later map generation, market contracts, route diagnostics, replay, and deeper factory simulation safer to add. - -## v21 Phase 2 structural changes - -Implemented the Phase 2 foundation without the market board or programmable scanner logic. - -- Added seeded no-build terrain generation. Roughly 20% of grid cells become blocked each run while preserving the initial critical route. -- Added equipment degradation based on actual use. - - Truck and Manual Scanner are exempt and always operate normally. - - Conveyor tiles degrade from item pass counts and reduce local belt speed. - - Egg Farms degrade from egg production and gradually increase spawn interval. - - Mixer, Waste Shredder, and Auto Scanner degrade from processing counts and add delay. - - Equipment keeps full performance until 50% durability remains; at 0% durability it performs at half speed. -- Added dirty overlay rendering for degraded equipment. -- Added a one-day repairman hire button. The repairman costs ¥100 for the next production phase, walks freely across the map, and repairs 1% degradation every 3 seconds. -- Expanded debug/hover readouts with blocked-cell and degradation information. - -Market contracts and deeper scanner-programming logic are intentionally left for later Phase 2 work. - -## v22 Phase 2 starter-route protection - -No-build generation now protects the complete initial factory footprint before blocked cells are placed. The protected footprint includes the default Egg Farm, scanner bodies, scanner input/output ports, machine receiver cells, and every starter conveyor segment. After blocked-cell generation, the starter backbone is scrubbed from the blocked set and reinstalled as a final guard. - -Result: even with roughly 20% no-build cells, the initial line remains continuous from Egg Farm to S1, S1 to S2, and S2 to both Shredder and Truck exits. - - -## v23 hotfix - -- Fixed the startup ReferenceError caused by binding the repairman button to a missing `hireRepairman` wrapper. -- Disabled optional external art probing by default, preventing 404 console noise for placeholder image filenames. Canvas fallback art remains active. +- Removed duplicate `src/index.html` and `src/styles.css`; root `index.html` and `styles.css` are the single launch surface. +- Removed the old debug panel, debug hotkey, debug event log, and free-upgrade/debug-cash code. +- Removed the obsolete right-side selected-facility panel code left behind after the UI removal. +- Removed stale historical README files and old changelog text that no longer matched the current specification. diff --git a/assets/images/README.md b/assets/images/README.md index 1bd6e5b..0e29b23 100644 --- a/assets/images/README.md +++ b/assets/images/README.md @@ -1,16 +1,3 @@ -# Image asset folder +# Image assets -The game currently uses simple canvas placeholders. You can override them by adding images with these filenames: - -- `chick_male.png` -- `chick_female.png` -- `tarinai.png` -- `conveyor.png` -- `scanner_manual.png` -- `scanner_auto.png` -- `egg_farm.png` -- `mixer.png` -- `shredder.png` -- `truck.png` - -The render code checks whether each image loads and falls back to simple shapes when it does not. +`poop.png` is bundled and loaded by default. Other equipment/chick art is optional and currently falls back to canvas drawing unless external art loading is enabled in `src/render/draw.js`. diff --git a/assets/images/poop.png b/assets/images/poop.png new file mode 100644 index 0000000..75fde9d Binary files /dev/null and b/assets/images/poop.png differ diff --git a/index.html b/index.html index 8bd2917..efb67fa 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@
-Build, drag, connect all receiver ports, then start the next day.
+Build, drag, connect at least one valid EGG route, then start the next day.