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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
66
src/mon.c
66
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 */
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user