From 19d9b34374d2ffd58d0f6c663a3caf3a298e0d28 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 1 Dec 2007 21:07:23 +0000 Subject: [PATCH] jetison old warning code Get rid of most of the vestiges of the old warning code that was replaced over 7 years ago. I left the list of colors which were used for warning flashes. --- include/decl.h | 3 --- src/decl.c | 3 --- src/mon.c | 66 -------------------------------------------------- src/monmove.c | 17 ------------- 4 files changed, 89 deletions(-) diff --git a/include/decl.h b/include/decl.h index cce90e69a..46c811f99 100644 --- a/include/decl.h +++ b/include/decl.h @@ -27,9 +27,6 @@ E char SAVEP[]; E NEARDATA int bases[MAXOCLASSES]; E NEARDATA int multi; -#if 0 -E NEARDATA int warnlevel; -#endif E NEARDATA int nroom; E NEARDATA int nsubroom; E NEARDATA int occtime; diff --git a/src/decl.c b/src/decl.c index 1aa5f6546..266478686 100644 --- a/src/decl.c +++ b/src/decl.c @@ -20,9 +20,6 @@ char *catmore = 0; /* default pager */ NEARDATA int bases[MAXOCLASSES] = DUMMY; NEARDATA int multi = 0; -#if 0 -NEARDATA int warnlevel = 0; /* used by movemon and dochugw */ -#endif NEARDATA int nroom = 0; NEARDATA int nsubroom = 0; NEARDATA int occtime = 0; diff --git a/src/mon.c b/src/mon.c index a6ea49a7d..d0947f842 100644 --- a/src/mon.c +++ b/src/mon.c @@ -33,15 +33,8 @@ STATIC_DCL void FDECL(dealloc_mextra, (struct mextra *)); #if 0 /* part of the original warning code which was replaced in 3.3.1 */ -#define warnDelay 10 -long lastwarntime; -int lastwarnlev; - const char *warnings[] = { "white", "pink", "red", "ruby", "purple", "black" -}; - -STATIC_DCL void NDECL(warn_effects); #endif /* 0 */ STATIC_DCL struct obj *FDECL(make_corpse,(struct monst *, unsigned)); @@ -325,56 +318,6 @@ unsigned corpseflags; return obj; } -#if 0 -/* part of the original warning code which was replaced in 3.3.1 */ -STATIC_OVL void -warn_effects() -{ - if (warnlevel == 100) { - if(!Blind && uwep && - (warnlevel > lastwarnlev || moves > lastwarntime + warnDelay)) { - pline("%s %s!", Yobjnam2(uwep, "glow"), hcolor(NH_LIGHT_BLUE)); - lastwarnlev = warnlevel; - lastwarntime = moves; - } - warnlevel = 0; - return; - } - - if (warnlevel >= SIZE(warnings)) - warnlevel = SIZE(warnings)-1; - if (!Blind && - (warnlevel > lastwarnlev || moves > lastwarntime + warnDelay)) { - const char *which, *what, *how; - long rings = (EWarning & (LEFT_RING|RIGHT_RING)); - - if (rings) { - what = Hallucination ? "mood ring" : "ring"; - how = "glows"; /* singular verb */ - if (rings == LEFT_RING) { - which = "left "; - } else if (rings == RIGHT_RING) { - which = "right "; - } else { /* both */ - which = ""; - what = (const char *) makeplural(what); - how = "glow"; /* plural verb */ - } - Your("%s%s %s %s!", which, what, how, hcolor(warnings[warnlevel])); - } else { - if (Hallucination) - Your("spider-sense is tingling..."); - else - You_feel("apprehensive as you sense a %s flash.", - warnings[warnlevel]); - } - - lastwarntime = moves; - lastwarnlev = warnlevel; - } -} -#endif /* 0 */ - /* check mtmp and water/lava for compatibility, 0 (survived), 1 (died) */ int minliquid(mtmp) @@ -558,10 +501,6 @@ movemon() { register struct monst *mtmp, *nmtmp; register boolean somebody_can_move = FALSE; -#if 0 - /* part of the original warning code which was replaced in 3.3.1 */ - warnlevel = 0; -#endif /* Some of you may remember the former assertion here that @@ -631,11 +570,6 @@ movemon() if(dochugw(mtmp)) /* otherwise just move the monster */ continue; } -#if 0 - /* part of the original warning code which was replaced in 3.3.1 */ - if(warnlevel > 0) - warn_effects(); -#endif if (any_light_source()) vision_full_recalc = 1; /* in case a mon moved with a light source */ diff --git a/src/monmove.c b/src/monmove.c index 5d237501c..ed3da7d1b 100644 --- a/src/monmove.c +++ b/src/monmove.c @@ -89,23 +89,6 @@ dochugw(mtmp) register int x = mtmp->mx, y = mtmp->my; boolean already_saw_mon = !occupation ? 0 : canspotmon(mtmp); int rd = dochug(mtmp); -#if 0 - /* part of the original warning code which was replaced in 3.3.1 */ - int dd; - - if(Warning && !rd && !mtmp->mpeaceful && - (dd = distu(mtmp->mx,mtmp->my)) < distu(x,y) && - dd < 100 && !canseemon(mtmp)) { - /* Note: this assumes we only want to warn against the monster to - * which the weapon does extra damage, as there is no "monster - * which the weapon warns against" field. - */ - if (spec_ability(uwep, SPFX_WARN) && spec_dbon(uwep, mtmp, 1)) - warnlevel = 100; - else if ((int) (mtmp->m_lev / 4) > warnlevel) - warnlevel = (mtmp->m_lev / 4); - } -#endif /* 0 */ /* a similar check is in monster_nearby() in hack.c */ /* check whether hero notices monster and stops current activity */