Merge branch 'NetHack-3.6'

This commit is contained in:
nhmall
2019-10-08 20:27:39 -04:00
11 changed files with 41 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 ball.c $NHDT-Date: 1559601027 2019/06/03 22:30:27 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.40 $ */
/* NetHack 3.6 ball.c $NHDT-Date: 1570566373 2019/10/08 20:26:13 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.43 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) David Cohrs, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1074,7 +1074,7 @@ bc_sanity_check()
&& uball->where != OBJ_FREE)
|| (freeball ^ freechain)
|| (uball->owornmask & W_BALL) == 0L
|| (uball->owornmask & ~(W_BALL | W_WEAPON)) != 0L)) {
|| (uball->owornmask & ~(W_BALL | W_WEAPONS)) != 0L)) {
otyp = uball->otyp;
onam = safe_typename(otyp);
impossible("uball: type %d (%s), where %d, wornmask=0x%08lx",

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do_wear.c $NHDT-Date: 1559670603 2019/06/04 17:50:03 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.109 $ */
/* NetHack 3.6 do_wear.c $NHDT-Date: 1570566377 2019/10/08 20:26:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.111 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1097,7 +1097,7 @@ struct obj *otmp;
boolean already_blind = Blind, changed = FALSE;
/* blindfold might be wielded; release it for wearing */
if (otmp->owornmask & W_WEAPON)
if (otmp->owornmask & W_WEAPONS)
remove_worn_item(otmp, FALSE);
setworn(otmp, W_TOOL);
on_msg(otmp);
@@ -1915,7 +1915,7 @@ struct obj *obj;
/* if the armor is wielded, release it for wearing (won't be
welded even if cursed; that only happens for weapons/weptools) */
if (obj->owornmask & W_WEAPON)
if (obj->owornmask & W_WEAPONS)
remove_worn_item(obj, FALSE);
/*
* Setting obj->known=1 is done because setworn() causes hero's AC
@@ -2541,7 +2541,7 @@ doddoremarm()
possibly combined with weapons */
(void) strncpy(g.context.takeoff.disrobing, "disrobing", CONTEXTVERBSZ);
/* specific activity when handling weapons only */
if (!(g.context.takeoff.mask & ~W_WEAPON))
if (!(g.context.takeoff.mask & ~W_WEAPONS))
(void) strncpy(g.context.takeoff.disrobing, "disarming",
CONTEXTVERBSZ);
(void) take_off();

View File

@@ -621,6 +621,13 @@ struct obj *obj; /* only scatter this obj */
obj->ox, obj->oy, sx, sy);
while ((otmp = (individual_object ? obj : g.level.objects[sx][sy])) != 0) {
if (otmp == uball || otmp == uchain) {
boolean waschain = (otmp == uchain);
pline_The("chain shatters!");
unpunish();
if (waschain)
continue;
}
if (otmp->quan > 1L) {
qtmp = otmp->quan - 1L;
if (qtmp > LARGEST_INT)

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 invent.c $NHDT-Date: 1570232224 2019/10/04 23:37:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.263 $ */
/* NetHack 3.6 invent.c $NHDT-Date: 1570566378 2019/10/08 20:26:18 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.264 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1884,7 +1884,7 @@ boolean
is_worn(otmp)
struct obj *otmp;
{
return (otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE | W_WEAPON))
return (otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE | W_WEAPONS))
? TRUE
: FALSE;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1561236435 2019/06/22 20:47:15 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.138 $ */
/* NetHack 3.6 makemon.c $NHDT-Date: 1570569787 2019/10/08 21:23:07 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.140 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -166,7 +166,7 @@ register struct monst *mtmp;
register struct permonst *ptr = mtmp->data;
register int mm = monsndx(ptr);
struct obj *otmp;
int bias, spe2, w1, w2;
int bias, w1, w2;
if (Is_rogue_level(&u.uz))
return;
@@ -259,12 +259,10 @@ register struct monst *mtmp;
} else if (ptr->msound == MS_PRIEST
|| quest_mon_represents_role(ptr, PM_PRIEST)) {
otmp = mksobj(MACE, FALSE, FALSE);
if (otmp) {
otmp->spe = rnd(3);
if (!rn2(2))
curse(otmp);
(void) mpickobj(mtmp, otmp);
}
otmp->spe = rnd(3);
if (!rn2(2))
curse(otmp);
(void) mpickobj(mtmp, otmp);
} else if (mm == PM_NINJA) { /* extra quest villains */
(void) mongets(mtmp, rn2(4) ? SHURIKEN : DART);
(void) mongets(mtmp, rn2(4) ? SHORT_SWORD : AXE);
@@ -336,14 +334,13 @@ register struct monst *mtmp;
artiname(rn2(2) ? ART_DEMONBANE : ART_SUNSWORD));
bless(otmp);
otmp->oerodeproof = TRUE;
spe2 = rn2(4);
otmp->spe = max(otmp->spe, spe2);
otmp->spe = rn2(4);
(void) mpickobj(mtmp, otmp);
otmp = mksobj(!rn2(4) || is_lord(ptr) ? SHIELD_OF_REFLECTION
: LARGE_SHIELD,
FALSE, FALSE);
otmp->cursed = FALSE;
/* uncurse(otmp); -- mksobj(,FALSE,) item is always uncursed */
otmp->oerodeproof = TRUE;
otmp->spe = 0;
(void) mpickobj(mtmp, otmp);

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1561588627 2019/06/26 22:37:07 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.151 $ */
/* NetHack 3.6 mkobj.c $NHDT-Date: 1570569798 2019/10/08 21:23:18 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.153 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1064,6 +1064,7 @@ boolean artif;
default:
impossible("impossible mkobj %d, sym '%c'.", otmp->otyp,
objects[otmp->otyp].oc_class);
dealloc_obj(otmp); /* free() would suffice here */
return (struct obj *) 0;
}
}
@@ -2572,7 +2573,7 @@ struct obj *obj;
}
if (n == 2 && carried(obj)
&& obj == uball && (owornmask & W_BALL) != 0L
&& (owornmask & W_WEAPON) != 0L) {
&& (owornmask & W_WEAPONS) != 0L) {
/* chained ball can be wielded/alt-wielded/quivered; if so,
pretend it's not chained in order to check the weapon pointer
(we've already verified the ball pointer by successfully passing
@@ -2681,7 +2682,7 @@ struct obj *obj;
becoming embedded in poly'd hero's skin */
if (embedded && !Is_dragon_scales(obj))
what = "skin";
} else if (owornmask & W_WEAPON) {
} else if (owornmask & W_WEAPONS) {
/* monsters don't maintain alternate weapon or quiver */
if (mcarried(obj) && (owornmask & (W_SWAPWEP | W_QUIVER)) != 0L)
what = (owornmask & W_SWAPWEP) != 0L ? "monst alt weapon?"

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pickup.c $NHDT-Date: 1570142736 2019/10/03 22:45:36 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.234 $ */
/* NetHack 3.6 pickup.c $NHDT-Date: 1570566381 2019/10/08 20:26:21 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.235 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1194,7 +1194,8 @@ int qflags;
for (curr = olist; curr; curr = FOLLOW(curr, qflags)) {
if (curr->oclass == *pack) {
if ((qflags & WORN_TYPES)
&& !(curr->owornmask & (W_ARMOR | W_ACCESSORY | W_WEAPON)))
&& !(curr->owornmask & (W_ARMOR | W_ACCESSORY
| W_WEAPONS)))
continue;
if (!counted_category) {
ccount++;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 steal.c $NHDT-Date: 1562806584 2019/07/11 00:56:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.74 $ */
/* NetHack 3.6 steal.c $NHDT-Date: 1570566382 2019/10/08 20:26:22 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.75 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -218,7 +218,7 @@ boolean unchain_ball; /* whether to unpunish or just unwield */
Ring_gone(obj);
} else if (obj->owornmask & W_TOOL) {
Blindf_off(obj);
} else if (obj->owornmask & W_WEAPON) {
} else if (obj->owornmask & W_WEAPONS) {
if (obj == uwep)
uwepgone();
if (obj == uswapwep)