2007-08-08 09:43:24 +02:00
|
|
|
local locales = { "de", "en" }
|
|
|
|
|
2005-01-04 08:50:36 +01:00
|
|
|
function run_scripts()
|
|
|
|
scripts = {
|
2007-08-08 09:43:24 +02:00
|
|
|
"default.lua",
|
2005-10-08 23:34:00 +02:00
|
|
|
"spells.lua",
|
2005-10-29 16:48:37 +02:00
|
|
|
"extensions.lua",
|
2006-02-26 14:24:16 +01:00
|
|
|
"familiars.lua",
|
2005-11-26 00:32:56 +01:00
|
|
|
"hse/portals.lua",
|
|
|
|
"hse/stats.lua"
|
2005-01-04 08:50:36 +01:00
|
|
|
}
|
|
|
|
for index in scripts do
|
|
|
|
local script = scriptpath .. "/" .. scripts[index]
|
|
|
|
print("- loading " .. script)
|
|
|
|
if pcall(dofile, script)==0 then
|
|
|
|
print("Could not load " .. script)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-02-18 21:25:39 +01:00
|
|
|
function refresh_pool()
|
|
|
|
for f in factions do
|
|
|
|
f:add_item("money", 50)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2005-01-04 08:50:36 +01:00
|
|
|
function process(orders)
|
|
|
|
file = "" .. get_turn()
|
|
|
|
if read_game(file)~=0 then
|
|
|
|
print("could not read game")
|
|
|
|
return -1
|
|
|
|
end
|
|
|
|
|
|
|
|
-- run the turn:
|
|
|
|
read_orders(orders)
|
|
|
|
run_scripts()
|
|
|
|
|
2005-10-02 18:06:12 +02:00
|
|
|
spawn_braineaters(0.25)
|
2005-01-04 08:50:36 +01:00
|
|
|
plan_monsters()
|
|
|
|
process_orders()
|
2005-02-18 21:25:39 +01:00
|
|
|
|
2007-08-08 09:43:24 +02:00
|
|
|
write_files(locales)
|
2005-01-04 08:50:36 +01:00
|
|
|
|
|
|
|
file = "" .. get_turn()
|
|
|
|
if write_game(file)~=0 then
|
|
|
|
print("could not write game")
|
|
|
|
return -1
|
|
|
|
end
|
2005-01-08 12:40:14 +01:00
|
|
|
|
2005-01-13 13:42:36 +01:00
|
|
|
write_stats("grails.txt")
|
2005-01-04 08:50:36 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
-- main body of script
|
|
|
|
--
|
|
|
|
|
|
|
|
-- orderfile: contains the name of the orders.
|
|
|
|
if orderfile==nil then
|
|
|
|
print "you must specify an orderfile"
|
|
|
|
else
|
|
|
|
process(orderfile)
|
|
|
|
end
|
|
|
|
|