summaryrefslogtreecommitdiffstats
path: root/phantasia/macros.h
diff options
context:
space:
mode:
authorjtc <jtc@NetBSD.org>1994-10-21 21:19:39 +0000
committerjtc <jtc@NetBSD.org>1994-10-21 21:19:39 +0000
commitbcced3608bdd120315d4ed1d9b9478f7caa4a2f1 (patch)
tree1b68a06d7ec808c1e35e59a8f41e3e609e18490a /phantasia/macros.h
parent77e00dbff29bb84ca1625007d722e38a00e6f601 (diff)
downloadbsdgames-darwin-bcced3608bdd120315d4ed1d9b9478f7caa4a2f1.tar.gz
bsdgames-darwin-bcced3608bdd120315d4ed1d9b9478f7caa4a2f1.tar.zst
bsdgames-darwin-bcced3608bdd120315d4ed1d9b9478f7caa4a2f1.zip
phantasia(6), from 44lite
Diffstat (limited to 'phantasia/macros.h')
-rw-r--r--phantasia/macros.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/phantasia/macros.h b/phantasia/macros.h
new file mode 100644
index 00000000..e2327421
--- /dev/null
+++ b/phantasia/macros.h
@@ -0,0 +1,16 @@
+/*
+ * macros.h - macro definitions for Phantasia
+ */
+
+#define ROLL(BASE,INTERVAL) floor((BASE) + (INTERVAL) * drandom())
+#define SGN(X) ((X) < 0 ? -1 : 1)
+#define CIRCLE(X, Y) floor(distance(X, 0.0, Y, 0.0) / 125.0 + 1)
+#define MAX(A, B) ((A) > (B) ? (A) : (B))
+#define MIN(A, B) ((A) < (B) ? (A) : (B))
+#define ILLCMD() mvaddstr(5, 0, Illcmd)
+#define MAXMOVE() (Player.p_level * 1.5 + 1)
+#define ILLMOVE() mvaddstr(5, 0, Illmove)
+#define ILLSPELL() mvaddstr(5, 0, Illspell)
+#define NOMANA() mvaddstr(5, 0, Nomana)
+#define SOMEBETTER() addstr(Somebetter)
+#define NOBETTER() mvaddstr(17, 0, Nobetter)