finish up the changes to trigger erosion on use
Elbereth is a magical power, and like everything else, magic eventually gets used up... even for burned engravings.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 extern.h $NHDT-Date: 1429755449 2015/04/23 02:17:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.477 $ */
|
||||
/* NetHack 3.5 extern.h $NHDT-Date: 1430172934 2015/04/27 22:15:34 $ $NHDT-Branch: derek-elbereth $:$NHDT-Revision: 1.485 $ */
|
||||
/* Copyright (c) Steve Creps, 1988. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -654,7 +654,7 @@ E const char *FDECL(ceiling, (int,int));
|
||||
E struct engr *FDECL(engr_at, (XCHAR_P,XCHAR_P));
|
||||
E int FDECL(sengr_at, (const char *,XCHAR_P,XCHAR_P,BOOLEAN_P));
|
||||
E void FDECL(u_wipe_engr, (int));
|
||||
E void FDECL(wipe_engr_at, (XCHAR_P,XCHAR_P,XCHAR_P));
|
||||
E void FDECL(wipe_engr_at, (XCHAR_P,XCHAR_P,XCHAR_P,BOOLEAN_P));
|
||||
E void FDECL(read_engr_at, (int,int));
|
||||
E void FDECL(make_engr_at, (int,int,const char *,long,XCHAR_P));
|
||||
E void FDECL(del_engr_at, (int,int));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 engrave.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 engrave.c $NHDT-Date: 1430172943 2015/04/27 22:15:43 $ $NHDT-Branch: derek-elbereth $:$NHDT-Revision: 1.49 $ */
|
||||
/* NetHack 3.5 engrave.c $Date: 2012/12/20 01:48:36 $ $Revision: 1.39 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -245,27 +245,29 @@ u_wipe_engr(cnt)
|
||||
register int cnt;
|
||||
{
|
||||
if (can_reach_floor(TRUE))
|
||||
wipe_engr_at(u.ux, u.uy, cnt);
|
||||
wipe_engr_at(u.ux, u.uy, cnt, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
wipe_engr_at(x,y,cnt)
|
||||
register xchar x,y,cnt;
|
||||
wipe_engr_at(x,y,cnt,magical)
|
||||
register xchar x,y,cnt,magical;
|
||||
{
|
||||
register struct engr *ep = engr_at(x,y);
|
||||
register struct engr *ep = engr_at(x,y);
|
||||
|
||||
/* Headstones are indelible */
|
||||
if(ep && ep->engr_type != HEADSTONE){
|
||||
if(ep->engr_type != BURN || is_ice(x,y)) {
|
||||
if(ep->engr_type != DUST && ep->engr_type != ENGR_BLOOD) {
|
||||
cnt = rn2(1 + 50/(cnt+1)) ? 0 : 1;
|
||||
}
|
||||
wipeout_text(ep->engr_txt, (int)cnt, 0);
|
||||
while(ep->engr_txt[0] == ' ')
|
||||
ep->engr_txt++;
|
||||
if(!ep->engr_txt[0]) del_engr(ep);
|
||||
}
|
||||
}
|
||||
/* Headstones are indelible */
|
||||
if(ep && ep->engr_type != HEADSTONE) {
|
||||
debugpline1("asked to erode %d characters", cnt);
|
||||
if(ep->engr_type != BURN || is_ice(x,y) || (magical && !rn2(2))) {
|
||||
if(ep->engr_type != DUST && ep->engr_type != ENGR_BLOOD) {
|
||||
cnt = rn2(1 + 50/(cnt+1)) ? 0 : 1;
|
||||
debugpline1("actually eroding %d characters", cnt);
|
||||
}
|
||||
wipeout_text(ep->engr_txt, (int)cnt, 0);
|
||||
while(ep->engr_txt[0] == ' ')
|
||||
ep->engr_txt++;
|
||||
if(!ep->engr_txt[0]) del_engr(ep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 mklev.c $NHDT-Date: 1426465436 2015/03/16 00:23:56 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.25 $ */
|
||||
/* NetHack 3.5 mklev.c $NHDT-Date: 1430172946 2015/04/27 22:15:46 $ $NHDT-Branch: derek-elbereth $:$NHDT-Revision: 1.38 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -482,7 +482,7 @@ int trap_type;
|
||||
if (trap_engravings[trap_type]) {
|
||||
make_engr_at(xx, yy-dy,
|
||||
trap_engravings[trap_type], 0L, DUST);
|
||||
wipe_engr_at(xx, yy-dy, 5); /* age it a little */
|
||||
wipe_engr_at(xx, yy-dy, 5, FALSE); /* age it a little */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 monmove.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
|
||||
/* NetHack 3.5 monmove.c $NHDT-Date: 1430172947 2015/04/27 22:15:47 $ $NHDT-Branch: derek-elbereth $:$NHDT-Revision: 1.62 $ */
|
||||
/* NetHack 3.5 monmove.c $Date: 2011/08/30 22:13:27 $ $Revision: 1.46 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -269,6 +269,7 @@ register struct monst *mtmp;
|
||||
int *inrange, *nearby, *scared;
|
||||
{
|
||||
int seescaryx, seescaryy;
|
||||
boolean sawscary = FALSE;
|
||||
|
||||
*inrange = (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) <=
|
||||
(BOLT_LIM * BOLT_LIM));
|
||||
@@ -288,11 +289,18 @@ int *inrange, *nearby, *scared;
|
||||
seescaryx = u.ux;
|
||||
seescaryy = u.uy;
|
||||
}
|
||||
if (*nearby &&
|
||||
(onscary(seescaryx, seescaryy, mtmp) ||
|
||||
(!mtmp->mpeaceful && in_your_sanctuary(mtmp, 0, 0)))) {
|
||||
|
||||
sawscary = onscary(seescaryx, seescaryy, mtmp);
|
||||
if (*nearby && (sawscary || (!mtmp->mpeaceful
|
||||
&& in_your_sanctuary(mtmp, 0, 0)))) {
|
||||
*scared = 1;
|
||||
monflee(mtmp, rnd(rn2(7) ? 10 : 100), TRUE, TRUE);
|
||||
|
||||
/* magical protection won't last forever, so there'll be a
|
||||
* chance of the magic being used up regardless of type */
|
||||
if (sawscary) {
|
||||
wipe_engr_at(seescaryx, seescaryy, 1, TRUE);
|
||||
}
|
||||
} else
|
||||
*scared = 0;
|
||||
}
|
||||
@@ -352,7 +360,7 @@ register struct monst *mtmp;
|
||||
}
|
||||
|
||||
/* not frozen or sleeping: wipe out texts written in the dust */
|
||||
wipe_engr_at(mtmp->mx, mtmp->my, 1);
|
||||
wipe_engr_at(mtmp->mx, mtmp->my, 1, FALSE);
|
||||
|
||||
/* confused monsters get unconfused with small probability */
|
||||
if (mtmp->mconf && !rn2(50)) mtmp->mconf = 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.5 zap.c $NHDT-Date: 1428207622 2015/04/05 04:20:22 $ $NHDT-Branch: nhmall-booktribute $:$NHDT-Revision: 1.215 $ */
|
||||
/* NetHack 3.5 zap.c $NHDT-Date: 1430172954 2015/04/27 22:15:54 $ $NHDT-Branch: derek-elbereth $:$NHDT-Revision: 1.218 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -2719,12 +2719,12 @@ struct obj *obj; /* wand or spell */
|
||||
pline_The(Hallucination ?
|
||||
"floor runs like butter!" :
|
||||
"edges on the floor get smoother.");
|
||||
wipe_engr_at(x, y, d(2,4));
|
||||
wipe_engr_at(x, y, d(2,4), TRUE);
|
||||
}
|
||||
break;
|
||||
case WAN_STRIKING:
|
||||
case SPE_FORCE_BOLT:
|
||||
wipe_engr_at(x, y, d(2,4));
|
||||
wipe_engr_at(x, y, d(2,4), TRUE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user