server/scripts/tests/spells.lua

30 lines
723 B
Lua
Raw Normal View History

2010-08-08 10:06:34 +02:00
require "lunit"
module("tests.spells", package.seeall, lunit.testcase)
2010-08-08 10:06:34 +02:00
function setup()
free_game()
settings.set("magic.fumble.enable", "0")
2010-08-08 10:06:34 +02:00
end
function test_roi()
local r = region.create(0,0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u.race = "elf"
u:set_skill("magic", 10)
u:add_item("money", 3010)
f.magic = "gwyrrd"
u.magic = "gwyrrd"
2010-08-08 10:06:34 +02:00
u.aura = 200
u.ship = s1
2012-05-26 19:16:39 +02:00
-- local err = u:add_spell("create_roi")
-- assert_equal(0, err)
2010-08-08 10:06:34 +02:00
u:clear_orders()
u:add_order("ZAUBERE 'Erschaffe einen Ring der Unsichtbarkeit' ")
process_orders()
write_reports()
assert_equal(1, u:get_item("roi"))
2010-08-08 10:06:34 +02:00
end