Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.257 $ $NHDT-Date: 1550014802 2019/02/12 23:40:02 $
|
||||
$NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.258 $ $NHDT-Date: 1550532194 2019/02/18 23:23:14 $
|
||||
|
||||
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,
|
||||
@@ -371,6 +371,8 @@ DUMPLOG: output from '/' (#whatis) and ';' went into ^P message recall history
|
||||
when donning armor, defer flagging its +/- value--which can be deduced from
|
||||
the status line--as known until finished in case it gets stolen before
|
||||
then (player might still deduce the +/- value but hero won't learn it)
|
||||
a monster with resistances supplied by worn armor would lose them if that
|
||||
monster went through a shape change even if the armor stayed worn
|
||||
|
||||
|
||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1549921169 2019/02/11 21:39:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.693 $ */
|
||||
/* NetHack 3.6 extern.h $NHDT-Date: 1550524545 2019/02/18 21:15:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.694 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -1439,7 +1439,7 @@ E void NDECL(monst_globals_init);
|
||||
|
||||
/* ### mondata.c ### */
|
||||
|
||||
E void FDECL(set_mon_data, (struct monst *, struct permonst *, int));
|
||||
E void FDECL(set_mon_data, (struct monst *, struct permonst *));
|
||||
E struct attack *FDECL(attacktype_fordmg, (struct permonst *, int, int));
|
||||
E boolean FDECL(attacktype, (struct permonst *, int));
|
||||
E boolean FDECL(noattacks, (struct permonst *));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mondata.h $NHDT-Date: 1548209737 2019/01/23 02:15:37 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.36 $ */
|
||||
/* NetHack 3.6 mondata.h $NHDT-Date: 1550524558 2019/02/18 21:15:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.37 $ */
|
||||
/* Copyright (c) 1989 Mike Threepoint */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -10,14 +10,22 @@
|
||||
|
||||
#define pm_resistance(ptr, typ) (((ptr)->mresists & (typ)) != 0)
|
||||
|
||||
#define resists_fire(mon) (((mon)->mintrinsics & MR_FIRE) != 0)
|
||||
#define resists_cold(mon) (((mon)->mintrinsics & MR_COLD) != 0)
|
||||
#define resists_sleep(mon) (((mon)->mintrinsics & MR_SLEEP) != 0)
|
||||
#define resists_disint(mon) (((mon)->mintrinsics & MR_DISINT) != 0)
|
||||
#define resists_elec(mon) (((mon)->mintrinsics & MR_ELEC) != 0)
|
||||
#define resists_poison(mon) (((mon)->mintrinsics & MR_POISON) != 0)
|
||||
#define resists_acid(mon) (((mon)->mintrinsics & MR_ACID) != 0)
|
||||
#define resists_ston(mon) (((mon)->mintrinsics & MR_STONE) != 0)
|
||||
#define resists_fire(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_FIRE) != 0)
|
||||
#define resists_cold(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_COLD) != 0)
|
||||
#define resists_sleep(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_SLEEP) != 0)
|
||||
#define resists_disint(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_DISINT) != 0)
|
||||
#define resists_elec(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_ELEC) != 0)
|
||||
#define resists_poison(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_POISON) != 0)
|
||||
#define resists_acid(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_ACID) != 0)
|
||||
#define resists_ston(mon) \
|
||||
((((mon)->data->mresists | (mon)->mextrinsics) & MR_STONE) != 0)
|
||||
|
||||
#define is_lminion(mon) \
|
||||
(is_minion((mon)->data) && mon_aligntyp(mon) == A_LAWFUL)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 monst.h $NHDT-Date: 1547428769 2019/01/14 01:19:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.27 $ */
|
||||
/* NetHack 3.6 monst.h $NHDT-Date: 1550524559 2019/02/18 21:15:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.28 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2016. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -70,7 +70,7 @@ struct monst {
|
||||
uchar m_ap_type; /* what mappearance is describing, m_ap_types */
|
||||
|
||||
schar mtame; /* level of tameness, implies peaceful */
|
||||
unsigned short mintrinsics; /* low 8 correspond to mresists */
|
||||
unsigned short mextrinsics; /* low 8 correspond to mresists */
|
||||
int mspec_used; /* monster's special ability attack timeout */
|
||||
|
||||
Bitfield(female, 1); /* is female */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 unixconf.h $NHDT-Date: 1548372343 2019/01/24 23:25:43 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.33 $ */
|
||||
/* NetHack 3.6 unixconf.h $NHDT-Date: 1550532737 2019/02/18 23:32:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Pasi Kallinen, 2018. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -350,7 +350,7 @@
|
||||
/* the high quality random number routines */
|
||||
#ifndef USE_ISAAC64
|
||||
# if defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) \
|
||||
|| defined(RANDOM) || defined(__APPLE__)
|
||||
|| defined(RANDOM) || defined(MACOSX)
|
||||
# define Rand() random()
|
||||
# else
|
||||
# define Rand() lrand48()
|
||||
@@ -407,7 +407,7 @@
|
||||
#endif /* LINUX */
|
||||
#endif /* GNOME_GRAPHICS */
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef MACOSX
|
||||
# define RUNTIME_PASTEBUF_SUPPORT
|
||||
#endif
|
||||
|
||||
@@ -415,11 +415,12 @@
|
||||
* /dev/random is blocking on Linux, so there we default to /dev/urandom which
|
||||
* should still be good enough.
|
||||
* BSD systems usually have /dev/random that is supposed to be used.
|
||||
* OSX is based on NetBSD kernel and has both /dev/random and /dev/urandom.
|
||||
*/
|
||||
#ifdef LINUX
|
||||
# define DEV_RANDOM "/dev/urandom"
|
||||
#else
|
||||
# ifdef BSD
|
||||
# if defined(BSD) || defined(MACOSX)
|
||||
# define DEV_RANDOM "/dev/random"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -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 */
|
||||
|
||||
|
||||
12
src/mon.c
12
src/mon.c
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
30
src/worn.c
30
src/worn.c
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user