2014-07-26 22:52:25 +02:00
|
|
|
-- DEPRECATED
|
2017-08-28 00:04:05 +02:00
|
|
|
if not config.eternath or config.eternath==0 then return nil end
|
2014-07-26 22:52:25 +02:00
|
|
|
-- implements parts of a quest in E2
|
|
|
|
-- this module is deprecated, because it puts functions in the global environment for at_building_action
|
2010-08-08 09:40:42 +02:00
|
|
|
|
2014-07-26 22:52:25 +02:00
|
|
|
local gates = require('eressea.gates')
|
|
|
|
|
|
|
|
local b1 = nil
|
|
|
|
local b2 = nil
|
2010-08-08 09:40:42 +02:00
|
|
|
|
|
|
|
function eternathgate_action(b)
|
2014-07-26 22:52:25 +02:00
|
|
|
if b1 == nil then
|
|
|
|
b1 = b
|
|
|
|
elseif b2 == nil then
|
|
|
|
b2 = b
|
2010-08-08 09:40:42 +02:00
|
|
|
else
|
2016-01-24 11:06:26 +01:00
|
|
|
eressea.log.warning("data contains more than two Eternath gates")
|
2010-08-08 09:40:42 +02:00
|
|
|
end
|
|
|
|
return 1
|
|
|
|
end
|
2014-07-26 22:52:25 +02:00
|
|
|
|
|
|
|
local eternath = {}
|
|
|
|
|
|
|
|
function eternath.update()
|
|
|
|
if b1 and b2 then
|
2014-12-28 17:29:34 +01:00
|
|
|
local size = 5
|
2014-07-26 22:52:25 +02:00
|
|
|
local units1 = gates.units(b1, size)
|
|
|
|
local units2 = gates.units(b2, size)
|
|
|
|
|
|
|
|
gates.travel(b2, units1)
|
|
|
|
gates.travel(b1, units2)
|
|
|
|
else
|
2016-01-24 11:06:26 +01:00
|
|
|
eressea.log.warning("data contains fewer than two Eternath gates")
|
2014-07-26 22:52:25 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return eternath
|