Wolves with a den, fishing, and a mixed diet

Wolves
- Den: a boulder cave at the foot of the rim, sited from the seed (away
  from the sea and spawn, mouth toward the valley, clearing in front)
- Grace period: no wolves days 1-2; they move in on day 3 and howl; hunting
  from night 4; pack of 2, 3 from day 6, 4 from day 9; replaced by day
- Wary pack hunters: circle and dart in one at a time; a lit campfire is a
  safe zone, a torch makes them hesitate, walls block bites (line of
  sight); hit one and the pack turns; hurt wolves flee; a lone wolf is
  timid; by day they defend the den; home at dawn
- Glowing eyes, synthesised howls, can't sleep with wolves prowling
- Wolf pelt and Wolf Cloak (+25 warmth)
- Animals take a committed detour around obstacles

Fishing
- Fishing rod (workbench); cast a float onto the lake, 1.5 s to land a bite
- Perch and rarer trout; faster bites at dawn/dusk and in rain; grill them
- Visible fish near the shore that jump with splash rings

Mixed diet
- Foods belong to meat, fish or greens; each level runs down over ~1.5 days
- One group low: no healing; two low: Malnourished (health drains);
  all three good: Balanced diet (heal x1.5); HUD diet bars; saved

Tests: test_wolves and test_fishing_diet; run_all.sh covers 9 suites
This commit is contained in:
Paul Bailey
2026-11-04 11:32:16 +00:00
parent 67bf85523d
commit f174221268
23 changed files with 2069 additions and 21 deletions

View File

@@ -16,6 +16,7 @@ var _toasts: VBoxContainer
var _screen: Control
var _menu: Control
var _bars: Dictionary = {}
var _diet_bars: Dictionary = {}
var _status: Label
var _clock: Label
var _hurt: ColorRect
@@ -142,6 +143,29 @@ func _build_stats(root: Control) -> void:
row.add_child(bar)
box.add_child(row)
_bars[spec[0]] = bar
# Diet: three short bars (meat, fish, greens), so a gap shows early.
var drow := HBoxContainer.new()
drow.add_theme_constant_override("separation", 6)
drow.mouse_filter = Control.MOUSE_FILTER_IGNORE
var dl := UITheme.label("Diet", 14, UITheme.TEXT_DIM)
dl.custom_minimum_size = Vector2(64, 0)
drow.add_child(dl)
for spec in [["meat", "Meat", Color(0.75, 0.3, 0.25)], ["fish", "Fish", Color(0.35, 0.6, 0.85)], ["plants", "Greens", Color(0.45, 0.75, 0.3)]]:
var cell := VBoxContainer.new()
cell.add_theme_constant_override("separation", 0)
cell.mouse_filter = Control.MOUSE_FILTER_IGNORE
var bar := ProgressBar.new()
bar.custom_minimum_size = Vector2(58, 8)
bar.show_percentage = false
bar.max_value = 100.0
bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
bar.add_theme_stylebox_override("background", UITheme.box(Color(0, 0, 0, 0.55), UITheme.SLOT_BORDER, 1, 3, 0))
bar.add_theme_stylebox_override("fill", UITheme.box(spec[2], spec[2].lightened(0.2), 1, 3, 0))
cell.add_child(bar)
cell.add_child(UITheme.label(spec[1], 11, UITheme.TEXT_DIM))
drow.add_child(cell)
_diet_bars[spec[0]] = bar
box.add_child(drow)
_clock = UITheme.label("", 18)
_clock.set_anchors_and_offsets_preset(Control.PRESET_TOP_RIGHT)
_clock.grow_horizontal = Control.GROW_DIRECTION_BEGIN
@@ -154,6 +178,10 @@ func _process(_d: float) -> void:
var s = player.survival
for k in _bars:
_bars[k].value = s.get(k)
for g in _diet_bars:
_diet_bars[g].value = s.diet[g]
# A group running low blinks, so you notice before it hurts.
_diet_bars[g].modulate.a = 0.45 + 0.55 * absf(sin(Time.get_ticks_msec() / 300.0)) if s.diet[g] < s.DIET_LOW else 1.0
# Warmth bar shifts from icy blue (cold) to orange (warm).
var w: float = s.warmth / 100.0
var wc := Color(0.35, 0.6, 0.95).lerp(Color(0.95, 0.55, 0.3), w)

View File

@@ -10,6 +10,7 @@ const CONTROLS := [
["Mouse", "Look"], ["E", "Interact / pick up / add fuel"], ["Left click", "Use tool / place"],
["Right click (holding food)", "Eat"], ["Right click (spear / cloak)", "Throw / wear"],
["Hold left click (bow)", "Draw, release to shoot"],
["Left click (fishing rod)", "Cast / reel in when the float dips"],
["R", "Rotate piece (building pieces: quarter turns)"], ["X", "Dismantle the piece you're looking at"],
["E on a bed", "Set spawn point / sleep (night, under a roof)"],
["1 - 8, wheel", "Hotbar"], ["Tab", "Inventory & crafting (shift-click Craft for 5)"],