Convert the vibrating square to a trap

Patch due to ais523 in NetHack 4.

This is not ready to be merged yet; the vibrating square needs a tile
image for tiles builds.
This commit is contained in:
Sean Hunt
2015-05-25 00:32:45 +09:00
parent 0e1a0d9bd9
commit 26ee7dc370
12 changed files with 44 additions and 14 deletions

View File

@@ -314,7 +314,7 @@ register int x, y, typ;
register boolean oldplace;
if ((ttmp = t_at(x, y)) != 0) {
if (ttmp->ttyp == MAGIC_PORTAL)
if (ttmp->ttyp == MAGIC_PORTAL || ttmp->ttyp == VIBRATING_SQUARE)
return (struct trap *) 0;
oldplace = TRUE;
if (u.utrap && (x == u.ux) && (y == u.uy)
@@ -826,8 +826,8 @@ unsigned trflags;
defsyms[trap_to_defsym(ttype)].explanation);
return;
}
if (!Fumbling && ttype != MAGIC_PORTAL && ttype != ANTI_MAGIC
&& !forcebungle && !plunged && !adj_pit
if (!Fumbling && ttype != MAGIC_PORTAL && ttype != VIBRATING_SQUARE
&& ttype != ANTI_MAGIC && !forcebungle && !plunged && !adj_pit
&& (!rn2(5) || ((ttype == PIT || ttype == SPIKED_PIT)
&& is_clinger(youmonst.data)))) {
You("escape %s %s.", (ttype == ARROW_TRAP && !trap->madeby_u)
@@ -1426,6 +1426,11 @@ unsigned trflags;
feeltrap(trap);
domagicportal(trap);
break;
case VIBRATING_SQUARE:
seetrap(trap);
/* messages handled elsewhere; the trap symbol is merely to mark the
* square for future reference */
break;
default:
feeltrap(trap);
@@ -2590,6 +2595,18 @@ register struct monst *mtmp;
}
break;
case VIBRATING_SQUARE:
if (see_it && !Blind) {
if (in_sight)
pline("You see a strange vibration beneath %s %s.",
s_suffix(mon_nam(mtmp)),
makeplural(mbodypart(mtmp, FOOT)));
else
pline("You see the ground vibrate in the distance.");
seetrap(trap);
}
break;
default:
impossible("Some monster encountered a strange trap of type %d.",
tt);