Add option to exclude dropped items from autopick

This is based on a feature in UnNetHack (and I think some other variants
as well).  If the hero intentionally drops an item with 'pickup_dropped'
disabled, don't autopick it back up when walking over that square again.

Typically when the player drops an item, it's because she doesn't want
it in her inventory any more, and this option stops autopickup from
defeating that goal (especially useful for tasks like stash management
without a container).  Players have come up with workarounds to this
problem like toggling autopickup when approaching their stash pile or
adding name-based autopickup exceptions to allow them to exclude
individual items from autopickup, but this behavior should reduce the
need for those things.

I think 'pickup_dropped' is a little unfortunate because it suggests
equivalence to 'pickup_thrown' (i.e. any dropped items will be
automatically picked up regardless of autopickup exceptions).  Calling
it something like 'nopick_dropped' might be better, but as far as I can
tell options cannot start with the word 'no' because it's interpreted as
a negation of the rest of the option name.
This commit is contained in:
Michael Meyer
2023-11-16 09:57:31 -05:00
committed by PatR
parent 275713b56e
commit d7d1c1476d
11 changed files with 41 additions and 7 deletions

View File

@@ -127,6 +127,7 @@ struct obj {
Bitfield(greased, 1); /* covered with grease */
Bitfield(nomerge, 1); /* set temporarily to prevent merging */
Bitfield(was_thrown, 1); /* thrown by hero since last picked up */
Bitfield(was_dropped, 1); /* dropped deliberately by the hero */
Bitfield(in_use, 1); /* for magic items before useup items */
Bitfield(bypass, 1); /* mark this as an object to be skipped by bhito() */
@@ -144,9 +145,9 @@ struct obj {
Bitfield(eknown, 1); /* effect known for wands zapped or rings worn when
* not seen yet after being picked up while blind
* [maybe for remaining stack of used potion too] */
/* 0 free bits */
/* 7 free bits */
#else
/* 2 free bits */
/* 1 free bit */
#endif
int corpsenm; /* type of corpse is mons[corpsenm] */