From e6c784e830f4f6e84b54b0dfcd4be0db8f441877 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 27 Feb 2010 22:14:36 +0000 Subject: [PATCH] move E3 related scripts out of main scripts folder --- src/basic/res/config-basic.xml | 2 +- src/eressea/res/config-e3a.xml | 3 - src/{ => eressea}/scripts/e3a/build.lua | 0 src/{ => eressea}/scripts/e3a/main.lua | 2 +- src/{ => eressea}/scripts/e3a/modules.lua | 0 src/{ => eressea}/scripts/e3a/rules.lua | 0 src/{ => eressea}/scripts/e3a/xmas2009.lua | 0 .../scripts/eressea}/adamant.lua | 0 src/{ => eressea}/scripts/tests/e3a.lua | 0 src/{ => eressea}/scripts/tests/eressea.lua | 0 src/scripts/eressea.lua | 58 ------------------- src/scripts/gm/move.lua | 32 ---------- 12 files changed, 2 insertions(+), 95 deletions(-) rename src/{ => eressea}/scripts/e3a/build.lua (100%) rename src/{ => eressea}/scripts/e3a/main.lua (96%) rename src/{ => eressea}/scripts/e3a/modules.lua (100%) rename src/{ => eressea}/scripts/e3a/rules.lua (100%) rename src/{ => eressea}/scripts/e3a/xmas2009.lua (100%) rename src/{scripts => eressea/scripts/eressea}/adamant.lua (100%) rename src/{ => eressea}/scripts/tests/e3a.lua (100%) rename src/{ => eressea}/scripts/tests/eressea.lua (100%) delete mode 100644 src/scripts/eressea.lua delete mode 100644 src/scripts/gm/move.lua diff --git a/src/basic/res/config-basic.xml b/src/basic/res/config-basic.xml index 58587925d..9ff9019fd 100644 --- a/src/basic/res/config-basic.xml +++ b/src/basic/res/config-basic.xml @@ -27,7 +27,7 @@ - + diff --git a/src/eressea/res/config-e3a.xml b/src/eressea/res/config-e3a.xml index 3008cd438..32f994fdd 100644 --- a/src/eressea/res/config-e3a.xml +++ b/src/eressea/res/config-e3a.xml @@ -38,9 +38,6 @@ - diff --git a/src/scripts/e3a/build.lua b/src/eressea/scripts/e3a/build.lua similarity index 100% rename from src/scripts/e3a/build.lua rename to src/eressea/scripts/e3a/build.lua diff --git a/src/scripts/e3a/main.lua b/src/eressea/scripts/e3a/main.lua similarity index 96% rename from src/scripts/e3a/main.lua rename to src/eressea/scripts/e3a/main.lua index 8e75b092e..0548ce513 100644 --- a/src/scripts/e3a/main.lua +++ b/src/eressea/scripts/e3a/main.lua @@ -1,7 +1,7 @@ require "multis" function process(orders) - local confirmed_multis = { "odin" } + local confirmed_multis = { } local suspected_multis = { } if open_game(get_turn())~=0 then diff --git a/src/scripts/e3a/modules.lua b/src/eressea/scripts/e3a/modules.lua similarity index 100% rename from src/scripts/e3a/modules.lua rename to src/eressea/scripts/e3a/modules.lua diff --git a/src/scripts/e3a/rules.lua b/src/eressea/scripts/e3a/rules.lua similarity index 100% rename from src/scripts/e3a/rules.lua rename to src/eressea/scripts/e3a/rules.lua diff --git a/src/scripts/e3a/xmas2009.lua b/src/eressea/scripts/e3a/xmas2009.lua similarity index 100% rename from src/scripts/e3a/xmas2009.lua rename to src/eressea/scripts/e3a/xmas2009.lua diff --git a/src/scripts/adamant.lua b/src/eressea/scripts/eressea/adamant.lua similarity index 100% rename from src/scripts/adamant.lua rename to src/eressea/scripts/eressea/adamant.lua diff --git a/src/scripts/tests/e3a.lua b/src/eressea/scripts/tests/e3a.lua similarity index 100% rename from src/scripts/tests/e3a.lua rename to src/eressea/scripts/tests/e3a.lua diff --git a/src/scripts/tests/eressea.lua b/src/eressea/scripts/tests/eressea.lua similarity index 100% rename from src/scripts/tests/eressea.lua rename to src/eressea/scripts/tests/eressea.lua diff --git a/src/scripts/eressea.lua b/src/scripts/eressea.lua deleted file mode 100644 index 70ce51cdd..000000000 --- a/src/scripts/eressea.lua +++ /dev/null @@ -1,58 +0,0 @@ -function process(orders) - -- initialize starting equipment for new players - if open_game==nil then - print("did you load default.lua?") - return -1 - end - - if open_game(get_turn())~=0 then - print("could not read game") - return -1 - end - init_summary() - - -- run the turn: - if read_orders(orders) ~= 0 then - print("could not read " .. orders) - return -1 - end - - plan_monsters() - - local nmrs = get_nmrs(1) - -- nmrs = 0 - maxnmrs = maxnmrs or 80 - if nmrs >= maxnmrs then - print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")") - write_summary() - return -1 - end - print (nmrs .. " Factions with 1 NMR") - - process_orders() - - -- create new monsters: - spawn_dragons() - spawn_undead() - spawn_braineaters(0.25) - spawn_ents() - - -- post-turn updates: - update_xmas2006() - update_embassies() - update_guards() - update_scores() - - change_locales() - - -- use newfactions file to place out new players - autoseed(config.basepath .. "/newfactions", false) - - write_files(locales) - - file = "" .. get_turn() .. ".dat" - if write_game(file, "binary")~=0 then - print("could not write game") - return -1 - end -end diff --git a/src/scripts/gm/move.lua b/src/scripts/gm/move.lua deleted file mode 100644 index d08a69ed9..000000000 --- a/src/scripts/gm/move.lua +++ /dev/null @@ -1,32 +0,0 @@ -swapx = 0 -swapy = 0 - -function swap_region(r, tr) - local sr = get_region(swapx, swapy) - while sr~=nil do - swapx = math.random(1000) - swapy = math.random(1000) - sr = get_region(swapx, swapy) - end - local tx = tr.x - local ty = tr.y - local x = r.x - local y = r.y - tr:move(swapx, swapy) - r:move(tx, ty) - tr:move(x, y) -end - -function move_selection(x, y) - for r in gmtool.get_selection() do - local tx = r.x+x - local ty = r.y+y - local tr = get_region(tx, ty) - if tr~=nil then - swap_region(r, tr) - else - r:move(tx, ty) - end - end -end -