File: moncast.lua

package info (click to toggle)
crawl 2%3A0.34.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 100,188 kB
  • sloc: cpp: 363,709; ansic: 27,765; javascript: 9,516; python: 8,463; perl: 3,293; java: 3,132; xml: 2,380; makefile: 1,835; sh: 611; objc: 250; cs: 15; sed: 9; lisp: 3
file content (28 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (2)
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
-- Monster casting tests.
-- this is mostly implemented on the c++ side (see debug_check_moncasts), but
-- we use lua to more easily set up the dungeon scenario.
dgn.dismiss_monsters()

local place1 = dgn.point(20, 20)
local place2 = dgn.point(20, 21)


dgn.create_monster(place1.x, place1.y, "generate_awake test statue")
-- first test without a foe. This provides a check on whether targeting flags
-- are set correctly.
debug.check_moncasts(place1.x, place1.y, place2.x, place2.y)

-- then check with a foe
dgn.dismiss_monsters()
dgn.create_monster(place1.x, place1.y, "generate_awake test statue")
dgn.create_monster(place2.x, place2.y, "generate_awake test statue att:friendly")
debug.check_moncasts(place1.x, place1.y, place2.x, place2.y)

-- and finally with an ally
dgn.dismiss_monsters()
dgn.create_monster(place1.x, place1.y, "generate_awake test statue")
dgn.create_monster(place2.x, place2.y, "generate_awake test statue")
debug.check_moncasts(place1.x, place1.y, place2.x, place2.y)

-- clean up
dgn.dismiss_monsters()