Deprecate "makedefs -m".
mons[].difficulty takes over for monstr[] Invoking "makedefs -m" gives a deprecation message; it is also included in the (now mostly empty) monstr.c. Ports should now remove "makedefs -m" from their build procedures but this commit does not include that change.
This commit is contained in:
18
src/muse.c
18
src/muse.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 muse.c $NHDT-Date: 1505181522 2017/09/12 01:58:42 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.80 $ */
|
||||
/* NetHack 3.6 muse.c $NHDT-Date: 1539804880 2018/10/17 19:34:40 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.85 $ */
|
||||
/* Copyright (C) 1990 by Ken Arromdee */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include "hack.h"
|
||||
|
||||
extern const int monstr[];
|
||||
|
||||
boolean m_using = FALSE;
|
||||
|
||||
/* Let monsters use magic items. Arbitrary assumptions: Monsters only use
|
||||
@@ -991,7 +989,7 @@ rnd_defensive_item(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
struct permonst *pm = mtmp->data;
|
||||
int difficulty = monstr[(monsndx(pm))];
|
||||
int difficulty = mons[(monsndx(pm))].difficulty;
|
||||
int trycnt = 0;
|
||||
|
||||
if (is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data)
|
||||
@@ -1556,7 +1554,7 @@ rnd_offensive_item(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
struct permonst *pm = mtmp->data;
|
||||
int difficulty = monstr[(monsndx(pm))];
|
||||
int difficulty = mons[(monsndx(pm))].difficulty;
|
||||
|
||||
if (is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data)
|
||||
|| pm->mlet == S_GHOST || pm->mlet == S_KOP)
|
||||
@@ -1636,7 +1634,7 @@ struct monst *mtmp;
|
||||
return FALSE;
|
||||
|
||||
if (!stuck && !immobile && (mtmp->cham == NON_PM)
|
||||
&& monstr[(pmidx = monsndx(mdat))] < 6) {
|
||||
&& mons[(pmidx = monsndx(mdat))].difficulty < 6) {
|
||||
boolean ignore_boulders = (verysmall(mdat) || throws_rocks(mdat)
|
||||
|| passes_walls(mdat)),
|
||||
diag_ok = !NODIAG(pmidx);
|
||||
@@ -1722,13 +1720,13 @@ struct monst *mtmp;
|
||||
}
|
||||
nomore(MUSE_WAN_POLYMORPH);
|
||||
if (obj->otyp == WAN_POLYMORPH && obj->spe > 0
|
||||
&& (mtmp->cham == NON_PM) && monstr[monsndx(mdat)] < 6) {
|
||||
&& (mtmp->cham == NON_PM) && mons[monsndx(mdat)].difficulty < 6) {
|
||||
m.misc = obj;
|
||||
m.has_misc = MUSE_WAN_POLYMORPH;
|
||||
}
|
||||
nomore(MUSE_POT_POLYMORPH);
|
||||
if (obj->otyp == POT_POLYMORPH && (mtmp->cham == NON_PM)
|
||||
&& monstr[monsndx(mdat)] < 6) {
|
||||
&& mons[monsndx(mdat)].difficulty < 6) {
|
||||
m.misc = obj;
|
||||
m.has_misc = MUSE_POT_POLYMORPH;
|
||||
}
|
||||
@@ -1997,7 +1995,7 @@ rnd_misc_item(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
struct permonst *pm = mtmp->data;
|
||||
int difficulty = monstr[(monsndx(pm))];
|
||||
int difficulty = mons[(monsndx(pm))].difficulty;
|
||||
|
||||
if (is_animal(pm) || attacktype(pm, AT_EXPL) || mindless(mtmp->data)
|
||||
|| pm->mlet == S_GHOST || pm->mlet == S_KOP)
|
||||
@@ -2052,7 +2050,7 @@ struct obj *obj;
|
||||
if (typ == WAN_DIGGING)
|
||||
return (boolean) !is_floater(mon->data);
|
||||
if (typ == WAN_POLYMORPH)
|
||||
return (boolean) (monstr[monsndx(mon->data)] < 6);
|
||||
return (boolean) (mons[monsndx(mon->data)].difficulty < 6);
|
||||
if (objects[typ].oc_dir == RAY || typ == WAN_STRIKING
|
||||
|| typ == WAN_TELEPORTATION || typ == WAN_CREATE_MONSTER)
|
||||
return TRUE;
|
||||
|
||||
Reference in New Issue
Block a user