Task #26: upgrade tiers and timed shed stock
Workbench stat upgrades get 3 levels: level L costs costs[id] x
upgrade_cost_growth (1.8) ^ (L - 1), each material rounded up, and opens on
day upgrade_level_days[L - 1] ([1, 8, 16]). Each owned level's "mult"/"add"
entry stacks. Level 1 keeps the user's values and costs (rapid fire 3.0x).
Shed items arrive on set days ("from_day"): corn shooter 1, shurikens 2,
pumpkin bombs 3, potato cannon 6, radar 8, propane torch 10, alien ray 14.
- Upgrades: level(), max_level(), maxed(), cost(cfg, id, level),
next_cost(), per_level(), text_at(), name_at() (roman numerals),
from_day(), level_day(), arrived(). owned() stays "level >= 1". blocker()
adds "Arrives on day N" and "Level N opens on day D"; buy() takes the next
level and applies that level's side effect; upgrades_bought counts every
level. FarmState.upgrades keeps id -> level, so saves don't change shape.
- UpgradePanel: "Rapid fire II" with the next level's text and cost, the
blocker reason, "Max" at the last level; a shed item before its day shows
its name greyed with "Arrives on day N" ("?" plus the day if hidden). The
title counts items at their last level. Every level bought jingles.
- Co-op: the host sends "bought" for any level (no wire change; PROTOCOL
stays 5).
- soak_night.gd buys the lowest next level first across UPGRADE_ORDER.
- Tests: level costs, day gates, stacking, from_day, save/morning/retry/co-op,
an old {"rapid_fire": 1} save as level 1. Existing tests set the day where
they buy stock that now arrives later.
- RULES.md Upgrades: per-level effects and costs, stock schedule.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
6a9575dfe4
commit
91b9e52e96
12 changed files with 531 additions and 137 deletions
|
|
@ -330,31 +330,58 @@ Implemented in Step 5. The numbers are in `GameConfig`; the gather points are li
|
|||
|
||||
## Upgrades
|
||||
|
||||
Implemented in Step 10. Bought once each, by day, from the menu at the work area's tool table. The
|
||||
menu works with mouse, keyboard (arrows and Enter), or gamepad (d-pad and A). Close it with
|
||||
Escape / B, interact again, or by walking off. The scarecrow stands still while it's open.
|
||||
Implemented in Step 10; levels and timed stock in #26. Bought by day from two menus: the work
|
||||
area's tool table sells the stat upgrades and Sprint, and the supply shed's counter sells the
|
||||
weapons and items. The menus work with mouse, keyboard (arrows and Enter), or gamepad (d-pad and
|
||||
A). Close one with Escape / B, interact again, or by walking off. The scarecrow stands still while
|
||||
it's open. "Day N" is the day before night N.
|
||||
|
||||
| Track | Upgrade | Effect | Cost |
|
||||
|---|---|---|---|
|
||||
| Weapon | Corn shooter | The gun: corn kernels from afar (below) | 10 scrap, 4 wood |
|
||||
| Weapon | Rapid fire | The corn shooter fires a third faster (needs the corn shooter) | 12 scrap, 8 wood |
|
||||
| Weapon | Heavy seeds | Each kernel does 2 damage (needs the corn shooter) | 14 scrap, 10 straw |
|
||||
| Weapon | Pumpkin bombs | Thrown bombs that burst over 3 m, one every 4 s (below) | 12 straw, 6 scrap |
|
||||
| Fear | Wide fear | Fear reaches 30% farther | 20 straw, 4 wood |
|
||||
| Fear | Quick fear | Fear recharges 20% faster | 16 straw, 6 scrap |
|
||||
| Scarecrow | Straw stuffing | +2 max health | 12 straw, 4 wood |
|
||||
| Scarecrow | Sprint | Hold Shift / L3 to sprint: 1.6 times as fast for 3 s, then 10 s to recharge | 8 wood, 6 straw |
|
||||
| Defenses | Reinforced fences | Fences and gates +50% health (standing ones keep their share) | 20 wood, 6 scrap |
|
||||
| Defenses | Long-range defenses | Automated defenses reach 30% farther | 14 scrap, 10 wood |
|
||||
| Defenses | Sticky tar | Slowing traps hold 50% longer | 14 straw, 6 scrap |
|
||||
**Workbench upgrades have three levels.** Each level is bought separately, and the levels stack.
|
||||
Level 1 can be bought from day 1, level 2 from day 8, and level 3 from day 16
|
||||
(`upgrade_level_days`). Each level costs 1.8 times the one before (`upgrade_cost_growth`), each
|
||||
material rounded up.
|
||||
|
||||
- **Cost:** all eleven cost 222 materials (74 scrap, 58 wood, 90 straw), drawing on the same
|
||||
stock as building. Measured (before Sprint and the weapons were added): the scripted
|
||||
scarecrow, building its plan, could afford 6 of the 8 over the five days.
|
||||
| Track | Upgrade | Level 1 | Level 2 | Level 3 |
|
||||
|---|---|---|---|---|
|
||||
| Weapon | Rapid fire (needs the corn shooter) | fires 3x faster; 8 wood, 12 scrap, 12 straw | another 25% faster (3.75x); 15 wood, 22 scrap, 22 straw | another 25% (4.69x); 26 wood, 39 scrap, 39 straw |
|
||||
| Weapon | Heavy seeds (needs the corn shooter) | 2 damage a kernel; 14 scrap, 10 straw | 3 damage; 26 scrap, 18 straw | 4 damage; 46 scrap, 33 straw |
|
||||
| Fear | Wide fear | reaches 30% farther; 4 wood, 20 straw | another 15% (1.5x); 8 wood, 36 straw | another 15% (1.72x); 13 wood, 65 straw |
|
||||
| Fear | Quick fear | recharges 20% faster; 6 scrap, 16 straw | another 10% (0.72x the wait); 11 scrap, 29 straw | another 10% (0.65x); 20 scrap, 52 straw |
|
||||
| Scarecrow | Straw stuffing | +2 max health; 4 wood, 12 straw | +2 more; 8 wood, 22 straw | +2 more; 13 wood, 39 straw |
|
||||
| Scarecrow | Bigger pouch | +8 (16 units); 10 wood, 8 straw | +4 (20 units); 18 wood, 15 straw | +4 (24 units); 33 wood, 26 straw |
|
||||
| Defenses | Reinforced fences | fences and gates +50% health; 20 wood, 6 scrap | another 25% (1.88x); 36 wood, 11 scrap | another 25% (2.34x); 65 wood, 20 scrap |
|
||||
| Defenses | Long-range defenses | automated defenses reach 30% farther; 10 wood, 14 scrap | another 15% (1.5x); 18 wood, 26 scrap | another 15% (1.72x); 33 wood, 46 scrap |
|
||||
| Defenses | Sticky tar | slowing traps hold 50% longer; 6 scrap, 14 straw | another 25% (1.88x); 11 scrap, 26 straw | another 25% (2.34x); 20 scrap, 46 straw |
|
||||
|
||||
Sprint is bought once: hold Shift / L3 to run 80% faster for 4 s, then 10 s to recharge
|
||||
(8 wood, 6 straw).
|
||||
|
||||
**The shed's stock arrives on set days** (`from_day`). Each item is bought once.
|
||||
|
||||
| Day | Item | Cost |
|
||||
|---|---|---|
|
||||
| 1 | Corn shooter: the gun, corn kernels from afar | 4 wood, 10 scrap |
|
||||
| 2 | Shurikens: fast, cheap throws | 6 scrap, 4 straw |
|
||||
| 3 | Pumpkin bombs: thrown, they burst over 3 m, one every 4 s | 6 scrap, 12 straw |
|
||||
| 6 | Potato cannon: a slow, heavy shot from afar | 8 wood, 14 scrap |
|
||||
| 8 | Radar: a minimap of nearby enemies (hidden until Alien Goop is collected) | 6 wood, 8 scrap |
|
||||
| 10 | Propane torch: a band of flame ahead while held | 6 wood, 12 scrap, 4 straw |
|
||||
| 14 | Alien ray: a piercing beam while held (hidden until Alien Goop is collected) | 10 scrap, 6 Alien Goop |
|
||||
|
||||
- **The menus:** a row shows the next level's name, what it does, and its cost, such as "Rapid
|
||||
fire II". A row that can't be bought yet says why: "Need 2 scrap more", "Level 2 opens on day
|
||||
8", or "The work area is for daytime". At the last level it says "Max" (a one-off says
|
||||
"Done"). A shed item before its day shows only its name and "Arrives on day 6". A hidden item
|
||||
shows "?" until it's revealed, plus its arrival day if it hasn't arrived.
|
||||
- **Cost:** everything together costs about 1,390 materials: the nine upgrades' levels cost
|
||||
206, 378, and 674, and the one-offs cost 130. They draw on the same stock as building.
|
||||
- **Needs:** rapid fire and heavy seeds can't be bought before the corn shooter ("Needs the corn
|
||||
shooter first").
|
||||
- **Persistence:** upgrades carry over between nights and come back with a retry. The automated
|
||||
defense's shots don't get heavy seeds.
|
||||
- **Persistence:** levels carry over between nights, are saved, and come back with a retry. A
|
||||
save from before levels loads each upgrade at level 1. The automated defense's shots don't get
|
||||
heavy seeds.
|
||||
- **Co-op:** either player can buy the next level. Player 2's purchase is made by the host, paid
|
||||
from player 2's pouch and then the shed.
|
||||
|
||||
## Construction
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue