view arogue5/rogue.h @ 88:07c4d4883ef2

rogue3: begin porting to autoconf. Rogue V3 can now be built with './configure && make'. This is preliminary: 'make install' does not work yet.
author John "Elwin" Edwards
date Sat, 24 Aug 2013 13:36:13 -0700
parents 7aff18a8d508
children dfeed24bb616
line wrap: on
line source

/*
 * Rogue definitions and variable declarations
 *
 * Advanced Rogue
 * Copyright (C) 1984, 1985 Michael Morgan, Ken Dalka and AT&T
 * All rights reserved.
 *
 * Based on "Rogue: Exploring the Dungeons of Doom"
 * Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
 * All rights reserved.
 *
 * See the file LICENSE.TXT for full copyright and licensing information.
 */

#define reg	register	/* register abbr.	*/
#define NOOP(x) (x += 0)
#define CCHAR(x) ( (char) (x & A_CHARTEXT) )

/*
 * Maximum number of different things
 */

#define MAXDAEMONS	10
#define MAXFUSES	20

#define NCOLORS         32
#define NSTONES         47
#define NWOOD           24
#define NMETAL          16
#define NSYLLS          159

#define	MAXROOMS	9
#define	MAXTHINGS	9
#define	MAXOBJ		9
#define MAXSTATS	62	/* max total of all stats at startup */
#define	MAXPACK		23
#define	MAXCONTENTS	10
#define MAXENCHANT	10	/* max number of enchantments on an item */
#define	MAXTREAS	15	/* number monsters/treasure in treasure room */
#define	MAXTRAPS	20
#define	MAXTRPTRY	8	/* attempts/level allowed for setting traps */
#define	MAXDOORS	4	/* Maximum doors to a room */
#define	MAXPRAYERS	15	/* Maximum number of prayers for cleric */
#define	MAXSPELLS	20	/* Maximum number of spells (for magician) */
#define	NUMMONST	120	/* Current number of monsters */
#define NUMUNIQUE	24	/* number of UNIQUE creatures */
#define	NLEVMONS	3	/* Number of new monsters per level */
#define	MAXFOODS	1
#define NUMSCORE	20	/* number of entries in score file */
#define HARDER		35	/* at this level start making things harder */
#define MAXPURCH	4	/* max purchases per trading post visit */
#define LINELEN		80	/* characters in a buffer */
#define JUG_EMPTY	-1	/* signifys that the alchemy jug is empty */

/* Movement penalties */
#define BACKPENALTY 3
#define SHOTPENALTY 2		/* In line of sight of missile */
#define DOORPENALTY 1		/* Moving out of current room */

/*
 * these defines are used in calls to get_item() to signify what
 * it is we want
 */
#define	ALL		-1
#define	WEARABLE	-2
#define	CALLABLE	-3
#define WIELDABLE	-4
#define USEABLE		-5
#define IDENTABLE	-6
#define REMOVABLE	-7
#define PROTECTABLE	-8
#define ZAPPABLE	-9

/*
 * stuff to do with encumberance
 */
#define NORMENCB	1500	/* normal encumberance */
#define F_OKAY		 0	/* have plenty of food in stomach */
#define F_HUNGRY	 1	/* player is hungry */
#define F_WEAK		 2	/* weak from lack of food */
#define F_FAINT		 3	/* fainting from lack of food */

/*
 * return values for get functions
 */
#define	NORM	0	/* normal exit */
#define	QUIT	1	/* quit option setting */
#define	MINUS	2	/* back up one option */

/* 
 * The character types
 */
#define	C_FIGHTER	0
#define	C_MAGICIAN	1
#define	C_CLERIC	2
#define	C_THIEF		3
#define	C_MONSTER	4

/*
 * Number of hit points for going up a level
 */
#define HIT_FIGHTER	10
#define HIT_MAGICIAN	8
#define HIT_CLERIC	8
#define HIT_THIEF	6

/*
 * values for games end
 */
#define UPDATE  -2
#define SCOREIT -1
#define KILLED 	 0
#define CHICKEN  1
#define WINNER   2

/*
 * definitions for function step_ok:
 *	MONSTOK indicates it is OK to step on a monster -- it
 *	is only OK when stepping diagonally AROUND a monster
 */
#define MONSTOK 1
#define NOMONST 2

/*
 * used for ring stuff
 */
#define LEFT_1		 0
#define LEFT_2		 1
#define LEFT_3		 2
#define LEFT_4		 3
#define RIGHT_1		 4
#define RIGHT_2		 5
#define RIGHT_3		 6
#define RIGHT_4		 7
#define NUM_FINGERS	 8

/*
 * used for micellaneous magic (MM) stuff
 */
#define WEAR_BOOTS	0
#define WEAR_BRACERS	1
#define WEAR_CLOAK	2
#define WEAR_GAUNTLET	3
#define WEAR_JEWEL	4
#define WEAR_NECKLACE	5
#define NUM_MM		6

/*
 * All the fun defines
 */
#define next(ptr) (*ptr).l_next
#define prev(ptr) (*ptr).l_prev
#define ldata(ptr) (*ptr).l_data
#define inroom(rp, cp) (\
    (cp)->x <= (rp)->r_pos.x + ((rp)->r_max.x - 1) && (rp)->r_pos.x <= (cp)->x \
 && (cp)->y <= (rp)->r_pos.y + ((rp)->r_max.y - 1) && (rp)->r_pos.y <= (cp)->y)
#define winat(y, x) (mvwinch(mw, y, x)==' '?mvwinch(stdscr, y, x):winch(mw))
#define debug if (wizard) msg
#define RN (((seed = seed*11109+13849) & 0x7fff) >> 1)
#define unc(cp) (cp).y, (cp).x
#define cmov(xy) move((xy).y, (xy).x)
#define DISTANCE(y1, x1, y2, x2) ((x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1))
#define OBJPTR(what)	(struct object *)((*what).l_data)
#define THINGPTR(what)	(struct thing *)((*what).l_data)
#define DOORPTR(what)	(coord *)((*what).l_data)
#define when break;case
#define otherwise break;default
#define until(expr) while(!(expr))
#define ce(a, b) ((a).x == (b).x && (a).y == (b).y)
#define draw(window) wrefresh(window)
#define hero player.t_pos