forked from github/server
re-enable stealth faction (anon)
This commit is contained in:
parent
320bcb2121
commit
201ae39a4d
|
@ -64,7 +64,6 @@
|
|||
<order name="OPFERE" disable="yes"/>
|
||||
<order name="SABOTIEREN" disable="yes"/>
|
||||
<order name="SPIONIEREN" disable="yes"/>
|
||||
<order name="TARNEN" disable="yes"/>
|
||||
<order name="TREIBEN" disable="yes"/>
|
||||
<order name="UNTERHALTEN" disable="yes"/>
|
||||
<order name="VERKAUFEN" disable="yes"/>
|
||||
|
|
|
@ -9,4 +9,5 @@ tests = {
|
|||
srcpath .. '/eressea/scripts/tests/morale.lua',
|
||||
srcpath .. '/shared/scripts/tests/common.lua',
|
||||
srcpath .. '/eressea/scripts/tests/e3a.lua',
|
||||
srcpath .. '/eressea/scripts/tests/stealth.lua',
|
||||
}
|
||||
|
|
|
@ -48,6 +48,19 @@ function test_attrib()
|
|||
end
|
||||
end
|
||||
|
||||
function test_no_stealth()
|
||||
local r = region.create(0,0, "plain")
|
||||
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||
local u = unit.create(f, r, 1)
|
||||
|
||||
u:set_skill("stealth", 1)
|
||||
assert_equal(-1, u:get_skill("stealth"))
|
||||
u:clear_orders()
|
||||
u:add_order("LERNEN TARNUNG")
|
||||
process_orders()
|
||||
assert_equal(-1, u:get_skill("stealth"))
|
||||
end
|
||||
|
||||
function test_seecast()
|
||||
local r = region.create(0,0, "plain")
|
||||
for i = 1,10 do
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
require "lunit"
|
||||
|
||||
module("e3-stealth", package.seeall, lunit.testcase)
|
||||
|
||||
function setup_stealth()
|
||||
local result = {}
|
||||
free_game()
|
||||
result.r = region.create(0,0, "plain")
|
||||
result.f1 = faction.create("noreply@eressea.de", "human", "de")
|
||||
result.f2 = faction.create("noreply@eressea.de", "human", "de")
|
||||
result.u1 = unit.create(result.f1, result.r, 1)
|
||||
result.u2 = unit.create(result.f2, result.r, 1)
|
||||
result.u1:add_item("money", 1000)
|
||||
result.u2:add_item("money", 1000)
|
||||
return result
|
||||
end
|
||||
|
||||
function test_stealth_faction_on()
|
||||
local result = setup_stealth()
|
||||
local f = result.f2
|
||||
local u = result.u1
|
||||
u:clear_orders()
|
||||
u:add_order("TARNEN PARTEI")
|
||||
|
||||
settings.set("rules.stealth.faction", 1)
|
||||
process_orders()
|
||||
assert_not_match("Partei", report.report_unit(u, f))
|
||||
assert_match("anonym", report.report_unit(u, f))
|
||||
end
|
||||
|
||||
function test_stealth_faction_off()
|
||||
local result = setup_stealth()
|
||||
local f = result.f2
|
||||
local u = result.u1
|
||||
u:clear_orders()
|
||||
u:add_order("TARNEN PARTEI")
|
||||
|
||||
settings.set("rules.stealth.faction", 0)
|
||||
process_orders()
|
||||
assert_match("Partei", report.report_unit(u, f))
|
||||
assert_not_match("anonym", report.report_unit(u, f))
|
||||
end
|
Loading…
Reference in New Issue