Sitelet https://github.com/NetHack/NetHack/pull/1672
Skip to content

Name the container in loot prompts - #1672

Open
crissman wants to merge 1 commit into
NetHack:NetHack-5.0from
crissman:container-prompt-names
Open

crissman wants to merge 1 commit into
NetHack:NetHack-5.0from
crissman:container-prompt-names

Conversation

@crissman

@crissman crissman commented Sep 7, 2026 •

Copy link
Copy Markdown

When looting a container, the item prompts don't say which container:

Put in what type of objects?
Take out what?
What do you want to stash?

With several containers in inventory it's easy to load the wrong one. I put a bag
of tricks into a bag of holding this way; the "Do what with your bag called
holding?" line scrolls off before the item selection appears.

This names the container in those prompts, using its full description (BUC state and
contents count included):

Put what type of objects into a blessed bag called holding containing 27 items?
Take what out of an empty uncursed sack?
What do you want to stash in a blessed bag called holding containing 27 items?

Implementation: the prompts in menu_loot(), traditional_loot() (class prompt only —
the per-item askchain() prompts keep the short "put in" verb) and getobj() (verb
"stash") are built with safe_qbuf(..., doname, ansimpleoname, ...), the same idiom as
the "Pick up ?" prompt in pickup.c, so a long name falls back to the simple form
instead of overflowing. No new functions. The "Do what with your ?" action menu is unchanged. The existing "You cannot fit X into Y" messages are unchanged.

Tested in tty and Qt on macOS with menustyle full and traditional, against the
5.0.0 release; rebased onto current NetHack-5.0 and compile-checked there.

🤖 Generated with Claude Code

🙎‍♂️ Reviewed by human Crissman

https://claude.ai/code/session_01WJwWF29Bgj7KvkVqPrVr5M

@crissman
crissman force-pushed the container-prompt-names branch from 1fc2eb4 to 47f1c00 Compare September 7, 2026 00:41
@crissman
crissman marked this pull request as draft September 7, 2026 00:44
@crissman
crissman force-pushed the container-prompt-names branch 5 times, most recently from d809f6e to b753ca7 Compare September 7, 2026 01:37
When looting, the item prompts only said "Put in what?", "Take out
what?" or "What do you want to stash?".  With several containers in
inventory it is easy to load the wrong one -- including putting a bag
of holding into a bag of holding.

Name the container in those prompts, using its full description:

    Put what type of objects into a blessed bag called holding
        containing 27 items?
    Take what out of an empty uncursed sack?
    What do you want to stash in a blessed bag called holding
        containing 27 items?

Built with safe_qbuf(doname, ansimpleoname), the same way pickup.c's
"Pick up <object>?" prompt is, so a long name falls back to the simple
form instead of overflowing.  The "Do what with your <container>?"
action menu and the per-item askchain() prompts ("put in <item>?") are
unchanged.
@crissman
crissman force-pushed the container-prompt-names branch from b753ca7 to 9b4fc3b Compare September 7, 2026 01:41
@crissman
crissman marked this pull request as ready for review September 7, 2026 01:44
@crissman

Copy link
Copy Markdown
Author

Would you welcome naming the container in loot prompts? I’d appreciate feedback on the wording or implementation, or whether you prefer the current behavior.

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