embassies in a separate file

This commit is contained in:
Enno Rehling 2005-12-11 12:33:57 +00:00
parent 28be52c1b2
commit 57cb0c73fc
2 changed files with 30 additions and 28 deletions

View File

@ -28,39 +28,14 @@ function run_scripts()
"write_emails.lua", "write_emails.lua",
"eressea/eternath.lua", "eressea/eternath.lua",
"eressea/wedding-jadee.lua", "eressea/wedding-jadee.lua",
"eressea/ponnuki.lua" "eressea/ponnuki.lua",
"eressea/embassy.lua"
} }
for index in scripts do for index in scripts do
loadscript(scripts[index]) loadscript(scripts[index])
end end
end end
function use_seashell(u, amount)
-- Muschelplateau...
local visit = u.faction.objects["muschel"]
if visit~=nil then
local turns = get_turn() - visit
local msg = message("msg_event")
msg:set_string("string", tostring(u) .. " erzählt den Bewohnern von " .. r.name .. " von Muschelplateau, das seine Partei vor " .. turns .. " Wochen besucht hat." )
msg:send_region(u.region)
end
end
function update_special()
-- Muschelplateau
local r = get_region(165,30)
if r~=nil then
local u
for u in r.units do
if u.faction.objects["muschel"]~=nil then
if (u.faction.add_item("muschel", 1)>0) then
u.faction.objects["seashell"] = get_turn()
end
end
end
end
end
function process(orders) function process(orders)
-- initialize starting equipment for new players -- initialize starting equipment for new players
equipment_setitem("new_faction", "conquesttoken", "1"); equipment_setitem("new_faction", "conquesttoken", "1");
@ -94,7 +69,7 @@ function process(orders)
process_orders() process_orders()
-- post-turn updates: -- post-turn updates:
update_special() update_embassies()
update_guards() update_guards()
update_scores() update_scores()

View File

@ -0,0 +1,27 @@
function use_seashell(u, amount)
-- Muschelplateau...
local visit = u.faction.objects:get("embassy_muschel")
if visit~=nil then
local turns = get_turn() - visit
local msg = message("msg_event")
msg:set_string("string", tostring(u) .. " erzählt den Bewohnern von " .. r.name .. " von Muschelplateau, das seine Partei vor " .. turns .. " Wochen besucht hat." )
msg:send_region(u.region)
end
end
function update_embassies()
-- Muschelplateau
local r = get_region(165,30)
if r~=nil then
local u
for u in r.units do
if u.faction.objects:get("embassy_muschel")==nil then
if (u.faction:add_item("seashell", 1)>0) then
print(u.faction)
u.faction.objects:set("embassy_muschel", get_turn())
end
end
end
end
end