Add 'pickup_stolen' option

Add pickup_stolen option to autopick items stolen from you by a nymph or
monkey, even if they don't match your normal autopickup settings.
Replace was_dropped, was_thrown with a 2-bit bitfield that can contain
values LOST_DROPPED, LOST_THROWN, and LOST_STOLEN (or 0), since they
should all be mutually exclusive anyway as they track the most recent
way the item left the hero's inventory.

[Rebase/merge conflict fixed up.  PR]
This commit is contained in:
Michael Meyer
2023-11-17 09:37:16 -05:00
committed by PatR
parent ecda85cc32
commit 1736f3caaa
15 changed files with 54 additions and 23 deletions

View File

@@ -1504,7 +1504,7 @@ throwit(struct obj *obj,
}
gt.thrownobj = obj;
gt.thrownobj->was_thrown = 1;
gt.thrownobj->how_lost = LOST_THROWN;
iflags.returning_missile = AutoReturn(obj, wep_mask) ? (genericptr_t) obj
: (genericptr_t) 0;
/* NOTE: No early returns after this point or returning_missile
@@ -1719,7 +1719,7 @@ throwit(struct obj *obj,
if (tethered_weapon)
tmp_at(DISP_END, 0);
/* when this location is stepped on, the weapon will be
auto-picked up due to 'obj->was_thrown' of 1;
auto-picked up due to 'obj->how_lost' of LOST_THROWN;
addinv() prevents thrown Mjollnir from being placed
into the quiver slot, but an aklys will end up there if
that slot is empty at the time; since hero will need to