wire buff consumers, sick penalty, multi-count cremation
A: Storyteller.multiply_drops() stochastic-rounding helper drives crop_growth, harvest_yield, chop, mine consumption sites. sleep_decay multiplied in Pawn sleep tick. B: Pawn._sick_speed_penalty() (0% healthy → 75% severity 3, clamped to 25% min speed). JobRunner._work_speed_mult coin-flips per-tick progress on INTERACT/BUILD/CRAFT toils. Sleep/eat/treat unaffected. C: CraftingProvider builds N deposit trips for ingredient2_count > 1. JobRunner._tick_craft validates+consumes the full count from buffer. Cremation now actually requires and consumes 5 wood. crop._stage_accum round-trips through save/load to preserve buff- accumulated fractional growth. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d9638a4ea4
commit
2afca16299
9 changed files with 156 additions and 46 deletions
|
|
@ -467,6 +467,17 @@ func _check_death() -> void:
|
|||
queue_free()
|
||||
|
||||
|
||||
## Returns the work-speed penalty fraction from the SICK status (0.0 if not sick).
|
||||
## severity 1 → 0.25 penalty (75% speed), severity 2 → 0.50, severity 3 → 0.75.
|
||||
## The resulting multiplier is clamped to at least 0.25 so pawns never stop
|
||||
## working entirely from illness alone (design.md — sick pawns work slowly, not stop).
|
||||
func _sick_speed_penalty() -> float:
|
||||
for s in statuses:
|
||||
if s.kind == Status.Kind.SICK:
|
||||
return clampf(0.25 * float(s.severity), 0.0, 0.75)
|
||||
return 0.0
|
||||
|
||||
|
||||
## Returns the pawn's current level (0–10) for the given skill.
|
||||
## Returns 0 for unknown skills so callers need no nil-guard.
|
||||
func get_skill(skill: StringName) -> int:
|
||||
|
|
@ -1069,7 +1080,8 @@ func _on_sim_tick(_tick_number: int) -> void:
|
|||
hunger = maxf(0.0, hunger - HUNGER_DECAY_PER_TICK)
|
||||
# Phase 8 — decay sleep before orchestration so the AI sees the updated value
|
||||
# this tick and can immediately seek a bed once sleep < 30.
|
||||
sleep = maxf(0.0, sleep - SLEEP_DECAY_PER_TICK)
|
||||
# sleep_decay buff (summer): multiplier > 1.0 → faster depletion.
|
||||
sleep = maxf(0.0, sleep - SLEEP_DECAY_PER_TICK * Storyteller.get_buff_multiplier(&"sleep_decay"))
|
||||
# Phase 8 — process thoughts AFTER hunger/sleep decay so is_hungry() / is_tired()
|
||||
# reflect the freshly-decayed values when _sync_persistent_thought fires.
|
||||
_process_thoughts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue