From a4deb041e2c9a3c0a93e154c6fc835c759c250b9 Mon Sep 17 00:00:00 2001 From: jwalz Date: Sat, 5 Jan 2002 21:05:47 +0000 Subject: [PATCH] *** empty log message *** --- include/align.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/align.h diff --git a/include/align.h b/include/align.h new file mode 100644 index 000000000..199c5ccd4 --- /dev/null +++ b/include/align.h @@ -0,0 +1,42 @@ +/* SCCS Id: @(#)align.h 3.3 91/12/29 */ +/* Copyright (c) Mike Stephenson, Izchak Miller 1991. */ +/* NetHack may be freely redistributed. See license for details. */ + +#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 */