macros.h 684 B

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