the message explaining its fate was only given if it was sensed via ESP
hero could still see for brief period after being blinded by potion vapors
avoid crash when thrown potion hits bars before a monster
+don't give messages about seeing things happen while asleep
Platform- and/or Interface-Specific Fixes
E void VDECL(You_feel, (const char *,...)) PRINTF_F(1,2);
E void VDECL(You_cant, (const char *,...)) PRINTF_F(1,2);
E void VDECL(You_hear, (const char *,...)) PRINTF_F(1,2);
+E void VDECL(You_see, (const char *,...)) PRINTF_F(1,2);
E void VDECL(pline_The, (const char *,...)) PRINTF_F(1,2);
E void VDECL(There, (const char *,...)) PRINTF_F(1,2);
E void VDECL(verbalize, (const char *,...)) PRINTF_F(1,2);
-/* SCCS Id: @(#)apply.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)apply.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#include "hack.h"
#include "edog.h"
-
static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
static const char tools_too[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS,
WEAPON_CLASS, WAND_CLASS, GEM_CLASS, 0 };
You_feel("%s %s from your pack!", something,
locomotion(mtmp->data,"drop"));
else
- You("see %s %s out of your pack%s!",
+ You_see("%s %s out of your pack%s!",
monnambuf,
locomotion(mtmp->data,"drop"),
and_vanish);
if (suppress_see)
pline("%s suddenly vanishes!", an(xname(figurine)));
else
- You("suddenly see a figurine transform into %s%s!",
+ You_see("a figurine transform into %s%s!",
monnambuf, and_vanish);
redraw = TRUE; /* update figurine's map location */
}
if (canseemon(figurine->ocarry)) {
Sprintf(carriedby, "%s pack",
s_suffix(a_monnam(mon)));
- }
- else if (is_pool(mon->mx, mon->my))
+ } else if (is_pool(mon->mx, mon->my))
Strcpy(carriedby, "empty water");
else
Strcpy(carriedby, "thin air");
- You("see %s %s out of %s%s!", monnambuf,
+ You_see("%s %s out of %s%s!", monnambuf,
locomotion(mtmp->data, "drop"), carriedby,
and_vanish);
}
Sprintf(stonebuf, "stone%s", plur(tstone->quan));
if (do_scratch)
- pline("You make %s%sscratch marks on the %s.",
+ You("make %s%sscratch marks on the %s.",
streak_color ? streak_color : (const char *)"",
streak_color ? " " : "", stonebuf);
else if (streak_color)
- pline("You see %s streaks on the %s.", streak_color, stonebuf);
+ You_see("%s streaks on the %s.", streak_color, stonebuf);
else
pline(scritch);
return;
/* Distance attacks by pole-weapons */
STATIC_OVL int
-use_pole (obj)
+use_pole(obj)
struct obj *obj;
{
int res = 0, typ, max_range = 4, min_range = 4;
-/* SCCS Id: @(#)dbridge.c 3.5 2003/02/08 */
+/* SCCS Id: @(#)dbridge.c 3.5 2005/06/22 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
x2 = x; y2 = y;
get_wall_for_db(&x2,&y2);
if (cansee(x,y) || cansee(x2,y2))
- You("see a drawbridge %s up!",
+ You_see("a drawbridge %s up!",
(((u.ux == x || u.uy == y) && !Underwater) ||
distu(x2,y2) < distu(x,y)) ? "coming" : "going");
lev1->typ = DRAWBRIDGE_UP;
x2 = x; y2 = y;
get_wall_for_db(&x2,&y2);
if (cansee(x,y) || cansee(x2,y2))
- You("see a drawbridge %s down!",
+ You_see("a drawbridge %s down!",
(distu(x2,y2) < distu(x,y)) ? "going" : "coming");
lev1->typ = DRAWBRIDGE_DOWN;
lev2 = &levl[x2][y2];
-/* SCCS Id: @(#)detect.c 3.5 2003/08/13 */
+/* SCCS Id: @(#)detect.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
case 3 : pline_The("crystal pulses with sinister %s light!",
hcolor((char *)0));
break;
- case 4 : You("see goldfish swimming above fluorescent rocks.");
+ case 4 : You_see("goldfish swimming above fluorescent rocks.");
break;
- case 5 : You("see tiny snowflakes spinning around a miniature farmhouse.");
+ case 5 : You_see("tiny snowflakes spinning around a miniature farmhouse.");
break;
default: pline("Oh wow... like a kaleidoscope!");
break;
default:
{
int i = rn2(SIZE(level_detects));
- You("see %s, %s.",
+ You_see("%s, %s.",
level_detects[i].what,
level_distance(level_detects[i].where));
}
if (ret) {
if (!rn2(100)) /* make them nervous */
- You("see the Wizard of Yendor gazing out at you.");
+ You_see("the Wizard of Yendor gazing out at you.");
else pline_The("vision is unclear.");
}
}
/* Map the background and boulders */
for (x = 1; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) {
- levl[x][y].seenv = SVALL;
- levl[x][y].waslit = TRUE;
- map_background(x, y, 1);
- for (obj = level.objects[x][y]; obj; obj = obj->nexthere)
- if (obj->otyp == BOULDER)
- map_object(obj, 1);
+ levl[x][y].seenv = SVALL;
+ levl[x][y].waslit = TRUE;
+ map_background(x, y, 1);
+ for (obj = level.objects[x][y]; obj; obj = obj->nexthere)
+ if (obj->otyp == BOULDER)
+ map_object(obj, 1);
}
/* Map the traps */
-/* SCCS Id: @(#)do.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)do.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
You("don't see anything happen to the sink.");
break;
case RIN_FREE_ACTION:
- You("see the ring slide right down the drain!");
+ You_see("the ring slide right down the drain!");
break;
case RIN_SEE_INVISIBLE:
- You("see some air in the sink.");
+ You_see("some air in the sink.");
break;
case RIN_STEALTH:
pline_The("sink seems to blend into the floor for a moment.");
}
break;
case OBJ_CONTAINED:
- if (container_where == OBJ_MINVENT && cansee(mtmp->mx, mtmp->my) &&
+ {
+ char sackname[BUFSZ];
+
+ if (container_where == OBJ_MINVENT &&
+ cansee(mtmp->mx, mtmp->my) &&
mcarry && canseemon(mcarry) && container) {
- pline("%s writhes out of %s!",
+ pline("%s writhes out of %s!",
Amonnam(mtmp), yname(container));
- } else if (container_where == OBJ_INVENT && container) {
- char sackname[BUFSZ];
- Strcpy(sackname, an(xname(container)));
- pline("%s %s out of %s in your pack!",
- Blind ? Something : Amonnam(mtmp),
+ } else if (container_where == OBJ_INVENT && container) {
+ Strcpy(sackname, an(xname(container)));
+ pline("%s %s out of %s in your pack!",
+ Blind ? Something : Amonnam(mtmp),
locomotion(mtmp->data,"writhes"),
- sackname);
- } else if (container_where == OBJ_FLOOR && container &&
- cansee(mtmp->mx, mtmp->my)) {
- char sackname[BUFSZ];
- Strcpy(sackname, an(xname(container)));
+ sackname);
+ } else if (container_where == OBJ_FLOOR && container &&
+ cansee(mtmp->mx, mtmp->my)) {
+ Strcpy(sackname, an(xname(container)));
pline("%s escapes from %s!", Amonnam(mtmp), sackname);
}
break;
+ }
default:
/* we should be able to handle the other cases... */
impossible("revive_corpse: lost corpse @ %d", where);
-/* SCCS Id: @(#)dogmove.c 3.5 2002/09/10 */
+/* SCCS Id: @(#)dogmove.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
mtmp->mappearance = qm[idx].mappearance;
newsym(mtmp->mx,mtmp->my);
- You("see %s appear where %s was!",
+ You_see("%s appear where %s was!",
(mtmp->m_ap_type == M_AP_FURNITURE) ?
an(defsyms[mtmp->mappearance].explanation) :
(mtmp->m_ap_type == M_AP_OBJECT &&
-/* SCCS Id: @(#)dokick.c 3.5 2004/08/02 */
+/* SCCS Id: @(#)dokick.c 3.5 2005/06/22 */
/* Copyright (c) Izchak Miller, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
"Muddy waste pops up from the drain"));
if(!(maploc->looted & S_LRING)) { /* once per sink */
if (!Blind)
- You("see a ring shining in its midst.");
+ You_see("a ring shining in its midst.");
(void) mkobj_at(RING_CLASS, x, y, TRUE);
newsym(x, y);
exercise(A_DEX, TRUE);
-/* SCCS Id: @(#)engrave.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)engrave.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
*/
if(!Blind) {
sensed = 1;
- You("see a message scrawled in blood here.");
+ You_see("a message scrawled in blood here.");
}
break;
default:
-/* SCCS Id: @(#)fountain.c 3.5 2005/04/23 */
+/* SCCS Id: @(#)fountain.c 3.5 2005/06/22 */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
pline("Then it passes.");
}
} else {
- You("see an image of someone stalking you.");
+ You_see("an image of someone stalking you.");
pline("But it disappears.");
}
HSee_invisible |= FROMOUTSIDE;
-/* SCCS Id: @(#)mon.c 3.5 2004/06/12 */
+/* SCCS Id: @(#)mon.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if(nct) pline_The("guard%s get%s angry!",
nct == 1 ? "" : "s", nct == 1 ? "s" : "");
else if(!Blind)
- You("see %sangry guard%s approaching!",
+ You_see("%sangry guard%s approaching!",
sct == 1 ? "an " : "", sct > 1 ? "s" : "");
} else if(!Deaf)
You_hear("the shrill sound of a guard's whistle.");
-/* SCCS Id: @(#)monmove.c 3.5 2004/06/12 */
+/* SCCS Id: @(#)monmove.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
register struct monst *mtmp;
{
if (flags.verbose) {
- if (cansee(mtmp->mx, mtmp->my))
+ if (cansee(mtmp->mx, mtmp->my) && !u.usleep)
pline("KABOOM!! You see a door explode.");
else if (!Deaf)
You_hear("a distant explosion.");
} else {
if (flags.verbose) {
if (canseeit)
- You("see a door unlock and open.");
+ You_see("a door unlock and open.");
else if (!Deaf)
You_hear("a door unlock and open.");
}
} else {
if (flags.verbose) {
if (canseeit)
- You("see a door open.");
+ You_see("a door open.");
else if (!Deaf)
You_hear("a door open.");
}
} else {
if (flags.verbose) {
if (canseeit)
- You("see a door crash open.");
+ You_see("a door crash open.");
else if (!Deaf)
You_hear("a door crash open.");
}
-/* SCCS Id: @(#)pline.c 3.5 2004/11/22 */
+/* SCCS Id: @(#)pline.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
VA_END();
}
+/*VARARGS1*/
+void
+You_see VA_DECL(const char *,line)
+ char *tmp;
+
+ VA_START(line);
+ VA_INIT(line, const char *);
+ if (u.usleep)
+ YouPrefix(tmp, "You dream that you see ", line);
+ else if (Blind) /* caller should have caught this... */
+ YouPrefix(tmp, "You sense ", line);
+ else
+ YouPrefix(tmp, "You see ", line);
+ vpline(strcat(tmp, line), VA_ARGS);
+ VA_END();
+}
+
/* Print a message inside double-quotes.
* The caller is responsible for checking deafness.
* Gods can speak directly to you in spite of deafness.
-/* SCCS Id: @(#)timeout.c 3.5 2005/06/11 */
+/* SCCS Id: @(#)timeout.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
You_feel("%s %s from your pack!", something,
locomotion(mon->data, "drop"));
else
- You("see %s %s out of your pack!",
+ You_see("%s %s out of your pack!",
monnambuf, locomotion(mon->data, "drop"));
if (yours) {
pline("%s cries sound like \"%s%s\"",
case OBJ_FLOOR:
if (cansee_hatchspot) {
knows_egg = TRUE;
- You("see %s hatch.", monnambuf);
+ You_see("%s hatch.", monnambuf);
redraw = TRUE; /* update egg's map location */
}
break;
Strcpy(carriedby, "empty water");
else
Strcpy(carriedby, "thin air");
- You("see %s %s out of %s!", monnambuf,
+ You_see("%s %s out of %s!", monnambuf,
locomotion(mon->data, "drop"), carriedby);
}
break;
pline("%s flickers%s.", Yname2(obj), tailer);
break;
case OBJ_FLOOR:
- You("see %s flicker%s.", an(xname(obj)), tailer);
+ You_see("%s flicker%s.", an(xname(obj)), tailer);
break;
}
}
pline("Batteries have not been invented yet.");
break;
case OBJ_FLOOR:
- You("see a lantern getting dim.");
+ You_see("a lantern getting dim.");
break;
case OBJ_MINVENT:
pline("%s lantern is getting dim.",
whose);
break;
case OBJ_FLOOR:
- You("see a burning potion of oil go out.");
+ You_see("a burning potion of oil go out.");
need_newsym = TRUE;
break;
}
Yname2(obj));
break;
case OBJ_FLOOR:
- You("see %s about to go out.",
+ You_see("%s about to go out.",
an(xname(obj)));
break;
}
break;
case OBJ_FLOOR:
if (obj->otyp == BRASS_LANTERN)
- You("see a lantern run out of power.");
+ You_see("a lantern run out of power.");
else
- You("see %s go out.",
- an(xname(obj)));
+ You_see("%s go out.", an(xname(obj)));
break;
}
}
many ? "s are" : " is");
break;
case OBJ_FLOOR:
- You("see %scandle%s getting short.",
+ You_see("%scandle%s getting short.",
menorah ? "a candelabrum's " :
many ? "some " : "a ",
many ? "s" : "");
many ? "" : "s");
break;
case OBJ_FLOOR:
- You("see %scandle%s flame%s flicker low!",
+ You_see("%scandle%s flame%s flicker low!",
menorah ? "a candelabrum's " :
many ? "some " : "a ",
many ? "s'" : "'s",
whose, many ? "s die" : " dies");
break;
case OBJ_FLOOR:
- You("see a candelabrum's flame%s die.",
+ You_see("a candelabrum's flame%s die.",
many ? "s" : "");
break;
}
You see some wax candles consumed!
You see a wax candle consumed!
*/
- You("see %s%s consumed!",
- many ? "some " : "",
- many ? xname(obj):an(xname(obj)));
+ You_see("%s%s consumed!",
+ many ? "some " : "",
+ many ? xname(obj) : an(xname(obj)));
need_newsym = TRUE;
break;
}
-/* SCCS Id: @(#)trap.c 3.5 2005/06/02 */
+/* SCCS Id: @(#)trap.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
feeltrap(trap);
if (!In_sokoban(&u.uz) && is_clinger(youmonst.data)) {
if(trap->tseen) {
- You("see %s %spit below you.", a_your[trap->madeby_u],
+ You_see("%s %spit below you.", a_your[trap->madeby_u],
ttype == SPIKED_PIT ? "spiked " : "");
} else {
pline("%s pit %sopens up under you!",
tower_of_flame,
surface(mtmp->mx,mtmp->my), mon_nam(mtmp));
else if (see_it) /* evidently `mtmp' is invisible */
- You("see a %s erupt from the %s!",
+ You_see("a %s erupt from the %s!",
tower_of_flame, surface(mtmp->mx,mtmp->my));
if (resists_fire(mtmp)) {
make_blinded((long)rn1(5,10),FALSE);
if (!Blind) Your(vision_clears);
} else if (!Blind) {
- You("see a flash of light!");
+ You_see("a flash of light!");
} else if (!Deaf) {
You_hear("a deafening roar!");
}
-/* SCCS Id: @(#)zap.c 3.5 2005/05/18 */
+/* SCCS Id: @(#)zap.c 3.5 2005/06/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
pline("A trap door beneath you closes up then vanishes.");
disclose = TRUE;
} else {
- You("see a swirl of %s beneath you.",
+ You_see("a swirl of %s beneath you.",
is_ice(x,y) ? "frost" : "dust");
}
} else {