"just picked up" tweaks

For menustyles traditional and combination, allow 'IP' to request
inventory listing of just picked up items even if not carrying any
items flagged as just picked up.  The not carrying any such items
feedback was already present but couldn't be triggered.

For menustyles partial and full, the special menu entry for 'P'
when only one item applies shows the item instead of the category
"Items you just picked up".  [That sort of thing probably ought to
be done for every menu entry rather than just for 'P'.]  Rephrase
it from
| P - <item>
to
| P - Just picked up: <item>
in case it is player's first time seeing that category be listed.

Clear the just picked up flag for any item that is dipped or read.
Lots of other actions besides drop or put-into-container probably
ought to do that too.  [Maybe even just picking an item with getobj()
could be sufficient so that it wouldn't have to be replicated all
over the place.]
This commit is contained in:
PatR
2022-03-22 11:33:17 -07:00
parent 385a9a7fde
commit 56c2e63492
4 changed files with 12 additions and 3 deletions

View File

@@ -3224,6 +3224,8 @@ dotypeinv(void)
*extra_types++ = 'C';
if (!xcnt)
*extra_types++ = 'X';
if (!jcnt)
*extra_types++ = 'P';
*extra_types = '\0'; /* for index() */
for (i = 0; i < MAXOCLASSES; i++)
if (!index(types, def_oc_syms[i].sym)) {
@@ -3289,7 +3291,7 @@ dotypeinv(void)
after = " whose blessed/uncursed/cursed status is unknown";
break; /* better phrasing is desirable */
case 'P':
after = " you just picked up";
after = " that were just picked up";
break;
default:
/* 'c' is an object class, because we've already handled

View File

@@ -1305,7 +1305,8 @@ query_category(const char *qstr, /* query string */
char tmpbuf[BUFSZ];
if (num_justpicked == 1)
Sprintf(tmpbuf, "%s", doname(find_justpicked(olist)));
Sprintf(tmpbuf, "Just picked up: %s",
doname(find_justpicked(olist)));
else
Sprintf(tmpbuf, "Items you just picked up");
invlet = 'P';

View File

@@ -2209,6 +2209,7 @@ dodip(void)
flags.verbose ? obuf : shortestname);
/* "Dip <the object> into the fountain?" */
if (yn(qbuf) == 'y') {
obj->pickup_prev = 0;
dipfountain(obj);
return ECMD_TIME;
}
@@ -2225,6 +2226,7 @@ dodip(void)
&& P_SKILL(P_RIDING) < P_BASIC) {
rider_cant_reach(); /* not skilled enough to reach */
} else {
obj->pickup_prev = 0;
if (obj->otyp == POT_ACID)
obj->in_use = 1;
if (water_damage(obj, 0, TRUE) != ER_DESTROYED && obj->in_use)
@@ -2244,6 +2246,8 @@ dodip(void)
pline("That is a potion bottle, not a Klein bottle!");
return ECMD_OK;
}
obj->pickup_prev = 0; /* no longer 'recently picked up' */
potion->in_use = TRUE; /* assume it will be used up */
if (potion->otyp == POT_WATER) {
boolean useeit = !Blind || (obj == ublindf && Blindfolded_only);
@@ -2260,7 +2264,8 @@ dodip(void)
/* KMH, conduct */
if (!u.uconduct.polypiles++)
livelog_printf(LL_CONDUCT, "polymorphed %s first item", uhis());
livelog_printf(LL_CONDUCT, "polymorphed %s first item",
uhis());
obj = poly_obj(obj, STRANGE_OBJECT);

View File

@@ -356,6 +356,7 @@ doread(void)
if (!scroll)
return ECMD_CANCEL;
otyp = scroll->otyp;
scroll->pickup_prev = 0; /* no longer 'just picked up' */
/* outrumor has its own blindness check */
if (otyp == FORTUNE_COOKIE) {