address #H6552 - #adjust behavior
The report stated that '#adjust a c' after '#adjust 1a b' moved all the original 'a' to 'c' instead of leaving the one in 'b' alone. That's true, but it is also the intended behavior. Splitting off with a count explicitly avoids gathering compatible stacks (but does merge into the destination if compatible, instead of swapping). Moving a whole stack gathers compatible ones and puts the whole merged group into the destination. But that leaves a gap in functionality: there's no way to get the don't-collect-other-stacks without splitting; there ought to be. So, allow the player to specify full count to move a stack from one slot to another without collecting compatible stacks (the behavior when no count is given) or splitting (the behavior when count is less than full amount). In the example above, if 'a' started with 5 doodads and had 4 left after splitting one to 'b', '#adjust 4a c' will move those 4 (all of 'a') to 'c' without merging 'b' into them. The method is a bit obscure but it's also something which doesn't come up very often.
This commit is contained in:
+10
-1
@@ -1,4 +1,4 @@
|
|||||||
.\" $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.233 $ $NHDT-Date: 1505214878 2017/09/12 11:14:38 $
|
.\" $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.240 $ $NHDT-Date: 1512098127 2017/12/01 03:15:27 $
|
||||||
.ds h0 "NetHack Guidebook
|
.ds h0 "NetHack Guidebook
|
||||||
.ds h1
|
.ds h1
|
||||||
.ds h2 %
|
.ds h2 %
|
||||||
@@ -924,8 +924,17 @@ This command allows you to move an item from one particular inventory
|
|||||||
slot to another so that it has a letter which is more meaningful for you
|
slot to another so that it has a letter which is more meaningful for you
|
||||||
or that it will appear in a particular location when inventory listings
|
or that it will appear in a particular location when inventory listings
|
||||||
are displayed.
|
are displayed.
|
||||||
|
You can move to a currently empty slot, or if the destination is
|
||||||
|
occupied--and won't merge--the item there will swap slots with the one
|
||||||
|
being moved.
|
||||||
``#adjust'' can also be used to split a stack of objects; when
|
``#adjust'' can also be used to split a stack of objects; when
|
||||||
choosing the item to adjust, enter a count prior to its letter.
|
choosing the item to adjust, enter a count prior to its letter.
|
||||||
|
.lp ""
|
||||||
|
When no count is given, other compatible stacks are merged with the source
|
||||||
|
stack as it's moved to the destination. When a split count is given, the
|
||||||
|
only stack that might be merged is the one already in the destination.
|
||||||
|
To move a whole stack without having other compatible ones merge with it,
|
||||||
|
specify a ``split'' count which matches the full stack size.
|
||||||
.lp #annotate
|
.lp #annotate
|
||||||
Allows you to specify one line of text to associate with the current
|
Allows you to specify one line of text to associate with the current
|
||||||
dungeon level. All levels with annotations are displayed by the
|
dungeon level. All levels with annotations are displayed by the
|
||||||
|
|||||||
+10
-1
@@ -1104,8 +1104,17 @@ This command allows you to move an item from one particular inventory
|
|||||||
slot to another so that it has a letter which is more meaningful for you
|
slot to another so that it has a letter which is more meaningful for you
|
||||||
or that it will appear in a particular location when inventory listings
|
or that it will appear in a particular location when inventory listings
|
||||||
are displayed.
|
are displayed.
|
||||||
|
You can move to a currently empty slot, or if the destination is
|
||||||
|
occupied--and won't merge--the item there will swap slots with the one
|
||||||
|
being moved.
|
||||||
``{\tt \#adjust}'' can also be used to split a stack of objects; when
|
``{\tt \#adjust}'' can also be used to split a stack of objects; when
|
||||||
choosing the item to adjust, enter a count prior to its letter.
|
choosing the item to adjust, enter a count prior to its letter.\\
|
||||||
|
%.lp ""
|
||||||
|
When no count is given, other compatible stacks are merged with the source
|
||||||
|
stack as it's moved to the destination. When a split count is given, the
|
||||||
|
only stack that might be merged is the one already in the destination.
|
||||||
|
To move a whole stack without having other compatible ones merge with it,
|
||||||
|
specify a ``split'' count which matches the full stack size.
|
||||||
%.lp
|
%.lp
|
||||||
\item[\tb{\#annotate}]
|
\item[\tb{\#annotate}]
|
||||||
Allows you to specify one line of text to associate with the current
|
Allows you to specify one line of text to associate with the current
|
||||||
|
|||||||
@@ -720,6 +720,9 @@ Master Key of Thievery always finds door and chest traps if used to lock or
|
|||||||
"Elbereth" now erodes based on attacks by the player, not monsters scared
|
"Elbereth" now erodes based on attacks by the player, not monsters scared
|
||||||
option herecmd_menu to make a mouse click on your character pop up
|
option herecmd_menu to make a mouse click on your character pop up
|
||||||
a context menu, and extended command #herecmdmenu to do the same
|
a context menu, and extended command #herecmdmenu to do the same
|
||||||
|
for #adjust, specifying a split count which matches an inventory slot's full
|
||||||
|
size will move or swap that stack without combining other compatible
|
||||||
|
stacks (except for the one in the destination slot, if applicable)
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific New Features
|
Platform- and/or Interface-Specific New Features
|
||||||
|
|||||||
+22
-13
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 invent.c $NHDT-Date: 1508827592 2017/10/24 06:46:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.220 $ */
|
/* NetHack 3.6 invent.c $NHDT-Date: 1512096431 2017/12/01 02:47:11 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.222 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -617,8 +617,7 @@ void
|
|||||||
carry_obj_effects(obj)
|
carry_obj_effects(obj)
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
/* Cursed figurines can spontaneously transform
|
/* Cursed figurines can spontaneously transform when carried. */
|
||||||
when carried. */
|
|
||||||
if (obj->otyp == FIGURINE) {
|
if (obj->otyp == FIGURINE) {
|
||||||
if (obj->cursed && obj->corpsenm != NON_PM
|
if (obj->cursed && obj->corpsenm != NON_PM
|
||||||
&& !dead_species(obj->corpsenm, TRUE)) {
|
&& !dead_species(obj->corpsenm, TRUE)) {
|
||||||
@@ -1473,6 +1472,9 @@ redo_menu:
|
|||||||
else if (otmp->otyp == LOADSTONE && otmp->cursed)
|
else if (otmp->otyp == LOADSTONE && otmp->cursed)
|
||||||
/* kludge for canletgo()'s can't-drop-this message */
|
/* kludge for canletgo()'s can't-drop-this message */
|
||||||
otmp->corpsenm = (int) cnt;
|
otmp->corpsenm = (int) cnt;
|
||||||
|
} else if (!strcmp(word, "adjust")) {
|
||||||
|
/* specifying stack's full count means something to #adjust */
|
||||||
|
otmp->nomerge = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return otmp;
|
return otmp;
|
||||||
@@ -3568,7 +3570,7 @@ doorganize() /* inventory organizer by Del Lamb */
|
|||||||
char qbuf[QBUFSZ];
|
char qbuf[QBUFSZ];
|
||||||
char allowall[4]; /* { ALLOW_COUNT, ALL_CLASSES, 0, 0 } */
|
char allowall[4]; /* { ALLOW_COUNT, ALL_CLASSES, 0, 0 } */
|
||||||
const char *adj_type;
|
const char *adj_type;
|
||||||
boolean ever_mind = FALSE;
|
boolean ever_mind = FALSE, dont_collect = FALSE;
|
||||||
|
|
||||||
if (!invent) {
|
if (!invent) {
|
||||||
You("aren't carrying anything to adjust.");
|
You("aren't carrying anything to adjust.");
|
||||||
@@ -3600,12 +3602,19 @@ doorganize() /* inventory organizer by Del Lamb */
|
|||||||
|
|
||||||
/* figure out whether user gave a split count to getobj() */
|
/* figure out whether user gave a split count to getobj() */
|
||||||
splitting = bumped = 0;
|
splitting = bumped = 0;
|
||||||
for (otmp = invent; otmp; otmp = otmp->nobj)
|
if (obj->nomerge) {
|
||||||
if (otmp->nobj == obj) { /* knowledge of splitobj() operation */
|
/* player specified full count; no split occurred and we'll
|
||||||
if (otmp->invlet == obj->invlet)
|
avoid collecting compatible stacks when moving this one */
|
||||||
splitting = otmp;
|
obj->nomerge = 0;
|
||||||
break;
|
dont_collect = TRUE;
|
||||||
}
|
} else {
|
||||||
|
for (otmp = invent; otmp; otmp = otmp->nobj)
|
||||||
|
if (otmp->nobj == obj) { /* knowledge of splitobj() operation */
|
||||||
|
if (otmp->invlet == obj->invlet)
|
||||||
|
splitting = otmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* initialize the list with all lower and upper case letters */
|
/* initialize the list with all lower and upper case letters */
|
||||||
lets[GOLD_INDX] = (obj->oclass == COIN_CLASS) ? GOLD_SYM : ' ';
|
lets[GOLD_INDX] = (obj->oclass == COIN_CLASS) ? GOLD_SYM : ' ';
|
||||||
@@ -3659,7 +3668,7 @@ doorganize() /* inventory organizer by Del Lamb */
|
|||||||
/* adjusting to same slot is meaningful since all
|
/* adjusting to same slot is meaningful since all
|
||||||
compatible stacks get collected along the way,
|
compatible stacks get collected along the way,
|
||||||
but splitting to same slot is not */
|
but splitting to same slot is not */
|
||||||
|| (splitting && let == obj->invlet)) {
|
|| ((splitting || dont_collect) && let == obj->invlet)) {
|
||||||
noadjust:
|
noadjust:
|
||||||
if (splitting)
|
if (splitting)
|
||||||
(void) merged(&splitting, &obj);
|
(void) merged(&splitting, &obj);
|
||||||
@@ -3692,7 +3701,7 @@ doorganize() /* inventory organizer by Del Lamb */
|
|||||||
extract_nobj(obj, &invent);
|
extract_nobj(obj, &invent);
|
||||||
|
|
||||||
for (otmp = invent; otmp;) {
|
for (otmp = invent; otmp;) {
|
||||||
if (!splitting) {
|
if (!splitting && !dont_collect) {
|
||||||
if (merged(&otmp, &obj)) {
|
if (merged(&otmp, &obj)) {
|
||||||
adj_type = "Merging:";
|
adj_type = "Merging:";
|
||||||
obj = otmp;
|
obj = otmp;
|
||||||
@@ -3730,7 +3739,7 @@ doorganize() /* inventory organizer by Del Lamb */
|
|||||||
if (merged(&otmp, &obj)) {
|
if (merged(&otmp, &obj)) {
|
||||||
obj = otmp;
|
obj = otmp;
|
||||||
extract_nobj(obj, &invent);
|
extract_nobj(obj, &invent);
|
||||||
} else if (inv_cnt(FALSE) >= 52) {
|
} else if (inv_cnt(FALSE) >= 52 && !dont_collect) {
|
||||||
(void) merged(&splitting, &obj); /* undo split */
|
(void) merged(&splitting, &obj); /* undo split */
|
||||||
/* "knapsack cannot accommodate any more items" */
|
/* "knapsack cannot accommodate any more items" */
|
||||||
Your("pack is too full.");
|
Your("pack is too full.");
|
||||||
|
|||||||
Reference in New Issue
Block a user