Zwergenbonus gibt es nur in E2

This commit is contained in:
Enno Rehling 2017-03-18 08:00:35 +01:00
parent 4c67e0603b
commit ae6d9f0e1a
2 changed files with 23 additions and 23 deletions

View File

@ -39,6 +39,29 @@ function test_herbalism()
assert_equal(98, r:get_resource("seed")) assert_equal(98, r:get_resource("seed"))
end 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("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() function test_build_harbour()
-- try to reproduce mantis bug 2221 -- try to reproduce mantis bug 2221
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")

View File

@ -32,29 +32,6 @@ function test_mine_bonus()
assert_equal(80, r:get_resource("iron")) assert_equal(80, r:get_resource("iron"))
end end
function test_mine_example()
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("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_no_guards() function test_no_guards()
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")
r:set_resource("tree", 100) r:set_resource("tree", 100)