Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2

This commit is contained in:
nhmall
2019-01-10 09:26:27 -05:00
15 changed files with 145 additions and 87 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.225 $ $NHDT-Date: 1546770987 2019/01/06 10:36:27 $
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.226 $ $NHDT-Date: 1547118629 2019/01/10 11:10:29 $
This fixes36.2 file is here to capture information about updates in the 3.6.x
lineage following the release of 3.6.1 in April 2018. Please note, however,
@@ -327,6 +327,8 @@ when ^T resorted to the teleport-away spell if hero didn't have intrinsic
than casting with 'Z'; ^T also required that the corresponding book
be known even though knowing and casting a spell should be (and is
with 'Z') possible after forgetting the spellbook due to amnesia
setting SEDUCE=0 made all succubus and incubus attacks be described as
smiling engagingly or seductively rather than hitting or missing
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
+4 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mondata.h $NHDT-Date: 1513297342 2017/12/15 00:22:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.33 $ */
/* NetHack 3.6 mondata.h $NHDT-Date: 1547086248 2019/01/10 02:10:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) 1989 Mike Threepoint */
/* NetHack may be freely redistributed. See license for details. */
@@ -127,9 +127,9 @@
#define is_longworm(ptr) \
(((ptr) == &mons[PM_BABY_LONG_WORM]) || ((ptr) == &mons[PM_LONG_WORM]) \
|| ((ptr) == &mons[PM_LONG_WORM_TAIL]))
#define is_covetous(ptr) ((ptr->mflags3 & M3_COVETOUS))
#define infravision(ptr) ((ptr->mflags3 & M3_INFRAVISION))
#define infravisible(ptr) ((ptr->mflags3 & M3_INFRAVISIBLE))
#define is_covetous(ptr) (((ptr)->mflags3 & M3_COVETOUS))
#define infravision(ptr) (((ptr)->mflags3 & M3_INFRAVISION))
#define infravisible(ptr) (((ptr)->mflags3 & M3_INFRAVISIBLE))
#define is_displacer(ptr) (((ptr)->mflags3 & M3_DISPLACES) != 0L)
#define is_mplayer(ptr) \
(((ptr) >= &mons[PM_ARCHEOLOGIST]) && ((ptr) <= &mons[PM_WIZARD]))
+31 -13
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 attrib.c $NHDT-Date: 1494034337 2017/05/06 01:32:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.62 $ */
/* NetHack 3.6 attrib.c $NHDT-Date: 1547086687 2019/01/10 02:18:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.64 $ */
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
@@ -115,7 +115,7 @@ adjattrib(ndx, incr, msgflg)
int ndx, incr;
int msgflg; /* positive => no message, zero => message, and */
{ /* negative => conditional (msg if change made) */
int old_acurr, old_abase;
int old_acurr, old_abase, old_amax, decr;
boolean abonflg;
const char *attrstr;
@@ -130,23 +130,38 @@ int msgflg; /* positive => no message, zero => message, and */
old_acurr = ACURR(ndx);
old_abase = ABASE(ndx);
old_amax = AMAX(ndx);
ABASE(ndx) += incr; /* when incr is negative, this reduces ABASE() */
if (incr > 0) {
ABASE(ndx) += incr;
if (ABASE(ndx) > AMAX(ndx)) {
incr = ABASE(ndx) - AMAX(ndx);
AMAX(ndx) += incr;
AMAX(ndx) = ABASE(ndx);
if (AMAX(ndx) > ATTRMAX(ndx))
AMAX(ndx) = ATTRMAX(ndx);
ABASE(ndx) = AMAX(ndx);
ABASE(ndx) = AMAX(ndx) = ATTRMAX(ndx);
}
attrstr = plusattr[ndx];
abonflg = (ABON(ndx) < 0);
} else {
ABASE(ndx) += incr;
} else { /* incr is negative */
if (ABASE(ndx) < ATTRMIN(ndx)) {
incr = ABASE(ndx) - ATTRMIN(ndx);
/*
* If base value has dropped so low that it is trying to be
* taken below the minimum, reduce max value (peak reached)
* instead. That means that restore ability and repeated
* applications of unicorn horn will not be able to recover
* all the lost value. Starting will 3.6.2, we only take away
* some (average half, possibly zero) of the excess from max
* instead of all of it, but without intervening recovery, it
* can still eventually drop to the minimum allowed. After
* that, it can't be recovered, only improved with new gains.
*
* This used to assign a new negative value to incr and then
* add it, but that could affect messages below, possibly
* making a large decrease be described as a small one.
*
* decr = rn2(-(ABASE - ATTRMIN) + 1);
*/
decr = rn2(ATTRMIN(ndx) - ABASE(ndx) + 1);
ABASE(ndx) = ATTRMIN(ndx);
AMAX(ndx) += incr;
AMAX(ndx) -= decr;
if (AMAX(ndx) < ATTRMIN(ndx))
AMAX(ndx) = ATTRMIN(ndx);
}
@@ -155,13 +170,16 @@ int msgflg; /* positive => no message, zero => message, and */
}
if (ACURR(ndx) == old_acurr) {
if (msgflg == 0 && flags.verbose) {
if (ABASE(ndx) == old_abase)
if (ABASE(ndx) == old_abase && AMAX(ndx) == old_amax) {
pline("You're %s as %s as you can get.",
abonflg ? "currently" : "already", attrstr);
else /* current stayed the same but base value changed */
} else {
/* current stayed the same but base value changed, or
base is at minimum and reduction caused max to drop */
Your("innate %s has %s.", attrname[ndx],
(incr > 0) ? "improved" : "declined");
}
}
return FALSE;
}
+4 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 do.c $NHDT-Date: 1545597418 2018/12/23 20:36:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.182 $ */
/* NetHack 3.6 do.c $NHDT-Date: 1547086513 2019/01/10 02:15:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.183 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1698,8 +1698,8 @@ struct obj *corpse;
where = corpse->where;
is_uwep = (corpse == uwep);
chewed = (corpse->oeaten != 0);
Strcpy(cname,
corpse_xname(corpse, chewed ? "bite-covered" : (const char *) 0,
Strcpy(cname, corpse_xname(corpse,
chewed ? "bite-covered" : (const char *) 0,
CXN_SINGULAR));
mcarry = (where == OBJ_MINVENT) ? corpse->ocarry : 0;
@@ -1707,8 +1707,7 @@ struct obj *corpse;
struct monst *mtmp2;
container = corpse->ocontainer;
mtmp2 =
get_container_location(container, &container_where, (int *) 0);
mtmp2 = get_container_location(container, &container_where, (int *) 0);
/* container_where is the outermost container's location even if
* nested */
if (container_where == OBJ_MINVENT && mtmp2)
+5 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 dokick.c $NHDT-Date: 1543185070 2018/11/25 22:31:10 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.128 $ */
/* NetHack 3.6 dokick.c $NHDT-Date: 1547086527 2019/01/10 02:15:27 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.129 $ */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1412,9 +1412,10 @@ xchar dlev; /* if !0 send to dlev near player */
obj_extract_self(obj);
if (costly) {
price += stolen_value(
obj, x, y, (costly_spot(u.ux, u.uy)
&& index(u.urooms, *in_rooms(x, y, SHOPBASE))),
price += stolen_value(obj, x, y,
(costly_spot(u.ux, u.uy)
&& index(u.urooms,
*in_rooms(x, y, SHOPBASE))),
TRUE);
/* set obj->no_charge to 0 */
if (Has_contents(obj))
+4 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 lock.c $NHDT-Date: 1544442712 2018/12/10 11:51:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.82 $ */
/* NetHack 3.6 lock.c $NHDT-Date: 1547086531 2019/01/10 02:15:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.83 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -195,12 +195,13 @@ boolean destroyit;
if (!rn2(3) || otmp->oclass == POTION_CLASS) {
chest_shatter_msg(otmp);
if (costly)
loss +=
stolen_value(otmp, u.ux, u.uy, peaceful_shk, TRUE);
loss += stolen_value(otmp, u.ux, u.uy, peaceful_shk, TRUE);
if (otmp->quan == 1L) {
obfree(otmp, (struct obj *) 0);
continue;
}
/* this works because we're sure to have at least 1 left;
otherwise it would fail since otmp is not in inventory */
useup(otmp);
}
if (box->otyp == ICE_BOX && otmp->otyp == CORPSE) {
+1 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitm.c $NHDT-Date: 1513297346 2017/12/15 00:22:26 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.99 $ */
/* NetHack 3.6 mhitm.c $NHDT-Date: 1547118629 2019/01/10 11:10:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.112 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
+30 -11
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mhitu.c $NHDT-Date: 1545130893 2018/12/18 11:01:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */
/* NetHack 3.6 mhitu.c $NHDT-Date: 1547118629 2019/01/10 11:10:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.161 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -268,6 +268,23 @@ struct attack *alt_attk_buf;
struct attack *attk = &mptr->mattk[indx];
struct obj *weap = (magr == &youmonst) ? uwep : MON_WEP(magr);
/* honor SEDUCE=0 */
if (!SYSOPT_SEDUCE) {
extern const struct attack sa_no[NATTK];
/* if the first attack is for SSEX damage, all six attacks will be
substituted (expected succubus/incubus handling); if it isn't
but another one is, only that other one will be substituted */
if (mptr->mattk[0].adtyp == AD_SSEX) {
*alt_attk_buf = sa_no[indx];
attk = alt_attk_buf;
} else if (attk->adtyp == AD_SSEX) {
*alt_attk_buf = *attk;
attk = alt_attk_buf;
attk->adtyp = AD_DRLI;
}
}
/* prevent a monster with two consecutive disease or hunger attacks
from hitting with both of them on the same turn; if the first has
already hit, switch to a stun attack for the second */
@@ -1326,7 +1343,10 @@ register struct attack *mattk;
break;
/* Continue below */
} else if (dmgtype(youmonst.data, AD_SEDU)
|| (SYSOPT_SEDUCE && dmgtype(youmonst.data, AD_SSEX))) {
/* !SYSOPT_SEDUCE: when hero is attacking and AD_SSEX
is disabled, it would be changed to another damage
type, but when defending, it remains as-is */
|| dmgtype(youmonst.data, AD_SSEX)) {
pline("%s %s.", Monnam(mtmp),
Deaf ? "says something but you can't hear it"
: mtmp->minvent
@@ -2328,6 +2348,7 @@ struct attack *mattk;
struct permonst *pagr;
boolean agrinvis, defperc;
xchar genagr, gendef;
int adtyp = mattk ? mattk->adtyp : AD_PHYS;
if (is_animal(magr->data))
return 0;
@@ -2347,20 +2368,18 @@ struct attack *mattk;
defperc = perceives(mdef->data);
gendef = gender(mdef);
}
if (adtyp == AD_SSEX && !SYSOPT_SEDUCE)
adtyp = AD_SEDU;
if (agrinvis && !defperc
&& (!SYSOPT_SEDUCE || (mattk && mattk->adtyp != AD_SSEX)))
if (agrinvis && !defperc && adtyp == AD_SEDU)
return 0;
if (pagr->mlet != S_NYMPH
&& ((pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
|| (SYSOPT_SEDUCE && mattk && mattk->adtyp != AD_SSEX)))
if ((pagr->mlet != S_NYMPH
&& pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
|| (adtyp != AD_SEDU && adtyp != AD_SSEX))
return 0;
if (genagr == 1 - gendef)
return 1;
else
return (pagr->mlet == S_NYMPH) ? 2 : 0;
return (genagr == 1 - gendef) ? 1 : (pagr->mlet == S_NYMPH) ? 2 : 0;
}
/* returns 1 if monster teleported (or hero leaves monster's vicinity) */
+1 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mkobj.c $NHDT-Date: 1546837153 2019/01/07 04:59:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.140 $ */
/* NetHack 3.6 mkobj.c $NHDT-Date: 1547086532 2019/01/10 02:15:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.141 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
+3 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 monst.c $NHDT-Date: 1539804880 2018/10/17 19:34:40 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.61 $ */
/* NetHack 3.6 monst.c $NHDT-Date: 1547118631 2019/01/10 11:10:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.62 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3235,8 +3235,8 @@ monst_init()
return;
}
struct attack sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
struct attack sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
const struct attack sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
const struct attack sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
#endif
/*monst.c*/
+3 -2
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 polyself.c $NHDT-Date: 1520797126 2018/03/11 19:38:46 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.117 $ */
/* NetHack 3.6 polyself.c $NHDT-Date: 1547086249 2019/01/10 02:10:49 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.125 $ */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -81,7 +81,8 @@ set_uasmon()
PROPSET(HALLUC_RES, dmgtype(mdat, AD_HALU));
PROPSET(SEE_INVIS, perceives(mdat));
PROPSET(TELEPAT, telepathic(mdat));
PROPSET(INFRAVISION, infravision(mdat));
/* note that Infravision uses mons[race] rather than usual mons[role] */
PROPSET(INFRAVISION, infravision(Upolyd ? mdat : &mons[urace.malenum]));
PROPSET(INVIS, pm_invisible(mdat));
PROPSET(TELEPORT, can_teleport(mdat));
PROPSET(TELEPORT_CONTROL, control_teleport(mdat));
+5 -4
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 potion.c $NHDT-Date: 1545597429 2018/12/23 20:37:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.157 $ */
/* NetHack 3.6 potion.c $NHDT-Date: 1547086533 2019/01/10 02:15:33 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.158 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2234,9 +2234,10 @@ more_dips:
}
}
obj_extract_self(singlepotion);
singlepotion =
hold_another_object(singlepotion, "You juggle and drop %s!",
doname(singlepotion), (const char *) 0);
singlepotion = hold_another_object(singlepotion,
"You juggle and drop %s!",
doname(singlepotion),
(const char *) 0);
nhUse(singlepotion);
update_inventory();
return 1;
+10 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 role.c $NHDT-Date: 1546137492 2018/12/30 02:38:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.55 $ */
/* NetHack 3.6 role.c $NHDT-Date: 1547086250 2019/01/10 02:10:50 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2098,6 +2098,14 @@ role_init()
/* 0 or 1; no gods are neuter, nor is gender randomized */
quest_status.godgend = !strcmpi(align_gtitle(alignmnt), "goddess");
#if 0
/*
* Disable this fixup so that mons[] can be const. The only
* place where it actually matters for the hero is in set_uasmon()
* and that can use mons[race] rather than mons[role] for this
* particular property. Despite the comment, it is checked--where
* needed--via instrinsic 'Infravision' which set_uasmon() manages.
*/
/* Fix up infravision */
if (mons[urace.malenum].mflags3 & M3_INFRAVISION) {
/* although an infravision intrinsic is possible, infravision
@@ -2113,6 +2121,7 @@ role_init()
if (urole.femalenum != NON_PM)
mons[urole.femalenum].mflags3 |= M3_INFRAVISION;
}
#endif /*0*/
/* Artifacts are fixed in hack_artifacts() */
+10 -3
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 sys.c $NHDT-Date: 1448241785 2015/11/23 01:23:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */
/* NetHack 3.6 sys.c $NHDT-Date: 1547118632 2019/01/10 11:10:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.43 $ */
/* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -120,13 +120,17 @@ sysopt_release()
return;
}
extern struct attack sa_yes[NATTK];
extern struct attack sa_no[NATTK];
extern const struct attack sa_yes[NATTK];
extern const struct attack sa_no[NATTK];
void
sysopt_seduce_set(val)
int val;
{
#if 0
/*
* Attack substitution is now done on the fly in getmattk(mhitu.c).
*/
struct attack *setval = val ? sa_yes : sa_no;
int x;
@@ -134,6 +138,9 @@ int val;
mons[PM_INCUBUS].mattk[x] = setval[x];
mons[PM_SUCCUBUS].mattk[x] = setval[x];
}
#else
nhUse(val);
#endif /*0*/
return;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 uhitm.c $NHDT-Date: 1545597432 2018/12/23 20:37:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.197 $ */
/* NetHack 3.6 uhitm.c $NHDT-Date: 1547118630 2019/01/10 11:10:30 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.198 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */