rough test of familiar spell

This commit is contained in:
Enno Rehling 2018-01-26 17:45:40 +01:00
parent e233d08e8f
commit 1c535b8dda
1 changed files with 21 additions and 0 deletions

View File

@ -103,3 +103,24 @@ function test_earn_silver()
assert_equal(350, u:get_item("money"))
assert_equal(0, r:get_resource("money"))
end
function test_familiar()
local r = region.create(0, 0, "mountain")
local f = faction.create("human")
local u = unit.create(f, r)
local uid = u.id
u.name = 'Hodor'
u.magic = "gwyrrd"
u.race = "elf"
u:set_skill("magic", 10)
u.aura = 200
local err = u:add_spell("summon_familiar")
assert_equal(0, err)
u:add_order("ZAUBERE Vertrauten~rufen")
process_orders()
for u in r.units do
if u.id ~= uid then
assert_equal('Vertrauter von Hodor (' .. itoa36(uid) ..')', u.name)
end
end
end