diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 0441a46f6..5affea141 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -42,7 +42,7 @@ - + @@ -53,10 +53,6 @@ - - eressea-server@eressea.kn-bremen.de - eressea-server@eressea.kn-bremen.de - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA 2 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. diff --git a/conf/e3/config.xml b/conf/e3/config.xml index c8c5dbb06..35716f332 100644 --- a/conf/e3/config.xml +++ b/conf/e3/config.xml @@ -28,14 +28,6 @@ - - - - - - - - @@ -45,10 +37,6 @@ - - eressea-server@eressea.kn-bremen.de - eressea-server@eressea.kn-bremen.de - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA 3 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. diff --git a/conf/e4/config.xml b/conf/e4/config.xml index b188f7d79..ac962202c 100644 --- a/conf/e4/config.xml +++ b/conf/e4/config.xml @@ -27,15 +27,6 @@ - - - - - - - - - @@ -46,10 +37,6 @@ - - eressea-server@eressea.kn-bremen.de - eressea-server@eressea.kn-bremen.de - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA 4 BEFEHLE an eressea-server@eressea.kn-bremen.de zu senden. diff --git a/res/eressea/equipment.xml b/res/eressea/equipment.xml index bf7e38376..efd4f2a3b 100644 --- a/res/eressea/equipment.xml +++ b/res/eressea/equipment.xml @@ -2,18 +2,18 @@ - + - + - + @@ -21,30 +21,30 @@ - + - + - + - + - + - + @@ -58,12 +58,12 @@ - + - + diff --git a/s/setup b/s/setup index 848175ddc..e3e8e113d 100755 --- a/s/setup +++ b/s/setup @@ -96,7 +96,8 @@ touch eressea.ini ini_start ini_sec game ini_add game locales de,en -ini_add id $game +ini_add game id $game +ini_add game start 1 ini_sec lua ini_add lua install $SOURCE ini_add lua paths $SOURCE/scripts:$SOURCE/lunit diff --git a/scripts/eressea/autoseed.lua b/scripts/eressea/autoseed.lua index 562c39361..9e5060f85 100644 --- a/scripts/eressea/autoseed.lua +++ b/scripts/eressea/autoseed.lua @@ -1,3 +1,4 @@ +if not config.autoseed then return nil end local autoseed = {} -- minimum required resources in the 7-hex neighborhood: @@ -64,9 +65,9 @@ local function seed(r, email, race, lang) assert(f) local u = unit.create(f, r) assert(u) - equip_unit(u, "new_faction") - equip_unit(u, "first_unit") - equip_unit(u, "first_" .. race, 7) -- disable old callbacks + equip_unit(u, "autoseed_faction") + equip_unit(u, "autoseed_unit") + equip_unit(u, "autoseed_" .. race, 7) unit.create(f, r, 5):set_skill("mining", 30) unit.create(f, r, 5):set_skill("quarrying", 30) f:set_origin(r) diff --git a/scripts/eressea/embassy.lua b/scripts/eressea/embassy.lua index efbe248b7..82bce62c2 100644 --- a/scripts/eressea/embassy.lua +++ b/scripts/eressea/embassy.lua @@ -1,8 +1,5 @@ -- Muschelplateau -local embassy = {} -local home = nil - -- global exports (use item) function use_seashell(u, amount) -- Muschelplateau... @@ -17,6 +14,11 @@ function use_seashell(u, amount) return -4 end +if not config.embassy then return nil end + +local embassy = {} +local home = nil + function embassy.init() home = get_region(165,30) if home==nil then diff --git a/scripts/eressea/eternath.lua b/scripts/eressea/eternath.lua index 858a8d462..063577b74 100644 --- a/scripts/eressea/eternath.lua +++ b/scripts/eressea/eternath.lua @@ -1,5 +1,5 @@ -- DEPRECATED - +if not config.eternath then return nil end -- implements parts of a quest in E2 -- this module is deprecated, because it puts functions in the global environment for at_building_action diff --git a/scripts/eressea/ponnuki.lua b/scripts/eressea/ponnuki.lua index 994a16ff0..96bb0b5f1 100644 --- a/scripts/eressea/ponnuki.lua +++ b/scripts/eressea/ponnuki.lua @@ -1,3 +1,4 @@ +if not config.ponnuki then return nil end local ponnuki = {} local directions = { "NW", "NO", "O", "SO", "SW", "W" } diff --git a/scripts/eressea/wedding.lua b/scripts/eressea/wedding.lua index 812bd3269..2c06d9891 100644 --- a/scripts/eressea/wedding.lua +++ b/scripts/eressea/wedding.lua @@ -1,4 +1,5 @@ -- DEPRECATED +if not config.wedding then return nil end -- this script contains the action functions for the two portals -- used on the jadee/wildente wedding island. the two _action functions diff --git a/scripts/eressea/xmas.lua b/scripts/eressea/xmas.lua index 36e755f45..0316e6265 100644 --- a/scripts/eressea/xmas.lua +++ b/scripts/eressea/xmas.lua @@ -1,3 +1,5 @@ +if not config.xmas then return nil end + local gifts = { e2 = { { year = 2015, turn = 959, item = 'snowglobe', msg='santa_f' }, diff --git a/src/bindings.c b/src/bindings.c index 94e78fb70..14eae1c56 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -948,7 +948,7 @@ static int init_data(const char *filename, const char *catalog) return l; } if (turn < 0) { - turn = first_turn; + turn = first_turn(); } return 0; } diff --git a/src/calendar.c b/src/calendar.c index 7a27328a7..2099b6631 100644 --- a/src/calendar.c +++ b/src/calendar.c @@ -1,10 +1,10 @@ #include #include "calendar.h" +#include #include #include -int first_turn = 0; int first_month = 0; int weeks_per_month = 4; int months_per_year = 12; @@ -16,10 +16,15 @@ int *month_season = NULL; char *agename = NULL; int seasons = 0; +int first_turn(void) +{ + return config_get_int("game.start", 1); +} + const gamedate *get_gamedate(int turn, gamedate * gd) { int weeks_per_year = months_per_year * weeks_per_month; - int t = turn - first_turn; + int t = turn - first_turn(); assert(gd); if (t < 0) diff --git a/src/calendar.h b/src/calendar.h index 86f665c1a..d398cd77c 100644 --- a/src/calendar.h +++ b/src/calendar.h @@ -13,7 +13,6 @@ extern "C" { }; extern char *agename; - extern int first_turn; extern int first_month; extern int seasons; @@ -35,8 +34,9 @@ extern "C" { int week; } gamedate; - extern const gamedate *get_gamedate(int turn, gamedate * gd); - extern void calendar_cleanup(void); +const gamedate *get_gamedate(int turn, gamedate * gd); +void calendar_cleanup(void); +int first_turn(void); #ifdef __cplusplus } diff --git a/src/creport.c b/src/creport.c index bd9c97ec6..34cff9de3 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1475,7 +1475,7 @@ report_computer(const char *filename, report_context * ctx, const char *bom) faction *f = ctx->f; const char *prefix; region *r; - const char *mailto = LOC(f->locale, "mailto"); + const char *mailto = config_get("game.email"); const attrib *a; FILE *F = fopen(filename, "w"); static const race *rc_human; @@ -1510,8 +1510,11 @@ report_computer(const char *filename, report_context * ctx, const char *bom) fprintf(F, "%d;Zeitalter\n", era); fprintf(F, "\"%s\";Build\n", eressea_version()); if (mailto != NULL) { + // char mailcmd[64]; + // snprintf(mailcmd, sizeof(mailcmd), "%s %d, %s", game_name(), game_id(), LOC(f->locale, "mailcmd")); + const char * mailcmd = LOC(f->locale, "mailcmd"); fprintf(F, "\"%s\";mailto\n", mailto); - fprintf(F, "\"%s\";mailcmd\n", LOC(f->locale, "mailcmd")); + fprintf(F, "\"%s\";mailcmd\n", mailcmd); } show_alliances_cr(F, f); diff --git a/src/kernel/faction.c b/src/kernel/faction.c index 2c6d4d244..e3b80566d 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -22,7 +22,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "alliance.h" #include "ally.h" #include "curse.h" -#include "equipment.h" #include "group.h" #include "item.h" #include "messages.h" @@ -286,15 +285,10 @@ faction *addfaction(const char *email, const char *password, unit *addplayer(region * r, faction * f) { unit *u; - char buffer[32]; assert(f->units == NULL); faction_setorigin(f, 0, r->x, r->y); u = create_unit(r, f, 1, f->race, 0, NULL, NULL); - equip_items(&u->faction->items, get_equipment("new_faction")); - equip_unit(u, get_equipment("first_unit")); - sprintf(buffer, "first_%s", u_race(u)->_name); - equip_unit(u, get_equipment(buffer)); u->hp = unit_max_hp(u) * u->number; fset(u, UFL_ISNEW); if (f->race == get_race(RC_DAEMON)) { diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index 2f38cdab3..2ba9d785a 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -375,8 +375,13 @@ static int parse_calendar(xmlDocPtr doc) xmlNodeSetPtr nsetWeeks, nsetMonths, nsetSeasons; xmlChar *propValue = xmlGetProp(calendar, BAD_CAST "name"); xmlChar *newyear = xmlGetProp(calendar, BAD_CAST "newyear"); + xmlChar *start; - first_turn = xml_ivalue(calendar, "start", first_turn); + start = xmlGetProp(calendar, BAD_CAST "start"); + if (start && config_get("game.start")==NULL) { + config_set("game.start", (const char *)start); + xmlFree(start); + } if (propValue) { free(agename); agename = strdup(mkname("calendar", (const char *)propValue)); diff --git a/src/report.c b/src/report.c index 9b5e243b4..3c15f54f4 100644 --- a/src/report.c +++ b/src/report.c @@ -1408,7 +1408,7 @@ report_template(const char *filename, report_context * ctx, const char *bom) newline(out); newline(out); - sprintf(buf, "%s %s \"password\"", LOC(f->locale, "ERESSEA"), itoa36(f->no)); + sprintf(buf, "%s %s \"password\"", LOC(f->locale, parameters[P_FACTION]), itoa36(f->no)); rps_nowrap(out, buf); newline(out); newline(out);