From 58c5d7135f2649ac6c87176b87fbfdffa8cca0a2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 22 Feb 2010 07:14:37 +0000 Subject: [PATCH] basic config and scripts. passes a subset of tests, but I fear it lacks a lot of essentials. --- src/basic/res/armor.xml | 13 + src/basic/res/buildings.xml | 4 + src/{ => basic}/res/buildings/castle.xml | 0 src/basic/res/catalog.xml | 10 + src/basic/res/config.xml | 107 ++ src/basic/res/items.xml | 3 + src/basic/res/races.xml | 14 + src/basic/res/races/aquarian.xml | 20 + src/basic/res/races/cat.xml | 27 + src/basic/res/races/demon.xml | 33 + src/basic/res/races/dwarf.xml | 33 + src/basic/res/races/elf.xml | 29 + src/basic/res/races/goblin.xml | 27 + src/basic/res/races/halfling.xml | 34 + src/basic/res/races/human.xml | 17 + src/basic/res/races/insect.xml | 30 + src/basic/res/races/orc.xml | 31 + src/basic/res/races/troll.xml | 32 + src/basic/res/ships.xml | 4 + src/basic/res/ships/boat.xml | 18 + src/basic/res/spells.xml | 2 + src/{res/asgard => basic/res}/terrains.xml | 28 +- src/basic/res/weapons.xml | 25 + .../eressea => basic/scripts/basic}/main.lua | 0 src/basic/scripts/basic/modules.lua | 1 + .../eressea => basic/scripts/basic}/rules.lua | 0 src/common/kernel/pool.c | 27 +- src/common/kernel/race.h | 2 + src/common/kernel/xmlreader.c | 2 + src/common/spells/spells.c | 8 +- .../eressea => eressea/res}/artrewards.xml | 0 .../eressea => eressea/res}/buildings.xml | 2 +- src/eressea/res/buildings/castle.xml | 26 + src/{res/eressea => eressea/res}/calendar.xml | 0 src/eressea/res/catalog.xml | 10 + src/eressea/res/config.xml | 120 ++ src/{res/eressea => eressea/res}/dungeons.xml | 0 .../eressea => eressea/res}/equipment.xml | 0 src/{res/eressea => eressea/res}/items.xml | 0 src/{res/eressea => eressea/res}/races.xml | 0 src/{res/common => eressea/res}/spellinfo.xml | 2 +- src/{res/eressea => eressea/res}/spells.xml | 0 src/{res/eressea => eressea/res}/strings.xml | 2 +- src/{ => eressea}/scripts/eressea/alp.lua | 0 src/{ => eressea}/scripts/eressea/embassy.lua | 0 src/{ => eressea}/scripts/eressea/ents.lua | 0 .../scripts/eressea/eternath.lua | 0 src/{ => eressea}/scripts/eressea/igjaruk.lua | 0 src/{ => eressea}/scripts/eressea/items.lua | 0 src/eressea/scripts/eressea/main.lua | 54 + src/{ => eressea}/scripts/eressea/modules.lua | 1 + src/{ => eressea}/scripts/eressea/ponnuki.lua | 0 src/eressea/scripts/eressea/rules.lua | 8 + src/{ => eressea}/scripts/eressea/tunnels.lua | 0 .../scripts/eressea/wedding-jadee.lua | 0 .../scripts/eressea/xmas2004.lua | 0 .../scripts/eressea/xmas2005.lua | 0 .../scripts/eressea/xmas2006.lua | 0 src/res/asgard.xml | 132 -- src/res/asgard/items.xml | 605 -------- src/res/asgard/races.xml | 1328 ----------------- src/res/asgard/rules.xml | 4 - src/res/common/items.xml | 10 - src/res/common/resources.xml | 10 + src/res/de/strings.xml | 16 +- src/res/dungeons.xml | 6 - src/res/e3a.xml | 2 - src/res/e3a/races.xml | 30 +- src/res/eressea.xml | 2 - src/res/eressea/de/welcome.txt | 20 - src/res/eressea/en/welcome.txt | 27 - src/res/eressea/items-hse.xml | 16 - src/res/hse-05-01.xml | 90 -- src/res/hse4.xml | 97 -- src/res/kingdoms.xml | 123 -- src/res/kingdoms/buildings.xml | 10 - src/res/kingdoms/equipment.xml | 30 - src/res/kingdoms/races.xml | 15 - src/res/kingdoms/resources.xml | 14 - src/res/kingdoms/rules.xml | 5 - src/res/kingdoms/terrains.xml | 12 - src/res/races.xml | 37 +- src/res/rts.xml | 113 -- src/res/rts/buildings.xml | 38 - src/res/rts/calendar.xml | 23 - src/res/rts/equipment.xml | 37 - src/res/rts/strings.xml | 51 - src/res/rts/units.xml | 39 - src/res/vinyambar-3.xml | 40 - src/res/vinyambar-classic.xml | 33 - src/res/vinyambar-wdw.xml | 139 -- src/res/vinyambar.xml | 34 - src/res/vinyambar/conquest.xml | 14 - src/res/vinyambar/de/strings-classic.xml | 14 - src/res/vinyambar/de/strings.xml | 16 - src/res/vinyambar/de/welcome.txt | 20 - src/res/vinyambar/items.xml | 36 - src/res/vinyambar/stronghold.xml | 15 - src/res/vinyambar/wdw-buildings.xml | 56 - src/res/vinyambar/wdw-races.xml | 276 ---- src/res/vinyambar/wdw-resources.xml | 59 - src/res/vinyambar/wdw-strings.xml | 171 --- src/scripts/asgard.lua | 80 - src/scripts/asgard/extensions.lua | 94 -- src/scripts/e3a/modules.lua | 1 + src/scripts/hse/buildings.lua | 27 - src/scripts/hse/grails.lua | 26 - src/scripts/hse/portals.lua | 19 - src/scripts/hse/spoils.lua | 32 - src/scripts/hse/stats.lua | 15 - src/scripts/hse3-run.lua | 64 - src/scripts/hse4-run.lua | 77 - src/scripts/init.lua | 3 +- src/scripts/kingdoms-run.lua | 92 -- src/scripts/kingdoms/extensions.lua | 16 - src/scripts/{extensions.lua => resources.lua} | 0 src/scripts/rts-run.lua | 80 - src/scripts/tests/common.lua | 69 +- src/scripts/tests/eressea.lua | 8 + src/scripts/tests/spells.lua | 64 + src/scripts/wdw-run.lua | 78 - src/scripts/wdw-setup.lua | 205 --- src/scripts/wdw/phoenix.lua | 38 - src/scripts/wdw/sphinx-announce.lua | 80 - src/scripts/wdw/sphinx-initfactions.lua | 22 - src/scripts/wdw/sphinx.lua | 140 -- src/scripts/wdw/standings.lua | 41 - 127 files changed, 891 insertions(+), 5151 deletions(-) create mode 100644 src/basic/res/armor.xml create mode 100644 src/basic/res/buildings.xml rename src/{ => basic}/res/buildings/castle.xml (100%) create mode 100644 src/basic/res/catalog.xml create mode 100644 src/basic/res/config.xml create mode 100644 src/basic/res/items.xml create mode 100644 src/basic/res/races.xml create mode 100644 src/basic/res/races/aquarian.xml create mode 100644 src/basic/res/races/cat.xml create mode 100644 src/basic/res/races/demon.xml create mode 100644 src/basic/res/races/dwarf.xml create mode 100644 src/basic/res/races/elf.xml create mode 100644 src/basic/res/races/goblin.xml create mode 100644 src/basic/res/races/halfling.xml create mode 100644 src/basic/res/races/human.xml create mode 100644 src/basic/res/races/insect.xml create mode 100644 src/basic/res/races/orc.xml create mode 100644 src/basic/res/races/troll.xml create mode 100644 src/basic/res/ships.xml create mode 100644 src/basic/res/ships/boat.xml create mode 100644 src/basic/res/spells.xml rename src/{res/asgard => basic/res}/terrains.xml (76%) create mode 100644 src/basic/res/weapons.xml rename src/{scripts/eressea => basic/scripts/basic}/main.lua (100%) create mode 100644 src/basic/scripts/basic/modules.lua rename src/{scripts/eressea => basic/scripts/basic}/rules.lua (100%) rename src/{res/eressea => eressea/res}/artrewards.xml (100%) rename src/{res/eressea => eressea/res}/buildings.xml (65%) create mode 100644 src/eressea/res/buildings/castle.xml rename src/{res/eressea => eressea/res}/calendar.xml (100%) create mode 100644 src/eressea/res/catalog.xml create mode 100644 src/eressea/res/config.xml rename src/{res/eressea => eressea/res}/dungeons.xml (100%) rename src/{res/eressea => eressea/res}/equipment.xml (100%) rename src/{res/eressea => eressea/res}/items.xml (100%) rename src/{res/eressea => eressea/res}/races.xml (100%) rename src/{res/common => eressea/res}/spellinfo.xml (99%) rename src/{res/eressea => eressea/res}/spells.xml (100%) rename src/{res/eressea => eressea/res}/strings.xml (99%) rename src/{ => eressea}/scripts/eressea/alp.lua (100%) rename src/{ => eressea}/scripts/eressea/embassy.lua (100%) rename src/{ => eressea}/scripts/eressea/ents.lua (100%) rename src/{ => eressea}/scripts/eressea/eternath.lua (100%) rename src/{ => eressea}/scripts/eressea/igjaruk.lua (100%) rename src/{ => eressea}/scripts/eressea/items.lua (100%) create mode 100644 src/eressea/scripts/eressea/main.lua rename src/{ => eressea}/scripts/eressea/modules.lua (95%) rename src/{ => eressea}/scripts/eressea/ponnuki.lua (100%) create mode 100644 src/eressea/scripts/eressea/rules.lua rename src/{ => eressea}/scripts/eressea/tunnels.lua (100%) rename src/{ => eressea}/scripts/eressea/wedding-jadee.lua (100%) rename src/{ => eressea}/scripts/eressea/xmas2004.lua (100%) rename src/{ => eressea}/scripts/eressea/xmas2005.lua (100%) rename src/{ => eressea}/scripts/eressea/xmas2006.lua (100%) delete mode 100644 src/res/asgard.xml delete mode 100644 src/res/asgard/items.xml delete mode 100644 src/res/asgard/races.xml delete mode 100644 src/res/asgard/rules.xml delete mode 100644 src/res/dungeons.xml delete mode 100644 src/res/eressea/de/welcome.txt delete mode 100644 src/res/eressea/en/welcome.txt delete mode 100644 src/res/eressea/items-hse.xml delete mode 100644 src/res/hse-05-01.xml delete mode 100644 src/res/hse4.xml delete mode 100644 src/res/kingdoms.xml delete mode 100644 src/res/kingdoms/buildings.xml delete mode 100644 src/res/kingdoms/equipment.xml delete mode 100644 src/res/kingdoms/races.xml delete mode 100644 src/res/kingdoms/resources.xml delete mode 100644 src/res/kingdoms/rules.xml delete mode 100644 src/res/kingdoms/terrains.xml delete mode 100644 src/res/rts.xml delete mode 100644 src/res/rts/buildings.xml delete mode 100644 src/res/rts/calendar.xml delete mode 100644 src/res/rts/equipment.xml delete mode 100644 src/res/rts/strings.xml delete mode 100644 src/res/rts/units.xml delete mode 100644 src/res/vinyambar-3.xml delete mode 100644 src/res/vinyambar-classic.xml delete mode 100644 src/res/vinyambar-wdw.xml delete mode 100644 src/res/vinyambar.xml delete mode 100644 src/res/vinyambar/conquest.xml delete mode 100644 src/res/vinyambar/de/strings-classic.xml delete mode 100644 src/res/vinyambar/de/strings.xml delete mode 100644 src/res/vinyambar/de/welcome.txt delete mode 100644 src/res/vinyambar/items.xml delete mode 100644 src/res/vinyambar/stronghold.xml delete mode 100644 src/res/vinyambar/wdw-buildings.xml delete mode 100644 src/res/vinyambar/wdw-races.xml delete mode 100644 src/res/vinyambar/wdw-resources.xml delete mode 100644 src/res/vinyambar/wdw-strings.xml delete mode 100644 src/scripts/asgard.lua delete mode 100644 src/scripts/asgard/extensions.lua delete mode 100644 src/scripts/hse/buildings.lua delete mode 100644 src/scripts/hse/grails.lua delete mode 100644 src/scripts/hse/portals.lua delete mode 100644 src/scripts/hse/spoils.lua delete mode 100644 src/scripts/hse/stats.lua delete mode 100644 src/scripts/hse3-run.lua delete mode 100644 src/scripts/hse4-run.lua delete mode 100644 src/scripts/kingdoms-run.lua delete mode 100644 src/scripts/kingdoms/extensions.lua rename src/scripts/{extensions.lua => resources.lua} (100%) delete mode 100644 src/scripts/rts-run.lua create mode 100644 src/scripts/tests/spells.lua delete mode 100644 src/scripts/wdw-run.lua delete mode 100644 src/scripts/wdw-setup.lua delete mode 100644 src/scripts/wdw/phoenix.lua delete mode 100644 src/scripts/wdw/sphinx-announce.lua delete mode 100644 src/scripts/wdw/sphinx-initfactions.lua delete mode 100644 src/scripts/wdw/sphinx.lua delete mode 100644 src/scripts/wdw/standings.lua diff --git a/src/basic/res/armor.xml b/src/basic/res/armor.xml new file mode 100644 index 000000000..f24ddcd35 --- /dev/null +++ b/src/basic/res/armor.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/basic/res/buildings.xml b/src/basic/res/buildings.xml new file mode 100644 index 000000000..3d128a12c --- /dev/null +++ b/src/basic/res/buildings.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/res/buildings/castle.xml b/src/basic/res/buildings/castle.xml similarity index 100% rename from src/res/buildings/castle.xml rename to src/basic/res/buildings/castle.xml diff --git a/src/basic/res/catalog.xml b/src/basic/res/catalog.xml new file mode 100644 index 000000000..8eb4603a3 --- /dev/null +++ b/src/basic/res/catalog.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/basic/res/config.xml b/src/basic/res/config.xml new file mode 100644 index 000000000..1573341e5 --- /dev/null +++ b/src/basic/res/config.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eressea-server@example.com + eressea-server@example.com + + + Bitte denke daran, deine Befehle mit dem Betreff + ERESSEA BEFEHLE an eressea-server@example.com zu senden. + Remember to send your orders to + eressea-server@example.com with the subject ERESSEA ORDERS. + + + ERESSEA BEFEHLE + ERESSEA ORDERS + + + ARBEITEN + WORK + + + diff --git a/src/basic/res/items.xml b/src/basic/res/items.xml new file mode 100644 index 000000000..e8fa7246a --- /dev/null +++ b/src/basic/res/items.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/basic/res/races.xml b/src/basic/res/races.xml new file mode 100644 index 000000000..09ce2212e --- /dev/null +++ b/src/basic/res/races.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/src/basic/res/races/aquarian.xml b/src/basic/res/races/aquarian.xml new file mode 100644 index 000000000..0bd11c8c3 --- /dev/null +++ b/src/basic/res/races/aquarian.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/cat.xml b/src/basic/res/races/cat.xml new file mode 100644 index 000000000..d71d41b92 --- /dev/null +++ b/src/basic/res/races/cat.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/demon.xml b/src/basic/res/races/demon.xml new file mode 100644 index 000000000..24f89c515 --- /dev/null +++ b/src/basic/res/races/demon.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/dwarf.xml b/src/basic/res/races/dwarf.xml new file mode 100644 index 000000000..a718581a7 --- /dev/null +++ b/src/basic/res/races/dwarf.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/basic/res/races/elf.xml b/src/basic/res/races/elf.xml new file mode 100644 index 000000000..678422652 --- /dev/null +++ b/src/basic/res/races/elf.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/basic/res/races/goblin.xml b/src/basic/res/races/goblin.xml new file mode 100644 index 000000000..b68137353 --- /dev/null +++ b/src/basic/res/races/goblin.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/halfling.xml b/src/basic/res/races/halfling.xml new file mode 100644 index 000000000..0e61aa55d --- /dev/null +++ b/src/basic/res/races/halfling.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/human.xml b/src/basic/res/races/human.xml new file mode 100644 index 000000000..0d689b4ac --- /dev/null +++ b/src/basic/res/races/human.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/insect.xml b/src/basic/res/races/insect.xml new file mode 100644 index 000000000..d727e1ee4 --- /dev/null +++ b/src/basic/res/races/insect.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/basic/res/races/orc.xml b/src/basic/res/races/orc.xml new file mode 100644 index 000000000..2caaaf8e5 --- /dev/null +++ b/src/basic/res/races/orc.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/races/troll.xml b/src/basic/res/races/troll.xml new file mode 100644 index 000000000..3761e17ec --- /dev/null +++ b/src/basic/res/races/troll.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/ships.xml b/src/basic/res/ships.xml new file mode 100644 index 000000000..f5577c2f4 --- /dev/null +++ b/src/basic/res/ships.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/basic/res/ships/boat.xml b/src/basic/res/ships/boat.xml new file mode 100644 index 000000000..c19d18529 --- /dev/null +++ b/src/basic/res/ships/boat.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/basic/res/spells.xml b/src/basic/res/spells.xml new file mode 100644 index 000000000..343cd1e92 --- /dev/null +++ b/src/basic/res/spells.xml @@ -0,0 +1,2 @@ + + diff --git a/src/res/asgard/terrains.xml b/src/basic/res/terrains.xml similarity index 76% rename from src/res/asgard/terrains.xml rename to src/basic/res/terrains.xml index 7eb41c87e..5fb289d3b 100644 --- a/src/res/asgard/terrains.xml +++ b/src/basic/res/terrains.xml @@ -1,55 +1,55 @@ - + - + - + - + - + - + - + - + - + - - - - + + + + - + diff --git a/src/basic/res/weapons.xml b/src/basic/res/weapons.xml new file mode 100644 index 000000000..0cab11ad0 --- /dev/null +++ b/src/basic/res/weapons.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/scripts/eressea/main.lua b/src/basic/scripts/basic/main.lua similarity index 100% rename from src/scripts/eressea/main.lua rename to src/basic/scripts/basic/main.lua diff --git a/src/basic/scripts/basic/modules.lua b/src/basic/scripts/basic/modules.lua new file mode 100644 index 000000000..4ed093dbb --- /dev/null +++ b/src/basic/scripts/basic/modules.lua @@ -0,0 +1 @@ +require "basic.rules" diff --git a/src/scripts/eressea/rules.lua b/src/basic/scripts/basic/rules.lua similarity index 100% rename from src/scripts/eressea/rules.lua rename to src/basic/scripts/basic/rules.lua diff --git a/src/common/kernel/pool.c b/src/common/kernel/pool.c index 5dcb20589..7c7ad103b 100644 --- a/src/common/kernel/pool.c +++ b/src/common/kernel/pool.c @@ -40,22 +40,6 @@ #define TODO_POOL #undef TODO_RESOURCES -static const race * rc_stonegolem; -static const race * rc_irongolem; - -static void -init_static(void) -{ - static boolean init = false; - if (!init) { - init = true; - rc_stonegolem = rc_find("stonegolem"); - if (rc_stonegolem==NULL) log_error(("Could not find race: stonegolem\n")); - rc_irongolem = rc_find("irongolem"); - if (rc_irongolem==NULL) log_error(("Could not find race: irongolem\n")); - } -} - int get_resource(const unit * u, const resource_type * rtype) { @@ -67,10 +51,9 @@ get_resource(const unit * u, const resource_type * rtype) if (i>=0) return i; } if (itype!=NULL) { - if (!rc_stonegolem) init_static(); - if (itype == olditemtype[R_STONE] && u->race==rc_stonegolem) { + if (itype == olditemtype[R_STONE] && (u->race->flags&RCF_STONEGOLEM)) { return u->number*GOLEM_STONE; - } else if (itype==olditemtype[R_IRON] && u->race==rc_irongolem) { + } else if (itype==olditemtype[R_IRON] && (u->race->flags&RCF_IRONGOLEM)) { return u->number*GOLEM_IRON; } else { const item * i = *i_findc(&u->items, itype); @@ -108,11 +91,9 @@ get_reservation(const unit * u, const resource_type * rtype) { struct reservation * res = u->reservations; - if (!rc_stonegolem) init_static(); - - if (rtype==oldresourcetype[R_STONE] && u->race==rc_stonegolem) + if (rtype==oldresourcetype[R_STONE] && (u->race->flags&RCF_STONEGOLEM)) return (u->number * GOLEM_STONE); - if (rtype==oldresourcetype[R_IRON] && u->race==rc_irongolem) + if (rtype==oldresourcetype[R_IRON] && (u->race->flags&RCF_IRONGOLEM)) return (u->number * GOLEM_IRON); while (res && res->type!=rtype) res=res->next; if (res) return res->value; diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index c778b8a67..a15999e3e 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -143,6 +143,8 @@ extern int rc_specialdamage(const race *, const race *, const struct weapon_type #define RCF_CANSAIL (1<<24) /* Einheit darf Schiffe betreten */ #define RCF_INVISIBLE (1<<25) /* not visible in any report */ #define RCF_SHIPSPEED (1<<26) /* race gets +1 on shipspeed */ +#define RCF_STONEGOLEM (1<<27) /* race gets stonegolem properties */ +#define RCF_IRONGOLEM (1<<28) /* race gets irongolem properties */ /* Economic flags */ #define GIVEITEM (1<<1) /* gibt Gegenstände weg */ diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 507455229..d46d39dfe 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1619,6 +1619,8 @@ parse_races(xmlDocPtr doc) if (xml_bvalue(node, "undead", false)) rc->flags |= RCF_UNDEAD; if (xml_bvalue(node, "dragon", false)) rc->flags |= RCF_DRAGON; if (xml_bvalue(node, "shipspeed", false)) rc->flags |= RCF_SHIPSPEED; + if (xml_bvalue(node, "stonegolem", false)) rc->flags |= RCF_STONEGOLEM; + if (xml_bvalue(node, "irongolem", false)) rc->flags |= RCF_IRONGOLEM; if (xml_bvalue(node, "giveitem", false)) rc->ec_flags |= GIVEITEM; if (xml_bvalue(node, "giveperson", false)) rc->ec_flags |= GIVEPERSON; diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 88ec3ff21..f437e4391 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -1457,7 +1457,7 @@ sp_create_irongolem(castorder *co) return 0; } - u2 = create_unit(r, mage->faction, number, new_race[RC_IRONGOLEM], 0, NULL, mage); + u2 = create_unit(r, mage->faction, number, rc_find("irongolem"), 0, NULL, mage); set_level(u2, SK_ARMORER, 1); set_level(u2, SK_WEAPONSMITH, 1); @@ -1470,7 +1470,7 @@ sp_create_irongolem(castorder *co) ADDMSG(&mage->faction->msgs, msg_message("magiccreate_effect", "region command unit amount object", mage->region, co->order, mage, number, - LOC(mage->faction->locale, rc_name(new_race[RC_IRONGOLEM], 1)))); + LOC(mage->faction->locale, rc_name(rc_find("irongolem"), 1)))); return cast_level; } @@ -1518,7 +1518,7 @@ sp_create_stonegolem(castorder *co) return 0; } - u2 = create_unit(r, mage->faction, number, new_race[RC_STONEGOLEM], 0, NULL, mage); + u2 = create_unit(r, mage->faction, number, rc_find("stonegolem"), 0, NULL, mage); set_level(u2, SK_ROAD_BUILDING, 1); set_level(u2, SK_BUILDING, 1); @@ -1530,7 +1530,7 @@ sp_create_stonegolem(castorder *co) ADDMSG(&mage->faction->msgs, msg_message("magiccreate_effect", "region command unit amount object", mage->region, co->order, mage, number, - LOC(mage->faction->locale, rc_name(new_race[RC_STONEGOLEM], 1)))); + LOC(mage->faction->locale, rc_name(rc_find("stonegolem"), 1)))); return cast_level; } diff --git a/src/res/eressea/artrewards.xml b/src/eressea/res/artrewards.xml similarity index 100% rename from src/res/eressea/artrewards.xml rename to src/eressea/res/artrewards.xml diff --git a/src/res/eressea/buildings.xml b/src/eressea/res/buildings.xml similarity index 65% rename from src/res/eressea/buildings.xml rename to src/eressea/res/buildings.xml index b25ce565b..fe7063029 100644 --- a/src/res/eressea/buildings.xml +++ b/src/eressea/res/buildings.xml @@ -1,4 +1,4 @@ - + diff --git a/src/eressea/res/buildings/castle.xml b/src/eressea/res/buildings/castle.xml new file mode 100644 index 000000000..296d1f716 --- /dev/null +++ b/src/eressea/res/buildings/castle.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/res/eressea/calendar.xml b/src/eressea/res/calendar.xml similarity index 100% rename from src/res/eressea/calendar.xml rename to src/eressea/res/calendar.xml diff --git a/src/eressea/res/catalog.xml b/src/eressea/res/catalog.xml new file mode 100644 index 000000000..8eb4603a3 --- /dev/null +++ b/src/eressea/res/catalog.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/src/eressea/res/config.xml b/src/eressea/res/config.xml new file mode 100644 index 000000000..6860333be --- /dev/null +++ b/src/eressea/res/config.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eressea-server@eressea.de + eressea-server@eressea.de + + + Bitte denke daran, deine Befehle mit dem Betreff + ERESSEA BEFEHLE an eressea-server@eressea.de zu senden. + Remember to send your orders to + eressea-server@eressea.de with the subject ERESSEA ORDERS. + + + ERESSEA BEFEHLE + ERESSEA ORDERS + + + diff --git a/src/res/eressea/dungeons.xml b/src/eressea/res/dungeons.xml similarity index 100% rename from src/res/eressea/dungeons.xml rename to src/eressea/res/dungeons.xml diff --git a/src/res/eressea/equipment.xml b/src/eressea/res/equipment.xml similarity index 100% rename from src/res/eressea/equipment.xml rename to src/eressea/res/equipment.xml diff --git a/src/res/eressea/items.xml b/src/eressea/res/items.xml similarity index 100% rename from src/res/eressea/items.xml rename to src/eressea/res/items.xml diff --git a/src/res/eressea/races.xml b/src/eressea/res/races.xml similarity index 100% rename from src/res/eressea/races.xml rename to src/eressea/res/races.xml diff --git a/src/res/common/spellinfo.xml b/src/eressea/res/spellinfo.xml similarity index 99% rename from src/res/common/spellinfo.xml rename to src/eressea/res/spellinfo.xml index d76b4149d..ce2e82635 100644 --- a/src/res/common/spellinfo.xml +++ b/src/eressea/res/spellinfo.xml @@ -110,4 +110,4 @@ services to peasants. - \ No newline at end of file + diff --git a/src/res/eressea/spells.xml b/src/eressea/res/spells.xml similarity index 100% rename from src/res/eressea/spells.xml rename to src/eressea/res/spells.xml diff --git a/src/res/eressea/strings.xml b/src/eressea/res/strings.xml similarity index 99% rename from src/res/eressea/strings.xml rename to src/eressea/res/strings.xml index 9fc4249c7..435e53f61 100644 --- a/src/res/eressea/strings.xml +++ b/src/eressea/res/strings.xml @@ -208,7 +208,7 @@ With the first two turns, you will get a computer report (CR). It can be used with many of the tools on http://eressea-pbem.de/download.html. If you want to continue getting it after the second turn, please make one of your units give the order OPTION COMPUTER. - ARBEITE + ARBEITEN WORK diff --git a/src/scripts/eressea/alp.lua b/src/eressea/scripts/eressea/alp.lua similarity index 100% rename from src/scripts/eressea/alp.lua rename to src/eressea/scripts/eressea/alp.lua diff --git a/src/scripts/eressea/embassy.lua b/src/eressea/scripts/eressea/embassy.lua similarity index 100% rename from src/scripts/eressea/embassy.lua rename to src/eressea/scripts/eressea/embassy.lua diff --git a/src/scripts/eressea/ents.lua b/src/eressea/scripts/eressea/ents.lua similarity index 100% rename from src/scripts/eressea/ents.lua rename to src/eressea/scripts/eressea/ents.lua diff --git a/src/scripts/eressea/eternath.lua b/src/eressea/scripts/eressea/eternath.lua similarity index 100% rename from src/scripts/eressea/eternath.lua rename to src/eressea/scripts/eressea/eternath.lua diff --git a/src/scripts/eressea/igjaruk.lua b/src/eressea/scripts/eressea/igjaruk.lua similarity index 100% rename from src/scripts/eressea/igjaruk.lua rename to src/eressea/scripts/eressea/igjaruk.lua diff --git a/src/scripts/eressea/items.lua b/src/eressea/scripts/eressea/items.lua similarity index 100% rename from src/scripts/eressea/items.lua rename to src/eressea/scripts/eressea/items.lua diff --git a/src/eressea/scripts/eressea/main.lua b/src/eressea/scripts/eressea/main.lua new file mode 100644 index 000000000..300a58e7e --- /dev/null +++ b/src/eressea/scripts/eressea/main.lua @@ -0,0 +1,54 @@ +require "multis" + +function process(orders) + local confirmed_multis = { } + local suspected_multis = { } + + if open_game(get_turn())~=0 then + print("could not read game") + return -1 + end + init_summary() + + -- kill multi-players (external script) + kill_multis(confirmed_multis, false) + mark_multis(suspected_multis, false) + + -- run the turn: + if read_orders(orders) ~= 0 then + print("could not read " .. orders) + return -1 + end + + plan_monsters() + + if nmr_check(config.maxnmrs or 80)~=0 then + return -1 + end + + 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() + + local localechange = { de = { "ii" } } + change_locales(localechange) + + write_files(config.locales) + + file = "" .. get_turn() .. ".dat" + if write_game(file, "binary")~=0 then + print("could not write game") + return -1 + end + return 0 +end diff --git a/src/scripts/eressea/modules.lua b/src/eressea/scripts/eressea/modules.lua similarity index 95% rename from src/scripts/eressea/modules.lua rename to src/eressea/scripts/eressea/modules.lua index 2a212dc38..14b699997 100644 --- a/src/scripts/eressea/modules.lua +++ b/src/eressea/scripts/eressea/modules.lua @@ -1,3 +1,4 @@ +require "spells" require "gates" require "eressea.alp" require "eressea.eternath" diff --git a/src/scripts/eressea/ponnuki.lua b/src/eressea/scripts/eressea/ponnuki.lua similarity index 100% rename from src/scripts/eressea/ponnuki.lua rename to src/eressea/scripts/eressea/ponnuki.lua diff --git a/src/eressea/scripts/eressea/rules.lua b/src/eressea/scripts/eressea/rules.lua new file mode 100644 index 000000000..5866a8ffc --- /dev/null +++ b/src/eressea/scripts/eressea/rules.lua @@ -0,0 +1,8 @@ +function item_canuse(u, iname) + local race = u.race + if iname=="greatbow" then + -- only elves use greatbow + return race=="elf" + end + return true +end diff --git a/src/scripts/eressea/tunnels.lua b/src/eressea/scripts/eressea/tunnels.lua similarity index 100% rename from src/scripts/eressea/tunnels.lua rename to src/eressea/scripts/eressea/tunnels.lua diff --git a/src/scripts/eressea/wedding-jadee.lua b/src/eressea/scripts/eressea/wedding-jadee.lua similarity index 100% rename from src/scripts/eressea/wedding-jadee.lua rename to src/eressea/scripts/eressea/wedding-jadee.lua diff --git a/src/scripts/eressea/xmas2004.lua b/src/eressea/scripts/eressea/xmas2004.lua similarity index 100% rename from src/scripts/eressea/xmas2004.lua rename to src/eressea/scripts/eressea/xmas2004.lua diff --git a/src/scripts/eressea/xmas2005.lua b/src/eressea/scripts/eressea/xmas2005.lua similarity index 100% rename from src/scripts/eressea/xmas2005.lua rename to src/eressea/scripts/eressea/xmas2005.lua diff --git a/src/scripts/eressea/xmas2006.lua b/src/eressea/scripts/eressea/xmas2006.lua similarity index 100% rename from src/scripts/eressea/xmas2006.lua rename to src/eressea/scripts/eressea/xmas2006.lua diff --git a/src/res/asgard.xml b/src/res/asgard.xml deleted file mode 100644 index 0c94ed943..000000000 --- a/src/res/asgard.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - eressea-server@eressea.kn-bremen.de - eressea-server@eressea.kn-bremen.de - - - Bitte denke daran, deine Befehle mit dem Betreff - ERESSEA BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. - Remember to send your orders to - eressea-server@eressea.kn-bremen.de with the subject ERESSEA ORDERS. - - - ERESSEA BEFEHLE - ERESSEA ORDERS - - - diff --git a/src/res/asgard/items.xml b/src/res/asgard/items.xml deleted file mode 100644 index 1c6bc6699..000000000 --- a/src/res/asgard/items.xml +++ /dev/null @@ -1,605 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/asgard/races.xml b/src/res/asgard/races.xml deleted file mode 100644 index 1bb526f52..000000000 --- a/src/res/asgard/races.xml +++ /dev/null @@ -1,1328 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/asgard/rules.xml b/src/res/asgard/rules.xml deleted file mode 100644 index ec095ac88..000000000 --- a/src/res/asgard/rules.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/res/common/items.xml b/src/res/common/items.xml index 061a1cbba..f16260e45 100644 --- a/src/res/common/items.xml +++ b/src/res/common/items.xml @@ -153,16 +153,6 @@ - - - - - - - - - - diff --git a/src/res/common/resources.xml b/src/res/common/resources.xml index 3f9ab8ad3..55710abe0 100644 --- a/src/res/common/resources.xml +++ b/src/res/common/resources.xml @@ -9,4 +9,14 @@ + + + + + + + + + + diff --git a/src/res/de/strings.xml b/src/res/de/strings.xml index 8eb4dea78..a7dd2ef24 100644 --- a/src/res/de/strings.xml +++ b/src/res/de/strings.xml @@ -3676,20 +3676,20 @@ - Altork - oldorc + Ork + orc - Altorks - oldorcs + Orks + orcs - Altorks - oldorcs + Orks + orcs - Altork - oldorc + Ork + orc diff --git a/src/res/dungeons.xml b/src/res/dungeons.xml deleted file mode 100644 index 6949c1da0..000000000 --- a/src/res/dungeons.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/res/e3a.xml b/src/res/e3a.xml index 874bf1463..528a5c5f0 100644 --- a/src/res/e3a.xml +++ b/src/res/e3a.xml @@ -19,7 +19,6 @@ - @@ -186,7 +185,6 @@ - eressea-server@eressea.de diff --git a/src/res/e3a/races.xml b/src/res/e3a/races.xml index 499b8e0a6..652923d17 100644 --- a/src/res/e3a/races.xml +++ b/src/res/e3a/races.xml @@ -8,6 +8,21 @@ + + + + + + + + + + + + + + + @@ -37,21 +52,6 @@ - - - - - - - - - - - - - - - diff --git a/src/res/eressea.xml b/src/res/eressea.xml index cce31579b..c20be8026 100644 --- a/src/res/eressea.xml +++ b/src/res/eressea.xml @@ -25,7 +25,6 @@ - @@ -103,7 +102,6 @@ - eressea-server@eressea.de diff --git a/src/res/eressea/de/welcome.txt b/src/res/eressea/de/welcome.txt deleted file mode 100644 index 6e91e4e4a..000000000 --- a/src/res/eressea/de/welcome.txt +++ /dev/null @@ -1,20 +0,0 @@ - -Willkommen bei Eressea ----------------------- - -Wir wünschen dir viel Spaß bei diesem Spiel. Solltest du mit deinem ersten Zug -Probleme haben, weil dir vielleicht die Regeln noch unklar sind, so gibt es -mehrere Informationsquellen, die dir hoffentlich helfen können. - -Die wichtigste Hilfe für das Spiel ist nach wie vor die Anleitung, im Netz zu -finden unter http://eressea.upb.de/rules/. - -Eine Gruppe engagierter Mitspieler hat sich zum Ziel gesetzt, Neulingen zu -helfen. Diese Spieler können per EMail unter eressea-help@eressea.kn-bremen.de -werden. Im IRC (IRCnet, z.B. irc.uni-erlangen.de) finden sich hilfsbereite -Spieler im Channel #e-help und sind dort gern bereit, Neulingsfragen zu -beantworten. Bitte benutze diesen Channel dafür, und nicht #eressea, welcher -eigentlich nur für Kommunikation zwischen den Parteien gedacht ist. - -Viel Spaß wünscht -Dein Eressea-Team diff --git a/src/res/eressea/en/welcome.txt b/src/res/eressea/en/welcome.txt deleted file mode 100644 index f02639003..000000000 --- a/src/res/eressea/en/welcome.txt +++ /dev/null @@ -1,27 +0,0 @@ - -Welcome to Eressea ------------------- - -Playing Eressea in english is still a rather new thing (though some have -done it for almost a year), and there may be some issues left. If you find -any, please let us know. We're constantly trying to make Eressea a better -game. - -There is a newsgroup on news://eressea.upb.de/eressea.lang.en dealing -especially with the english language version, if you want to be more involved. -You will need to log in with your faction's number and password to use this -server. - -The single most important thing to know is the help. You can find it at -http://eressea.upb.de/rules/en/ and should read it before you start playing. - -If you have a question or think you found a bug, please send it to -eressea-help@eressea.kn-bremen.de - the people reading those mails can filter -the requests, give answers to known problems or common questions, and in general -you'll get a very quick response. The exception are problems with your account -or with mailhandling, these you should send directly to -eressea-bugs@eressea.kn-bremen.de. - - -We hope you enjoy the game, -The Eressea Team diff --git a/src/res/eressea/items-hse.xml b/src/res/eressea/items-hse.xml deleted file mode 100644 index b09a76c6c..000000000 --- a/src/res/eressea/items-hse.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/res/hse-05-01.xml b/src/res/hse-05-01.xml deleted file mode 100644 index dd5e6d2c0..000000000 --- a/src/res/hse-05-01.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Game specific - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - hse-server@eressea.de - hse-server@eressea.de - - - ERESSEA BEFEHLE - ERESSEA ORDERS - - - diff --git a/src/res/hse4.xml b/src/res/hse4.xml deleted file mode 100644 index 7d3d23b64..000000000 --- a/src/res/hse4.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Game specific - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an hse-server@eressea.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. - Remember to send your orders to hse-server@eressea.de with the subject ERESSEA ORDERS. - - - hse-server@eressea.de - hse-server@eressea.de - - - ERESSEA BEFEHLE - ERESSEA ORDERS - - - diff --git a/src/res/kingdoms.xml b/src/res/kingdoms.xml deleted file mode 100644 index 58ba7b32c..000000000 --- a/src/res/kingdoms.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an kingdoms-server@eressea.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. - Remember to send your orders to kingdoms-server@eressea.de with the subject ERESSEA ORDERS. - - - kingdoms-server@eressea.de - kingdoms-server@eressea.de - - - ERESSEA BEFEHLE - ERESSEA ORDERS - - - diff --git a/src/res/kingdoms/buildings.xml b/src/res/kingdoms/buildings.xml deleted file mode 100644 index 1aac7682a..000000000 --- a/src/res/kingdoms/buildings.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/res/kingdoms/equipment.xml b/src/res/kingdoms/equipment.xml deleted file mode 100644 index 56ac5782d..000000000 --- a/src/res/kingdoms/equipment.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/kingdoms/races.xml b/src/res/kingdoms/races.xml deleted file mode 100644 index 73a7dd6d4..000000000 --- a/src/res/kingdoms/races.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/src/res/kingdoms/resources.xml b/src/res/kingdoms/resources.xml deleted file mode 100644 index cee195a77..000000000 --- a/src/res/kingdoms/resources.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/res/kingdoms/rules.xml b/src/res/kingdoms/rules.xml deleted file mode 100644 index 04489d26c..000000000 --- a/src/res/kingdoms/rules.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/res/kingdoms/terrains.xml b/src/res/kingdoms/terrains.xml deleted file mode 100644 index 378e397bd..000000000 --- a/src/res/kingdoms/terrains.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/src/res/races.xml b/src/res/races.xml index 93ed7cb3f..8309b6e37 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -1,5 +1,22 @@ - + + + + + + + + + + + + + + + + + + @@ -807,7 +824,7 @@ - + @@ -929,22 +946,6 @@ - - - - - - - - - - - - - - - - diff --git a/src/res/rts.xml b/src/res/rts.xml deleted file mode 100644 index 55e531d03..000000000 --- a/src/res/rts.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - rts-server@eressea.de - rts-server@eressea.de - - - Bitte denke daran, deine Befehle mit dem Betreff - ERESSEA BEFEHLE an rts-server@eressea.de zu senden. - Remember to send your orders to - rts-server@eressea.de with the subject ERESSEA ORDERS. - - - ERESSEA BEFEHLE - ERESSEA ORDERS - - - diff --git a/src/res/rts/buildings.xml b/src/res/rts/buildings.xml deleted file mode 100644 index 725f8189b..000000000 --- a/src/res/rts/buildings.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/rts/calendar.xml b/src/res/rts/calendar.xml deleted file mode 100644 index 6a1730726..000000000 --- a/src/res/rts/calendar.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/rts/equipment.xml b/src/res/rts/equipment.xml deleted file mode 100644 index 62c0aefcc..000000000 --- a/src/res/rts/equipment.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/rts/strings.xml b/src/res/rts/strings.xml deleted file mode 100644 index dabd2758f..000000000 --- a/src/res/rts/strings.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - game designer - Spieldesigner - - - game designers - Spieldesigner - - - - knight - Ritter - - - knights - Ritter - - - craftsman - Handwerker - - - craftsmen - Handwerker - - - swordsman - Schwertkämpfer - - - swordsmen - Schwertkämpfer - - - swordsman - Pikenier - - - pikemen - Pikeniere - - - - Barracks - Kaserne - - - diff --git a/src/res/rts/units.xml b/src/res/rts/units.xml deleted file mode 100644 index 72a3b864d..000000000 --- a/src/res/rts/units.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar-3.xml b/src/res/vinyambar-3.xml deleted file mode 100644 index 9703bc044..000000000 --- a/src/res/vinyambar-3.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - Localization - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - vinyambar@eressea.amber.kn-bremen.de - - - VIN3 BEFEHLE - - - diff --git a/src/res/vinyambar-classic.xml b/src/res/vinyambar-classic.xml deleted file mode 100644 index fb501df70..000000000 --- a/src/res/vinyambar-classic.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - Localization - - - - - - - - - Game specific - - - - - - - - - - - - - - vinyambar@eressea.amber.kn-bremen.de - - - VIN1 BEFEHLE - - - diff --git a/src/res/vinyambar-wdw.xml b/src/res/vinyambar-wdw.xml deleted file mode 100644 index ee3238223..000000000 --- a/src/res/vinyambar-wdw.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - vinyambar@eressea.amber.kn-bremen.de - - - WDW BEFEHLE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar.xml b/src/res/vinyambar.xml deleted file mode 100644 index 31825132c..000000000 --- a/src/res/vinyambar.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Localization - - - - - - - - - Game specific - - - - - - - - - - - - - - - vinyambar@eressea.amber.kn-bremen.de - - - VIN2 BEFEHLE - - - diff --git a/src/res/vinyambar/conquest.xml b/src/res/vinyambar/conquest.xml deleted file mode 100644 index 946de88e0..000000000 --- a/src/res/vinyambar/conquest.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Gral - grail - - - Grale - grails - - diff --git a/src/res/vinyambar/de/strings-classic.xml b/src/res/vinyambar/de/strings-classic.xml deleted file mode 100644 index 4e22735df..000000000 --- a/src/res/vinyambar/de/strings-classic.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - Bitte denke daran, deine Befehle mit dem Betreff WDW BEFEHLE an vinyambar@eressea.amber.kn-bremen.de zu senden. - - - Weitere Informationen über das Spiel findest Du unter htpp://www.vinyambar.de/ - - - Mit der ersten Auswertung bekommst du einen Computerreport, den du mit vielen der Tools auf http://www.eressea.de/ benutzen kannst. Wenn du ihn nicht bekommen möchtest, gib einer deiner Einheiten den Befehl OPTION COMPUTER NICHT. - - - ARBEITE - - diff --git a/src/res/vinyambar/de/strings.xml b/src/res/vinyambar/de/strings.xml deleted file mode 100644 index 65ba95aaa..000000000 --- a/src/res/vinyambar/de/strings.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Bitte denke daran, deine Befehle mit dem Betreff WDW BEFEHLE an vinyambar@eressea.amber.kn-bremen.de zu senden. - - - Weitere Informationen über das Spiel findest Du unter http://www.vinyambar.de/ - - - Mit der ersten Auswertung bekommst du einen Computerreport, den du mit vielen der Tools auf http://www.eressea-pbem.de/download.html benutzen kannst. Wenn du ihn nicht bekommen möchtest, gib einer deiner Einheiten den Befehl OPTION COMPUTER NICHT. - - - LERNE WAHRNEHMUNG - - - diff --git a/src/res/vinyambar/de/welcome.txt b/src/res/vinyambar/de/welcome.txt deleted file mode 100644 index 67735ce2e..000000000 --- a/src/res/vinyambar/de/welcome.txt +++ /dev/null @@ -1,20 +0,0 @@ - -Willkommen bei Vinyambar ------------------------- - -Wir wünschen dir viel Spaß bei diesem Spiel. Solltest du mit deinem ersten Zug -Probleme haben, weil dir vielleicht die Regeln noch unklar sind, so gibt es -mehrere Informationsquellen, die dir hoffentlich helfen können. - -Die wichtigste Hilfe für das Spiel ist nach wie vor die Anleitung, im Netz zu -finden unter http://eressea.upb.de/rules/. - -Eine Gruppe engagierter Mitspieler hat sich zum Ziel gesetzt, Neulingen zu -helfen. Diese Spieler können per EMail unter eressea-help@eressea.kn-bremen.de -werden. Im IRC (IRCnet, z.B. irc.uni-erlangen.de) finden sich hilfsbereite -Spieler im Channel #e-help und sind dort gern bereit, Neulingsfragen zu -beantworten. Bitte benutze diesen Channel dafür, und nicht #eressea, welcher -eigentlich nur für Kommunikation zwischen den Parteien gedacht ist. - -Viel Spaß wünscht -Dein Eressea-Team diff --git a/src/res/vinyambar/items.xml b/src/res/vinyambar/items.xml deleted file mode 100644 index ff9536d88..000000000 --- a/src/res/vinyambar/items.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar/stronghold.xml b/src/res/vinyambar/stronghold.xml deleted file mode 100644 index 816a9a150..000000000 --- a/src/res/vinyambar/stronghold.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - Tempel - temple - - - diff --git a/src/res/vinyambar/wdw-buildings.xml b/src/res/vinyambar/wdw-buildings.xml deleted file mode 100644 index fb69f6bff..000000000 --- a/src/res/vinyambar/wdw-buildings.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar/wdw-races.xml b/src/res/vinyambar/wdw-races.xml deleted file mode 100644 index 5a8f619dd..000000000 --- a/src/res/vinyambar/wdw-races.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar/wdw-resources.xml b/src/res/vinyambar/wdw-resources.xml deleted file mode 100644 index bde345d74..000000000 --- a/src/res/vinyambar/wdw-resources.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - Boost a magician's skill to level 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/res/vinyambar/wdw-strings.xml b/src/res/vinyambar/wdw-strings.xml deleted file mode 100644 index 3ba6fdb65..000000000 --- a/src/res/vinyambar/wdw-strings.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine Region für den Pyramidenbau geeignet ist. - - - Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine Region für den Pyramidenbau geeignet ist. - - - Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine Region für den Pyramidenbau geeignet ist. - - - Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine Region für den Pyramidenbau geeignet ist. - - - Mit Hilfe dieses Zaubers kann der Magier erkennen, ob eine Region für den Pyramidenbau geeignet ist. - - - - - Schriftrolle - scroll - - - Schriftrollen - scrolls - - - - Edelstein - gem - - - Edelsteine - gems - - - - Opal - opal - - - Opale - opals - - - - Diamant - diamond - - - Diamanten - diamonds - - - - Saphir - zaphire - - - Saphire - zaphires - - - - Topas - topaz - - - Topase - topazes - - - - Beryll - beryl - - - Berylle - beryls - - - - Achat - agate - - - Achate - agates - - - - Granat - garnet - - - Granate - garnets - - - - Smaragd - emerald - - - Smaragde - emeralds - - - Pyramide des Hapi - pyramid of Hapi - - - Pyramide der Tayet - pyramid of Tayet - - - Pyramide der Tefnut - pyramid of Tefnut - - - Pyramide des Shu - pyramid of Shu - - - Pyramide der Nuit - pyramid of Nuit - - - Pyramide der Bastet - pyramid of Bastet - - - Pyramide des Horus - pyramid of Horus - - - Pyramide der Maat - pyramid of Maat - - - Pyramide des Osiris - pyramid of Osiris - - - Pyramide des Set - pyramid of Set - - - Pyramide des Thoth - pyramid of Thoth - - - Gefangener Windgeist - trapped air elemental - - - Gefangene Windgeister - trapped air elementals - - - Phönixkompass - phoenixcompass - - - Phönixkompasse - phoenix compasses - - diff --git a/src/scripts/asgard.lua b/src/scripts/asgard.lua deleted file mode 100644 index f26f22943..000000000 --- a/src/scripts/asgard.lua +++ /dev/null @@ -1,80 +0,0 @@ --- the locales that this gameworld supports. -local locales = { "de", "en" } - -function loadscript(name) - local script = scriptpath .. "/" .. name - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end -end - -loadscript("default.lua") - -function load_scripts() - scripts = { - "asgard/extensions.lua" - } - for index, value in pairs(scripts) do - loadscript(value) - end -end - -function process(orders) - -- initialize starting equipment for new players - - if open_game(get_turn())~=0 then - print("could not read game") - return -1 - end - init_summary() - - -- kill multi-players (external script) - -- loadscript("eressea/multis.lua") - - -- run the turn: - if read_orders(orders) ~= 0 then - print("could not read " .. orders) - return -1 - end - - plan_monsters() - - local nmrs = get_nmrs(1) - if nmrs >= 80 then - print("Shit. More than 80 factions with 1 NMR (" .. nmrs .. ")") - write_summary() - return -1 - end - print (nmrs .. " Factions with 1 NMR") - - process_orders() - - -- post-turn updates: - update_guards() - update_scores() - - -- use newfactions file to place out new players - autoseed(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 - --- --- main body of script --- - --- orderfile: contains the name of the orders. -load_scripts() -if orderfile==nil then - print "you must specify an orderfile" -else - process(orderfile) -end - diff --git a/src/scripts/asgard/extensions.lua b/src/scripts/asgard/extensions.lua deleted file mode 100644 index 31f81069d..000000000 --- a/src/scripts/asgard/extensions.lua +++ /dev/null @@ -1,94 +0,0 @@ --- wage per person in this region -function wage(r, f, race) - return 10 -end - -function peasant_getresource(u) - return u.region:get_resource("peasant") -end - -function peasant_changeresource(u, delta) - local p = u.region:get_resource("peasant") - p = p + delta - if p < 0 then - p = 0 - end - u.region:set_resource("peasant", p) - return p -end - -function hp_getresource(u) - return u.hp -end - -function hp_changeresource(u, delta) - local hp = u.hp + delta - - if hp < u.number then - if hp < 0 then - hp = 0 - end - u.number = hp - end - u.hp = hp - return hp -end - -function horse_limit(r) - return r:get_resource("horse") -end - -function horse_produce(r, n) - local horses = r:get_resource("horse") - if horses>=n then - r:set_resource("horse", horses-n) - else - r:set_resource("horse", 0) - end -end - -function log_limit(r) --- if r:get_flag(1) then -- RF_MALLORN --- return 0 --- end - return r:get_resource("tree") + r:get_resource("sapling") -end - -function log_produce(r, n) - local trees = r:get_resource("tree") - if trees>=n then - r:set_resource("tree", trees-n) - else - r:set_resource("tree", 0) - n = n - trees - trees = r:get_resource("sapling") - if trees>=n then - r:set_resource("sapling", trees-n) - else - r:set_resource("sapling", 0) - end - end -end - -function mallorn_limit(r) - if not r:get_flag(1) then -- RF_MALLORN - return 0 - end - return r:get_resource("tree") + r:get_resource("sapling") -end - -function mallorn_produce(r, n) - local trees = r:get_resource("tree") - if trees>=n then - r:set_resource("tree", trees-n) - else - r:set_resource("tree", 0) - n = n - trees - trees = r:get_resource("sapling") - if trees>=n then - r:set_resource("sapling", trees-n) - else - r:set_resource("sapling", 0) - end - end -end diff --git a/src/scripts/e3a/modules.lua b/src/scripts/e3a/modules.lua index b21735765..996d6bcc7 100644 --- a/src/scripts/e3a/modules.lua +++ b/src/scripts/e3a/modules.lua @@ -1,2 +1,3 @@ +require "spells" require "e3a.xmas2009" require "e3a.rules" diff --git a/src/scripts/hse/buildings.lua b/src/scripts/hse/buildings.lua deleted file mode 100644 index 8e92cf302..000000000 --- a/src/scripts/hse/buildings.lua +++ /dev/null @@ -1,27 +0,0 @@ -function write_buildings(file) - types = { "sawmill", "quarry", "mine", "lighthouse", "castle", "monument" } - local index - local tname - for index, tname in pairs(types) do - count = 0 - best = nil - for r in regions() do - for b in r.buildings do - if b.type == tname then - count = count + 1 - if best == nil then - best = b - else - if best.size 0 then - if grails[f.id] == nil then - grails[f.id] = u:get_item("grail") - else - grails[f.id] = grails[f.id] + u:get_item("grail") - end - end - end - end - - file:write("Parteien mit mehr oder weniger als einem Gral:\n") - - for k in factions() do - v = 0 - if grails[k.id] ~= nil then - v = grails[k.id] - end - if v~= 1 then - file:write("- " .. v .. " Grale: " .. k.name .. " (" .. itoa36(k.id) .. ")\n") - end - end -end diff --git a/src/scripts/hse/portals.lua b/src/scripts/hse/portals.lua deleted file mode 100644 index b8d4badae..000000000 --- a/src/scripts/hse/portals.lua +++ /dev/null @@ -1,19 +0,0 @@ -if gate_travel==nil then - dofile(scriptpath .. "/gates.lua") -end - -buildings = {} - -function portal_exchange(b1, param) - id = buildings[param] - if id == nil then - buildings[param] = b1.id - else - b2 = get_building(id) - u1 = gate_units(b1, 100) - u2 = gate_units(b2, 100) - gate_travel(b1, u2) - gate_travel(b2, u1) - end - return 1 -end diff --git a/src/scripts/hse/spoils.lua b/src/scripts/hse/spoils.lua deleted file mode 100644 index 1478fa8d5..000000000 --- a/src/scripts/hse/spoils.lua +++ /dev/null @@ -1,32 +0,0 @@ -function fname(f) - return f.name .. " (" .. itoa36(f.id) .. ")" -end - -function write_spoils(file) - items = { "elfspoil", "demonspoil", "goblinspoil", "dwarfspoil", "halflingspoil", "humanspoil", "aquarianspoil", "insectspoil", "catspoil", "orcspoil", "trollspoil" } - local index - local iname - for index, iname in pairs(items) do - printed = false - for f in factions() do - trophies = 0 - for u in f.units do - if u:get_item(iname) > 0 then - trophies = trophies + u:get_item(iname) - end - end - if trophies > 0 then - if not printed then - file:write(get_string("de", iname .. "_p") .. "\n") - printed=true - end - if trophies == 1 then - istr = get_string("de", iname) - else - istr = get_string("de", iname .. "_p") - end - file:write("- " .. trophies .. " " .. istr .. ": " .. fname(f) .. "\n") - end - end - end -end diff --git a/src/scripts/hse/stats.lua b/src/scripts/hse/stats.lua deleted file mode 100644 index e6f4217e1..000000000 --- a/src/scripts/hse/stats.lua +++ /dev/null @@ -1,15 +0,0 @@ -dofile(scriptpath .. "/hse/grails.lua") -dofile(scriptpath .. "/hse/spoils.lua") -dofile(scriptpath .. "/hse/buildings.lua") - -function write_stats(filename) - local file = io.open(reportpath .. "/" .. filename, "w") - print("grails") - write_grails(file) - file:write("\n") - print("spoils") - write_spoils(file) - print("buildings") - write_buildings(file) - file:close() -end diff --git a/src/scripts/hse3-run.lua b/src/scripts/hse3-run.lua deleted file mode 100644 index 82226779f..000000000 --- a/src/scripts/hse3-run.lua +++ /dev/null @@ -1,64 +0,0 @@ -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 - diff --git a/src/scripts/hse4-run.lua b/src/scripts/hse4-run.lua deleted file mode 100644 index 566801df6..000000000 --- a/src/scripts/hse4-run.lua +++ /dev/null @@ -1,77 +0,0 @@ --- the locales that this gameworld supports. -local locales = { "de", "en" } - -function loadscript(name) - local script = scriptpath .. "/" .. name - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end -end - -loadscript("default.lua") - -function load_scripts() - scripts = { - "spells.lua", - "extensions.lua", - "familiars.lua", - "hse/portals.lua", - "hse/stats.lua" - } - for index, value in pairs(scripts) do - loadscript(value) - end -end - -function refresh_pool() - for f in factions() do - f:add_item("money", 50) - end -end - -function process(orders) - -- initialize starting equipment for new players - if open_game(get_turn())~=0 then - print("could not read game") - return -1 - end - init_summary() - - -- kill multi-players (external script) - -- loadscript("eressea/multis.lua") - - -- run the turn: - if read_orders(orders) ~= 0 then - print("could not read " .. orders) - return -1 - end - - plan_monsters() - process_orders() - - -- create new monsters: - spawn_braineaters(0.25) - - refresh_pool() - write_files(locales) - - file = "" .. get_turn() .. ".dat" - if write_game(file, "binary")~=0 then - print("could not write game") - return -1 - end -end - --- --- main body of script --- - --- orderfile: contains the name of the orders. -load_scripts() -if orderfile==nil then - print "you must specify an orderfile" -else - process(orderfile) -end - diff --git a/src/scripts/init.lua b/src/scripts/init.lua index 9bd1e5d86..701615ede 100644 --- a/src/scripts/init.lua +++ b/src/scripts/init.lua @@ -1,7 +1,6 @@ require(config.game .. ".modules") require "default" -require "spells" -require "extensions" +require "resources" function run_editor() local turn = get_turn() diff --git a/src/scripts/kingdoms-run.lua b/src/scripts/kingdoms-run.lua deleted file mode 100644 index a35c85f48..000000000 --- a/src/scripts/kingdoms-run.lua +++ /dev/null @@ -1,92 +0,0 @@ --- the locales that this gameworld supports. -local locales = { "de", "en" } - -function loadscript(name) - local script = scriptpath .. "/" .. name - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end -end - -function update_resources() --- remaining contents of region pool rots --- wood falls from trees - local r - for r in regions() do - local item - for item in r.items do - local num = math.ceil(r:get_item(item)/2) - r:add_item(item, -num) - end - - local wood = math.floor(r:get_resource("tree")/20) - if wood>0 then - r.add_item("log", wood) - end - end -end - -function update_owners() --- update the region's owners. currently uses the owner of --- the largest castle. - local r - for r in regions() do - local lb = nil - for b in r.buildings do - if b.type=="castle" and (lb==nil or b.size>lb.size) then - lb = b - end - end - local u - if b ~=nil then - u = b.units() - if u~=nil and u.faction~=r.owner then - r.owner = u.faction - end - end - end -end - -function process(orders) - file = "" .. get_turn() - if read_game(file)~=0 then - print("could not read game") - return -1 - end - init_summary() - - -- run the turn: - read_orders(orders) - - process_orders() - update_owners() - update_resources() - - -- use newfactions file to place out new players - autoseed(basepath .. "/newfactions", true) - - write_files(locales) - - file = "" .. get_turn() - if write_game(file)~=0 then - print("could not write game") - return -1 - end -end - - --- --- main body of script --- - --- orderfile: contains the name of the orders. -if orderfile==nil then - print "you must specify an orderfile" -else - loadscript("default.lua") - loadscript("extensions.lua") - loadscript("kingdoms/extensions.lua") - process(orderfile) -end - diff --git a/src/scripts/kingdoms/extensions.lua b/src/scripts/kingdoms/extensions.lua deleted file mode 100644 index 834f7afdb..000000000 --- a/src/scripts/kingdoms/extensions.lua +++ /dev/null @@ -1,16 +0,0 @@ -function wage(r, f, race) - return 10 -end - - -function maintenance(u) - local f = u.region.owner - if f ~= nil then - if f == u.faction then - return 2 * u.number - else if f:get_policy(u.faction, "money") then - return 5 * u.number - end - end - return 10 * u.number -end diff --git a/src/scripts/extensions.lua b/src/scripts/resources.lua similarity index 100% rename from src/scripts/extensions.lua rename to src/scripts/resources.lua diff --git a/src/scripts/rts-run.lua b/src/scripts/rts-run.lua deleted file mode 100644 index cac74f250..000000000 --- a/src/scripts/rts-run.lua +++ /dev/null @@ -1,80 +0,0 @@ -function loadscript(name) - local script = scriptpath .. "/" .. name - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end -end - -function run_scripts() - scripts = { - "default.lua", - "spells.lua", - "extensions.lua", - "familiars.lua" - } - for index, name in pairs(scripts) do - loadscript(name) - end -end - -function equip_new_faction(u) - b = add_building(u.region, "castle") - b.size = 10 - u.building = b -end - -function process(orders) - file = "" .. get_turn() - if read_game(file)~=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 - run_scripts() - - plan_monsters() - - local nmrs = get_nmrs(1) - if nmrs >= 70 then - print("Shit. More than 70 factions with 1 NMR (" .. nmrs .. ")") - write_summary() - return -1 - end - print (nmrs .. " Factions with 1 NMR") - - process_orders() - - -- post-turn updates: - update_guards() - update_scores() - - -- use newfactions file to place out new players - autoseed(basepath .. "/newfactions", false) - - write_files(locales) - - file = "" .. get_turn() - if write_game(file)~=0 then - print("could not write game") - return -1 - end -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 - diff --git a/src/scripts/tests/common.lua b/src/scripts/tests/common.lua index a18426bfa..b9d797edc 100644 --- a/src/scripts/tests/common.lua +++ b/src/scripts/tests/common.lua @@ -70,61 +70,16 @@ function test_plane() for x = -3, 3 do for y = -3, 3 do r = region.create(x, y, "plain") if (x==y) then - local u = unit.create(f, r, 1) + local u = unit.create(f, r, 1) end end end end -function test_rename() - local r = region.create(0, 0, "plain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r) - u:add_item("aoh", 1) - assert_equal(u:get_item("ao_healing"), 1) -end - -function test_blessedharvest_lasts_n_turn() - free_game() - local r = region.create(0, 0, "plain") - local f = faction.create("noreply@eressea.de", "halfling", "de") - local u = unit.create(f, r) - r:set_resource("peasant", 100) - r:set_resource("money", 0) - u:add_item("money", 1000) - u.magic = "gwyrrd" - u.race = "dwarf" - u:set_skill("magic", 20) - u.aura = 200 - u:add_spell("raindance") - u:add_spell("blessedharvest") - u:clear_orders() - local level = 5 - u:add_order("ZAUBERE STUFE " .. level .. " Regentanz") - assert_equal(0, r:get_resource("money"), 0) - - local m = 0 - local p = 100 - for i=1,level+2 do - process_orders() - local income = p * 12 - p = r:get_resource("peasant") - income = income - p * 10 - m = m + income - -- print(i, m, p, r:get_resource("money")) - if (i>level+1) then - assert_not_equal(m, r:get_resource("money")) - else - assert_equal(m, r:get_resource("money")) - end - u:clear_orders() - u:add_order("ARBEITEN") --- u:add_spell("raindance") - end -end - function test_pure() free_game() local r = region.create(0, 0, "plain") + assert_not_equal(nil, r) + assert_equal(r, get_region(0, 0)) end function test_read_write() @@ -611,21 +566,3 @@ function test_building_other() process_orders() assert_not_equal(10, b.size) end - -function test_roi() - local r = region.create(0,0, "plain") - local f = faction.create("noreply@eressea.de", "human", "de") - local u = unit.create(f, r, 1) - u.race = "elf" - u:set_skill("magic", 10) - u:add_item("money", 3010) - u.magic = "tybied" - u.aura = 200 - u.ship = s1 - u:add_spell("create_roi") - u:clear_orders() - u:add_order("ZAUBERE 'Erschaffe einen Ring der Unsichtbarkeit' ") - process_orders() - write_reports() - assert_equal(1, u:get_item("roi")) -end diff --git a/src/scripts/tests/eressea.lua b/src/scripts/tests/eressea.lua index a9151465e..043226077 100644 --- a/src/scripts/tests/eressea.lua +++ b/src/scripts/tests/eressea.lua @@ -6,6 +6,14 @@ function setup() free_game() end +function test_rename() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r) + u:add_item("aoh", 1) + assert_equal(u:get_item("ao_healing"), 1) +end + function DISABLE_test_alp() local r = region.create(0,0, "plain") local f = faction.create("noreply@eressea.de", "human", "de") diff --git a/src/scripts/tests/spells.lua b/src/scripts/tests/spells.lua new file mode 100644 index 000000000..e71935aa8 --- /dev/null +++ b/src/scripts/tests/spells.lua @@ -0,0 +1,64 @@ +require "lunit" + +module( "spells", package.seeall, lunit.testcase ) + +function setup() + free_game() +end + +function test_roi() + local r = region.create(0,0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + u.race = "elf" + u:set_skill("magic", 10) + u:add_item("money", 3010) + u.magic = "tybied" + u.aura = 200 + u.ship = s1 + u:add_spell("create_roi") + u:clear_orders() + u:add_order("ZAUBERE 'Erschaffe einen Ring der Unsichtbarkeit' ") + process_orders() + write_reports() + assert_equal(1, u:get_item("roi")) +end + +function test_blessedharvest_lasts_n_turn() + free_game() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "halfling", "de") + local u = unit.create(f, r) + r:set_resource("peasant", 100) + r:set_resource("money", 0) + u:add_item("money", 1000) + u.magic = "gwyrrd" + u.race = "dwarf" + u:set_skill("magic", 20) + u.aura = 200 + u:add_spell("raindance") + u:add_spell("blessedharvest") + u:clear_orders() + local level = 5 + u:add_order("ZAUBERE STUFE " .. level .. " Regentanz") + assert_equal(0, r:get_resource("money"), 0) + + local m = 0 + local p = 100 + for i=1,level+2 do + process_orders() + local income = p * 12 + p = r:get_resource("peasant") + income = income - p * 10 + m = m + income + -- print(i, m, p, r:get_resource("money")) + if (i>level+1) then + assert_not_equal(m, r:get_resource("money")) + else + assert_equal(m, r:get_resource("money")) + end + u:clear_orders() + u:add_order("ARBEITEN") +-- u:add_spell("raindance") + end +end diff --git a/src/scripts/wdw-run.lua b/src/scripts/wdw-run.lua deleted file mode 100644 index c05f683f2..000000000 --- a/src/scripts/wdw-run.lua +++ /dev/null @@ -1,78 +0,0 @@ --- the locales that this gameworld supports. -local locales = { "de", "en" } - -function process(orders) - -- read game and orders - if open_game(get_turn())~=0 then - print("could not read game") - return -1 - end - init_summary() - - -- read the orders file - read_orders(orders) - - -- set up the sphinx - -- init_sphinxhints() - update_phoenix() - sphinx_handler() - sphinx_weekly() - - -- run the turn: - - plan_monsters() - process_orders() - - -- create new monsters: - spawn_dragons() - spawn_undead() - -- (no more braineaters) spawn_braineaters(0.25) - - -- post-turn updates: - update_guards() - update_scores() - - write_files(locales) - - -- siegbedingungen ausgeben - write_standings() - - -- save the game - outfile = "" .. get_turn() - if write_game(outfile, "text")~=0 then - print("could not write game") - return -1 - end -end - --- --- main body of script --- - -print("- Running wdw-run.lua") - -scripts = { - "default.lua", - "spells.lua", - "extensions.lua", - "familiars.lua", - "wdw/sphinx.lua", - "wdw/phoenix.lua", - "wdw/standings.lua" -} - --- orderfile: contains the name of the orders. -if orderfile==nil then - print "you must specify an orderfile" -else - local name - local index - for index, name in pairs(scripts) do - local script = scriptpath .. "/" .. name - print("- loading " .. script) - if pcall(dofile, script)==0 then - print("Could not load " .. script) - end - end - process(orderfile) -end diff --git a/src/scripts/wdw-setup.lua b/src/scripts/wdw-setup.lua deleted file mode 100644 index 26dc300cb..000000000 --- a/src/scripts/wdw-setup.lua +++ /dev/null @@ -1,205 +0,0 @@ -positions = {} - -function init_positions() - -- init starting positions for the alliances here. - positions = { - [11] = get_region(1,-12), - [12] = get_region(10,-11), - [13] = get_region(-7,-8), - [14] = get_region(13,1), - [15] = get_region(5,10), - [17] = get_region(-6,14), - [18] = get_region(-15,12), - [19] = get_region(-15,6) - } -end - -function get_position(aid) --- return the position at which alliance 'aid' will start. - print("Alliance " .. aid) - local pos = positions[aid] - - -- hack, because i have no coordinates yet: - if pos ~= nil and pos.terrain ~= "ocean" then - return pos - else - -- find a region. let's use the region number 'aid' in the list, - -- so everyone gets their own - -- print("cannot place alliance " .. aid .. " at " .. pos.x .. ", " .. pos.y) - for pos in regions() do - if pos.terrain ~= "ocean" then - if aid==0 then - return pos - else - aid = aid-1 - end - end - end - end -end - -gems = { "opal", "diamond", "zaphire", "topaz", "beryl", "agate", "garnet", "emerald" } - -function get_gem(id) - return gems[math.mod(id, 8)+1] -end - -ano = 0 -- counting active alliance -numalliances = 8 -- number of alliances -lastalliance = nil - -function make_faction(position, alliance, number, email, race) - local skillno = 25 -- es gibt 25 skills in der liste - local units = (1+skillno)*6 / number -- jede allianz kriegt 168 leute - local money = units * 5 * 10 -- jede allianz kriegt 8400 silber - - local f = faction.create(email, race, "de") - if f == nil then - print("could not create " .. email .. " " .. race) - return - end - - - print("\n" .. email .. " (" .. itoa36(f.id) .. ")") - f.alliance = alliance - local u = unit.create(f, position) - -- erster ist der, der die extras kriegt: - u.number = 1 - local units = units - 1 - u:add_item("money", money) - if lastalliance==nil or alliance.id ~= lastalliance.id then - ano=ano+1 - lastalliance = alliance - u:add_item(get_gem(ano), numalliances-1) - u:add_item(get_gem(ano+1), 2) - u:add_item(get_gem(ano+2), 2) - u:add_item("log", 50) - end - - local sk - local skill - for sk, skill in pairs(skills) do - u = unit.create(f, position) - - -- anzahl personen berechnen - local number = math.floor(units / skillno) - units = units - number - skillno = skillno - 1 - u.number = number - - u:set_skill(skill, 3) - - print("- " .. number .. " x " .. skill) - end -end - --- skills that will be given to new units -skills = { - "roadwork", - "crossbow", - "mining", - "bow", - "building", - "trade", - "forestry", - "catapult", - "herbalism", - "training", - "riding", - "armorer", - "shipcraft", - "melee", - "sailing", - "polearm", - "espionage", - "quarrying", - "stealth", - "entertainment", - "weaponsmithing", - "cartmaking", - "perception", - "taxation", - "stamina" -} - -function wdw_setup() - -- initialize starting equipment for new players - -- equipment_setitem("new_faction", "magicskillboost", "1") - - init_positions() - - -- Initialize Wächter des Phoenix - alliance = add_alliance(11, "Wächter des Phoenix") - position = get_position(11) - faction = make_faction(position, alliance, 4, "durgan@web.de", "Elfen") - faction = make_faction(position, alliance, 4, "Daniel@gedankenwelt.net", "Trolle") - faction = make_faction(position, alliance, 4, "rostnicht@web.de", "Dämonen") - faction = make_faction(position, alliance, 4, "16419@uni-lueneburg.de", "Insekten") - - -- Initialize Refinius - alliance = add_alliance(12, "Allianz 12") - position = get_position(12) - faction = make_faction(position, alliance, 5, "wanderameisen@dunklerpfad.de", "Meermenschen") - faction = make_faction(position, alliance, 5, "ElunasErben@dunklerpfad.de", "Elfen") - faction = make_faction(position, alliance, 5, "miles.tegson@gmx.net", "Zwerge") - faction = make_faction(position, alliance, 5, "shannera@shannera.de", "Dämonen") - faction = make_faction(position, alliance, 5, "langhaarigerBombenleger@firemail.de", "Trolle") - - -- Initialize Stählerner Bund von Parinor - alliance = add_alliance(13, "Stählerner Bund von Parinor") - position = get_position(13) - faction = make_faction(position, alliance, 5, "ta@sts-gbr.de", "Dämonen") - faction = make_faction(position, alliance, 5, "klausnet@gmx.de", "Elfen") - faction = make_faction(position, alliance, 5, "r.jerger@gmx.de", "Trolle") - faction = make_faction(position, alliance, 5, "christianemmler@t-online.de", "Insekten") - faction = make_faction(position, alliance, 5, "DieCherusker@gmx.de", "Orks") - - -- Initialize Ethâra´s Zirkel des Chaos - alliance = add_alliance(14, "Ethâra´s Zirkel des Chaos") - position = get_position(14) - faction = make_faction(position, alliance, 4, "craban@web.de", "Elfen") - faction = make_faction(position, alliance, 4, "saressa@celtic-visions.net", "Zwerge") - faction = make_faction(position, alliance, 4, "krachon@gmx.de", "Orks") - faction = make_faction(position, alliance, 4, "andreas.westhoff@physik3.gwdg.de", "Meermenschen") - - -- Initialize Janustempler - alliance = add_alliance(15, "Janustempler") - position = get_position(15) - faction = make_faction(position, alliance, 4, "alex.goelkel@t-online.de", "Meermenschen") - faction = make_faction(position, alliance, 4, "matthias.lendholt@gmx.de", "Elfen") - faction = make_faction(position, alliance, 4, "Uwe.Kopf@onlinehome.de", "Orks") - faction = make_faction(position, alliance, 4, "Jan.Thaler@gmx.de", "Dämonen") - - -- Initialize Kiddies - alliance = add_alliance(17, "Kiddies") - position = get_position(17) - faction = make_faction(position, alliance, 5, "henning.ewald@t-online.de", "Orks") - faction = make_faction(position, alliance, 5, "red@gmx.de", "Meermenschen") - faction = make_faction(position, alliance, 5, "Morgon@Morgon.de", "Zwerge") - faction = make_faction(position, alliance, 5, "hadmar.lang@wu-wien.ac.at", "Elfen") - faction = make_faction(position, alliance, 5, "vinyambar@burningchaos.org", "Dämonen") - - -- Initialize Airbe Druad - alliance = add_alliance(18, "Airbe Druad") - position = get_position(18) - faction = make_faction(position, alliance, 6, "t.lam@gmx.at", "Elfen") - faction = make_faction(position, alliance, 6, "Post_der_Trolle@gmx.de", "Dämonen") - faction = make_faction(position, alliance, 6, "Mann.Martin@t-online.de", "Meermenschen") - faction = make_faction(position, alliance, 6, "thaeberli@freesurf.ch", "Orks") - faction = make_faction(position, alliance, 6, "sonja@tzi.de", "Trolle") - faction = make_faction(position, alliance, 6, "lothar.juerss@gmx.at", "Zwerge") - - -- Initialize Matula - alliance = add_alliance(19, "Allianz 19") - position = get_position(19) - faction = make_faction(position, alliance, 4, "mserrano@tiscali.de", "Meermenschen") - faction = make_faction(position, alliance, 4, "kerki@aol.com", "Elfen") - faction = make_faction(position, alliance, 4, "Roddiwi@aol.com", "Zwerge") - faction = make_faction(position, alliance, 4, "bauschan@aol.com", "Trolle") - -end - - --- --- main body of the script -wdw_setup() diff --git a/src/scripts/wdw/phoenix.lua b/src/scripts/wdw/phoenix.lua deleted file mode 100644 index 016e992ea..000000000 --- a/src/scripts/wdw/phoenix.lua +++ /dev/null @@ -1,38 +0,0 @@ -function update_phoenix() - local f - for f in factions() do - local u - for u in f.units do - if u.race=="phoenix" then - print("The phoenix is in " .. u.region.name() .. "(" .. u.region.x .. "," .. u.region.y .. ")") - return - end - end - end - print("The phoenix has not been found and needs to be regenerated") - f = get_faction(0) - if (f~=nil) then - local r - local nregions - - nregions = 0 - for r in regions() do - nregions = nregions+1 - end - local rno = math.random(nregions) - for r in regions() do - rno = rno - 1 - if rno <=1 then - if r.plane_id==0 and r.name~=nil then - local u = add_unit(f, r) - u.race = "phoenix" - u.name = "Der Phönix" - u.number = 1 - -- TODO: generate an appropriate region message - print("The phoenix has been generated in " .. u.region.name .. "(" .. u.region.x .. "," .. u.region.y .. ")") - break - end - end - end - end -end diff --git a/src/scripts/wdw/sphinx-announce.lua b/src/scripts/wdw/sphinx-announce.lua deleted file mode 100644 index 05b61a4eb..000000000 --- a/src/scripts/wdw/sphinx-announce.lua +++ /dev/null @@ -1,80 +0,0 @@ -function sphinx_handler() - - local function send_gotHint(u, usphinx) - u:add_notice("Eine Botschaft von Sphinx ("..itoa36(usphinx.id).."): Du hast diese Woche bereits einen Hinweis erhalten!"); - end - - local function send_hint(u, usphinx) - hintText[0] = "Das Schiff des Elfen hat ein rotes Segel" - hintText[1] = "Der Zwerg hat eine Nuss dabei" - hintText[2] = "Die Katze führt eine Hellebarde" - hintText[3] = "Das Schiff mit dem grünen Segel liegt links neben dem mit einem weissen Segel" - hintText[4] = "Auf dem Schiff mit grünen Segeln kam der Speerkämpfer" - hintText[5] = "Der Krieger mit dem Kreis im Wappen hat einen Keks" - hintText[6] = "Der Krieger des mittleren Schiffs hat ein Schwert" - hintText[7] = "Auf dem gelben Segel prankt ein Kreuz als Wappen" - hintText[8] = "Der Mensch kam mit dem ersten Schiff" - hintText[9] = "Das Schiff mit dem Stern im Wappen liegt neben dem der einen Mandelkern hat" - hintText[10] = "Das Schiff des Kriegers, der ein Apfel hat, liegt neben dem, der ein Kreuz als Wappen hat" - hintText[11] = "Der Krieger mit dem Turm im Wappen trägt eine Axt" - hintText[12] = "Das Schiff des Menschen liegt neben dem blauen Schiff" - hintText[13] = "Das Insekt trägt einen Baum als Wappen" - hintText[14] = "Das Schiff mit dem Stern im Wappen liegt neben dem des Kriegers, der einen Zweihänder führt" - - for i=0,4,1 do - possibleHint[i] = u:faction.objects:get("sphinxhint"..tostring(i)) - end - - hint = math.random(0,4) - - u:add_notice("Eine Botschaft von Sphinx ("..itoa36(usphinx.id).."): "..hintText[possibleHint[hint]].."!"); - end - - local function msg_handler(u, evt) - str = evt:get_string(0) - u2 = evt:get_unit(1) - if str.lower() == "hinweis" then - if u2:faction.objects:get("sphinxGotHint"..itoa36(u.id) then - send_gotHint(u2) - else - send_hint(u2, u) - end - end - end - - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("si7z")) - if u ~= nil and u.faction == f then - u:add_handler("message", msg_handler) - end - - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("qcph")) - if u ~= nil and u.faction == f then - u:add_handler("message", msg_handler) - end -end - -function sphinx_weekly() - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("si7z")) - if u ~= nil and u.faction == f then - u.region:add_notice("Eine Botschaft von Sphinx (si7z): Mit SPHINX HINWEIS gebe ich euch einen Hinweis, mit SPHINX ANTWORT \"Antwort\" könnt ihr mir eure Antwort mitteilen. Doch Vorsicht, falsche Antworten werde ich bestrafen!") - u.region:add_notice("Eine Botschaft von Sphinx (si7z): Fünf Krieger kamen auf ihren Schiffen in die Ebene der Helden, wollten um die Ehre ringen. Jedes Schiff trug ein anderes Segel, auf dem das Wappen des Kriegers prankte. Ein jeder trug seine liebste Waffe und das Signum seines Volkes und doch war keiner gleich.") - u.region:add_notice("Eine Botschaft von Sphinx (si7z): Wer hat den Schneeball?") - end - - local u = get_unit(atoi36("qcph")) - if u ~= nil and u.faction == f then - u.region:add_notice("Eine Botschaft von Sphinx (qcph): Mit SPHINX HINWEIS gebe ich euch einen Hinweis, mit SPHINX ANTWORT \"Antwort\" könnt ihr mir eure Antwort mitteilen. Doch Vorsicht, falsche Antworten werde ich bestrafen!") - u.region:add_notice("Eine Botschaft von Sphinx (qcph): Fünf Krieger kamen auf ihren Schiffen in die Ebene der Helden, wollten um die Ehre ringen. Jedes Schiff trug ein anderes Segel, auf dem das Wappen des Kriegers prankte. Ein jeder trug seine liebste Waffe und das Signum seines Volkes und doch war keiner gleich.") - u.region:add_notice("Eine Botschaft von Sphinx (qcph): Wer hat den Schneeball?") - end - - for faction in factions() do - faction:delete_variable("sphinxGotHintsi7z", "true"); - faction:delete_variable("sphinxGotHintqcph", "true"); - end - -end - diff --git a/src/scripts/wdw/sphinx-initfactions.lua b/src/scripts/wdw/sphinx-initfactions.lua deleted file mode 100644 index ed854bf6a..000000000 --- a/src/scripts/wdw/sphinx-initfactions.lua +++ /dev/null @@ -1,22 +0,0 @@ - -function init_sphinxhints() - - for faction in factions() do - - for i=0,14,1 do - hints[i] = 0 - end - for i=0,4,1 do - if faction.objects:get("sphinxhint"..tostring(i)) == nil then - repeat - hint = math.random(0,14) - until hints[hint] = 0 - hints[hint] = 1 - faction.objects:set("sphinxhint"..tostring(i), tostring(hint)) - end - end - end -end - -init_sphinxhints() - diff --git a/src/scripts/wdw/sphinx.lua b/src/scripts/wdw/sphinx.lua deleted file mode 100644 index 3ec2f1e07..000000000 --- a/src/scripts/wdw/sphinx.lua +++ /dev/null @@ -1,140 +0,0 @@ --- --- www.websudoku.com --- Evil Puzzle 9,558,581,844 --- - -function init_sphinxhints() - - for f in factions() do - hints = {} - - for i=0,14,1 do - hints[i] = 0 - end - for i=0,4,1 do - if f.objects:get("sphinxhint"..tostring(i)) == nil then - repeat - hint = math.random(0,14) - until hints[hint] == 0 - hints[hint] = 1 - f.objects:set("sphinxhint" .. tostring(i), tostring(hint)) - end - end - end -end - -function sphinx_handler() - - local function send_gotHint(u, usphinx) - usphinx:add_order("botschaft einheit " .. itoa36(u.id) .. " \"Du hast diese Woche bereits einen Hinweis erhalten!\"") - end - - local function send_hint(u, usphinx) - hintText = {} - possibleHint = {} - - hintText[0] = "Eins! Neun! Vier" - hintText[1] = "Sechs! Eins! Zwei" - hintText[2] = "Vier! Neun! Sieben" - hintText[3] = "Sieben! Eins! Neun" - hintText[4] = "Nenne mir die Summe der beiden Diagonalen" - hintText[5] = "Fünf! Fünf! Sechs" - hintText[6] = "Sieben! Zwei! Fünf" - hintText[7] = "Sechs! Zwei! Sieben" - hintText[8] = "Zwei! Zwei! Zwei" - hintText[9] = "Acht! Sechs! Eins" - hintText[10] = "Fünf! Acht! Vier" - hintText[11] = "Acht! Sieben! Drei" - hintText[12] = "Sechs! Fünf! Vier" - hintText[13] = "Eins! Zwei! Drei" - hintText[14] = "Vier! Fünf! Neun" - hintText[15] = "Acht! Acht! Neun" - hintText[16] = "Zwei! Drei! Eins" - hintText[17] = "Fünf! Zwei! Neun" - hintText[18] = "Zwei! Vier! Sieben" - hintText[19] = "Neun! Eins! Eins" - hintText[20] = "Eins! Vier! Fünf" - hintText[21] = "Neun! Sechs! Acht" - hintText[22] = "Drei! Neun! Neun" - hintText[23] = "Neun! Acht! Fünf" - hintText[24] = "Vier! Acht! Sechs" - hintText[25] = "Drei! Acht! Drei" - - numhints = 26 - turn = get_turn() - -- hint = turn%26 - hint = turn - (math.floor(turn/numhints)*numhints) - - print("sphinx turn=" .. turn .. ", hint=" .. hint .. "\n") - - usphinx:add_order("botschaft einheit " .. itoa36(u.id) .. " \"" .. hintText[hint] .. "!\"") - end - - local function msg_handler(u, evt) - str = evt:get_string(0) - u2 = evt:get_unit(1) - if string.lower(str) == "hinweis" then - if u2.faction.objects:get("sphinxGotHint"..itoa36(u.id)) ~= nil then - send_gotHint(u2) - else - send_hint(u2, u) - end - end - tokens = {} - for token in string.gfind(str, "%a+") do - table.insert(tokens, token) - end - -- index starts with 1 in lua - if table.getn(tokens) == 2 and string.lower(tokens[1]) == "antwort" then - if string.lower(tokens[2]) == "999999" then - -- Botschaft in alle Regionen - local m = message.create("msg_event") - m:set_string("string", "Das Rätsel der Sphinx ist gelöst! Die Sphinx wird sich eine neue Heimat und ein neues Rätsel suchen.") - for r in regions() do - m:send_region(r) - end - -- Region region.createen - region.create(u2.region.x, u.region.y, "plain") - u2.region.set_resource(u2.region, "tree", 721) - u2.region.set_resource(u2.region, "peasant", 2312) - u2.add_item(u2, "trappedairelemental", 5) - -- Neues Raetsel fuer beide Sphinxe! - -- Sphinx neu platzieren - -- Hint-Attribute von allen Allianzen loeschen - else - - end - end - end - - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("si7z")) - if u ~= nil and u.faction == f then - u:add_handler("message", msg_handler) - end - - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("qcph")) - if u ~= nil and u.faction == f then - u:add_handler("message", msg_handler) - end -end - -function sphinx_weekly() - local f = get_faction(atoi36("ycx9")) - local u = get_unit(atoi36("si7z")) - if u ~= nil and u.faction == f then - u.region:add_notice("Eine Botschaft von Sphinx (si7z): Mit einer Botschaft \"Hinweis\" gebe ich euch einen Hinweis, mit einer Botschaft \"Antwort \" könnt ihr mir eure Antwort mitteilen. Doch Vorsicht, falsche Antworten werde ich bestrafen!") - end - - local u = get_unit(atoi36("qcph")) - if u ~= nil and u.faction == f then - u.region:add_notice("Eine Botschaft von Sphinx (qcph): Mit einer Botschaft \"Hinweis\" gebe ich euch einen Hinweis, mit einer Botschaft \"Antwort \" könnt ihr mir eure Antwort mitteilen. Doch Vorsicht, falsche Antworten werde ich bestrafen!") - end - - for faction in factions() do - faction:delete_variable("sphinxGotHintsi7z"); - faction:delete_variable("sphinx2GotHintqcph"); - end - -end diff --git a/src/scripts/wdw/standings.lua b/src/scripts/wdw/standings.lua deleted file mode 100644 index 9be23857a..000000000 --- a/src/scripts/wdw/standings.lua +++ /dev/null @@ -1,41 +0,0 @@ -conditions = { pyramid="Pyramide", gems="Handel", phoenix="Phönix" } - -function log(file, line) - print(line) - file:write(line .. "\n") -end - -function write_standings() - print(reportpath .. "/victory.txt") - local file = io.open(reportpath .. "/victory.txt", "w") - - log(file, "** Allianzen ** " .. reportpath .. "/victory.txt") - local alliance - for alliance in alliances() do - local faction - log(file, alliance.id .. ": " .. alliance.name) - for faction in alliance.factions do - log(file, "- " .. faction.name .." (" .. itoa36(faction.id) .. ")") - end - log (file, "") - end - - log(file, "** Erfüllte Siegbedingungen **") - local condition - local index - for index, condition in pairs(conditions) do - local none = true - log(file, condition) - for alliance in alliances() do - if victorycondition(alliance, index)==1 then - log(file, " - " .. alliance.name .. " (" .. alliance.id .. ")") - none = false - end - end - if none then - log(file, " - Niemand") - end - end - - file:close() -end