Source:NetHack 3.4.0/align.h

From NetHackWiki
Jump to navigation Jump to search

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

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

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1.    /*	SCCS Id: @(#)align.h	3.4	1991/12/29	*/
2.    /* Copyright (c) Mike Stephenson, Izchak Miller  1991.		  */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef ALIGN_H
6.    #define ALIGN_H
7.    
8.    typedef schar	aligntyp;	/* basic alignment type */
9.    
10.   typedef struct	align {		/* alignment & record */
11.   	aligntyp	type;
12.   	int		record;
13.   } align;
14.   
15.   /* bounds for "record" -- respect initial alignments of 10 */
16.   #define ALIGNLIM	(10L + (moves/200L))
17.   
18.   #define A_NONE	      (-128)	/* the value range of type */
19.   
20.   #define A_CHAOTIC	(-1)
21.   #define A_NEUTRAL	 0
22.   #define A_LAWFUL	 1
23.   
24.   #define A_COALIGNED	 1
25.   #define A_OPALIGNED	(-1)
26.   
27.   #define AM_NONE		 0
28.   #define AM_CHAOTIC	 1
29.   #define AM_NEUTRAL	 2
30.   #define AM_LAWFUL	 4
31.   
32.   #define AM_MASK		 7
33.   
34.   #define AM_SPLEV_CO	 3
35.   #define AM_SPLEV_NONCO	 7
36.   
37.   #define Amask2align(x)	((aligntyp) ((!(x)) ? A_NONE \
38.   			 : ((x) == AM_LAWFUL) ? A_LAWFUL : ((int)x) - 2))
39.   #define Align2amask(x)	(((x) == A_NONE) ? AM_NONE \
40.   			 : ((x) == A_LAWFUL) ? AM_LAWFUL : (x) + 2)
41.   
42.   #endif /* ALIGN_H */