Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-02-19 07:48:19 -05:00
14 changed files with 76 additions and 77 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1545439153 2018/12/22 00:39:13 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */
/* NetHack 3.6 makemon.c $NHDT-Date: 1550524560 2019/02/18 21:16:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1200,7 +1200,7 @@ int mmflags;
mtmp->m_id = g.context.ident++;
if (!mtmp->m_id)
mtmp->m_id = g.context.ident++; /* ident overflowed */
set_mon_data(mtmp, ptr, 0);
set_mon_data(mtmp, ptr); /* mtmp->data = ptr; */
if (ptr->msound == MS_LEADER && quest_info(MS_LEADER) == mndx)
g.quest_status.leader_m_id = mtmp->m_id;
mtmp->mnum = mndx;
@@ -1860,7 +1860,7 @@ struct monst *mtmp, *victim;
pline("As %s grows up into %s, %s %s!", mon_nam(mtmp),
an(ptr->mname), mhe(mtmp),
nonliving(ptr) ? "expires" : "dies");
set_mon_data(mtmp, ptr, -1); /* keep g.mvitals[] accurate */
set_mon_data(mtmp, ptr); /* keep g.mvitals[] accurate */
mondied(mtmp);
return (struct permonst *) 0;
} else if (canspotmon(mtmp)) {
@@ -1883,7 +1883,7 @@ struct monst *mtmp, *victim;
: "grows up into",
an(buf));
}
set_mon_data(mtmp, ptr, 1); /* preserve intrinsics */
set_mon_data(mtmp, ptr);
newsym(mtmp->mx, mtmp->my); /* color may change */
lev_limit = (int) mtmp->m_lev; /* never undo increment */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mon.c $NHDT-Date: 1548937318 2019/01/31 12:21:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.278 $ */
/* NetHack 3.6 mon.c $NHDT-Date: 1550524562 2019/02/18 21:16:02 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.279 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1989,14 +1989,14 @@ register struct monst *mtmp;
mptr = mtmp->data; /* save this for m_detach() */
/* restore chameleon, lycanthropes to true form at death */
if (mtmp->cham >= LOW_PM) {
set_mon_data(mtmp, &mons[mtmp->cham], -1);
set_mon_data(mtmp, &mons[mtmp->cham]);
mtmp->cham = NON_PM;
} else if (mtmp->data == &mons[PM_WEREJACKAL])
set_mon_data(mtmp, &mons[PM_HUMAN_WEREJACKAL], -1);
set_mon_data(mtmp, &mons[PM_HUMAN_WEREJACKAL]);
else if (mtmp->data == &mons[PM_WEREWOLF])
set_mon_data(mtmp, &mons[PM_HUMAN_WEREWOLF], -1);
set_mon_data(mtmp, &mons[PM_HUMAN_WEREWOLF]);
else if (mtmp->data == &mons[PM_WERERAT])
set_mon_data(mtmp, &mons[PM_HUMAN_WERERAT], -1);
set_mon_data(mtmp, &mons[PM_HUMAN_WERERAT]);
/*
* g.mvitals[].died does double duty as total number of dead monsters
@@ -3568,7 +3568,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
mtmp->mhp = 1;
/* take on the new form... */
set_mon_data(mtmp, mdat, 0);
set_mon_data(mtmp, mdat);
if (emits_light(olddata) != emits_light(mtmp->data)) {
/* used to give light, now doesn't, or vice versa,

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mondata.c $NHDT-Date: 1546465283 2019/01/02 21:41:23 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.70 $ */
/* NetHack 3.6 mondata.c $NHDT-Date: 1550525093 2019/02/18 21:24:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.72 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -10,30 +10,30 @@
/* set up an individual monster's base type (initial creation, shapechange) */
void
set_mon_data(mon, ptr, flag)
set_mon_data(mon, ptr)
struct monst *mon;
struct permonst *ptr;
int flag;
{
int new_speed, old_speed = mon->data ? mon->data->mmove : 0;
mon->data = ptr;
mon->mnum = (short) monsndx(ptr);
if (flag == -1)
return; /* "don't care" */
if (flag == 1)
mon->mintrinsics |= (ptr->mresists & 0x00FF);
else
mon->mintrinsics = (ptr->mresists & 0x00FF);
if (mon->movement) { /* same adjustment as poly'd hero undergoes */
if (mon->movement) { /* used to adjust poly'd hero as well as monsters */
new_speed = ptr->mmove;
/* prorate unused movement if new form is slower so that
it doesn't get extra moves leftover from previous form;
if new form is faster, leave unused movement as is */
if (new_speed < old_speed)
mon->movement = new_speed * mon->movement / old_speed;
if (new_speed < old_speed) {
/*
* Some static analysis warns that this might divide by 0
mon->movement = new_speed * mon->movement / old_speed;
* so add a redundant test to suppress that.
*/
mon->movement *= new_speed;
if (old_speed > 0) /* old > new and new >= 0, so always True */
mon->movement /= old_speed;
}
}
return;
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 mplayer.c $NHDT-Date: 1545964576 2018/12/28 02:36:16 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.25 $ */
/* NetHack 3.6 mplayer.c $NHDT-Date: 1550524564 2019/02/18 21:16:04 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.26 $ */
/* Copyright (c) Izchak Miller, 1992. */
/* NetHack may be freely redistributed. See license for details. */
@@ -341,7 +341,7 @@ boolean special;
/* roll for character class */
pm = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST);
set_mon_data(&fakemon, &mons[pm], -1);
set_mon_data(&fakemon, &mons[pm]);
/* roll for an available location */
do {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 polyself.c $NHDT-Date: 1548208238 2019/01/23 01:50:38 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.126 $ */
/* NetHack 3.6 polyself.c $NHDT-Date: 1550525094 2019/02/18 21:24:54 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.128 $ */
/* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
/* NetHack may be freely redistributed. See license for details. */
@@ -37,9 +37,8 @@ void
set_uasmon()
{
struct permonst *mdat = &mons[u.umonnum];
int new_speed, old_speed = g.youmonst.data ? g.youmonst.data->mmove : 0;
set_mon_data(&g.youmonst, mdat, 0);
set_mon_data(&g.youmonst, mdat);
#define PROPSET(PropIndx, ON) \
do { \
@@ -97,15 +96,6 @@ set_uasmon()
float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
polysense();
if (g.youmonst.movement) {
new_speed = mdat->mmove;
/* prorate unused movement if new form is slower so that
it doesn't get extra moves leftover from previous form;
if new form is faster, leave unused movement as is */
if (new_speed < old_speed)
g.youmonst.movement = new_speed * g.youmonst.movement / old_speed;
}
#ifdef STATUS_HILITES
status_initialize(REASSESS_ONLY);
#endif

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1545946257 2018/12/27 21:30:57 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.109 $ */
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1550524566 2019/02/18 21:16:06 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -1733,7 +1733,7 @@ struct mkroom *croom;
struct permonst *olddata = mtmp->data;
mgender_from_permonst(mtmp, mdat);
set_mon_data(mtmp, mdat, 0);
set_mon_data(mtmp, mdat);
if (emits_light(olddata) != emits_light(mtmp->data)) {
/* used to give light, now doesn't, or vice versa,
or light's range has changed */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1549157815 2019/02/03 01:36:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.84 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1550524567 2019/02/18 21:16:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.85 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -127,7 +127,7 @@ unsigned entflags;
mdat = &mons[u.umonster];
}
fakemon = cg.zeromonst;
set_mon_data(&fakemon, mdat, -1); /* set up for goodpos */
set_mon_data(&fakemon, mdat); /* set up for goodpos */
good_ptr = good;
range = 1;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 were.c $NHDT-Date: 1505214877 2017/09/12 11:14:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.21 $ */
/* NetHack 3.6 were.c $NHDT-Date: 1550524568 2019/02/18 21:16:08 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.23 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -107,7 +107,7 @@ register struct monst *mon;
pline("%s changes into a %s.", Monnam(mon),
is_human(&mons[pm]) ? "human" : mons[pm].mname + 4);
set_mon_data(mon, &mons[pm], 0);
set_mon_data(mon, &mons[pm]);
if (mon->msleeping || !mon->mcanmove) {
/* transformation wakens and/or revitalizes */
mon->msleeping = 0;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 worn.c $NHDT-Date: 1537234121 2018/09/18 01:28:41 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.55 $ */
/* NetHack 3.6 worn.c $NHDT-Date: 1550524569 2019/02/18 21:16:09 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.56 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -317,7 +317,8 @@ struct obj *obj; /* item to make known if effect can be seen */
}
}
/* armor put on or taken off; might be magical variety */
/* armor put on or taken off; might be magical variety
[TODO: rename to 'update_mon_extrinsics()' and change all callers...] */
void
update_mon_intrinsics(mon, obj, on, silently)
struct monst *mon;
@@ -369,7 +370,7 @@ boolean on, silently;
if (which <= 8) { /* 1 thru 8 correspond to MR_xxx mask values */
/* FIRE,COLD,SLEEP,DISINT,SHOCK,POISON,ACID,STONE */
mask = (uchar) (1 << (which - 1));
mon->mintrinsics |= (unsigned short) mask;
mon->mextrinsics |= (unsigned short) mask;
}
break;
}
@@ -395,25 +396,22 @@ boolean on, silently;
case ACID_RES:
case STONE_RES:
mask = (uchar) (1 << (which - 1));
/* If the monster doesn't have this resistance intrinsically,
check whether any other worn item confers it. Note that
we don't currently check for anything conferred via simply
carrying an object. */
if (!(mon->data->mresists & mask)) {
for (otmp = mon->minvent; otmp; otmp = otmp->nobj)
if (otmp->owornmask
&& (int) objects[otmp->otyp].oc_oprop == which)
break;
if (!otmp)
mon->mintrinsics &= ~((unsigned short) mask);
}
/* update monster's extrinsics (for worn objects only;
'obj' itself might still be worn or already unworn) */
for (otmp = mon->minvent; otmp; otmp = otmp->nobj)
if (otmp != obj
&& otmp->owornmask
&& (int) objects[otmp->otyp].oc_oprop == which)
break;
if (!otmp)
mon->mextrinsics &= ~((unsigned short) mask);
break;
default:
break;
}
}
maybe_blocks:
maybe_blocks:
/* obj->owornmask has been cleared by this point, so we can't use it.
However, since monsters don't wield armor, we don't have to guard
against that and can get away with a blanket worn-mask value. */