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:
keni
2018-10-17 15:37:24 -04:00
parent b9d99b343d
commit f222023bd8
9 changed files with 445 additions and 522 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 allmain.c $NHDT-Date: 1518193644 2018/02/09 16:27:24 $ $NHDT-Branch: githash $:$NHDT-Revision: 1.86 $ */
/* NetHack 3.6 allmain.c $NHDT-Date: 1539804859 2018/10/17 19:34:19 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.89 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -35,7 +35,6 @@ boolean resuming;
*/
decl_init();
monst_init();
monstr_init(); /* monster strengths */
objects_init();
/* if a save file created in normal mode is now being restored in

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 end.c $NHDT-Date: 1528332335 2018/06/07 00:45:35 $ $NHDT-Branch: NetHack-3.6.2 $:$NHDT-Revision: 1.141 $ */
/* NetHack 3.6 end.c $NHDT-Date: 1539804880 2018/10/17 19:34:40 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.146 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1574,8 +1574,6 @@ int status;
nethack_exit(status);
}
extern const int monstr[];
enum vanq_order_modes {
VANQ_MLVL_MNDX = 0,
VANQ_MSTR_MNDX,
@@ -1620,7 +1618,7 @@ const genericptr vptr2;
break;
case VANQ_MSTR_MNDX:
/* sort by monster toughness */
mstr1 = monstr[indx1], mstr2 = monstr[indx2];
mstr1 = mons[indx1].difficulty, mstr2 = mons[indx2].difficulty;
res = mstr2 - mstr1; /* monstr high to low */
break;
case VANQ_ALPHA_SEP:

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 makemon.c $NHDT-Date: 1537477761 2018/09/20 21:09:21 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.124 $ */
/* NetHack 3.6 makemon.c $NHDT-Date: 1539804904 2018/10/17 19:35:04 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.127 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2012. */
/* NetHack may be freely redistributed. See license for details. */
@@ -25,12 +25,10 @@ STATIC_DCL void FDECL(m_initinv, (struct monst *));
STATIC_DCL boolean FDECL(makemon_rnd_goodpos, (struct monst *,
unsigned, coord *));
extern const int monstr[];
#define m_initsgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 3)
#define m_initlgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 10)
#define toostrong(monindx, lev) (monstr[monindx] > lev)
#define tooweak(monindx, lev) (monstr[monindx] < lev)
#define toostrong(monindx, lev) (mons[monindx].difficulty > lev)
#define tooweak(monindx, lev) (mons[monindx].difficulty < lev)
boolean
is_home_elemental(ptr)
@@ -1652,7 +1650,7 @@ int spc;
if (mk_gen_ok(last, G_GONE, mask)) {
/* consider it */
if (num && toostrong(last, maxmlev)
&& monstr[last] != monstr[last - 1] && rn2(2))
&& mons[last].difficulty != mons[last - 1].difficulty && rn2(2))
break;
num += mons[last].geno & G_FREQ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -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;

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1519662898 2018/02/26 16:34:58 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.96 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1539804904 2018/10/17 19:35:04 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.103 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1325,7 +1325,6 @@ dosacrifice()
if (otmp->otyp == CORPSE) {
register struct permonst *ptr = &mons[otmp->corpsenm];
struct monst *mtmp;
extern const int monstr[];
/* KMH, conduct */
u.uconduct.gnostic++;
@@ -1338,7 +1337,7 @@ dosacrifice()
if (otmp->corpsenm == PM_ACID_BLOB
|| (monstermoves <= peek_at_iced_corpse_age(otmp) + 50)) {
value = monstr[otmp->corpsenm] + 1;
value = mons[otmp->corpsenm].difficulty + 1;
if (otmp->oeaten)
value = eaten_stat(value, otmp);
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wizard.c $NHDT-Date: 1456618999 2016/02/28 00:23:19 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.48 $ */
/* NetHack 3.6 wizard.c $NHDT-Date: 1539804905 2018/10/17 19:35:05 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.53 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -11,8 +11,6 @@
#include "hack.h"
#include "qtext.h"
extern const int monstr[];
STATIC_DCL short FDECL(which_arti, (int));
STATIC_DCL boolean FDECL(mon_has_arti, (struct monst *, SHORT_P));
STATIC_DCL struct monst *FDECL(other_mon_has_arti, (struct monst *, SHORT_P));
@@ -588,7 +586,8 @@ struct monst *summoner;
m_cls = mons[makeindex].mlet;
} while (summoner
&& ((attacktype(&mons[makeindex], AT_MAGC)
&& monstr[makeindex] >= monstr[summoner->mnum])
&& mons[makeindex].difficulty
>= mons[summoner->mnum].difficulty)
|| (s_cls == S_DEMON && m_cls == S_ANGEL)
|| (s_cls == S_ANGEL && m_cls == S_DEMON)));
/* do this after picking the monster to place */