forked from github/server
fix tests that use leveled resources.
This commit is contained in:
parent
2953a5f036
commit
182cecf31b
|
@ -99,30 +99,32 @@ end
|
|||
function test_guard_protects_iron()
|
||||
local r = region.create(0, 0, "plain")
|
||||
r:set_resource("iron", 100)
|
||||
local level = r:get_resourcelevel("iron")
|
||||
local u = unit.create(faction.create("human"), r)
|
||||
u:set_skill("mining", 1)
|
||||
u:set_skill("mining", level)
|
||||
local guard = unit.create(get_monsters(), r, 1)
|
||||
guard:add_order("BEWACHEN")
|
||||
|
||||
u:add_order("MACHE EISEN")
|
||||
process_orders()
|
||||
assert_equal(1, u:get_item("iron"))
|
||||
assert_equal(level, u:get_item("iron"))
|
||||
process_orders()
|
||||
assert_equal(1, u:get_item("iron"))
|
||||
assert_equal(level, u:get_item("iron"))
|
||||
end
|
||||
|
||||
function test_ironkeeper_guards_iron()
|
||||
local r = region.create(0, 0, "plain")
|
||||
r:set_resource("iron", 100)
|
||||
local level = r:get_resourcelevel("iron")
|
||||
local u = unit.create(faction.create("human"), r)
|
||||
u:set_skill("mining", 1)
|
||||
u:set_skill("mining", level)
|
||||
local guard = unit.create(faction.create("mountainguard"), r, 1, "mountainguard")
|
||||
guard:add_order("BEWACHEN")
|
||||
u:add_order("MACHE EISEN")
|
||||
process_orders()
|
||||
assert_equal(1, u:get_item("iron"))
|
||||
assert_equal(level, u:get_item("iron"))
|
||||
process_orders()
|
||||
assert_equal(1, u:get_item("iron"))
|
||||
assert_equal(level, u:get_item("iron"))
|
||||
end
|
||||
|
||||
function test_ent_guards_trees()
|
||||
|
@ -140,26 +142,5 @@ function test_ent_guards_trees()
|
|||
process_orders()
|
||||
assert_equal(1, u:get_item("log"))
|
||||
process_orders()
|
||||
-- print("report: " .. tostring(u.faction))
|
||||
-- init_reports()
|
||||
-- write_report(u.faction)
|
||||
assert_equal(1, u:get_item("log"))
|
||||
end
|
||||
|
||||
function test_ironkeeper_allows_recruit()
|
||||
local r = region.create(0, 0, "plain")
|
||||
r:set_resource("iron", 100)
|
||||
local u = unit.create(faction.create("human"), r)
|
||||
u:set_skill("mining", 1)
|
||||
local guard = unit.create(faction.create("mountainguard"), r, 1, "mountainguard")
|
||||
guard:add_order("BEWACHEN")
|
||||
|
||||
u:add_item("money", 1000)
|
||||
assert_equal(1, u.number)
|
||||
u:add_order("REKRUTIERE 1")
|
||||
process_orders()
|
||||
assert_equal(2, u.number)
|
||||
u:add_order("REKRUTIERE 1")
|
||||
process_orders()
|
||||
assert_equal(3, u.number)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue