forked from github/server
test guardhouse level limits.
This commit is contained in:
parent
08e14f3095
commit
623137e872
|
@ -11,30 +11,40 @@ function teardown()
|
||||||
eressea.settings.set("rules.food.flags", "0")
|
eressea.settings.set("rules.food.flags", "0")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_watch()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local b = building.create(r, "watch")
|
||||||
|
|
||||||
|
assert_equal("scaffolding", b:get_typename(1))
|
||||||
|
assert_equal("scaffolding", b:get_typename(4))
|
||||||
|
assert_equal("guardhouse", b:get_typename(5))
|
||||||
|
assert_equal("guardhouse", b:get_typename(9))
|
||||||
|
assert_equal("guardtower", b:get_typename(10))
|
||||||
|
end
|
||||||
|
|
||||||
function test_small_castles()
|
function test_small_castles()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
local f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||||
local u1 = unit.create(f1, r, 1)
|
local u1 = unit.create(f1, r, 1)
|
||||||
local f2 = faction.create("noreply@eressea.de", "halfling", "de")
|
local f2 = faction.create("noreply@eressea.de", "halfling", "de")
|
||||||
local u2 = unit.create(f2, r, 1)
|
local u2 = unit.create(f2, r, 1)
|
||||||
u1:add_item("money", 10000)
|
|
||||||
|
|
||||||
local b = building.create(r, "castle")
|
local b = building.create(r, "castle")
|
||||||
u2.building = b
|
u2.building = b
|
||||||
u1.building = b
|
u1.building = b
|
||||||
|
|
||||||
b.owner = u2
|
b.owner = u2
|
||||||
assert_equal("site", b:get_typename(7))
|
assert_equal("site", b:get_typename(7))
|
||||||
assert_equal("fortification", b:get_typename(8))
|
assert_equal("fortification", b:get_typename(8))
|
||||||
b.owner = u1
|
b.owner = u1
|
||||||
assert_equal("site", b:get_typename(9))
|
assert_equal("site", b:get_typename(9))
|
||||||
assert_equal("fortification", b:get_typename(10))
|
assert_equal("fortification", b:get_typename(10))
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_build_normal()
|
function test_build_normal()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
local f = faction.create("noreply@eressea.de", "human", "de")
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
local u = unit.create(f, r, 1)
|
local u = unit.create(f, r, 1)
|
||||||
u:clear_orders()
|
u:clear_orders()
|
||||||
u:add_item("stone", 10)
|
u:add_item("stone", 10)
|
||||||
u:set_skill("building", 10)
|
u:set_skill("building", 10)
|
||||||
|
@ -45,9 +55,9 @@ function test_build_normal()
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_build_packice()
|
function test_build_packice()
|
||||||
local r = region.create(0, 0, "packice")
|
local r = region.create(0, 0, "packice")
|
||||||
local f = faction.create("packice@eressea.de", "human", "de")
|
local f = faction.create("packice@eressea.de", "human", "de")
|
||||||
local u = unit.create(f, r, 1)
|
local u = unit.create(f, r, 1)
|
||||||
u:clear_orders()
|
u:clear_orders()
|
||||||
u:add_item("stone", 10)
|
u:add_item("stone", 10)
|
||||||
u:set_skill("building", 10)
|
u:set_skill("building", 10)
|
||||||
|
|
Loading…
Reference in New Issue