2010-08-08 10:06:34 +02:00
|
|
|
require "lunit"
|
|
|
|
|
2011-02-19 15:13:24 +01:00
|
|
|
module("tests.spells", package.seeall, lunit.testcase)
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
function setup()
|
|
|
|
free_game()
|
2012-05-20 03:50:28 +02:00
|
|
|
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)
|
2012-05-26 05:15:57 +02:00
|
|
|
f.magic = "tybied"
|
2010-08-08 10:06:34 +02:00
|
|
|
u.magic = "tybied"
|
|
|
|
u.aura = 200
|
|
|
|
u.ship = s1
|
2012-05-26 19:16:39 +02:00
|
|
|
|
2012-05-26 05:15:57 +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()
|
2012-05-26 04:55:47 +02:00
|
|
|
assert_equal(1, u:get_item("roi"))
|
2010-08-08 10:06:34 +02:00
|
|
|
end
|