summaryrefslogtreecommitdiff
path: root/src/joke.cc
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-01-27 12:43:59 -0800
committerManoj Srivastava <srivasta@debian.org>2016-01-27 12:50:09 -0800
commit76fce162659078323fcd5e54b3195dae371faca2 (patch)
treec1d93d415b96238aae3c54eb83cb0815af2e4bca /src/joke.cc
parentb4456969cd02d75c599a5b86b225c0774697e85d (diff)
parent4aa1a39402c3908e9e8b6eb3fd4e2183d5e5c52e (diff)
Merge branch 'development' into upstream
Signed-off-by: Manoj Srivastava <srivasta@debian.org> # Conflicts: # src/.gitignore # src/maid-x11.c # src/quest.pkg
Diffstat (limited to 'src/joke.cc')
-rw-r--r--src/joke.cc40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/joke.cc b/src/joke.cc
new file mode 100644
index 00000000..be272115
--- /dev/null
+++ b/src/joke.cc
@@ -0,0 +1,40 @@
+#include "joke.hpp"
+
+#include "monster2.hpp"
+#include "options.hpp"
+#include "util.hpp"
+#include "variable.hpp"
+#include "z-rand.hpp"
+
+static void gen_joke_place_monster(int 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] = TRUE;
+ gen_joke_place_monster(r_idx);
+ m_allow_special[r_idx] = FALSE;
+ }
+ }
+
+ return FALSE;
+}