Source:NetHack 3.4.3/include/align.h

From NetHackWiki
Revision as of 19:17, 31 January 2011 by Paxedbot (talk | contribs) (moved Source:Align.h to Source:NetHack 3.4.3/include/align.h: Moving src to subdirs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

/*	SCCS Id: @(#)align.h	3.4	1991/12/29	*/
/* Copyright (c) Mike Stephenson, Izchak Miller  1991.		  */
/* NetHack may be freely redistributed.  See license for details. */

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.

#ifndef ALIGN_H
#define ALIGN_H

typedef schar	aligntyp;	/* basic alignment type */

typedef struct	align {		/* alignment & record */
	aligntyp	type;
	int		record;
} align;

/* bounds for "record" -- respect initial alignments of 10 */
#define ALIGNLIM	(10L + (moves/200L))

#define A_NONE	      (-128)	/* the value range of type */

#define A_CHAOTIC	(-1)
#define A_NEUTRAL	 0
#define A_LAWFUL	 1

#define A_COALIGNED	 1
#define A_OPALIGNED	(-1)

#define AM_NONE		 0
#define AM_CHAOTIC	 1
#define AM_NEUTRAL	 2
#define AM_LAWFUL	 4

#define AM_MASK		 7

#define AM_SPLEV_CO	 3
#define AM_SPLEV_NONCO	 7

#define Amask2align(x)	((aligntyp) ((!(x)) ? A_NONE \
			 : ((x) == AM_LAWFUL) ? A_LAWFUL : ((int)x) - 2))
#define Align2amask(x)	(((x) == A_NONE) ? AM_NONE \
			 : ((x) == A_LAWFUL) ? AM_LAWFUL : (x) + 2)

#endif /* ALIGN_H */