Skip to content

Add Pork Elf toilet support to the diet#48

Open
eegeeZA wants to merge 1 commit into
soolar:masterfrom
eegeeZA:feature/pork-elf-toilet
Open

Add Pork Elf toilet support to the diet#48
eegeeZA wants to merge 1 commit into
soolar:masterfrom
eegeeZA:feature/pork-elf-toilet

Conversation

@eegeeZA

@eegeeZA eegeeZA commented Jun 13, 2026

Copy link
Copy Markdown

Summary

The Pork Elf toilet reduces fullness by 1 on the first daily campground rest, provided at least 2 fullness is already used. CONSUME currently has no awareness of this — the free slot goes unused on days driven by CONSUME standalone.

This PR integrates the toilet into the diet plan:

  • Plans one extra fullness slot when the toilet is available.
  • Fills the stomach past the real cap (cap+1 total food).
  • Injects a single rest 1 campground; just before the food action that would exceed the real cap, so the toilet flush makes room for that item.

Guard conditions (pork_elf_toilet_available())

  • Pork Elf toilet is present in get_campground().
  • _porkElfToiletUsed is false.
  • A free rest is available (total_free_rests() > timesRested), so the rest never costs an adventure.

The extra slot is only reserved when the remaining fullness to fill is >= 2 (i.e. the toilet would actually proc). If food runs out before the extra slot is needed, no rest is injected and the diet is simply <= cap — no harm done.

Changes

  • CONSUME/CONSTANTS.ash: add ORGAN_REST = 12.
  • CONSUME.ash: add pork_elf_toilet_available() helper; reserve/inject logic in get_diet(); emit rest 1 campground; in append_diet_action().

Testing

CONSUME SIM with the toilet installed and _porkElfToiletUsed=false prints a diet planning fullness_limit()+1 fullness with exactly one rest 1 campground; positioned among the food items, before the cap-exceeding item.

With _porkElfToiletUsed=true (or toilet absent, or no free rests remaining), CONSUME SIM plans the normal fullness_limit() with no rest in the diet.

@eegeeZA eegeeZA force-pushed the feature/pork-elf-toilet branch from 87a4acb to acda391 Compare June 13, 2026 20:55
The Pork Elf toilet reduces fullness by 1 on the first daily campground
rest, provided at least 2 fullness is already used. CONSUME now plans one
extra fullness slot when the toilet is available, fills the stomach past
the cap, then injects a single `rest 1 campground;` before the food item
that would exceed the real cap -- so the flush makes room for that item.

Guard conditions (via pork_elf_toilet_available()):
  - Pork Elf toilet is in get_campground()
  - _porkElfToiletUsed is false
  - a free rest is available (total_free_rests() > timesRested), so the
    rest never costs an adventure

CONSUME/CONSTANTS.ash: add ORGAN_REST = 12.
CONSUME.ash: add pork_elf_toilet_available() helper; reserve/inject logic
in get_diet(); emit `rest 1 campground;` in append_diet_action().
@eegeeZA eegeeZA force-pushed the feature/pork-elf-toilet branch from acda391 to 179264c Compare June 13, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant