server/src/scripts/hse3-run.lua
Enno Rehling 940d236edc - filereader.c rewritten since the initial implementation is in the moving van.
- moved some summary functionality (emails, aliases) to Lua code
- made default.lua an include for all the different run-scripts

report.c is the last file that needs some work, everything else should be fine. Most importantly, all the messages are not internationalized, so that means just about no more German in the code. Yay!
2007-08-08 07:43:24 +00:00

64 lines
1.1 KiB
Lua

local locales = { "de", "en" }
function run_scripts()
scripts = {
"default.lua",
"spells.lua",
"extensions.lua",
"familiars.lua",
"hse/portals.lua",
"hse/stats.lua"
}
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
function refresh_pool()
for f in factions do
f:add_item("money", 50)
end
end
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()
spawn_braineaters(0.25)
plan_monsters()
process_orders()
write_files(locales)
file = "" .. get_turn()
if write_game(file)~=0 then
print("could not write game")
return -1
end
write_stats("grails.txt")
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