showmood: report bar/cloth/thread requirements in items, not raw units - #5944
Open
magnus-ISU wants to merge 4 commits into
Open
magnus-ISU wants to merge 4 commits into
magnus-ISU wants to merge 4 commits into
Conversation
A mood job states a bar, cloth or thread requirement in raw units (150 to a bar, 10000 to a bolt, 15000 to a spool), and one item's whole dimension counts against it. A quantity below one item's worth -- "3" units of metal bars is what a smith's mood actually rolls -- was printed verbatim, so the report read "got 1 of 3" for a mood that already had every bar it needed and had moved on to its next requirement. Convert with a ceiling divide (minimum 1), and add the thread divisor. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUrAgtuoK3TPwGbD2hwGeV
magnus-ISU
marked this pull request as draft
September 17, 2026 20:11
magnus-ISU
marked this pull request as ready for review
September 19, 2026 04:11
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.
The wiki says:
However, strange moods actually only require one unit of bars. The reason is that DF doesn't multiply the requested amount by 150 (the size of a bar). Therefore, it requests 1-3 (probably) bars and gets 150 from the first bar, and then is done.
The old code checked if more than the divisor was being requested, and if not didn't use it. This code always uses the divisor, but rounds up to 1.
Cloth moods request 10000 to 30000 cloth, which correctly shows up as 1 to 3 cloth.
This PR makes showmood accurately report that 3 bars requested means 1 bar actually.
It also adds a size for thread, which isn't necessary but would be if thread was added to moods, and rome told me I shouldn't remove that.