Merge branch 'master' into develop

This commit is contained in:
Enno Rehling 2018-07-12 20:32:57 +02:00
commit 3ab29225c9
2 changed files with 27 additions and 4 deletions

View File

@ -1,13 +1,20 @@
-- forward declaration required:
-- forward declarations required:
local self = {}
local function equip_first(u)
equip_newunits(u)
name = 'seed_' .. u.race
equip_unit(u, name, 255)
end
local mysets = {
['first_unit'] = {
['items'] = {
['money'] = 2500,
['log'] = 10,
['stone'] = 4
}
},
['callback'] = equip_first
},
['seed_unit'] = {
['items'] = {

View File

@ -14,6 +14,22 @@ function test_read_race()
assert_not_nil(f)
end
function test_first_insect()
local f = faction.create('insect')
local r = region.create(0, 0, "plain")
local u = unit.create(f, r, 1)
u:equip('first_unit')
assert_equal(9, u:get_item('nestwarmth'))
end
function test_first_troll()
local f = faction.create('troll')
local r = region.create(0, 0, "plain")
local u = unit.create(f, r, 1)
u:equip('first_unit')
assert_equal(2, u:eff_skill('perception'))
end
function test_seed_unit()
local r = region.create(0, 0, "plain")
local f = faction.create('human')