2014-07-26 22:52:25 +02:00
|
|
|
-- Muschelplateau
|
|
|
|
|
2017-01-22 11:38:01 +01:00
|
|
|
if not config.embassy then return nil end
|
|
|
|
|
|
|
|
local embassy = {}
|
|
|
|
local home = nil
|
|
|
|
|
2014-07-26 22:52:25 +02:00
|
|
|
function embassy.init()
|
|
|
|
home = get_region(165,30)
|
|
|
|
if home==nil then
|
|
|
|
eressea.log.error("cannot find embassy region 'Muschelplateau'")
|
|
|
|
end
|
2010-08-08 09:40:42 +02:00
|
|
|
end
|
|
|
|
|
2014-07-26 22:52:25 +02:00
|
|
|
function embassy.update()
|
2015-05-20 13:05:47 +02:00
|
|
|
-- Muschelplateau
|
|
|
|
if home==nil then
|
|
|
|
return
|
|
|
|
end
|
2014-07-26 22:52:25 +02:00
|
|
|
eressea.log.debug("updating embassies in " .. tostring(home))
|
2010-08-08 09:40:42 +02:00
|
|
|
local u
|
2014-07-26 22:52:25 +02:00
|
|
|
for u in home.units do
|
2017-02-11 22:15:21 +01:00
|
|
|
if not u.faction:get_key('mupL') then
|
2014-07-26 22:52:25 +02:00
|
|
|
if (u.faction:add_item('seashell', 1)>0) then
|
|
|
|
eressea.log.debug("new seashell for " .. tostring(u.faction))
|
2017-02-11 22:15:21 +01:00
|
|
|
u.faction:set_key('mupL', get_turn())
|
2014-07-26 22:52:25 +02:00
|
|
|
end
|
2010-08-08 09:40:42 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-07-26 22:52:25 +02:00
|
|
|
return embassy
|