Merge remote-tracking branch 'origin/NetHack-3.6.0'
This commit is contained in:
+2
-2
@@ -6759,7 +6759,7 @@ pretty good sigh. IT APPEARS THAT THE BUTLER DID IT.
|
|||||||
|
|
||||||
IT IS A MADE-UP STORY. VERY STRANGE. ALL ONE NEEDS TO DO IS TURN TO THE
|
IT IS A MADE-UP STORY. VERY STRANGE. ALL ONE NEEDS TO DO IS TURN TO THE
|
||||||
LAST PAGE AND THE ANSWER IS THERE. WHAT, THEREFORE, IS THE POINT OF
|
LAST PAGE AND THE ANSWER IS THERE. WHAT, THEREFORE, IS THE POINT OF
|
||||||
DELIBERATEDLY NOT KNOWING?
|
DELIBERATELY NOT KNOWING?
|
||||||
|
|
||||||
It sounded like gibberish to Vimes, so he ignored it. Some of the aches
|
It sounded like gibberish to Vimes, so he ignored it. Some of the aches
|
||||||
had gone, although his head still hammered. There was an empty feeling
|
had gone, although his head still hammered. There was an empty feeling
|
||||||
@@ -6815,7 +6815,7 @@ favor.
|
|||||||
"I have been know to have the occasional 'little flutter,' sir."
|
"I have been know to have the occasional 'little flutter,' sir."
|
||||||
|
|
||||||
"Given, then, a contest between an invisible and very powerful quasidemonic
|
"Given, then, a contest between an invisible and very powerful quasidemonic
|
||||||
/thing/ of pure vengence on the one hand, and the commander on the other,
|
/thing/ of pure vengeance on the one hand, and the commander on the other,
|
||||||
where would you wager, say... one dollar?"
|
where would you wager, say... one dollar?"
|
||||||
|
|
||||||
"I wouldn't, sir. That looks like one that would go to the judges."
|
"I wouldn't, sir. That looks like one that would go to the judges."
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ negative intrinsic protection shouldn't confer MC=1, "you are warded" (not
|
|||||||
possible from divine protection but is possible from eating rings)
|
possible from divine protection but is possible from eating rings)
|
||||||
make a slight adjustment to the quickmimic() sense wording
|
make a slight adjustment to the quickmimic() sense wording
|
||||||
fix typo in passage 1 of The Colour of Magic
|
fix typo in passage 1 of The Colour of Magic
|
||||||
|
fix typos in passages 2 and 6 of Thud!
|
||||||
falling asleep when reading dull spellbook ignored sleep resistance
|
falling asleep when reading dull spellbook ignored sleep resistance
|
||||||
getpos() complaint about invalid movement keystroke didn't describe meta-chars
|
getpos() complaint about invalid movement keystroke didn't describe meta-chars
|
||||||
accurately
|
accurately
|
||||||
@@ -322,6 +323,17 @@ clarify that shape-shifted vampires revert to vampire form when petrified or
|
|||||||
digested; when back in 'V' form, they're vulnerable to such damage
|
digested; when back in 'V' form, they're vulnerable to such damage
|
||||||
when poly'd into an engulfer which does digestion damage, a kill resulting in
|
when poly'd into an engulfer which does digestion damage, a kill resulting in
|
||||||
a level gain gave "welcome to level N+1" before "you digest <victim>"
|
a level gain gave "welcome to level N+1" before "you digest <victim>"
|
||||||
|
any corpse eaten by omnivorous hero always tasted "terrible"
|
||||||
|
eating the corpse of a unique non-named monster (Wizard of Yendor, Oracle,
|
||||||
|
Chromatic Dragon, others) gave "The the <monster corpse> tastes ..."
|
||||||
|
when escaping the dungeon, change "you were here" annotation in dungeon
|
||||||
|
overview to "you left from here"
|
||||||
|
option parsing will crash if 'playmode' option is present without a value
|
||||||
|
any item drained of enchantment was blamed on the player as far as shop
|
||||||
|
billing was concerned, even if caused by disenchanter attack
|
||||||
|
if user supplied a specific monster name when asked to choose a monster class,
|
||||||
|
first prefix match was picked rather than best match ("titan" yielded
|
||||||
|
S_quadruped due to being preceded by "titanothere" in mons[])
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
|
||||||
@@ -333,17 +345,25 @@ rings covered by non-cursed gloves not listed as 'R' candidates
|
|||||||
in baalz_fixup, move any monster away from the two fake pool spots
|
in baalz_fixup, move any monster away from the two fake pool spots
|
||||||
switching farlook from xname to doname was giving away information for items
|
switching farlook from xname to doname was giving away information for items
|
||||||
located via object detection (quantity of detected gold)
|
located via object detection (quantity of detected gold)
|
||||||
|
changing doname to use "some" instead of precise quantity when an item's
|
||||||
|
dknown flag is not set could result in blind hero getting
|
||||||
|
"There is a some jackal corpses here. Eat one?" and
|
||||||
|
"You can only lift some of the some jackal corpses. Continue?"
|
||||||
catch up win/Qt/qt_win.cpp on 18-Dec-2015 change to formatkiller()
|
catch up win/Qt/qt_win.cpp on 18-Dec-2015 change to formatkiller()
|
||||||
fix for long lines in config file (28-Jan-2016) made 'O' command's 'list' and
|
fix for long lines in config file (28-Jan-2016) made 'O' command's 'list' and
|
||||||
'remove' menu choices in interactive handling for menu colorings,
|
'remove' menu choices in interactive handling for menu colorings,
|
||||||
message types, and autopickup exceptions subject to buffer overflow
|
message types, and autopickup exceptions subject to buffer overflow
|
||||||
when picking a destination for #jump, '$' to show valid dest. is more accurate
|
when picking a destination for #jump, '$' to show valid dest. is more accurate
|
||||||
enchant armor gave "your pair of boots/gloves glow", should have been "glows"
|
enchant armor gave "your pair of boots/gloves glow", should have been "glows"
|
||||||
|
when autopickup is overridden in a shop, always-pick-up exceptions and
|
||||||
|
pickup_thrown still picked unpaid items up
|
||||||
|
|
||||||
|
|
||||||
Platform- and/or Interface-Specific Fixes
|
Platform- and/or Interface-Specific Fixes
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
tiles: wrinkled spellbook had a spurious brown pixel on far right edge of tile
|
tiles: wrinkled spellbook had a spurious brown pixel on far right edge of tile
|
||||||
|
tiles: when statues are displayed as corresponding monsters, total_tiles_used
|
||||||
|
in generated src/tile.c had incorrect value
|
||||||
tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
|
tty: M-N gave "Unknown command 'M-" with "'." finishing the sentence on the
|
||||||
line below it, leaving bogus '.' displayed on the top row of the map
|
line below it, leaving bogus '.' displayed on the top row of the map
|
||||||
tty: specifying all four of role, race, gender, and alignment still prompted
|
tty: specifying all four of role, race, gender, and alignment still prompted
|
||||||
@@ -390,6 +410,8 @@ X11: make the extended command menu be easier to use and look a little nicer
|
|||||||
X11: make the getline text entry widget display a bigger text entry area
|
X11: make the getline text entry widget display a bigger text entry area
|
||||||
X11: color didn't work when the map was displayed as text rather than tiles
|
X11: color didn't work when the map was displayed as text rather than tiles
|
||||||
X11: use grayscale monster tiles for statues
|
X11: use grayscale monster tiles for statues
|
||||||
|
X11/USE_XPM: [post-3.6.0 issue] the 'tiles' bug of incorrect total_tiles_used
|
||||||
|
for STATUES_LOOK_LIKE_MONSTERS broke XPM manipulation of tiles data
|
||||||
|
|
||||||
|
|
||||||
General New Features
|
General New Features
|
||||||
|
|||||||
+3
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 extern.h $NHDT-Date: 1461967848 2016/04/29 22:10:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.558 $ */
|
/* NetHack 3.6 extern.h $NHDT-Date: 1471112244 2016/08/13 18:17:24 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.570 $ */
|
||||||
/* Copyright (c) Steve Creps, 1988. */
|
/* Copyright (c) Steve Creps, 1988. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1609,6 +1609,7 @@ E boolean FDECL(the_unique_pm, (struct permonst *));
|
|||||||
E boolean FDECL(erosion_matters, (struct obj *));
|
E boolean FDECL(erosion_matters, (struct obj *));
|
||||||
E char *FDECL(doname, (struct obj *));
|
E char *FDECL(doname, (struct obj *));
|
||||||
E char *FDECL(doname_with_price, (struct obj *));
|
E char *FDECL(doname_with_price, (struct obj *));
|
||||||
|
E char *FDECL(doname_vague_quan, (struct obj *));
|
||||||
E boolean FDECL(not_fully_identified, (struct obj *));
|
E boolean FDECL(not_fully_identified, (struct obj *));
|
||||||
E char *FDECL(corpse_xname, (struct obj *, const char *, unsigned));
|
E char *FDECL(corpse_xname, (struct obj *, const char *, unsigned));
|
||||||
E char *FDECL(cxname, (struct obj *));
|
E char *FDECL(cxname, (struct obj *));
|
||||||
@@ -2774,7 +2775,7 @@ E struct monst *FDECL(montraits, (struct obj *, coord *));
|
|||||||
E struct monst *FDECL(revive, (struct obj *, BOOLEAN_P));
|
E struct monst *FDECL(revive, (struct obj *, BOOLEAN_P));
|
||||||
E int FDECL(unturn_dead, (struct monst *));
|
E int FDECL(unturn_dead, (struct monst *));
|
||||||
E void FDECL(cancel_item, (struct obj *));
|
E void FDECL(cancel_item, (struct obj *));
|
||||||
E boolean FDECL(drain_item, (struct obj *));
|
E boolean FDECL(drain_item, (struct obj *, BOOLEAN_P));
|
||||||
E struct obj *FDECL(poly_obj, (struct obj *, int));
|
E struct obj *FDECL(poly_obj, (struct obj *, int));
|
||||||
E boolean FDECL(obj_resists, (struct obj *, int, int));
|
E boolean FDECL(obj_resists, (struct obj *, int, int));
|
||||||
E boolean FDECL(obj_shudders, (struct obj *));
|
E boolean FDECL(obj_shudders, (struct obj *));
|
||||||
|
|||||||
+17
-14
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 sp_lev.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */
|
/* NetHack 3.6 sp_lev.h $NHDT-Date: 1470212260 2016/08/03 08:17:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.17 $ */
|
||||||
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
/* Copyright (c) 1989 by Jean-Christophe Collet */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -229,28 +229,31 @@ enum opcode_defs {
|
|||||||
|
|
||||||
#define SP_COORD_X(l) (l & 0xff)
|
#define SP_COORD_X(l) (l & 0xff)
|
||||||
#define SP_COORD_Y(l) ((l >> 16) & 0xff)
|
#define SP_COORD_Y(l) ((l >> 16) & 0xff)
|
||||||
#define SP_COORD_PACK(x, y) (((x) &0xff) + (((y) &0xff) << 16))
|
#define SP_COORD_PACK(x, y) (((x) & 0xff) + (((y) & 0xff) << 16))
|
||||||
#define SP_COORD_PACK_RANDOM(f) (SP_COORD_IS_RANDOM | (f))
|
#define SP_COORD_PACK_RANDOM(f) (SP_COORD_IS_RANDOM | (f))
|
||||||
|
|
||||||
#define SP_REGION_X1(l) (l & 0xff)
|
#define SP_REGION_X1(l) (l & 0xff)
|
||||||
#define SP_REGION_Y1(l) ((l >> 8) & 0xff)
|
#define SP_REGION_Y1(l) ((l >> 8) & 0xff)
|
||||||
#define SP_REGION_X2(l) ((l >> 16) & 0xff)
|
#define SP_REGION_X2(l) ((l >> 16) & 0xff)
|
||||||
#define SP_REGION_Y2(l) ((l >> 24) & 0xff)
|
#define SP_REGION_Y2(l) ((l >> 24) & 0xff)
|
||||||
#define SP_REGION_PACK(x1, y1, x2, y2) \
|
#define SP_REGION_PACK(x1, y1, x2, y2) \
|
||||||
(((x1) &0xff) + (((y1) &0xff) << 8) + (((x2) &0xff) << 16) \
|
(((x1) & 0xff) + (((y1) & 0xff) << 8) + (((x2) & 0xff) << 16) \
|
||||||
+ (((y2) &0xff) << 24))
|
+ (((y2) & 0xff) << 24))
|
||||||
|
|
||||||
#define SP_MONST_CLASS(l) (l & 0xff)
|
/* permonst index, object index, and lit value might be negative;
|
||||||
#define SP_MONST_PM(l) ((l >> 8) & 0xffff)
|
* add 10 to accept -1 through -9 while forcing non-negative for bit shift
|
||||||
#define SP_MONST_PACK(m, c) (((m) << 8) + ((char) (c)))
|
*/
|
||||||
|
#define SP_MONST_CLASS(l) ((l) & 0xff)
|
||||||
|
#define SP_MONST_PM(l) ((((l) >> 8) & 0xffff) - 10)
|
||||||
|
#define SP_MONST_PACK(pm, cls) (((10 + (pm)) << 8) | ((cls) & 0xff))
|
||||||
|
|
||||||
#define SP_OBJ_CLASS(l) (l & 0xff)
|
#define SP_OBJ_CLASS(l) ((l) & 0xff)
|
||||||
#define SP_OBJ_TYP(l) ((l >> 8) & 0xffff)
|
#define SP_OBJ_TYP(l) ((((l) >> 8) & 0xffff) - 10)
|
||||||
#define SP_OBJ_PACK(o, c) (((o) << 8) + ((char) (c)))
|
#define SP_OBJ_PACK(ob, cls) (((10 + (ob)) << 8) | ((cls) & 0xff))
|
||||||
|
|
||||||
#define SP_MAPCHAR_TYP(l) (l & 0xff)
|
#define SP_MAPCHAR_TYP(l) ((l) & 0xff)
|
||||||
#define SP_MAPCHAR_LIT(l) ((l >> 8) & 0xff)
|
#define SP_MAPCHAR_LIT(l) ((((l) >> 8) & 0xffff) - 10)
|
||||||
#define SP_MAPCHAR_PACK(typ, lit) (((lit) << 8) + ((char) (typ)))
|
#define SP_MAPCHAR_PACK(typ, lit) (((10 + (lit)) << 8) | ((typ) & 0xff))
|
||||||
|
|
||||||
struct opvar {
|
struct opvar {
|
||||||
xchar spovartyp; /* one of SPOVAR_foo */
|
xchar spovartyp; /* one of SPOVAR_foo */
|
||||||
|
|||||||
+7
-6
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 botl.c $NHDT-Date: 1452660188 2016/01/13 04:43:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
|
/* NetHack 3.6 botl.c $NHDT-Date: 1469930895 2016/07/31 02:08:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.75 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1311,17 +1311,18 @@ boolean from_configfile;
|
|||||||
/* Now finally, we notify the window port */
|
/* Now finally, we notify the window port */
|
||||||
if (!from_configfile)
|
if (!from_configfile)
|
||||||
status_threshold(idx, status_hilites[idx].anytype,
|
status_threshold(idx, status_hilites[idx].anytype,
|
||||||
status_hilites[idx].threshold,
|
status_hilites[idx].threshold,
|
||||||
status_hilites[idx].behavior,
|
status_hilites[idx].behavior,
|
||||||
status_hilites[idx].coloridx[0],
|
status_hilites[idx].coloridx[0],
|
||||||
status_hilites[idx].coloridx[1]);
|
status_hilites[idx].coloridx[1]);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*ARGUSED*/
|
||||||
void
|
void
|
||||||
status_notify_windowport(all)
|
status_notify_windowport(all)
|
||||||
boolean all;
|
boolean all UNUSED;
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
anything it;
|
anything it;
|
||||||
|
|||||||
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 dungeon.c $NHDT-Date: 1462486971 2016/05/05 22:22:51 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.73 $ */
|
/* NetHack 3.6 dungeon.c $NHDT-Date: 1470275509 2016/08/04 01:51:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.76 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -2864,7 +2864,9 @@ boolean printdun;
|
|||||||
Sprintf(eos(buf), " \"%s\"", mptr->custom);
|
Sprintf(eos(buf), " \"%s\"", mptr->custom);
|
||||||
if (on_level(&u.uz, &mptr->lev))
|
if (on_level(&u.uz, &mptr->lev))
|
||||||
Sprintf(eos(buf), " <- You %s here.",
|
Sprintf(eos(buf), " <- You %s here.",
|
||||||
(!final || (final == 1 && how == ASCENDED)) ? "are" : "were");
|
(!final || (final == 1 && how == ASCENDED)) ? "are"
|
||||||
|
: (final == 1 && how == ESCAPED) ? "left from"
|
||||||
|
: "were");
|
||||||
putstr(win, !final ? ATR_BOLD : 0, buf);
|
putstr(win, !final ? ATR_BOLD : 0, buf);
|
||||||
|
|
||||||
if (mptr->flags.forgot)
|
if (mptr->flags.forgot)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 eat.c $NHDT-Date: 1467028559 2016/06/27 11:55:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.171 $ */
|
/* NetHack 3.6 eat.c $NHDT-Date: 1470272344 2016/08/04 00:59:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.172 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1662,22 +1662,33 @@ struct obj *otmp;
|
|||||||
} else if (mnum == PM_FLOATING_EYE && u.umonnum == PM_RAVEN) {
|
} else if (mnum == PM_FLOATING_EYE && u.umonnum == PM_RAVEN) {
|
||||||
You("peck the eyeball with delight.");
|
You("peck the eyeball with delight.");
|
||||||
} else {
|
} else {
|
||||||
/* [is this right? omnivores end up always disliking the taste] */
|
/* yummy is always False for omnivores, palatable always True */
|
||||||
boolean yummy = vegan(&mons[mnum])
|
boolean yummy = (vegan(&mons[mnum])
|
||||||
? (!carnivorous(youmonst.data)
|
? (!carnivorous(youmonst.data)
|
||||||
&& herbivorous(youmonst.data))
|
&& herbivorous(youmonst.data))
|
||||||
: (carnivorous(youmonst.data)
|
: (carnivorous(youmonst.data)
|
||||||
&& !herbivorous(youmonst.data));
|
&& !herbivorous(youmonst.data))),
|
||||||
|
palatable = (vegetarian(&mons[mnum])
|
||||||
|
? herbivorous(youmonst.data)
|
||||||
|
: carnivorous(youmonst.data));
|
||||||
|
const char *pmxnam = food_xname(otmp, FALSE);
|
||||||
|
|
||||||
|
if (!strncmpi(pmxnam, "the ", 4))
|
||||||
|
pmxnam += 4;
|
||||||
pline("%s%s %s!",
|
pline("%s%s %s!",
|
||||||
type_is_pname(&mons[mnum])
|
type_is_pname(&mons[mnum])
|
||||||
? "" : the_unique_pm(&mons[mnum]) ? "The " : "This ",
|
? "" : the_unique_pm(&mons[mnum]) ? "The " : "This ",
|
||||||
food_xname(otmp, FALSE),
|
pmxnam,
|
||||||
|
/* tiger reference is to TV ads for "Frosted Flakes",
|
||||||
|
breakfast cereal targeted at kids by "Tony the tiger" */
|
||||||
Hallucination
|
Hallucination
|
||||||
? (yummy ? ((u.umonnum == PM_TIGER) ? "is gr-r-reat"
|
? (yummy ? ((u.umonnum == PM_TIGER) ? "is gr-r-reat"
|
||||||
: "is gnarly")
|
: "is gnarly")
|
||||||
: "is grody")
|
: palatable ? "is copacetic"
|
||||||
: (yummy ? "is delicious" : "tastes terrible"));
|
: "is grody")
|
||||||
|
: (yummy ? "tastes delicious"
|
||||||
|
: palatable ? "tastes okay"
|
||||||
|
: "tastes terrible"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return retcode;
|
return retcode;
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mhitm.c $NHDT-Date: 1456992461 2016/03/03 08:07:41 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.86 $ */
|
/* NetHack 3.6 mhitm.c $NHDT-Date: 1470819842 2016/08/10 09:04:02 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.92 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1522,7 +1522,7 @@ int mdead;
|
|||||||
goto assess_dmg;
|
goto assess_dmg;
|
||||||
case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
|
case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
|
||||||
if (mhit && !mdef->mcan && otmp) {
|
if (mhit && !mdef->mcan && otmp) {
|
||||||
(void) drain_item(otmp);
|
(void) drain_item(otmp, FALSE);
|
||||||
/* No message */
|
/* No message */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
+25
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1456992469 2016/03/03 08:07:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.136 $ */
|
/* NetHack 3.6 mhitu.c $NHDT-Date: 1470819843 2016/08/10 09:04:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.144 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1597,7 +1597,27 @@ register struct attack *mattk;
|
|||||||
if (uncancelled) {
|
if (uncancelled) {
|
||||||
struct obj *obj = some_armor(&youmonst);
|
struct obj *obj = some_armor(&youmonst);
|
||||||
|
|
||||||
if (drain_item(obj)) {
|
if (!obj) {
|
||||||
|
/* some rings are susceptible;
|
||||||
|
amulets and blindfolds aren't (at present) */
|
||||||
|
switch (rn2(5)) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
obj = uright;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
obj = uleft;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
obj = uamul;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
obj = ublindf;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (drain_item(obj, FALSE)) {
|
||||||
pline("%s less effective.", Yobjnam2(obj, "seem"));
|
pline("%s less effective.", Yobjnam2(obj, "seem"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2691,7 +2711,9 @@ register struct attack *mattk;
|
|||||||
}
|
}
|
||||||
case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
|
case AD_ENCH: /* KMH -- remove enchantment (disenchanter) */
|
||||||
if (otmp) {
|
if (otmp) {
|
||||||
(void) drain_item(otmp);
|
/* by_you==True: passive counterattack to hero's action
|
||||||
|
is hero's fault */
|
||||||
|
(void) drain_item(otmp, TRUE);
|
||||||
/* No message */
|
/* No message */
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
+40
-42
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1461571093 2016/04/25 07:58:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
|
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1469930897 2016/07/31 02:08:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.50 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ STATIC_OVL int
|
|||||||
iswall(x, y)
|
iswall(x, y)
|
||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
register int type;
|
int type;
|
||||||
|
|
||||||
if (!isok(x, y))
|
if (!isok(x, y))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -132,7 +132,7 @@ wall_cleanup(x1, y1, x2, y2)
|
|||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
{
|
{
|
||||||
uchar type;
|
uchar type;
|
||||||
register int x, y;
|
int x, y;
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
|
|
||||||
/* sanity check on incoming variables */
|
/* sanity check on incoming variables */
|
||||||
@@ -164,7 +164,7 @@ fix_wall_spines(x1, y1, x2, y2)
|
|||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
{
|
{
|
||||||
uchar type;
|
uchar type;
|
||||||
register int x,y;
|
int x, y;
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
int FDECL((*loc_f), (int, int));
|
int FDECL((*loc_f), (int, int));
|
||||||
int bits;
|
int bits;
|
||||||
@@ -232,7 +232,7 @@ int x1, y1, x2, y2;
|
|||||||
STATIC_OVL boolean
|
STATIC_OVL boolean
|
||||||
okay(x, y, dir)
|
okay(x, y, dir)
|
||||||
int x, y;
|
int x, y;
|
||||||
register int dir;
|
int dir;
|
||||||
{
|
{
|
||||||
mz_move(x, y, dir);
|
mz_move(x, y, dir);
|
||||||
mz_move(x, y, dir);
|
mz_move(x, y, dir);
|
||||||
@@ -466,9 +466,9 @@ static boolean was_waterlevel; /* ugh... this shouldn't be needed */
|
|||||||
void
|
void
|
||||||
fixup_special()
|
fixup_special()
|
||||||
{
|
{
|
||||||
register lev_region *r = lregions;
|
lev_region *r = lregions;
|
||||||
struct d_level lev;
|
struct d_level lev;
|
||||||
register int x, y;
|
int x, y;
|
||||||
struct mkroom *croom;
|
struct mkroom *croom;
|
||||||
boolean added_branch = FALSE;
|
boolean added_branch = FALSE;
|
||||||
|
|
||||||
@@ -606,7 +606,7 @@ fixup_special()
|
|||||||
|
|
||||||
create_secret_door(croom, W_ANY);
|
create_secret_door(croom, W_ANY);
|
||||||
} else if (on_level(&u.uz, &orcus_level)) {
|
} else if (on_level(&u.uz, &orcus_level)) {
|
||||||
register struct monst *mtmp, *mtmp2;
|
struct monst *mtmp, *mtmp2;
|
||||||
|
|
||||||
/* it's a ghost town, get rid of shopkeepers */
|
/* it's a ghost town, get rid of shopkeepers */
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
|
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
|
||||||
@@ -631,7 +631,7 @@ fixup_special()
|
|||||||
|
|
||||||
void
|
void
|
||||||
makemaz(s)
|
makemaz(s)
|
||||||
register const char *s;
|
const char *s;
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
char protofile[20];
|
char protofile[20];
|
||||||
@@ -850,7 +850,7 @@ walkfrom(x, y, typ)
|
|||||||
int x, y;
|
int x, y;
|
||||||
schar typ;
|
schar typ;
|
||||||
{
|
{
|
||||||
register int q, a, dir;
|
int q, a, dir;
|
||||||
int dirs[4];
|
int dirs[4];
|
||||||
|
|
||||||
if (!typ) {
|
if (!typ) {
|
||||||
@@ -898,7 +898,8 @@ coord *cc;
|
|||||||
&& levl[cc->x][cc->y].typ
|
&& levl[cc->x][cc->y].typ
|
||||||
!= (level.flags.corrmaze ? CORR : ROOM));
|
!= (level.flags.corrmaze ? CORR : ROOM));
|
||||||
if (cpt >= 100) {
|
if (cpt >= 100) {
|
||||||
register int x, y;
|
int x, y;
|
||||||
|
|
||||||
/* last try */
|
/* last try */
|
||||||
for (x = 0; x < (x_maze_max >> 1) - 1; x++)
|
for (x = 0; x < (x_maze_max >> 1) - 1; x++)
|
||||||
for (y = 0; y < (y_maze_max >> 1) - 1; y++) {
|
for (y = 0; y < (y_maze_max >> 1) - 1; y++) {
|
||||||
@@ -926,9 +927,9 @@ coord *cc;
|
|||||||
void
|
void
|
||||||
bound_digging()
|
bound_digging()
|
||||||
{
|
{
|
||||||
register int x, y;
|
int x, y;
|
||||||
register unsigned typ;
|
unsigned typ;
|
||||||
register struct rm *lev;
|
struct rm *lev;
|
||||||
boolean found, nonwall;
|
boolean found, nonwall;
|
||||||
int xmin, xmax, ymin, ymax;
|
int xmin, xmax, ymin, ymax;
|
||||||
|
|
||||||
@@ -1035,8 +1036,10 @@ fumaroles()
|
|||||||
for (n = rn2(3) + 2; n; n--) {
|
for (n = rn2(3) + 2; n; n--) {
|
||||||
xchar x = rn1(COLNO - 4, 3);
|
xchar x = rn1(COLNO - 4, 3);
|
||||||
xchar y = rn1(ROWNO - 4, 3);
|
xchar y = rn1(ROWNO - 4, 3);
|
||||||
|
|
||||||
if (levl[x][y].typ == LAVAPOOL) {
|
if (levl[x][y].typ == LAVAPOOL) {
|
||||||
NhRegion *r = create_gas_cloud(x, y, 4 + rn2(5), rn1(10, 5));
|
NhRegion *r = create_gas_cloud(x, y, 4 + rn2(5), rn1(10, 5));
|
||||||
|
|
||||||
clear_heros_fault(r);
|
clear_heros_fault(r);
|
||||||
snd = TRUE;
|
snd = TRUE;
|
||||||
if (distu(x, y) < 15)
|
if (distu(x, y) < 15)
|
||||||
@@ -1054,11 +1057,6 @@ fumaroles()
|
|||||||
* other source files, but they are all so nicely encapsulated here.
|
* other source files, but they are all so nicely encapsulated here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
/* to ease the work of debuggers at this stage */
|
|
||||||
#define register
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONS_OBJ 0
|
#define CONS_OBJ 0
|
||||||
#define CONS_MON 1
|
#define CONS_MON 1
|
||||||
#define CONS_HERO 2
|
#define CONS_HERO 2
|
||||||
@@ -1082,8 +1080,8 @@ void
|
|||||||
movebubbles()
|
movebubbles()
|
||||||
{
|
{
|
||||||
static boolean up;
|
static boolean up;
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
register int x, y, i, j;
|
int x, y, i, j;
|
||||||
struct trap *btrap;
|
struct trap *btrap;
|
||||||
static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0,
|
static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0 };
|
0, 0, 0, 0, 0, 0 };
|
||||||
@@ -1205,7 +1203,7 @@ movebubbles()
|
|||||||
*/
|
*/
|
||||||
up = !up;
|
up = !up;
|
||||||
for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) {
|
for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) {
|
||||||
register int rx = rn2(3), ry = rn2(3);
|
int rx = rn2(3), ry = rn2(3);
|
||||||
|
|
||||||
mv_bubble(b, b->dx + 1 - (!b->dx ? rx : (rx ? 1 : 0)),
|
mv_bubble(b, b->dx + 1 - (!b->dx ? rx : (rx ? 1 : 0)),
|
||||||
b->dy + 1 - (!b->dy ? ry : (ry ? 1 : 0)), FALSE);
|
b->dy + 1 - (!b->dy ? ry : (ry ? 1 : 0)), FALSE);
|
||||||
@@ -1221,8 +1219,8 @@ movebubbles()
|
|||||||
void
|
void
|
||||||
water_friction()
|
water_friction()
|
||||||
{
|
{
|
||||||
register int x, y, dx, dy;
|
int x, y, dx, dy;
|
||||||
register boolean eff = FALSE;
|
boolean eff = FALSE;
|
||||||
|
|
||||||
if (Swimming && rn2(4))
|
if (Swimming && rn2(4))
|
||||||
return; /* natural swimmers have advantage */
|
return; /* natural swimmers have advantage */
|
||||||
@@ -1256,7 +1254,7 @@ void
|
|||||||
save_waterlevel(fd, mode)
|
save_waterlevel(fd, mode)
|
||||||
int fd, mode;
|
int fd, mode;
|
||||||
{
|
{
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
|
|
||||||
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
||||||
return;
|
return;
|
||||||
@@ -1279,11 +1277,10 @@ int fd, mode;
|
|||||||
|
|
||||||
void
|
void
|
||||||
restore_waterlevel(fd)
|
restore_waterlevel(fd)
|
||||||
register int fd;
|
int fd;
|
||||||
{
|
{
|
||||||
register struct bubble *b = (struct bubble *) 0, *btmp;
|
struct bubble *b = (struct bubble *) 0, *btmp;
|
||||||
register int i;
|
int i, n;
|
||||||
int n;
|
|
||||||
|
|
||||||
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
||||||
return;
|
return;
|
||||||
@@ -1316,7 +1313,7 @@ const char *
|
|||||||
waterbody_name(x, y)
|
waterbody_name(x, y)
|
||||||
xchar x, y;
|
xchar x, y;
|
||||||
{
|
{
|
||||||
register struct rm *lev;
|
struct rm *lev;
|
||||||
schar ltyp;
|
schar ltyp;
|
||||||
|
|
||||||
if (!isok(x, y))
|
if (!isok(x, y))
|
||||||
@@ -1355,10 +1352,10 @@ set_wportal()
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
setup_waterlevel()
|
setup_waterlevel()
|
||||||
{
|
{
|
||||||
register int x, y;
|
int x, y;
|
||||||
register int xskip, yskip;
|
int xskip, yskip;
|
||||||
register int water_glyph = cmap_to_glyph(S_water);
|
int water_glyph = cmap_to_glyph(S_water),
|
||||||
register int air_glyph = cmap_to_glyph(S_air);
|
air_glyph = cmap_to_glyph(S_air);
|
||||||
|
|
||||||
/* ouch, hardcoded... */
|
/* ouch, hardcoded... */
|
||||||
|
|
||||||
@@ -1391,7 +1388,7 @@ setup_waterlevel()
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
unsetup_waterlevel()
|
unsetup_waterlevel()
|
||||||
{
|
{
|
||||||
register struct bubble *b, *bb;
|
struct bubble *b, *bb;
|
||||||
|
|
||||||
/* free bubbles */
|
/* free bubbles */
|
||||||
|
|
||||||
@@ -1404,7 +1401,7 @@ unsetup_waterlevel()
|
|||||||
|
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
mk_bubble(x, y, n)
|
mk_bubble(x, y, n)
|
||||||
register int x, y, n;
|
int x, y, n;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* These bit masks make visually pleasing bubbles on a normal aspect
|
* These bit masks make visually pleasing bubbles on a normal aspect
|
||||||
@@ -1413,14 +1410,15 @@ register int x, y, n;
|
|||||||
* in situ, either. The first two elements tell the dimensions of
|
* in situ, either. The first two elements tell the dimensions of
|
||||||
* the bubble's bounding box.
|
* the bubble's bounding box.
|
||||||
*/
|
*/
|
||||||
static uchar bm2[] = { 2, 1, 0x3 }, bm3[] = { 3, 2, 0x7, 0x7 },
|
static uchar bm2[] = { 2, 1, 0x3 },
|
||||||
|
bm3[] = { 3, 2, 0x7, 0x7 },
|
||||||
bm4[] = { 4, 3, 0x6, 0xf, 0x6 },
|
bm4[] = { 4, 3, 0x6, 0xf, 0x6 },
|
||||||
bm5[] = { 5, 3, 0xe, 0x1f, 0xe },
|
bm5[] = { 5, 3, 0xe, 0x1f, 0xe },
|
||||||
bm6[] = { 6, 4, 0x1e, 0x3f, 0x3f, 0x1e },
|
bm6[] = { 6, 4, 0x1e, 0x3f, 0x3f, 0x1e },
|
||||||
bm7[] = { 7, 4, 0x3e, 0x7f, 0x7f, 0x3e },
|
bm7[] = { 7, 4, 0x3e, 0x7f, 0x7f, 0x3e },
|
||||||
bm8[] = { 8, 4, 0x7e, 0xff, 0xff, 0x7e },
|
bm8[] = { 8, 4, 0x7e, 0xff, 0xff, 0x7e },
|
||||||
*bmask[] = { bm2, bm3, bm4, bm5, bm6, bm7, bm8 };
|
*bmask[] = { bm2, bm3, bm4, bm5, bm6, bm7, bm8 };
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
|
|
||||||
if (x >= bxmax || y >= bymax)
|
if (x >= bxmax || y >= bymax)
|
||||||
return;
|
return;
|
||||||
@@ -1466,11 +1464,11 @@ register int x, y, n;
|
|||||||
*/
|
*/
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
mv_bubble(b, dx, dy, ini)
|
mv_bubble(b, dx, dy, ini)
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
register int dx, dy;
|
int dx, dy;
|
||||||
register boolean ini;
|
boolean ini;
|
||||||
{
|
{
|
||||||
register int x, y, i, j, colli = 0;
|
int x, y, i, j, colli = 0;
|
||||||
struct container *cons, *ctemp;
|
struct container *cons, *ctemp;
|
||||||
|
|
||||||
/* clouds move slowly */
|
/* clouds move slowly */
|
||||||
|
|||||||
+7
-11
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mondata.c $NHDT-Date: 1446604115 2015/11/04 02:28:35 $ $NHDT-Branch: master $:$NHDT-Revision: 1.58 $ */
|
/* NetHack 3.6 mondata.c $NHDT-Date: 1470966820 2016/08/12 01:53:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.61 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -855,16 +855,12 @@ int *mndx_p;
|
|||||||
if ((p = strstri(x, in_str)) != 0 && (p == x || *(p - 1) == ' '))
|
if ((p = strstri(x, in_str)) != 0 && (p == x || *(p - 1) == ' '))
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
/* check individual species names; not as thorough as mon_to_name()
|
/* check individual species names */
|
||||||
but our caller can call that directly if desired */
|
i = name_to_mon(in_str);
|
||||||
for (i = LOW_PM; i < NUMMONS; i++) {
|
if (i != NON_PM) {
|
||||||
x = mons[i].mname;
|
if (mndx_p)
|
||||||
if ((p = strstri(x, in_str)) != 0
|
*mndx_p = i;
|
||||||
&& (p == x || *(p - 1) == ' ')) {
|
return mons[i].mlet;
|
||||||
if (mndx_p)
|
|
||||||
*mndx_p = i;
|
|
||||||
return mons[i].mlet;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
+54
-25
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 objnam.c $NHDT-Date: 1462067746 2016/05/01 01:55:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.169 $ */
|
/* NetHack 3.6 objnam.c $NHDT-Date: 1471112245 2016/08/13 18:17:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.178 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -17,6 +17,7 @@ STATIC_DCL char *NDECL(nextobuf);
|
|||||||
STATIC_DCL void FDECL(releaseobuf, (char *));
|
STATIC_DCL void FDECL(releaseobuf, (char *));
|
||||||
STATIC_DCL char *FDECL(minimal_xname, (struct obj *));
|
STATIC_DCL char *FDECL(minimal_xname, (struct obj *));
|
||||||
STATIC_DCL void FDECL(add_erosion_words, (struct obj *, char *));
|
STATIC_DCL void FDECL(add_erosion_words, (struct obj *, char *));
|
||||||
|
STATIC_DCL char *FDECL(doname_base, (struct obj *obj, unsigned));
|
||||||
STATIC_DCL boolean FDECL(singplur_lookup, (char *, char *, BOOLEAN_P,
|
STATIC_DCL boolean FDECL(singplur_lookup, (char *, char *, BOOLEAN_P,
|
||||||
const char *const *));
|
const char *const *));
|
||||||
STATIC_DCL char *FDECL(singplur_compound, (char *));
|
STATIC_DCL char *FDECL(singplur_compound, (char *));
|
||||||
@@ -580,7 +581,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
|
|||||||
brown potion -- if oc_name_known not set
|
brown potion -- if oc_name_known not set
|
||||||
potion of object detection -- if discovered
|
potion of object detection -- if discovered
|
||||||
*/
|
*/
|
||||||
static char *
|
STATIC_OVL char *
|
||||||
minimal_xname(obj)
|
minimal_xname(obj)
|
||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
@@ -756,12 +757,17 @@ struct obj *obj;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
#define DONAME_WITH_PRICE 1
|
||||||
doname_base(obj, with_price)
|
#define DONAME_VAGUE_QUAN 2
|
||||||
register struct obj *obj;
|
|
||||||
boolean with_price;
|
STATIC_OVL char *
|
||||||
|
doname_base(obj, doname_flags)
|
||||||
|
struct obj *obj;
|
||||||
|
unsigned doname_flags;
|
||||||
{
|
{
|
||||||
boolean ispoisoned = FALSE;
|
boolean ispoisoned = FALSE,
|
||||||
|
with_price = (doname_flags & DONAME_WITH_PRICE) != 0,
|
||||||
|
vague_quan = (doname_flags & DONAME_VAGUE_QUAN) != 0;
|
||||||
boolean known, dknown, cknown, bknown, lknown;
|
boolean known, dknown, cknown, bknown, lknown;
|
||||||
int omndx = obj->corpsenm;
|
int omndx = obj->corpsenm;
|
||||||
char prefix[PREFIX];
|
char prefix[PREFIX];
|
||||||
@@ -792,7 +798,7 @@ boolean with_price;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (obj->quan != 1L) {
|
if (obj->quan != 1L) {
|
||||||
if (dknown)
|
if (dknown || !vague_quan)
|
||||||
Sprintf(prefix, "%ld ", obj->quan);
|
Sprintf(prefix, "%ld ", obj->quan);
|
||||||
else
|
else
|
||||||
Strcpy(prefix, "some ");
|
Strcpy(prefix, "some ");
|
||||||
@@ -816,11 +822,11 @@ boolean with_price;
|
|||||||
making the prefix be redundant; note that 'known' flag
|
making the prefix be redundant; note that 'known' flag
|
||||||
isn't set when emptiness gets discovered because then
|
isn't set when emptiness gets discovered because then
|
||||||
charging magic would yield known number of new charges) */
|
charging magic would yield known number of new charges) */
|
||||||
&& (obj->otyp == BAG_OF_TRICKS
|
&& ((obj->otyp == BAG_OF_TRICKS)
|
||||||
? (obj->spe == 0 && !obj->known)
|
? (obj->spe == 0 && !obj->known)
|
||||||
/* not bag of tricks: empty if container which has no contents */
|
/* not bag of tricks: empty if container which has no contents */
|
||||||
: (Is_container(obj) || obj->otyp == STATUE)
|
: ((Is_container(obj) || obj->otyp == STATUE)
|
||||||
&& !Has_contents(obj)))
|
&& !Has_contents(obj))))
|
||||||
Strcat(prefix, "empty ");
|
Strcat(prefix, "empty ");
|
||||||
|
|
||||||
if (bknown && obj->oclass != COIN_CLASS
|
if (bknown && obj->oclass != COIN_CLASS
|
||||||
@@ -872,11 +878,9 @@ boolean with_price;
|
|||||||
Strcat(prefix, "greased ");
|
Strcat(prefix, "greased ");
|
||||||
|
|
||||||
if (cknown && Has_contents(obj)) {
|
if (cknown && Has_contents(obj)) {
|
||||||
/* we count all objects (obj->quantity); perhaps we should
|
/* we count the number of separate stacks, which corresponds
|
||||||
count separate stacks instead (or even introduce a user
|
to the number of inventory slots needed to be able to take
|
||||||
preference option to choose between the two alternatives)
|
everything out if no merges occur */
|
||||||
since it's somewhat odd so see "containing 1002 items"
|
|
||||||
when there are 2 scrolls plus 1000 gold pieces */
|
|
||||||
long itemcount = count_contents(obj, FALSE, FALSE, TRUE);
|
long itemcount = count_contents(obj, FALSE, FALSE, TRUE);
|
||||||
|
|
||||||
Sprintf(eos(bp), " containing %ld item%s", itemcount,
|
Sprintf(eos(bp), " containing %ld item%s", itemcount,
|
||||||
@@ -960,8 +964,13 @@ boolean with_price;
|
|||||||
if (obj->oeaten)
|
if (obj->oeaten)
|
||||||
Strcat(prefix, "partly eaten ");
|
Strcat(prefix, "partly eaten ");
|
||||||
if (obj->otyp == CORPSE) {
|
if (obj->otyp == CORPSE) {
|
||||||
Sprintf(prefix, "%s ",
|
/* (quan == 1) => want corpse_xname() to supply article,
|
||||||
corpse_xname(obj, prefix, CXN_ARTICLE | CXN_NOCORPSE));
|
(quan != 1) => already have count or "some" as prefix;
|
||||||
|
"corpse" is already in the buffer returned by xname() */
|
||||||
|
unsigned cxarg = (((obj->quan != 1L) ? 0 : CXN_ARTICLE)
|
||||||
|
| CXN_NOCORPSE);
|
||||||
|
|
||||||
|
Sprintf(prefix, "%s ", corpse_xname(obj, prefix, cxarg));
|
||||||
} else if (obj->otyp == EGG) {
|
} else if (obj->otyp == EGG) {
|
||||||
#if 0 /* corpses don't tell if they're stale either */
|
#if 0 /* corpses don't tell if they're stale either */
|
||||||
if (known && stale_egg(obj))
|
if (known && stale_egg(obj))
|
||||||
@@ -1074,23 +1083,43 @@ boolean with_price;
|
|||||||
|
|
||||||
char *
|
char *
|
||||||
doname(obj)
|
doname(obj)
|
||||||
register struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
return doname_base(obj, FALSE);
|
return doname_base(obj, (unsigned) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Name of object including price. */
|
/* Name of object including price. */
|
||||||
char *
|
char *
|
||||||
doname_with_price(obj)
|
doname_with_price(obj)
|
||||||
register struct obj *obj;
|
struct obj *obj;
|
||||||
{
|
{
|
||||||
return doname_base(obj, TRUE);
|
return doname_base(obj, DONAME_WITH_PRICE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* "some" instead of precise quantity if obj->dknown not set */
|
||||||
|
char *
|
||||||
|
doname_vague_quan(obj)
|
||||||
|
struct obj *obj;
|
||||||
|
{
|
||||||
|
/* Used by farlook.
|
||||||
|
* If it hasn't been seen up close and quantity is more than one,
|
||||||
|
* use "some" instead of the quantity: "some gold pieces" rather
|
||||||
|
* than "25 gold pieces". This is suboptimal, to put it mildly,
|
||||||
|
* because lookhere and pickup report the precise amount.
|
||||||
|
* Picking the item up while blind also shows the precise amount
|
||||||
|
* for inventory display, then dropping it while still blind leaves
|
||||||
|
* obj->dknown unset so the count reverts to "some" for farlook.
|
||||||
|
*
|
||||||
|
* TODO: add obj->qknown flag for 'quantity known' on stackable
|
||||||
|
* items; it could overlay obj->cknown since no containers stack.
|
||||||
|
*/
|
||||||
|
return doname_base(obj, DONAME_VAGUE_QUAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* used from invent.c */
|
/* used from invent.c */
|
||||||
boolean
|
boolean
|
||||||
not_fully_identified(otmp)
|
not_fully_identified(otmp)
|
||||||
register struct obj *otmp;
|
struct obj *otmp;
|
||||||
{
|
{
|
||||||
/* gold doesn't have any interesting attributes [yet?] */
|
/* gold doesn't have any interesting attributes [yet?] */
|
||||||
if (otmp->oclass == COIN_CLASS)
|
if (otmp->oclass == COIN_CLASS)
|
||||||
@@ -3448,14 +3477,14 @@ typfnd:
|
|||||||
otmp->spe = 0; /* No spinach */
|
otmp->spe = 0; /* No spinach */
|
||||||
if (dead_species(mntmp, FALSE)) {
|
if (dead_species(mntmp, FALSE)) {
|
||||||
otmp->corpsenm = NON_PM; /* it's empty */
|
otmp->corpsenm = NON_PM; /* it's empty */
|
||||||
} else if (!(mons[mntmp].geno & G_UNIQ)
|
} else if ((!(mons[mntmp].geno & G_UNIQ) || wizard)
|
||||||
&& !(mvitals[mntmp].mvflags & G_NOCORPSE)
|
&& !(mvitals[mntmp].mvflags & G_NOCORPSE)
|
||||||
&& mons[mntmp].cnutrit != 0) {
|
&& mons[mntmp].cnutrit != 0) {
|
||||||
otmp->corpsenm = mntmp;
|
otmp->corpsenm = mntmp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CORPSE:
|
case CORPSE:
|
||||||
if (!(mons[mntmp].geno & G_UNIQ)
|
if ((!(mons[mntmp].geno & G_UNIQ) || wizard)
|
||||||
&& !(mvitals[mntmp].mvflags & G_NOCORPSE)) {
|
&& !(mvitals[mntmp].mvflags & G_NOCORPSE)) {
|
||||||
if (mons[mntmp].msound == MS_GUARDIAN)
|
if (mons[mntmp].msound == MS_GUARDIAN)
|
||||||
mntmp = genus(mntmp, 1);
|
mntmp = genus(mntmp, 1);
|
||||||
|
|||||||
+27
-21
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 options.c $NHDT-Date: 1461102048 2016/04/19 21:40:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.268 $ */
|
/* NetHack 3.6 options.c $NHDT-Date: 1470357737 2016/08/05 00:42:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.279 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -500,6 +500,7 @@ static boolean initial, from_file;
|
|||||||
STATIC_DCL void FDECL(nmcpy, (char *, const char *, int));
|
STATIC_DCL void FDECL(nmcpy, (char *, const char *, int));
|
||||||
STATIC_DCL void FDECL(escapes, (const char *, char *));
|
STATIC_DCL void FDECL(escapes, (const char *, char *));
|
||||||
STATIC_DCL void FDECL(rejectoption, (const char *));
|
STATIC_DCL void FDECL(rejectoption, (const char *));
|
||||||
|
STATIC_DCL void FDECL(badoptmsg, (const char *, const char *));
|
||||||
STATIC_DCL void FDECL(badoption, (const char *));
|
STATIC_DCL void FDECL(badoption, (const char *));
|
||||||
STATIC_DCL char *FDECL(string_for_opt, (char *, BOOLEAN_P));
|
STATIC_DCL char *FDECL(string_for_opt, (char *, BOOLEAN_P));
|
||||||
STATIC_DCL char *FDECL(string_for_env_opt, (const char *, char *, BOOLEAN_P));
|
STATIC_DCL char *FDECL(string_for_env_opt, (const char *, char *, BOOLEAN_P));
|
||||||
@@ -927,40 +928,43 @@ const char *optname;
|
|||||||
}
|
}
|
||||||
|
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
badoption(opts)
|
badoptmsg(opts, reason)
|
||||||
const char *opts;
|
const char *opts;
|
||||||
|
const char *reason; /* "Bad syntax" or "Missing value" */
|
||||||
{
|
{
|
||||||
|
const char *linesplit = "";
|
||||||
|
|
||||||
if (!initial) {
|
if (!initial) {
|
||||||
if (!strncmp(opts, "h", 1) || !strncmp(opts, "?", 1))
|
if (!strncmp(opts, "h", 1) || !strncmp(opts, "?", 1))
|
||||||
option_help();
|
option_help();
|
||||||
else
|
else
|
||||||
pline("Bad syntax: %s. Enter \"?g\" for help.", opts);
|
pline("%s: %s. Enter \"?g\" for help.", reason, opts);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
#ifdef MAC
|
#ifdef MAC
|
||||||
else
|
} else {
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
linesplit = "\n";
|
||||||
|
#endif
|
||||||
if (from_file)
|
if (from_file)
|
||||||
raw_printf("Bad syntax in OPTIONS in %s: %s%s.\n", configfile,
|
raw_printf("%s in OPTIONS in %s: %s%s.\n",
|
||||||
#ifdef WIN32
|
reason, configfile, linesplit, opts);
|
||||||
"\n",
|
|
||||||
#else
|
|
||||||
"",
|
|
||||||
#endif
|
|
||||||
opts);
|
|
||||||
else
|
else
|
||||||
raw_printf("Bad syntax in NETHACKOPTIONS: %s%s.\n",
|
raw_printf("%s in NETHACKOPTIONS: %s%s.\n",
|
||||||
#ifdef WIN32
|
reason, linesplit, opts);
|
||||||
"\n",
|
|
||||||
#else
|
|
||||||
"",
|
|
||||||
#endif
|
|
||||||
opts);
|
|
||||||
wait_synch();
|
wait_synch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC_OVL void
|
||||||
|
badoption(opts)
|
||||||
|
const char *opts;
|
||||||
|
{
|
||||||
|
badoptmsg(opts, "Bad syntax");
|
||||||
|
}
|
||||||
|
|
||||||
STATIC_OVL char *
|
STATIC_OVL char *
|
||||||
string_for_opt(opts, val_optional)
|
string_for_opt(opts, val_optional)
|
||||||
char *opts;
|
char *opts;
|
||||||
@@ -975,7 +979,7 @@ boolean val_optional;
|
|||||||
|
|
||||||
if (!colon || !*++colon) {
|
if (!colon || !*++colon) {
|
||||||
if (!val_optional)
|
if (!val_optional)
|
||||||
badoption(opts);
|
badoptmsg(opts, "Missing value");
|
||||||
return (char *) 0;
|
return (char *) 0;
|
||||||
}
|
}
|
||||||
return colon;
|
return colon;
|
||||||
@@ -2700,7 +2704,9 @@ boolean tinitial, tfrom_file;
|
|||||||
bad_negation(fullname, FALSE);
|
bad_negation(fullname, FALSE);
|
||||||
if (duplicate || negated)
|
if (duplicate || negated)
|
||||||
return;
|
return;
|
||||||
op = string_for_opt(opts, TRUE);
|
op = string_for_opt(opts, FALSE);
|
||||||
|
if (!op)
|
||||||
|
return;
|
||||||
if (!strncmpi(op, "normal", 6) || !strcmpi(op, "play")) {
|
if (!strncmpi(op, "normal", 6) || !strcmpi(op, "play")) {
|
||||||
wizard = discover = FALSE;
|
wizard = discover = FALSE;
|
||||||
} else if (!strncmpi(op, "explore", 6)
|
} else if (!strncmpi(op, "explore", 6)
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 pager.c $NHDT-Date: 1466638086 2016/06/22 23:28:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.111 $ */
|
/* NetHack 3.6 pager.c $NHDT-Date: 1471112245 2016/08/13 18:17:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.112 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -203,7 +203,7 @@ int x, y, glyph;
|
|||||||
|
|
||||||
if (otmp) {
|
if (otmp) {
|
||||||
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
|
Strcpy(buf, (otmp->otyp != STRANGE_OBJECT)
|
||||||
? distant_name(otmp, doname)
|
? distant_name(otmp, doname_vague_quan)
|
||||||
: obj_descr[STRANGE_OBJECT].oc_name);
|
: obj_descr[STRANGE_OBJECT].oc_name);
|
||||||
if (fakeobj)
|
if (fakeobj)
|
||||||
dealloc_obj(otmp), otmp = 0;
|
dealloc_obj(otmp), otmp = 0;
|
||||||
|
|||||||
+31
-17
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 pickup.c $NHDT-Date: 1461919368 2016/04/29 08:42:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.177 $ */
|
/* NetHack 3.6 pickup.c $NHDT-Date: 1470449858 2016/08/06 02:17:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.184 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ STATIC_DCL boolean FDECL(all_but_uchain, (struct obj *));
|
|||||||
#if 0 /* not used */
|
#if 0 /* not used */
|
||||||
STATIC_DCL boolean FDECL(allow_cat_no_uchain, (struct obj *));
|
STATIC_DCL boolean FDECL(allow_cat_no_uchain, (struct obj *));
|
||||||
#endif
|
#endif
|
||||||
STATIC_DCL boolean FDECL(autopick_testobj, (struct obj *));
|
STATIC_DCL boolean FDECL(autopick_testobj, (struct obj *, BOOLEAN_P));
|
||||||
STATIC_DCL int FDECL(autopick, (struct obj *, int, menu_item **));
|
STATIC_DCL int FDECL(autopick, (struct obj *, int, menu_item **));
|
||||||
STATIC_DCL int FDECL(count_categories, (struct obj *, int));
|
STATIC_DCL int FDECL(count_categories, (struct obj *, int));
|
||||||
STATIC_DCL long FDECL(carry_count, (struct obj *, struct obj *, long,
|
STATIC_DCL long FDECL(carry_count, (struct obj *, struct obj *, long,
|
||||||
@@ -685,30 +685,42 @@ boolean grab; /* forced pickup, rather than forced leave behind? */
|
|||||||
/*
|
/*
|
||||||
* Does the text description of this match an exception?
|
* Does the text description of this match an exception?
|
||||||
*/
|
*/
|
||||||
char *objdesc = makesingular(doname(obj));
|
|
||||||
struct autopickup_exception
|
struct autopickup_exception
|
||||||
*ape = (grab) ? iflags.autopickup_exceptions[AP_GRAB]
|
*ape = (grab) ? iflags.autopickup_exceptions[AP_GRAB]
|
||||||
: iflags.autopickup_exceptions[AP_LEAVE];
|
: iflags.autopickup_exceptions[AP_LEAVE];
|
||||||
|
|
||||||
while (ape) {
|
if (ape) {
|
||||||
if (regex_match(objdesc, ape->regex))
|
char *objdesc = makesingular(doname(obj));
|
||||||
return TRUE;
|
|
||||||
ape = ape->next;
|
while (ape) {
|
||||||
|
if (regex_match(objdesc, ape->regex))
|
||||||
|
return TRUE;
|
||||||
|
ape = ape->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean
|
STATIC_OVL boolean
|
||||||
autopick_testobj(otmp)
|
autopick_testobj(otmp, calc_costly)
|
||||||
struct obj *otmp;
|
struct obj *otmp;
|
||||||
|
boolean calc_costly;
|
||||||
{
|
{
|
||||||
|
static boolean costly = FALSE;
|
||||||
const char *otypes = flags.pickup_types;
|
const char *otypes = flags.pickup_types;
|
||||||
/* pick if in pickup_types and not unpaid item in shop */
|
boolean pickit;
|
||||||
boolean pickit = ((!*otypes || index(otypes, otmp->oclass))
|
|
||||||
&& !(otmp->where == OBJ_FLOOR
|
/* calculate 'costly' just once for a given autopickup operation */
|
||||||
&& !otmp->no_charge
|
if (calc_costly)
|
||||||
&& isok(otmp->ox, otmp->oy)
|
costly = (otmp->where == OBJ_FLOOR
|
||||||
&& costly_spot(otmp->ox, otmp->oy)));
|
&& costly_spot(otmp->ox, otmp->oy));
|
||||||
|
|
||||||
|
/* first check: reject if an unpaid item in a shop */
|
||||||
|
if (costly && !otmp->no_charge)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
/* check for pickup_types */
|
||||||
|
pickit = (!*otypes || index(otypes, otmp->oclass));
|
||||||
/* check for "always pick up */
|
/* check for "always pick up */
|
||||||
if (!pickit)
|
if (!pickit)
|
||||||
pickit = is_autopickup_exception(otmp, TRUE);
|
pickit = is_autopickup_exception(otmp, TRUE);
|
||||||
@@ -737,17 +749,19 @@ menu_item **pick_list; /* list of objects and counts to pick up */
|
|||||||
menu_item *pi; /* pick item */
|
menu_item *pi; /* pick item */
|
||||||
struct obj *curr;
|
struct obj *curr;
|
||||||
int n;
|
int n;
|
||||||
|
boolean check_costly = TRUE;
|
||||||
|
|
||||||
/* first count the number of eligible items */
|
/* first count the number of eligible items */
|
||||||
for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) {
|
for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) {
|
||||||
if (autopick_testobj(curr))
|
if (autopick_testobj(curr, check_costly))
|
||||||
++n;
|
++n;
|
||||||
|
check_costly = FALSE; /* only need to check once per autopickup */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
*pick_list = pi = (menu_item *) alloc(sizeof (menu_item) * n);
|
*pick_list = pi = (menu_item *) alloc(sizeof (menu_item) * n);
|
||||||
for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) {
|
for (n = 0, curr = olist; curr; curr = FOLLOW(curr, follow)) {
|
||||||
if (autopick_testobj(curr)) {
|
if (autopick_testobj(curr, FALSE)) {
|
||||||
pi[n].item.a_obj = curr;
|
pi[n].item.a_obj = curr;
|
||||||
pi[n].count = curr->quan;
|
pi[n].count = curr->quan;
|
||||||
n++;
|
n++;
|
||||||
|
|||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 uhitm.c $NHDT-Date: 1460103141 2016/04/08 08:12:21 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.156 $ */
|
/* NetHack 3.6 uhitm.c $NHDT-Date: 1470819843 2016/08/10 09:04:03 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.164 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -2537,12 +2537,12 @@ boolean wep_was_destroyed;
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
passive_obj(mon, obj, mattk)
|
passive_obj(mon, obj, mattk)
|
||||||
register struct monst *mon;
|
struct monst *mon;
|
||||||
register struct obj *obj; /* null means pick uwep, uswapwep or uarmg */
|
struct obj *obj; /* null means pick uwep, uswapwep or uarmg */
|
||||||
struct attack *mattk; /* null means we find one internally */
|
struct attack *mattk; /* null means we find one internally */
|
||||||
{
|
{
|
||||||
struct permonst *ptr = mon->data;
|
struct permonst *ptr = mon->data;
|
||||||
register int i;
|
int i;
|
||||||
|
|
||||||
/* if caller hasn't specified an object, use uwep, uswapwep or uarmg */
|
/* if caller hasn't specified an object, use uwep, uswapwep or uarmg */
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
@@ -2589,7 +2589,7 @@ struct attack *mattk; /* null means we find one internally */
|
|||||||
break;
|
break;
|
||||||
case AD_ENCH:
|
case AD_ENCH:
|
||||||
if (!mon->mcan) {
|
if (!mon->mcan) {
|
||||||
if (drain_item(obj) && carried(obj)
|
if (drain_item(obj, TRUE) && carried(obj)
|
||||||
&& (obj->known || obj->oclass == ARMOR_CLASS)) {
|
&& (obj->known || obj->oclass == ARMOR_CLASS)) {
|
||||||
pline("%s less effective.", Yobjnam2(obj, "seem"));
|
pline("%s less effective.", Yobjnam2(obj, "seem"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 zap.c $NHDT-Date: 1464163779 2016/05/25 08:09:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.258 $ */
|
/* NetHack 3.6 zap.c $NHDT-Date: 1470819844 2016/08/10 09:04:04 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.263 $ */
|
||||||
/* 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. */
|
||||||
|
|
||||||
@@ -1062,8 +1062,9 @@ register struct obj *obj;
|
|||||||
* possibly carried by you or a monster
|
* possibly carried by you or a monster
|
||||||
*/
|
*/
|
||||||
boolean
|
boolean
|
||||||
drain_item(obj)
|
drain_item(obj, by_you)
|
||||||
register struct obj *obj;
|
struct obj *obj;
|
||||||
|
boolean by_you;
|
||||||
{
|
{
|
||||||
boolean u_ring;
|
boolean u_ring;
|
||||||
|
|
||||||
@@ -1078,7 +1079,8 @@ register struct obj *obj;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/* Charge for the cost of the object */
|
/* Charge for the cost of the object */
|
||||||
costly_alteration(obj, COST_DRAIN);
|
if (by_you)
|
||||||
|
costly_alteration(obj, COST_DRAIN);
|
||||||
|
|
||||||
/* Drain the object and any implied effects */
|
/* Drain the object and any implied effects */
|
||||||
obj->spe--;
|
obj->spe--;
|
||||||
@@ -1110,6 +1112,10 @@ register struct obj *obj;
|
|||||||
if ((obj->owornmask & W_RING) && u_ring)
|
if ((obj->owornmask & W_RING) && u_ring)
|
||||||
u.udaminc--;
|
u.udaminc--;
|
||||||
break;
|
break;
|
||||||
|
case RIN_PROTECTION:
|
||||||
|
if (u_ring)
|
||||||
|
context.botl = 1; /* bot() will recalc u.uac */
|
||||||
|
break;
|
||||||
case HELM_OF_BRILLIANCE:
|
case HELM_OF_BRILLIANCE:
|
||||||
if ((obj->owornmask & W_ARMH) && (obj == uarmh)) {
|
if ((obj->owornmask & W_ARMH) && (obj == uarmh)) {
|
||||||
ABON(A_INT)--;
|
ABON(A_INT)--;
|
||||||
@@ -1123,10 +1129,11 @@ register struct obj *obj;
|
|||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RIN_PROTECTION:
|
default:
|
||||||
context.botl = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (context.botl)
|
||||||
|
bot();
|
||||||
if (carried(obj))
|
if (carried(obj))
|
||||||
update_inventory();
|
update_inventory();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -1935,7 +1942,7 @@ struct obj *obj, *otmp;
|
|||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case SPE_DRAIN_LIFE:
|
case SPE_DRAIN_LIFE:
|
||||||
(void) drain_item(obj);
|
(void) drain_item(obj, TRUE);
|
||||||
break;
|
break;
|
||||||
case WAN_TELEPORTATION:
|
case WAN_TELEPORTATION:
|
||||||
case SPE_TELEPORT_AWAY:
|
case SPE_TELEPORT_AWAY:
|
||||||
|
|||||||
+8
-3
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 tilemap.c $NHDT-Date: 1465163425 2016/06/05 21:50:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.30 $ */
|
/* NetHack 3.6 tilemap.c $NHDT-Date: 1470537037 2016/08/07 02:30:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.32 $ */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -464,8 +464,11 @@ FILE *ofp;
|
|||||||
fprintf(ofp, "%s\n", epilog[i]);
|
fprintf(ofp, "%s\n", epilog[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(ofp, "\nint total_tiles_used = %d;\n", start);
|
|
||||||
lastothtile = start - 1;
|
lastothtile = start - 1;
|
||||||
|
#ifdef STATUES_LOOK_LIKE_MONSTERS
|
||||||
|
start = laststatuetile + 1;
|
||||||
|
#endif
|
||||||
|
fprintf(ofp, "\nint total_tiles_used = %d;\n", start);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -500,7 +503,9 @@ main()
|
|||||||
fprintf(ofp, "\n#define MAXMONTILE %d\n", lastmontile);
|
fprintf(ofp, "\n#define MAXMONTILE %d\n", lastmontile);
|
||||||
fprintf(ofp, "#define MAXOBJTILE %d\n", lastobjtile);
|
fprintf(ofp, "#define MAXOBJTILE %d\n", lastobjtile);
|
||||||
fprintf(ofp, "#define MAXOTHTILE %d\n", lastothtile);
|
fprintf(ofp, "#define MAXOTHTILE %d\n", lastothtile);
|
||||||
|
#ifdef STATUES_LOOK_LIKE_MONSTERS
|
||||||
|
fprintf(ofp, "/* #define MAXSTATUETILE %d */\n", laststatuetile);
|
||||||
|
#endif
|
||||||
fprintf(ofp, "\n/*tile.c*/\n");
|
fprintf(ofp, "\n/*tile.c*/\n");
|
||||||
|
|
||||||
fclose(ofp);
|
fclose(ofp);
|
||||||
|
|||||||
Reference in New Issue
Block a user