xref: /openbsd/games/phantasia/macros.h (revision 7b36286a)
1 /*	$OpenBSD: macros.h,v 1.2 1998/11/29 19:56:57 pjanzen Exp $	*/
2 /*	$NetBSD: macros.h,v 1.3 1995/04/24 12:24:34 cgd Exp $	*/
3 
4 /*
5  * macros.h - macro definitions for Phantasia
6  */
7 
8 #define ROLL(BASE,INTERVAL)	floor((BASE) + (INTERVAL) * drandom())
9 #define SGN(X)		((X) < 0 ? -1 : 1)
10 #define CIRCLE(X, Y)	floor(distance(X, 0.0, Y, 0.0) / 125.0 + 1)
11 #undef MAX
12 #define MAX(A, B)	((A) > (B) ? (A) : (B))
13 #undef MIN
14 #define MIN(A, B)	((A) < (B) ? (A) : (B))
15 #define ILLCMD()	mvaddstr(5, 0, Illcmd)
16 #define MAXMOVE()	(Player.p_level * 1.5 + 1)
17 #define ILLMOVE()	mvaddstr(5, 0, Illmove)
18 #define ILLSPELL()	mvaddstr(5, 0, Illspell)
19 #define NOMANA()	mvaddstr(5, 0, Nomana)
20 #define SOMEBETTER()	addstr(Somebetter)
21 #define NOBETTER()	mvaddstr(17, 0, Nobetter)
22