directions (trunk only)
Some groundwork useful for the interface code I've been working on. If we already have some direction to name-of-direction code somewhere, I couldn't find it.
This commit is contained in:
@@ -194,6 +194,7 @@ E void FDECL(dtoxy, (coord *,int));
|
|||||||
E int FDECL(movecmd, (CHAR_P));
|
E int FDECL(movecmd, (CHAR_P));
|
||||||
E int FDECL(getdir, (const char *));
|
E int FDECL(getdir, (const char *));
|
||||||
E void NDECL(confdir);
|
E void NDECL(confdir);
|
||||||
|
E const char *FDECL(directionname, (int));
|
||||||
E int FDECL(isok, (int,int));
|
E int FDECL(isok, (int,int));
|
||||||
E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
|
E int FDECL(get_adjacent_loc, (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
|
||||||
E const char *FDECL(click_to_cmd, (int,int,int));
|
E const char *FDECL(click_to_cmd, (int,int,int));
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)hack.h 3.5 2007/01/02 */
|
/* SCCS Id: @(#)hack.h 3.5 2007/02/21 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -316,6 +316,7 @@ NEARDATA extern coord bhitpos; /* place where throw or zap hits or stops */
|
|||||||
#define POTION_OCCUPANT_CHANCE(n) (13 + 2*(n))
|
#define POTION_OCCUPANT_CHANCE(n) (13 + 2*(n))
|
||||||
#define WAND_BACKFIRE_CHANCE 100
|
#define WAND_BACKFIRE_CHANCE 100
|
||||||
#define BALL_IN_MON (u.uswallow && uball && uball->where == OBJ_FREE)
|
#define BALL_IN_MON (u.uswallow && uball && uball->where == OBJ_FREE)
|
||||||
|
#define NODIAG(monnum) ((monnum) == PM_GRID_BUG)
|
||||||
|
|
||||||
/* Flags to control menus */
|
/* Flags to control menus */
|
||||||
#define MENUTYPELEN sizeof("traditional ")
|
#define MENUTYPELEN sizeof("traditional ")
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* SCCS Id: @(#)cmd.c 3.5 2007/02/05 */
|
/* SCCS Id: @(#)cmd.c 3.5 2007/02/21 */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -21,8 +21,6 @@ struct cmd Cmd = { 0 }; /* flag.h */
|
|||||||
#define CMD_TRAVEL (char)0x90
|
#define CMD_TRAVEL (char)0x90
|
||||||
#define CMD_CLICKLOOK (char)0x8F
|
#define CMD_CLICKLOOK (char)0x8F
|
||||||
|
|
||||||
#define NODIAG(monnum) ((monnum) == PM_GRID_BUG)
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
/*
|
/*
|
||||||
* only one "wiz_debug_cmd" routine should be available (in whatever
|
* only one "wiz_debug_cmd" routine should be available (in whatever
|
||||||
@@ -2634,6 +2632,20 @@ confdir()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *
|
||||||
|
directionname(dir)
|
||||||
|
int dir;
|
||||||
|
{
|
||||||
|
static NEARDATA const char * const dirnames[] = {
|
||||||
|
"west", "northwest", "north", "northeast",
|
||||||
|
"east", "southeast", "south", "southwest",
|
||||||
|
"down", "up",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (dir < 0 || dir >= SIZE(dirnames)) return "invalid";
|
||||||
|
return dirnames[dir];
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
isok(x,y)
|
isok(x,y)
|
||||||
register int x, y;
|
register int x, y;
|
||||||
|
|||||||
Reference in New Issue
Block a user