summaryrefslogtreecommitdiff
path: root/src/joke.c
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-26 07:15:21 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-26 07:15:21 +0200
commit03aa3417ca54eeb3ebf61557d062a5c31bf0172e (patch)
treeac057913cccd49e99dc0f2d515c94c9c058e00cf /src/joke.c
parent79531149c7493b1126febb21bb7bfc958d6d3e2a (diff)
parent049a6c9ad822840b80a52e68a3095a2f072c74a2 (diff)
Merge branch 'unlua'
Diffstat (limited to 'src/joke.c')
-rw-r--r--src/joke.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/joke.c b/src/joke.c
new file mode 100644
index 00000000..0ff01557
--- /dev/null
+++ b/src/joke.c
@@ -0,0 +1,34 @@
+#include "angband.h"
+
+static void gen_joke_place_monster(r_idx)
+{
+ int try;
+
+ for (try = 0; try < 1000; try++)
+ {
+ int x = randint(cur_hgt - 4) + 2;
+ int y = randint(cur_wid - 4) + 2;
+
+ if (place_monster_one(y, x, r_idx, 0, FALSE, MSTATUS_ENEMY))
+ {
+ return;
+ }
+ }
+}
+
+bool_ gen_joke_monsters(void *data, void *in, void *out)
+{
+ if (joke_monsters)
+ {
+ if ((dungeon_type == 20) &&
+ (dun_level == 72))
+ {
+ int r_idx = test_monster_name("Neil, the Sorceror");
+ m_allow_special[r_idx + 1] = TRUE;
+ gen_joke_place_monster(r_idx);
+ m_allow_special[r_idx + 1] = FALSE;
+ }
+ }
+
+ return FALSE;
+}