enlightenment revamp, part I (trunk only)

Groundwork for re-doing ^X so that it'll be more integrated with
enlightenment and display bottom line information without abbreviations
or long-line truncation.  `mode' doesn't do anything yet so may provoke
lint complaints.
This commit is contained in:
nethack.rankin
2008-01-21 16:40:56 +00:00
parent f2d37bac2e
commit 33c14ba523
8 changed files with 29 additions and 18 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)extern.h 3.5 2007/06/27 */
/* SCCS Id: @(#)extern.h 3.5 2008/01/19 */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -194,7 +194,7 @@ E void FDECL(rhack, (char *));
E int NDECL(doextlist);
E int NDECL(extcmd_via_menu);
E int NDECL(enter_explore_mode);
E void FDECL(enlightenment, (int));
E void FDECL(enlightenment, (int,int));
E void FDECL(show_conduct, (int));
E int FDECL(xytod, (SCHAR_P,SCHAR_P));
E void FDECL(dtoxy, (coord *,int));

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)hack.h 3.5 2007/03/24 */
/* SCCS Id: @(#)hack.h 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -291,6 +291,13 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
#define EXPL_FROSTY 6
#define EXPL_MAX 7
/* enlightenment control flags */
#define BASICENLIGHTENMENT 1 /* show mundane stuff */
#define MAGICENLIGHTENMENT 2 /* show intrinsics and such */
#define ENL_GAMEINPROGRESS 0
#define ENL_GAMEOVERALIVE 1 /* ascension, escape, quit, trickery */
#define ENL_GAMEOVERDEAD 2
/* Macros for messages referring to hands, eyes, feet, etc... */
#define ARM 0
#define EYE 1

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)artifact.c 3.5 2007/05/09 */
/* SCCS Id: @(#)artifact.c 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1401,7 +1401,7 @@ arti_invoke(obj)
break;
}
case ENLIGHTENING:
enlightenment(0);
enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
break;
case CREATE_AMMO: {
struct obj *otmp = mksobj(ARROW, TRUE, FALSE);

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)cmd.c 3.5 2007/05/05 */
/* SCCS Id: @(#)cmd.c 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -960,7 +960,7 @@ wiz_rumor_check(VOID_ARGS)
/* -enlightenment and conduct- */
static winid en_win;
static winid en_win = WIN_ERR;
static const char
You_[] = "You ",
are[] = "are ", were[] = "were ",
@@ -1046,8 +1046,9 @@ int final;
}
void
enlightenment(final)
int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
enlightenment(mode, final)
int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
int final; /* ENL_GAMEINPROGRESS:0, ENL_GAVEOVERALIVE, ENL_GAMEOVERDEAD */
{
int ltmp, armpro;
char buf[BUFSZ];
@@ -1397,6 +1398,7 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
display_nhwindow(en_win, TRUE);
destroy_nhwindow(en_win);
en_win = WIN_ERR;
return;
}
@@ -1511,7 +1513,7 @@ doattributes(VOID_ARGS)
if (!minimal_enlightenment())
return 0;
if (wizard || discover)
enlightenment(0);
enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
return 0;
}
@@ -1614,6 +1616,7 @@ int final;
/* Pop up the window and wait for a key */
display_nhwindow(en_win, TRUE);
destroy_nhwindow(en_win);
en_win = WIN_ERR;
}
#ifndef M

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)end.c 3.5 2007/05/12 */
/* SCCS Id: @(#)end.c 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -398,7 +398,8 @@ boolean taken;
c = ask ? yn_function("Do you want to see your attributes?",
ynqchars, defquery) : defquery;
if (c == 'y')
enlightenment(how >= PANICKED ? 1 : 2); /* final */
enlightenment((BASICENLIGHTENMENT|MAGICENLIGHTENMENT),
(how >= PANICKED) ? ENL_GAMEOVERALIVE : ENL_GAMEOVERDEAD);
if (c == 'q') done_stopprint++;
}

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)fountain.c 3.5 2006/05/08 */
/* SCCS Id: @(#)fountain.c 3.5 2008/01/19 */
/* Copyright Scott R. Turner, srt@ucla, 10/27/86 */
/* NetHack may be freely redistributed. See license for details. */
@@ -239,7 +239,7 @@ drinkfountain()
You_feel("self-knowledgeable...");
display_nhwindow(WIN_MESSAGE, FALSE);
enlightenment(0);
enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
exercise(A_WIS, TRUE);
pline_The("feeling subsides.");
break;

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)potion.c 3.5 2007/05/29 */
/* SCCS Id: @(#)potion.c 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -583,7 +583,7 @@ peffects(otmp)
}
You_feel("self-knowledgeable...");
display_nhwindow(WIN_MESSAGE, FALSE);
enlightenment(0);
enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
pline_The("feeling subsides.");
exercise(A_WIS, TRUE);
}

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)zap.c 3.5 2007/05/30 */
/* SCCS Id: @(#)zap.c 3.5 2008/01/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1971,7 +1971,7 @@ register struct obj *obj;
known = TRUE;
You_feel("self-knowledgeable...");
display_nhwindow(WIN_MESSAGE, FALSE);
enlightenment(FALSE);
enlightenment(MAGICENLIGHTENMENT, ENL_GAMEINPROGRESS);
pline_The("feeling subsides.");
exercise(A_WIS, TRUE);
break;