-.\" $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 h1
.ds h2 %
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
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
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
Allows you to specify one line of text to associate with the current
dungeon level. All levels with annotations are displayed by the
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
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
-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
\item[\tb{\#annotate}]
Allows you to specify one line of text to associate with the current
-/* 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. */
/* NetHack may be freely redistributed. See license for details. */
carry_obj_effects(obj)
struct obj *obj;
{
- /* Cursed figurines can spontaneously transform
- when carried. */
+ /* Cursed figurines can spontaneously transform when carried. */
if (obj->otyp == FIGURINE) {
if (obj->cursed && obj->corpsenm != NON_PM
&& !dead_species(obj->corpsenm, TRUE)) {
else if (otmp->otyp == LOADSTONE && otmp->cursed)
/* kludge for canletgo()'s can't-drop-this message */
otmp->corpsenm = (int) cnt;
+ } else if (!strcmp(word, "adjust")) {
+ /* specifying stack's full count means something to #adjust */
+ otmp->nomerge = 1;
}
}
return otmp;
char qbuf[QBUFSZ];
char allowall[4]; /* { ALLOW_COUNT, ALL_CLASSES, 0, 0 } */
const char *adj_type;
- boolean ever_mind = FALSE;
+ boolean ever_mind = FALSE, dont_collect = FALSE;
if (!invent) {
You("aren't carrying anything to adjust.");
/* figure out whether user gave a split count to getobj() */
splitting = bumped = 0;
- for (otmp = invent; otmp; otmp = otmp->nobj)
- if (otmp->nobj == obj) { /* knowledge of splitobj() operation */
- if (otmp->invlet == obj->invlet)
- splitting = otmp;
- break;
- }
+ if (obj->nomerge) {
+ /* player specified full count; no split occurred and we'll
+ avoid collecting compatible stacks when moving this one */
+ obj->nomerge = 0;
+ 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 */
lets[GOLD_INDX] = (obj->oclass == COIN_CLASS) ? GOLD_SYM : ' ';
/* adjusting to same slot is meaningful since all
compatible stacks get collected along the way,
but splitting to same slot is not */
- || (splitting && let == obj->invlet)) {
+ || ((splitting || dont_collect) && let == obj->invlet)) {
noadjust:
if (splitting)
(void) merged(&splitting, &obj);
extract_nobj(obj, &invent);
for (otmp = invent; otmp;) {
- if (!splitting) {
+ if (!splitting && !dont_collect) {
if (merged(&otmp, &obj)) {
adj_type = "Merging:";
obj = otmp;
if (merged(&otmp, &obj)) {
obj = otmp;
extract_nobj(obj, &invent);
- } else if (inv_cnt(FALSE) >= 52) {
+ } else if (inv_cnt(FALSE) >= 52 && !dont_collect) {
(void) merged(&splitting, &obj); /* undo split */
/* "knapsack cannot accommodate any more items" */
Your("pack is too full.");