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.
scroll of earth messages cleaned up
long worms can no longer be leashed
the chest in the Castle containing the wishing wand can never be trapped
+the vibrating square is now a trap
Platform- and/or Interface-Specific Fixes
/* end effects */
-#define MAXPCHARS 95 /* maximum number of mapped characters */
+#define MAXPCHARS 96 /* maximum number of mapped characters */
#define MAXDCHARS 42 /* maximum of mapped dungeon characters */
#define MAXTCHARS 22 /* maximum of mapped trap characters */
#define MAXECHARS 31 /* maximum of mapped effects characters */
#define MAGIC_TRAP 20
#define ANTI_MAGIC 21
#define POLY_TRAP 22
-#define TRAPNUM 23
+#define VIBRATING_SQUARE 23
+#define TRAPNUM 24
#endif /* TRAP_H */
&& (levl[x][y].wall_info & W_NONDIGGABLE) != 0)
|| (ttmp
&& (ttmp->ttyp == MAGIC_PORTAL
+ || ttmp->ttyp == VIBRATING_SQUARE
|| (!Can_dig_down(&u.uz) && !levl[x][y].candig)))) {
if (verbose)
pline_The("%s here is too hard to %s.", surface(x, y), verb);
lev = &levl[dig_x][dig_y];
nohole = (!Can_dig_down(&u.uz) && !lev->candig);
- if ((ttmp && (ttmp->ttyp == MAGIC_PORTAL || nohole))
+ if ((ttmp && (ttmp->ttyp == MAGIC_PORTAL
+ || ttmp->ttyp == VIBRATING_SQUARE || nohole))
|| (IS_ROCK(lev->typ) && lev->typ != SDOOR
&& (lev->wall_info & W_NONDIGGABLE) != 0)) {
pline_The("%s %shere is too hard to dig in.", surface(dig_x, dig_y),
if (ttmp->ttyp == MAGIC_PORTAL) {
dotrap(ttmp, 0);
return FALSE;
+ } else if (ttmp->ttyp == VIBRATING_SQUARE) {
+ pline("The ground vibrates as you pass it.");
+ dotrap(ttmp, 0); /* doesn't print messages */
} else if (ttmp->ttyp == FIRE_TRAP) {
dotrap(ttmp, 0);
} else if ((ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT
{ '^', "magic trap", C(HI_ZAP) }, /* trap */
{ '^', "anti-magic field", C(HI_ZAP) }, /* trap */
{ '^', "polymorph trap", C(CLR_BRIGHT_GREEN) }, /* trap */
+ { '^', "vibrating square", C(CLR_YELLOW) }, /* trap */
{ '|', "wall", C(CLR_GRAY) }, /* vbeam */
{ '-', "wall", C(CLR_GRAY) }, /* hbeam */
{ '\\', "wall", C(CLR_GRAY) }, /* lslant */
{ '/', "wall", C(CLR_GRAY) }, /* rslant */
{ '*', "", C(CLR_WHITE) }, /* dig beam */
{ '!', "", C(CLR_WHITE) }, /* camera flash beam */
- /*70*/ { ')', "", C(HI_WOOD) }, /* boomerang open left */
- { '(', "", C(HI_WOOD) }, /* boomerang open right */
+ { ')', "", C(HI_WOOD) }, /* boomerang open left */
+ /*70*/ { '(', "", C(HI_WOOD) }, /* boomerang open right */
{ '0', "", C(HI_ZAP) }, /* 4 magic shield symbols */
{ '#', "", C(HI_ZAP) },
{ '@', "", C(HI_ZAP) },
C(CLR_BRIGHT_GREEN) }, /* valid position for targeting */
{ '/', "", C(CLR_GREEN) }, /* swallow top left */
{ '-', "", C(CLR_GREEN) }, /* swallow top center */
- /*80*/ { '\\', "", C(CLR_GREEN) }, /* swallow top right */
- { '|', "", C(CLR_GREEN) }, /* swallow middle left */
+ { '\\', "", C(CLR_GREEN) }, /* swallow top right */
+ /*80*/ { '|', "", C(CLR_GREEN) }, /* swallow middle left */
{ '|', "", C(CLR_GREEN) }, /* swallow middle right */
{ '\\', "", C(CLR_GREEN) }, /* swallow bottom left */
{ '-', "", C(CLR_GREEN) }, /* swallow bottom center*/
{ '-', "", C(CLR_ORANGE) }, /* explosion top center */
{ '\\', "", C(CLR_ORANGE) }, /* explosion top right */
{ '|', "", C(CLR_ORANGE) }, /* explosion middle left */
- /*90*/ { ' ', "", C(CLR_ORANGE) }, /* explosion middle center*/
- { '|', "", C(CLR_ORANGE) }, /* explosion middle right */
+ { ' ', "", C(CLR_ORANGE) }, /* explosion middle center*/
+ /*90*/ { '|', "", C(CLR_ORANGE) }, /* explosion middle right */
{ '\\', "", C(CLR_ORANGE) }, /* explosion bottom left */
{ '-', "", C(CLR_ORANGE) }, /* explosion bottom center*/
{ '/', "", C(CLR_ORANGE) }, /* explosion bottom right */
(char *) 0, (char *) 0, (char *) 0, (char *) 0,
/* 14..16: trap door, teleport, level-teleport */
"Vlad was here", "ad aerarium", "ad aerarium", (char *) 0, (char *) 0,
- (char *) 0, (char *) 0, (char *) 0, (char *) 0,
+ (char *) 0, (char *) 0, (char *) 0, (char *) 0, (char *) 0,
};
STATIC_OVL void
/* reject "too hard" traps */
switch (kind) {
case MAGIC_PORTAL:
+ case VIBRATING_SQUARE:
kind = NO_TRAP;
break;
case ROLLING_BOULDER_TRAP:
It might still fail if there's a dungeon feature here. */
struct trap *t = t_at(x, y);
- if (t && t->ttyp != MAGIC_PORTAL)
+ if (t && t->ttyp != MAGIC_PORTAL && t->ttyp != VIBRATING_SQUARE)
deltrap(t);
if (bad_location(x, y, nlx, nly, nhx, nhy))
return FALSE;
|| !SPACE_POS(levl[x][y].typ) || occupied(x, y));
inv_pos.x = x;
inv_pos.y = y;
+ maketrap(inv_pos.x, inv_pos.y, VIBRATING_SQUARE);
#undef INVPOS_X_MARGIN
#undef INVPOS_Y_MARGIN
#undef INVPOS_DISTANCE
case TELEP_TRAP:
case LEVEL_TELEP:
case MAGIC_PORTAL:
+ case VIBRATING_SQUARE:
Your("webbing vanishes!");
return (0);
case WEB:
rtrap = rnd(TRAPNUM - 1);
switch (rtrap) {
case HOLE: /* no random holes on special levels */
+ case VIBRATING_SQUARE:
case MAGIC_PORTAL:
rtrap = NO_TRAP;
break;
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)
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)
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);
}
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);
{ "magic", MAGIC_TRAP },
{ "anti magic", ANTI_MAGIC },
{ "polymorph", POLY_TRAP },
+ { "vibrating square", VIBRATING_SQUARE },
{ 0, 0 } };
static struct {