Add Pork Elf toilet support to the diet#48
Open
eegeeZA wants to merge 1 commit into
Open
Conversation
87a4acb to
acda391
Compare
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().
acda391 to
179264c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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 toiletis present inget_campground()._porkElfToiletUsedisfalse.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: addORGAN_REST = 12.CONSUME.ash: addpork_elf_toilet_available()helper; reserve/inject logic inget_diet(); emitrest 1 campground;inappend_diet_action().Testing
CONSUME SIMwith the toilet installed and_porkElfToiletUsed=falseprints a diet planningfullness_limit()+1fullness with exactly onerest 1 campground;positioned among the food items, before the cap-exceeding item.With
_porkElfToiletUsed=true(or toilet absent, or no free rests remaining),CONSUME SIMplans the normalfullness_limit()with no rest in the diet.