Source:NetHack 2.2a/you.h

From NetHackWiki
Jump to navigation Jump to search

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

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

Screenshots and source code from Hack are used under the CWI license.

1.    /*	SCCS Id: @(#)you.h	2.1	87/11/09
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    
4.    #ifndef YOU_H
5.    #define YOU_H
6.    
7.    #include "config.h"
8.    #include "onames.h"
9.    #include "permonst.h"
10.   
11.   struct prop {
12.   
13.   #define	TIMEOUT		007777	/* mask */
14.   #define	LEFT_RING	W_RINGL	/* 010000L */
15.   #define	RIGHT_RING	W_RINGR	/* 020000L */
16.   #define	INTRINSIC	040000L
17.   #define	LEFT_SIDE	LEFT_RING
18.   #define	RIGHT_SIDE	RIGHT_RING
19.   #define	BOTH_SIDES	(LEFT_SIDE | RIGHT_SIDE)
20.   
21.   	long p_flgs;
22.   	int (*p_tofn)();	/* called after timeout */
23.   };
24.   
25.   struct you {
26.   	xchar ux, uy;
27.   	schar dx, dy, dz;	/* direction of move (or zap or ... ) */
28.   	schar di;		/* direction of FF */
29.   	xchar ux0, uy0;		/* initial position FF */
30.   	xchar udisx, udisy;	/* last display pos */
31.   	char usym;		/* usually '@' */
32.   	schar uluck;
33.   #define	LUCKMAX		10	/* on moonlit nights 11 */
34.   #define	LUCKMIN		(-10)
35.   	int last_str_turn;	/* 0: none, 1: half turn, 2: full turn */
36.   				/* +: turn right, -: turn left */
37.   	unsigned udispl;	/* @ on display */
38.   	unsigned ulevel;	/* 1 - 14 */
39.   #ifdef QUEST
40.   	unsigned uhorizon;
41.   #endif
42.   	unsigned utrap;		/* trap timeout */
43.   	unsigned utraptype;	/* defined if utrap nonzero */
44.   #define	TT_BEARTRAP	0
45.   #define	TT_PIT		1
46.   #ifdef SPIDERS
47.   #define	TT_WEB		2
48.   #endif
49.   	unsigned uinshop;	/* used only in shk.c - (roomno+1) of shop */
50.   
51.   /* perhaps these #define's should also be generated by makedefs */
52.   #define	TELEPAT		LAST_RING		/* not a ring */
53.   #define	HTelepat	u.uprops[TELEPAT].p_flgs
54.   #define	Telepat		((HTelepat) || (u.usym == 'E'))
55.   #define	FAST		(LAST_RING+1)		/* not a ring */
56.   #define	Fast		u.uprops[FAST].p_flgs
57.   #define	CONFUSION	(LAST_RING+2)		/* not a ring */
58.   #define	HConfusion	u.uprops[CONFUSION].p_flgs
59.   #define Confusion	((HConfusion) || index("BIy", u.usym))
60.   #define	INVIS		(LAST_RING+3)		/* not a ring */
61.   #define	HInvis		u.uprops[INVIS].p_flgs
62.   #define Invis		((HInvis) || u.usym == 'I')
63.   #define Invisible	(Invis && !See_invisible)
64.   #define	GLIB		(LAST_RING+4)		/* not a ring */
65.   #define	Glib		u.uprops[GLIB].p_flgs
66.   #define	PUNISHED	(LAST_RING+5)		/* not a ring */
67.   #define	Punished	u.uprops[PUNISHED].p_flgs
68.   #define	SICK		(LAST_RING+6)		/* not a ring */
69.   #define	Sick		u.uprops[SICK].p_flgs
70.   #define	BLINDED		(LAST_RING+7)		/* not a ring */
71.   #define	Blinded		u.uprops[BLINDED].p_flgs
72.   #define	WOUNDED_LEGS	(LAST_RING+8)		/* not a ring */
73.   #define Wounded_legs	u.uprops[WOUNDED_LEGS].p_flgs
74.   #define STONED		(LAST_RING+9)		/* not a ring */
75.   #define Stoned		u.uprops[STONED].p_flgs
76.   #define HALLUCINATION	(LAST_RING+10)		/* not a ring */
77.   #define Hallucination	u.uprops[HALLUCINATION].p_flgs
78.   #define	BLINDFOLDED	(LAST_RING+11)		/* not a ring */
79.   #define	Blindfolded	u.uprops[BLINDFOLDED].p_flgs
80.   #define Blind		(Blinded || Blindfolded)
81.   #define PROP(x) (x-RIN_ADORNMENT)       /* convert ring to index in uprops */
82.   	struct prop uprops[LAST_RING+11];
83.   
84.   	unsigned umconf;
85.   	char *usick_cause;
86.   	int mh, mhmax, mtimedone, umonnum;	/* for polymorph-self */
87.   	schar mstr, mstrmax;			/* for saving ustr/ustrmax */
88.   #if defined(KOPS) && defined(KAA)
89.   	unsigned ucreamed;
90.   #endif
91.   	unsigned uswallow;		/* set if swallowed by a monster */
92.   	unsigned uswldtim;		/* time you have been swallowed */
93.   	unsigned uhs;			/* hunger state - see hack.eat.c */
94.   #ifdef HARD
95.   	unsigned udemigod;		/* once you kill the wiz */
96.   	unsigned udg_cnt;		/* how long you have been demigod */
97.   #endif
98.   #ifdef RPH
99.   	int medusa_level;		/* level of wiz and medusa */
100.  	int wiz_level;
101.  #endif	
102.  	schar ustr,ustrmax;
103.  	schar udaminc;
104.  	schar uac;
105.  	int uhp,uhpmax;
106.  #ifdef SPELLS
107.  	int uen,uenmax;			/* magical energy - M. Stephenson */
108.  #endif
109.  #ifdef PRAYERS
110.  	int ugangr;			/* if the gods are angry at you */
111.  	int ublessed,ublesscnt;		/* blessing/duration from #pray */
112.  #endif
113.  	long int ugold,ugold0,uexp,urexp;
114.  	int uhunger;			/* refd only in eat.c and shk.c */
115.  	int uinvault;
116.  	struct monst *ustuck;
117.  	int nr_killed[CMNUM+2];		/* used for experience bookkeeping */
118.  };
119.  
120.  #endif /* YOU_H /**/