summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/test/monplace.lua
blob: 21205d180d3c53c3909cb11c251a2fc78f8ce59e (plain) (blame)
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
-- Monster placement tests.

local place = dgn.point(20, 20)

local function place_monster_on(x, y, monster, feature)
  dgn.grid(place.x, place.y, feature)
  return dgn.create_monster(x, y, monster)
end

local function assert_place_monster_on(monster, feature)
  feature = feature or 'floor'
  dgn.dismiss_monsters()
  crawl.message("Placing " .. monster .. " on " .. feature)
  assert(place_monster_on(place.x, place.y, monster, feature),
         "Could not place monster " .. monster .. " on " .. feature)
end

assert_place_monster_on("quokka", "floor")
assert_place_monster_on("necrophage", "altar_zin")
assert_place_monster_on("rat", "shallow water")

-- [ds] One wonders why due has this morbid fetish involving flying
-- skulls and lava...
assert_place_monster_on("flying skull", "lava")
assert_place_monster_on("dryad", "tree")
assert_place_monster_on("cyan ugly thing")
assert_place_monster_on("purple very ugly thing")