forked from github/server
Zwergenbonus gibt es nur in E2
This commit is contained in:
parent
afd1cb4039
commit
ec375baa03
|
@ -39,6 +39,29 @@ function test_herbalism()
|
|||
assert_equal(98, r:get_resource("seed"))
|
||||
end
|
||||
|
||||
function test_dwarf_bonus()
|
||||
local r = region.create(0, 0, "mountain")
|
||||
r:set_resource("iron", 100)
|
||||
local level = r:get_resourcelevel("iron")
|
||||
assert_equal(1, level)
|
||||
local u = unit.create(faction.create('test@example.com', "dwarf"), r)
|
||||
assert_equal("dwarf", u.faction.race)
|
||||
assert_equal("dwarf", u.race)
|
||||
u.faction.name = "Zwerge"
|
||||
u.number = 10
|
||||
u:set_skill("mining", 1)
|
||||
u:add_order("MACHE EISEN")
|
||||
process_orders()
|
||||
assert_equal(30, u:get_item("iron"))
|
||||
assert_equal(82, r:get_resource("iron"))
|
||||
u.building = building.create(r, "mine")
|
||||
u.building.size = 10
|
||||
u:add_item("money", 500) -- maintenance
|
||||
process_orders()
|
||||
assert_equal(70, u:get_item("iron"))
|
||||
assert_equal(70, r:get_resource("iron"))
|
||||
end
|
||||
|
||||
function test_build_harbour()
|
||||
-- try to reproduce mantis bug 2221
|
||||
local r = region.create(0, 0, "plain")
|
||||
|
|
Loading…
Reference in New Issue