forked from github/server
embassies in a separate file
This commit is contained in:
parent
28be52c1b2
commit
57cb0c73fc
|
@ -28,39 +28,14 @@ function run_scripts()
|
|||
"write_emails.lua",
|
||||
"eressea/eternath.lua",
|
||||
"eressea/wedding-jadee.lua",
|
||||
"eressea/ponnuki.lua"
|
||||
"eressea/ponnuki.lua",
|
||||
"eressea/embassy.lua"
|
||||
}
|
||||
for index in scripts do
|
||||
loadscript(scripts[index])
|
||||
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)
|
||||
-- initialize starting equipment for new players
|
||||
equipment_setitem("new_faction", "conquesttoken", "1");
|
||||
|
@ -94,7 +69,7 @@ function process(orders)
|
|||
process_orders()
|
||||
|
||||
-- post-turn updates:
|
||||
update_special()
|
||||
update_embassies()
|
||||
update_guards()
|
||||
update_scores()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
Loading…
Reference in New Issue