xref: /csrg-svn/games/phantasia/macros.h (revision 34604)
1*34604Sbostic /*
2*34604Sbostic  * macros.h - macro definitions for Phantasia
3*34604Sbostic  */
4*34604Sbostic 
5*34604Sbostic #define ROLL(BASE,INTERVAL)	floor((BASE) + (INTERVAL) * drandom())
6*34604Sbostic #define SGN(X)		((X) < 0 ? -1 : 1)
7*34604Sbostic #define CIRCLE(X, Y)	floor(distance(X, 0.0, Y, 0.0) / 125.0 + 1)
8*34604Sbostic #define MAX(A, B)	((A) > (B) ? (A) : (B))
9*34604Sbostic #define MIN(A, B)	((A) < (B) ? (A) : (B))
10*34604Sbostic #define ILLCMD()	mvaddstr(5, 0, Illcmd)
11*34604Sbostic #define MAXMOVE()	(Player.p_level * 1.5 + 1)
12*34604Sbostic #define ILLMOVE()	mvaddstr(5, 0, Illmove)
13*34604Sbostic #define ILLSPELL()	mvaddstr(5, 0, Illspell)
14*34604Sbostic #define NOMANA()	mvaddstr(5, 0, Nomana)
15*34604Sbostic #define SOMEBETTER()	addstr(Somebetter)
16*34604Sbostic #define NOBETTER()	mvaddstr(17, 0, Nobetter)
17