Upgrade counts are in levels; day-1 text no longer promises pumpkin bombs

The workbench label, the morning screen and the end screen counted an
upgrade as done at level 1 ("N of 17"); they now count levels bought
(Upgrades.levels_bought / levels_total). Pumpkin bombs arrive at the shed
on day 3, so the first-morning text and the shoot tip say more weapons
arrive over the days instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:24:30 -04:00
parent 787b36a1c2
commit 5fcb87941e
6 changed files with 26 additions and 19 deletions

View file

@ -211,8 +211,8 @@ func _totals_text(t: Dictionary, finished: bool) -> String:
_count(t["crops_recovered"], "crop"), _count(t["animals_recovered"], "animal"), int(t["supplies_recovered"]),
_count(t["crops_lost"], "crop"), _count(t["animals_lost"], "animal"), int(t["supplies_lost"])])
lines.append("Built %d, repaired %d, broken %d. Upgrades: %d of %d. Patched up %s, %d damage taken." % [
int(t["structures_built"]), int(t["repairs"]), int(t["structures_destroyed"]), s.upgrades.size(),
Upgrades.ORDER.size(), _count(t["patches"], "time"), int(t["scarecrow_damage"])])
int(t["structures_built"]), int(t["repairs"]), int(t["structures_destroyed"]), Upgrades.levels_bought(campaign.config, s),
Upgrades.levels_total(campaign.config), _count(t["patches"], "time"), int(t["scarecrow_damage"])])
lines.append("Gathered %s. Spent %s." % [Assessment.materials_line(t, "gathered_"), Assessment.materials_line(t, "spent_")])
return "\n".join(lines)

View file

@ -114,7 +114,7 @@ func refresh() -> void:
_title.text = "The farmers are away"
lines.append("Keep the farm safe for %d nights until they come home: the crops, the animals in the pen, and the supplies in the shed." % nights)
lines.append("By day, gather wood, scrap, and straw (hold E), store them at the barn, and build defenses (B). There's more to gather off the farm, to the north, east, and south.")
lines.append("At night, stab aliens with your pitchfork (left mouse), scare them off (Q), and pick up anything they drop. Animals roam loose until you lead them into the pen: walk up to one and it follows you. The supply shed sells a corn shooter (switch weapons with Tab or 1-2) and pumpkin bombs (throw them with right mouse).")
lines.append("At night, stab aliens with your pitchfork (left mouse), scare them off (Q), and pick up anything they drop. Animals roam loose until you lead them into the pen: walk up to one and it follows you. The supply shed sells a corn shooter (switch weapons with Tab or 1-2), and more weapons arrive there over the days.")
else:
var e: Dictionary = s.night_log[s.night_log.size() - 1]
_title.text = "Morning of day %d of %d" % [s.night, nights]
@ -136,7 +136,8 @@ func refresh() -> void:
var plan := waves.tonight() if waves != null else null
if plan != null and plan.title != "":
if structures != null and structures.has_workbench():
lines.append("Tonight: %s. Upgrades at the work area: %d of %d done." % [plan.title, _upgrades_done(), Upgrades.ORDER.size()])
lines.append("Tonight: %s. Upgrades: %d of %d levels." % [plan.title, Upgrades.levels_bought(campaign.config, s),
Upgrades.levels_total(campaign.config)])
else: # #9: the Workbench hasn't been granted yet -- it arrives once Night 1 is survived
lines.append("Tonight: %s. The work area will be set up once you survive tonight." % plan.title)
_body.text = "\n".join(lines)
@ -210,14 +211,6 @@ func _damage_line() -> String:
return "Needs repair (marked with health bars): %s." % ", ".join(parts)
func _upgrades_done() -> int:
var n := 0
for id in Upgrades.ORDER:
if Upgrades.owned(campaign.state, id):
n += 1
return n
func _label(parent: Node, font_size: int, color: Color = Color(0.92, 0.92, 0.88)) -> Label:
var l := Label.new()
l.add_theme_font_size_override("font_size", font_size)

View file

@ -17,7 +17,7 @@ const TEXT := {
"store": "Your pouch only holds so much: walk onto the barn's apron (the Supply Shed) to store what you carry.",
"build": "Press [B / d-pad up] to build. Pick a fence [1], place it with left mouse / RT. Aliens have to break through fences.",
"dusk": "Dusk: aliens come at nightfall, from every side of the farm.",
"shoot": "Aim with the mouse or the right stick and hold left mouse / RT to stab with your pitchfork. The supply shed sells a corn shooter (switch with [Tab / 1-2]) and pumpkin bombs for your off-hand: throw them with [right mouse / LT].",
"shoot": "Aim with the mouse or the right stick and hold left mouse / RT to stab with your pitchfork. The supply shed sells a corn shooter (switch with [Tab / 1-2]); more weapons arrive there over the days, like pumpkin bombs for your off-hand (throw them with [right mouse / LT]).",
"fear": "Crowded? [Q / LB] Fear scares off everything nearby, and they drop what they carry.",
"recover": "Something was dropped! Walk over it to bring it home. A dropped animal follows you back to the pen.",
"patch": "Hurt? Hold [F / Y] to patch up with straw. Health carries over to the next night.",

View file

@ -47,6 +47,22 @@ static func maxed(cfg: GameConfig, state: FarmState, id: String) -> bool:
return level(state, id) >= max_level(cfg, id)
## Levels bought across both shops, and how many there are in all (the "N of M" counts on the
## workbench, the morning screen, and the end screen).
static func levels_bought(cfg: GameConfig, state: FarmState) -> int:
var n := 0
for id in ORDER:
n += mini(level(state, id), max_level(cfg, id))
return n
static func levels_total(cfg: GameConfig) -> int:
var n := 0
for id in ORDER:
n += max_level(cfg, id)
return n
## What buying this level costs: costs[id] for level 1, and upgrade_cost_growth times as much
## for each level after it (costs[id] x growth^(level - 1)), each material rounded up.
## next_cost() is the one the farm would buy now.

View file

@ -42,9 +42,6 @@ func show_state(campaign: CampaignController, show: bool, focused: bool, broken:
_label.text = "Broken -- repair it" if focused else "Broken"
return
_label.modulate = NORMAL_COLOR
var done := 0
for id in Upgrades.ORDER:
if Upgrades.owned(campaign.state, id):
done += 1
var hint := ("[E / X] Upgrades" if campaign.is_daytime() else "Upgrades by day") if focused else "Upgrades"
_label.text = "%s\n%d of %d done" % [hint, done, Upgrades.ORDER.size()]
_label.text = "%s\n%d of %d levels" % [hint, Upgrades.levels_bought(campaign.config, campaign.state),
Upgrades.levels_total(campaign.config)]