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