Ein Script, um die Gates aus der Hochzeit zu bedienen.

This commit is contained in:
Enno Rehling 2004-07-10 16:37:02 +00:00
parent 6883de2c22
commit 4bb1033947
2 changed files with 42 additions and 1 deletions

View File

@ -61,7 +61,7 @@ end
-- main body of script
--
scripts= { "ponnuki.lua" }
scripts = { "ponnuki.lua", "wedding-jadee.lua" }
-- orderfile: contains the name of the orders.
if orderfile==nil then

View File

@ -0,0 +1,41 @@
-- this script contains the action functions for the two portals
-- used on the jadee/wildente wedding island. the two _action functions
-- are used as age() functions for a building_action with b:addaction("name")
hellgate = nil
peacegate = nil
function gate_exchange(b1, b2)
local units = {}
local u
for u in b1.units do
units[u.no] = u
end
for u in b2.units do
u.region = b1.region
u.building = b1
end
for id in units do
u = units[id]
u.region = b2.region
u.building = b2
end
end
function hellgate_action(b)
if hellgate == nil then
hellgate = b
else
gate_exchange(hellgate, b)
end
return 1
end
function peacegate_action(b)
if peacegate == nil then
peacegate = b
else
gate_exchange(peacegate, b)
end
return 1
end