Skip to content

showmood: report bar/cloth/thread requirements in items, not raw units - #5944

Open
magnus-ISU wants to merge 4 commits into
DFHack:developfrom
magnus-ISU:showmood-bar-units
Open

magnus-ISU wants to merge 4 commits into
DFHack:developfrom
magnus-ISU:showmood-bar-units

Conversation

@magnus-ISU

@magnus-ISU magnus-ISU commented Sep 17, 2026

Copy link
Copy Markdown

The wiki says:

Once a workshop is claimed, the dwarf will begin collecting materials. Each artifact will require 1-3 "base items" and up to 7 additional items for decorations. The dwarf may well need several items of one material!

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.

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
magnus-ISU marked this pull request as draft September 17, 2026 20:11
@magnus-ISU
magnus-ISU marked this pull request as ready for review September 19, 2026 04:11
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