Source:NetHack 3.1.0/you.h

Below is the full text to you.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.0/you.h#line123 ]], for example.

Warning! This is the source code from an old release. For the latest release, see Source code

1.   /*	SCCS Id: @(#)you.h	3.1	92/11/29	*/ 2.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3.    /* NetHack may be freely redistributed. See license for details. */ 4.     5.    #ifndef YOU_H 6.   #define YOU_H 7.    8.    #ifndef ALIGN_H 9.   #include "align.h"  10. #endif 11.  #ifndef ATTRIB_H 12.  #include "attrib.h"  13. #endif 14.  #ifndef MONST_H 15.  #include "monst.h"  16. #endif 17.  #ifndef YOUPROP_H 18.  #include "youprop.h"  19. #endif 20.   21.   struct prop { 22.   23.   #define TIMEOUT		007777	/* mask */ 24.   25.   #define LEFT_RING	W_RINGL	/* 010000L */ 26.  #define RIGHT_RING	W_RINGR	/* 020000L */ 27.  #define LEFT_SIDE	LEFT_RING 28.  #define RIGHT_SIDE	RIGHT_RING 29.  #define BOTH_SIDES	(LEFT_SIDE | RIGHT_SIDE) 30.   31.   #define WORN_ARMOR	W_ARM	/* 040000L */ 32.  #define WORN_CLOAK	W_ARMC	/* 0100000L */ 33.  #define WORN_HELMET	W_ARMH	/* 0200000L */ 34.  #define WORN_SHIELD	W_ARMS	/* 0400000L */ 35.  #define WORN_GLOVES	W_ARMG	/* 01000000L */ 36.  #define WORN_BOOTS	W_ARMF	/* 02000000L */ 37.  #define WORN_AMUL	W_AMUL	/* 04000000L */ 38.  #define WORN_BLINDF	W_TOOL	/* 010000000L */ 39.  #ifdef TOURIST 40.  #define WORN_SHIRT	W_ARMU	/* 01000L */ 41.  #endif 42.   43.   /*  44.    * FROMEXPER is for a property gained by virtue of your experience level, 45.   * which will be lost if you lose that level; FROMOUTSIDE is one that is  46. * gained in some other way (e.g., a throne, a prayer, or a corpse). 47.   * INTRINSIC is either FROMEXPER or FROMOUTSIDE 48.   */  49.   #define FROMOUTSIDE	0200000000L 50.  #define FROMEXPER	0400000000L 51.  #define INTRINSIC	(FROMOUTSIDE|FROMEXPER) 52.   53.   	long p_flgs; 54.  	int NDECL((*p_tofn));	/* called after timeout */ 55.  };  56.    57.   struct u_have { 58.  	Bitfield(amulet,1);	/* carrying Amulet	*/ 59.  	Bitfield(bell,1);	/* carrying Bell	*/ 60.  	Bitfield(book,1);	/* carrying Book	*/ 61.  	Bitfield(menorah,1);	/* carrying Candelabrum */ 62.  #ifdef MULDGN 63.  	Bitfield(questart,1);	/* carrying the Quest Artifact */ 64.  	Bitfield(unused,3); 65.  #else 66.  	Bitfield(unused,4); 67.  #endif 68.  };  69.    70.   struct u_event { 71.  	Bitfield(minor_oracle,1);	/* received at least 1 cheap oracle */ 72.  	Bitfield(major_oracle,1);	/*  "  expensive oracle */  73.   #ifdef MULDGN  74.   	Bitfield(qexpelled,1);		/* expelled from the Quest dungeon */  75.   	Bitfield(qcompleted,1);	    /* successfully completed the Quest task */  76.   #endif  77.   	Bitfield(uheard_tune,2);	/* if you heard the passtune */  78.   	Bitfield(uopened_dbridge,1);	/* if you open the drawbridge */  79.   	Bitfield(invoked,1);	    /* invoked the gate to the Sanctum level */  80.    81.   	Bitfield(gehennom_entered,1);	/* entered Gehennom via Valley */  82.   #ifdef ELBERETH  83.   	Bitfield(uhand_of_elbereth,1);	/* if you become Hand of Elbereth */  84.   #endif  85.   	Bitfield(udemigod,1);		/* once you kill the wiz */  86.   };  87.    88.    89.   struct you {  90.   	xchar ux, uy;  91.   	schar dx, dy, dz;	/* direction of move (or zap or ... ) */  92.   	schar di;		/* direction of FF */  93.   	xchar ux0, uy0;		/* initial position FF */ 94.  	d_level uz, uz0;	/* your level on this and the previous turn */ 95.  	d_level utolev;		/* level monster teleported you to, or uz */ 96.  	char utotype;		/* bitmask of goto_level flags for utolev */ 97.  	char usym;		/* usually '@' */ 98.  	boolean umoved;		/* changed map location (post-move) */ 99.  	int last_str_turn;	/* 0: none, 1: half turn, 2: full turn */ 100. 				/* +: turn right, -: turn left */ 101. 	unsigned ulevel;	/* 1 - MAXULEV */ 102. 	unsigned utrap;		/* trap timeout */ 103. 	unsigned utraptype;	/* defined if utrap nonzero */ 104. #define TT_BEARTRAP	0 105. #define TT_PIT		1 106. #define TT_WEB		2 107. #define TT_LAVA		3 108. #define TT_INFLOOR	4 109. 	char	urooms[5];	/* rooms (roomno + 3) occupied now */ 110. 	char	urooms0[5];	/* ditto, for previous position */ 111. 	char	uentered[5];	/* rooms (roomno + 3) entered this turn */ 112. 	char	ushops[5];	/* shop rooms (roomno + 3) occupied now */ 113. 	char	ushops0[5];	/* ditto, for previous position */ 114. 	char	ushops_entered[5]; /* ditto, shops entered this turn */ 115. 	char	ushops_left[5];	/* ditto, shops exited this turn */ 116.  117.  	int	 uhunger;	/* refd only in eat.c and shk.c */ 118. 	unsigned uhs;		/* hunger state - see eat.c */ 119.  120.  	struct prop uprops[LAST_PROP+1]; 121.  122.  	unsigned umconf; 123. 	const char *usick_cause; 124. /* For messages referring to hands, eyes, feet, etc... when polymorphed */ 125. #define ARM 0 126. #define EYE 1 127. #define FACE 2 128. #define FINGER 3 129. #define FINGERTIP 4 130. #define FOOT 5 131. #define HAND 6 132. #define HANDED 7 133. #define HEAD 8 134. #define LEG 9 135. #define LIGHT_HEADED 10 136. #define NECK 11 137. #define SPINE 12 138. #define TOE 13 139.  140.  	/* These ranges can never be more than MAX_RANGE (vision.h). */ 141.  	int nv_range;			/* current night vision range */ 142. 	int xray_range;			/* current xray vision range */ 143.  144.  	/*  145.  	 * These variables are valid globally only when punished and blind. 146. 	 */  147.  #define BC_BALL  0x01	/* bit mask for ball  in 'bc_felt' below */ 148. #define BC_CHAIN 0x02	/* bit mask for chain in 'bc_felt' below */ 149. 	int bglyph;	/* glyph under the ball */ 150. 	int cglyph;	/* glyph under the chain */ 151. 	int bc_order;	/* ball & chain order [see bc_order in trap.c] */ 152. 	int bc_felt;	/* mask for ball/chain being felt */ 153.  154.   155.  	/*  156.  	 * Player type monster (e.g. PM_VALKYRIE). This is set in u_init 157. 	 * and never changed afterward. 158. 	 */  159.  	int umonster; 160. #ifdef POLYSELF 161. 	int umonnum;				/* monster number or -1 */ 162. 	int mh, mhmax, mtimedone;		/* for polymorph-self */ 163. 	struct attribs	macurr,			/* for monster attribs */ 164. 			mamax;			/* for monster attribs */ 165. 	int ulycn;				/* lycanthrope type */ 166. #endif 167. 	unsigned ucreamed; 168. 	unsigned uswldtim;		/* time you have been swallowed */ 169.  170.  	Bitfield (uswallow,1);		/* true if swallowed */ 171. 	Bitfield(uinwater,1);		/* if you're currently in water (only  172.  					   underwater possible currently) */ 173. #ifdef POLYSELF 174. 	Bitfield(uundetected,1);	/* if you're a hiding monster/piercer */ 175. 	Bitfield(mfemale,1);		/* saved human value of flags.female */ 176. #endif 177. 	Bitfield(uinvulnerable,1);	/* you're invulnerable (praying) */ 178. 	Bitfield(usleep,1);		/* you're sleeping */ 179.  180.  	unsigned udg_cnt;		/* how long you have been demigod */ 181. 	struct u_event	uevent;		/* certain events have happened */ 182. 	struct u_have	uhave;		/* you're carrying special objects */ 183. 	struct attribs	acurr,		/* your current attributes (eg. str)*/ 184. 			aexe,		/* for gain/loss via "exercise" */ 185. 			abon,		/* your bonus attributes (eg. str) */ 186. 			amax,		/* your max attributes (eg. str) */ 187. 			atemp,		/* used for temporary loss/gain */ 188. 			atime;		/* used for loss/gain countdown */ 189. 	align	ualign;			/* character alignment */ 190. #define CONVERT		2 191. 	aligntyp ualignbase[CONVERT];	/* for ualign conversion record */ 192. 	schar uluck, moreluck;		/* luck and luck bonus */ 193. #define LUCKADD		3	/* added value when carrying luck stone */ 194. #define Luck	(u.uluck + u.moreluck) 195. #define LUCKMAX		10	/* on moonlit nights 11 */ 196. #define LUCKMIN		(-10) 197. 	schar	udaminc; 198. 	schar	uac; 199. 	int	uhp,uhpmax; 200. 	int	uen, uenmax;		/* magical energy - M. Stephenson */ 201. 	int ugangr;			/* if the gods are angry at you */ 202. 	int ublessed, ublesscnt;	/* blessing/duration from #pray */ 203. 	long	ugold, ugold0; 204. 	long	uexp, urexp; 205. 	long	ucleansed;	/* to record moves when player was cleansed */ 206. 	int uinvault; 207. 	struct monst *ustuck; 208. 	int ugrave_arise; /* you die and become something aside from a ghost */ 209. 	int nr_killed[NUMMONS];		/* used for experience bookkeeping */ 210. };  211.   212.  #endif	/* YOU_H */