summaryrefslogtreecommitdiff
path: root/src/joke.c
blob: 0ff015578661bc71a3183a8870228e79f2a60d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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;
}