diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 6df0a4f59..ce43213a5 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -121,7 +121,7 @@ read_datenames(const char *filename) fgets(line,255,namesFP); l = strlen(line)-1; if(line[l] == '\n') line[l] = 0; - agename = strdup(line); + agename = strdup(mkname("calendar", line)); fgets(line,255,namesFP); seasons = strtol(line, NULL, 10); @@ -131,7 +131,7 @@ read_datenames(const char *filename) fgets(line,255,namesFP); l = strlen(line)-1; if(line[l] == '\n') line[l] = 0; - seasonnames[i] = strdup(line); + seasonnames[i] = strdup(mkname("calendar", line)); } fgets(line,255,namesFP); @@ -147,9 +147,9 @@ read_datenames(const char *filename) if(line[l] == '\n') line[l] = 0; np = strtok(line,":"); - weeknames[i] = strdup(np); + weeknames[i] = strdup(mkname("calendar", np)); np = strtok(NULL,":"); - weeknames2[i] = strdup(np); + weeknames2[i] = strdup(mkname("calendar", np)); } fgets(line,255,namesFP); @@ -165,7 +165,7 @@ read_datenames(const char *filename) if(line[l] == '\n') line[l] = 0; np = strtok(line,":"); - monthnames[i] = strdup(np); + monthnames[i] = strdup(mkname("calendar", np)); month_season[i] = atoi(strtok(NULL,":")); storms[i] = atoi(strtok(NULL,":")); } @@ -202,10 +202,10 @@ gamedate(const struct locale * lang) month = r/weeks_per_month; week = r%weeks_per_month; sprintf(buf, LOC(lang, "nr_calendar"), - weeknames[week], - monthnames[month], - year, - agename); + LOC(lang, weeknames[week]), + LOC(lang, monthnames[month]), + LOC(lang, year), + LOC(lang, agename)); return buf; } @@ -226,10 +226,10 @@ gamedate_season(const struct locale * lang) month = r/weeks_per_month; week = r%weeks_per_month; sprintf(buf, LOC(lang, "nr_calendar_season"), - weeknames[week], - monthnames[month], + LOC(lang, weeknames[week]), + LOC(lang, monthnames[month]), year, - agename, + LOC(lang, agename), LOC(lang, seasonnames[month_season[month]])); return buf; @@ -955,6 +955,7 @@ prices(FILE * F, const region * r, const faction * f) { const luxury_type *sale=NULL; struct demand * dmd; + message * m; int n = 0; if (r->land==NULL || r->land->demands==NULL) return; @@ -964,24 +965,35 @@ prices(FILE * F, const region * r, const faction * f) } assert(sale!=NULL); - sprintf(buf, "Auf dem Markt wird für %s %d Silber verlangt.", - LOC(f->locale, resourcename(sale->itype->rtype, GR_PLURAL)), - sale->price); + m = msg_message("nr_market_sale", "product price", + sale->itype->rtype, sale->price); + nr_render(m, f->locale, buf, sizeof(buf), f); + msg_release(m); - if(n > 0) scat(" Geboten wird für "); + if(n > 0) { + scat(" "); + scat(LOC(f->locale, "nr_trade_intro")); + scat(" "); - for (dmd=r->land->demands;dmd;dmd=dmd->next) if(dmd->value > 0) { - char sbuf[80]; - sprintf(sbuf, "%s %d Silber", LOC(f->locale, - resourcename(dmd->type->itype->rtype, GR_PLURAL)), - dmd->value * dmd->type->price); - scat(sbuf); - n--; - if (n == 0) scat("."); - else if (n == 1) scat(" und für "); - else scat(", für "); + for (dmd=r->land->demands;dmd;dmd=dmd->next) if(dmd->value > 0) { + char sbuf[80]; + m = msg_message("nr_market_price", "product price", + dmd->type->itype->rtype, dmd->value * dmd->type->price); + nr_render(m, f->locale, sbuf, sizeof(sbuf), f); + msg_release(m); + scat(sbuf); + n--; + if (n == 0) scat(LOC(f->locale, "nr_trade_end")); + else if (n == 1) { + scat(" "); + scat(LOC(f->locale, "nr_trade_final")); + scat(" "); + } else { + scat(LOC(f->locale, "nr_trade_next")); + scat(" "); + } + } } - /* Schreibe Paragraphen */ rparagraph(F, buf, 0, 0); @@ -1135,14 +1147,14 @@ describe(FILE * F, const region * r, int partial, faction * f) scat(" "); if (fval(r, RF_MALLORN)) { if (trees == 1) - scat(LOC(f->locale, "mallorntree")); + scat(LOC(f->locale, "nr_mallorntree")); else - scat(LOC(f->locale, "mallorntree_p")); + scat(LOC(f->locale, "nr_mallorntree_p")); } else if (trees == 1) - scat(LOC(f->locale, "tree")); + scat(LOC(f->locale, "nr_tree")); else - scat(LOC(f->locale, "tree_p")); + scat(LOC(f->locale, "nr_tree_p")); } } #else @@ -1153,14 +1165,14 @@ describe(FILE * F, const region * r, int partial, faction * f) scat(" "); if (fval(r, RF_MALLORN)) { if (trees == 1) - scat(LOC(f->locale, "mallorntree")); + scat(LOC(f->locale, "nr_mallorntree")); else - scat(LOC(f->locale, "mallorntree_p")); + scat(LOC(f->locale, "nr_mallorntree_p")); } else if (trees == 1) - scat(LOC(f->locale, "tree")); + scat(LOC(f->locale, "nr_tree")); else - scat(LOC(f->locale, "tree_p")); + scat(LOC(f->locale, "nr_tree_p")); } #endif @@ -1226,7 +1238,8 @@ describe(FILE * F, const region * r, int partial, faction * f) icat(rpeasants(r)); if(fval(r, RF_ORCIFIED)) { - scat(rpeasants(r)==1?" Ork":" Orks"); + scat(" "); + scat(LOC(f->locale, rpeasants(r)==1?"rc_orc":"rc_orc_p")); } else { scat(" "); scat(LOC(f->locale, resourcename(oldresourcetype[R_PEASANTS], rpeasants(r)!=1))); @@ -1282,11 +1295,14 @@ describe(FILE * F, const region * r, int partial, faction * f) if(!r2) continue; nrd--; if (dh) { - if (nrd == 0) scat(" und im "); - else scat(", im "); + if (nrd == 0) { + scat(" "); + scat(LOC(f->locale, "nr_nb_final")); + } else { + scat(LOC(f->locale, "nr_nb_next")); + } scat(LOC(f->locale, directions[d])); scat(" "); - if (!dh) scat("der Region liegt "); sprintf(dbuf, trailinto(r2, f->locale), f_regionid(r2, f)); scat(dbuf); @@ -1519,7 +1535,7 @@ order_template(FILE * F, faction * f) rps_nowrap(F, ""); rnl(F); - sprintf(buf, "%s %s \"hier_passwort_eintragen\"", LOC(f->locale, "ERESSEA"), factionid(f)); + sprintf(buf, "%s %s \"%s\"", LOC(f->locale, "ERESSEA"), factionid(f), LOC(f->locale, "enterpasswd")); rps_nowrap(F, buf); rnl(F); @@ -1893,8 +1909,11 @@ report(FILE *F, faction * f, const faction_list * addresses, else printf(" - Schreibe Report\n"); - sprintf(buf, "Report für %s, %s", global.gamename, pzTime); + m = msg_message("nr_header_date", "game date", global.gamename, pzTime); + nr_render(m, f->locale, buf, sizeof(buf), f); + msg_release(m); centre(F, buf, true); + centre(F, gamedate_season(f->locale), true); rnl(F); sprintf(buf, "%s, %s/%s (%s)", factionname(f), @@ -3649,7 +3668,7 @@ report_summary(summary * s, summary * o, boolean full) } } #endif - + fclose(F); if (full) { diff --git a/src/common/items/seed.c b/src/common/items/seed.c index 85873bebe..25c3c07af 100644 --- a/src/common/items/seed.c +++ b/src/common/items/seed.c @@ -22,6 +22,9 @@ /* kernel includes */ #include +/* util includes */ +#include + /* libc includes */ #include @@ -127,7 +130,11 @@ register_mallornseed(void) it_mallornseed.rtype->flags |= RTF_LIMITED; it_mallornseed.rtype->itype->flags |= ITF_NOBUILDBESIEGED; it_mallornseed.rtype->flags |= RTF_POOLED; - + register_function((pf_generic)limit_seeds, "limit_seeds"); + register_function((pf_generic)produce_seeds, "produce_seeds"); + register_function((pf_generic)limit_mallornseeds, "limit_mallornseeds"); + register_function((pf_generic)produce_mallornseeds, "produce_mallornseeds"); + a = a_add(&it_mallornseed.rtype->attribs, a_new(&at_resourcelimit)); { resource_limit * rdata = (resource_limit*)a->data.v; diff --git a/src/common/kernel/faction.c b/src/common/kernel/faction.c index 682246f4d..066b65a5a 100644 --- a/src/common/kernel/faction.c +++ b/src/common/kernel/faction.c @@ -117,7 +117,7 @@ addplayer(region *r, const char *email, const char * password, const struct race f->unique_id = ++max_unique_id; - sprintf(buf, "Partei %s", factionid(f)); + sprintf(buf, "%s %s", LOC(loc, "factiondefault"), factionid(f)); set_string(&f->name, buf); fset(f, FL_UNNAMED); @@ -138,7 +138,7 @@ addplayer(region *r, const char *email, const char * password, const struct race return u; } -boolean +boolean checkpasswd(const faction * f, const char * passwd) { if (strcasecmp(f->passw, passwd)==0) return true; diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index c10984760..40bab7f87 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -2098,7 +2098,7 @@ typedef struct xml_state { int wmods; } xml_state; -static int +static int tagend(struct xml_stack * stack) { const xml_tag * tag = stack->tag; @@ -2109,7 +2109,7 @@ tagend(struct xml_stack * stack) return XML_OK; } -static int +static int tagbegin(struct xml_stack * stack) { const xml_tag * tag = stack->tag; @@ -2597,6 +2597,9 @@ resname(resource_t res, int index) void register_resources(void) { + + register_function((pf_generic)limit_oldtypes, "limit_oldtypes"); + register_function((pf_generic)mod_elves_only, "mod_elves_only"); register_function((pf_generic)res_changeitem, "changeitem"); register_function((pf_generic)res_changeperson, "changeperson"); register_function((pf_generic)res_changepeasants, "changepeasants"); diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index 297db4578..db94c0a72 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -64,12 +64,12 @@ const char *magietypen[MAXMAGIETYP] = { - "Kein Magiegebiet", - "Illaun", - "Tybied", - "Cerddor", - "Gwyrrd", - "Draig" + "nomagic", + "illaun", + "tybied", + "cerddor", + "gwyrrd", + "draig" }; attrib_type at_reportspell = { @@ -1567,7 +1567,7 @@ regeneration_magiepunkte(void) aura += (int)reg_aura; add_message(&u->faction->msgs, msg_message( - "regenaura", "unit region amount", + "regenaura", "unit region amount", u, r, (int)reg_aura)); } set_spellpoints(u, min(aura, auramax)); @@ -1642,7 +1642,7 @@ verify_targets(castorder *co) unit *u; /* Versuch 1 : Region der Zauberwirkung */ u = findnewunit(target_r, mage->faction, spobj->data.i); - if (!u){ + if (!u){ /* Versuch 2 : Region des Magiers */ u = findnewunit(mage->region, mage->faction, spobj->data.i); } @@ -1806,7 +1806,7 @@ verify_targets(castorder *co) failed++; break; } - + if ((sp->sptyp & TESTRESISTANCE) && target_resists_magic(mage, u, TYP_UNIT, 0)) { /* Fehlermeldung */ @@ -1822,7 +1822,7 @@ verify_targets(castorder *co) } /* TODO: Test auf Parteieigenschaft Magieresistsenz */ - + success++; break; } @@ -2574,7 +2574,7 @@ remove_familiar(unit *mage) smd = (skillmod_data *)a->data.v; if (smd->special==sm_familiar) a_remove(&mage->attribs, a); a = an; - } + } } void @@ -2883,7 +2883,7 @@ magic(void) if (old_race(u->race) == RC_SPELL || fval(u, FL_LONGACTION)) continue; - if (old_race(u->race) == RC_INSECT && r_insectstalled(r) && + if (old_race(u->race) == RC_INSECT && r_insectstalled(r) && !is_cursed(u->attribs, C_KAELTESCHUTZ,0)) continue; @@ -3156,7 +3156,7 @@ magic(void) /* Ziele auf Existenz prüfen und Magieresistenz feststellen. Wurde * kein Ziel gefunden, so ist verify_targets=0. Scheitert der * Spruch an der Magieresistenz, so ist verify_targets = 1, bei - * Erfolg auf ganzer Linie ist verify_targets= 2 + * Erfolg auf ganzer Linie ist verify_targets= 2 */ switch (verify_targets(co)){ case 0: @@ -3167,13 +3167,13 @@ magic(void) spellparameter *pa = co->par; int n; for (n = 0; n < pa->length; n++) { - if(pa->param[n]->flag != TARGET_RESISTS + if(pa->param[n]->flag != TARGET_RESISTS && pa->param[n]->flag != TARGET_NOTFOUND) { /* mindestens ein erfolgreicher Zauberversuch, wir machen normal weiter */ break; } - } + } /* zwar wurde mindestens ein Ziel gefunden, das widerstand * jedoch dem Zauber. Kosten abziehen und abbrechen. */ pay_spell(u, sp, level, co->distance); @@ -3185,7 +3185,7 @@ magic(void) continue; /* äußere Schleife, nächster Zauberer */ } case 2: - default: + default: /* Zauber war erfolgreich */ break; } diff --git a/src/common/kernel/message.c b/src/common/kernel/message.c index b3dfdb71a..16319fbf6 100644 --- a/src/common/kernel/message.c +++ b/src/common/kernel/message.c @@ -299,6 +299,10 @@ arg_set(void * args[], const message_type * mtype, const char * buffer, void * v if (!strcmp(buffer, mtype->pnames[i])) break; } if (i!=mtype->nparameters) args[i] = v; + else { + fprintf(stderr, "invalid parameter %s for message type %s\n", buffer, mtype->name); + assert(!"program aborted."); + } } struct message * diff --git a/src/common/kernel/names.c b/src/common/kernel/names.c index 7a24f8223..0c1db2d89 100644 --- a/src/common/kernel/names.c +++ b/src/common/kernel/names.c @@ -26,6 +26,7 @@ /* kernel includes */ #include "unit.h" #include "region.h" +#include "faction.h" #include "magic.h" #include "race.h" @@ -712,7 +713,7 @@ name_unit(unit *u) if (u->race->generate_name) { set_string(&u->name, (u->race->generate_name(u))); } else { - sprintf(name, "Nummer %s", itoa36(u->no)); + sprintf(name, "%s %s", LOC(u->faction->locale, "unitdefault"), itoa36(u->no)); set_string(&u->name, name); fset(u, FL_UNNAMED); } diff --git a/src/common/kernel/reports.c b/src/common/kernel/reports.c index 5ce593966..6c626d487 100644 --- a/src/common/kernel/reports.c +++ b/src/common/kernel/reports.c @@ -620,7 +620,7 @@ spskill(const struct locale * lang, const struct unit * u, skill_t sk, int *dh, if (sk == SK_MAGIC){ if (find_magetype(u) != M_GRAU){ - sbuf += sprintf(sbuf, "%s ", magietypen[find_magetype(u)]); + sbuf += sprintf(sbuf, "%s ", LOC(lang, magietypen[find_magetype(u)])); } } @@ -725,7 +725,7 @@ spy_message(int spy, unit *u, unit *target) int found = 0; scat("Magiegebiet: "); - scat(magietypen[find_magetype(target)]); + scat(LOC(u->faction->locale, magietypen[find_magetype(target)])); if (get_mage(target)) { scat(", Sprüche: "); @@ -835,7 +835,7 @@ spy_message(int spy, unit *u, unit *target) scat("."); } - ADDMSG(&u->faction->msgs, msg_message("spyreport", + ADDMSG(&u->faction->msgs, msg_message("spyreport", "spy target report", u, target, strdup(buf))); } diff --git a/src/res/de/messages.xml b/src/res/de/messages.xml index 0f460154c..c2103ca1a 100644 --- a/src/res/de/messages.xml +++ b/src/res/de/messages.xml @@ -268,7 +268,7 @@ Wir schreiben %s des Monats %s im Jahre %d %s. Es ist %s. - It's %s of the month of %s in the %d. year of %s. It's %s. + It is %s of the month of %s in the %d. year of %s. It is %s. @@ -7294,6 +7294,24 @@ "Your password is ${password}." + + + + + + "Auf dem Markt wird für $resource($product,0) $int($price) verlangt." + "The local market offers $resource($product,0) at a price of $int($price)." + + + + + + + + "$resource($product,0) $int($price) Silber" + "$resource($product,0) for $int($price) silver" + + @@ -7302,6 +7320,15 @@ "Im $direction($dir) der Region liegt $trail($region,$locale("de"))" "To the $direction($dir) lies $trail($region,$locale("en"))" + + + + + + + "Report für $game, $date" + "Report for $game, $date" + diff --git a/src/res/de/strings.xml b/src/res/de/strings.xml index dfcb72e00..a13201e73 100644 --- a/src/res/de/strings.xml +++ b/src/res/de/strings.xml @@ -51,6 +51,44 @@ flame + + Geboten wird für + Traders can sell + + + und für + and + + + . + . + + + , für + , + + + + , im + , to the + + + und im + and to the + + + Einheit + Unit + + + Partei + Faction + + + hier_passwort_eintragen + insert_your_password_here + + Eis ice @@ -5098,6 +5136,133 @@ + + + Winter + winter + + + Sommer + summer + + + Frühling + spring + + + Herbst + fall + + + die erste Woche + the first week + + + die zweite Woche + the second week + + + die letzte Woche + the last week + + + der ersten Woche + of the first week + + + der zweiten Woche + of the second week + + + der letzten Woche + of the third week + + + Feldsegen + harvest moon + + + Nebetage + impenetrable fog + + + Sturmmond + storm moon + + + Herdfeuer + hearth fire + + + Eiswind + icewind + + + Schneeban + snowbane + + + Blütenregen + flowerrain + + + Mond der milden Winde + mild winds + + + Sonnenfeuer + sunfire + + + des zweiten Zeitalters + the second age + + + + + + Kein Magiegebiet + no magic school yet + + + Illaun + Illaun + + + Tybied + Tybied + + + Gwyrrd + Gwyrrd + + + Cerrdor + Cerrdor + + + Draig + Draig + + + + + Baum + tree + + + Bäume + trees + + + + Mallornbaum + mallorn tree + + + Mallornäume + mallorn trees + diff --git a/src/res/en/messages.xml b/src/res/en/messages.xml index ea4a4730f..0ec2632b3 100644 --- a/src/res/en/messages.xml +++ b/src/res/en/messages.xml @@ -774,7 +774,7 @@ - "$unit($unit) in $region($region): '$command' - The party could not be found." + "$unit($unit) in $region($region): '$command' - The faction could not be found." @@ -813,7 +813,7 @@ - "$unit($unit) in $region($region): '$command' - This region is guarded by a non allied party." + "$unit($unit) in $region($region): '$command' - This region is guarded by a non allied faction." @@ -1541,7 +1541,7 @@ - "$unit($unit) in $region($region): '$command' - Your party cannot hire so many strangers." + "$unit($unit) in $region($region): '$command' - Your faction cannot hire so many strangers." @@ -1554,7 +1554,7 @@ - "$unit($unit) in $region($region): '$command' - The party cannot hire so many strangers." + "$unit($unit) in $region($region): '$command' - The faction cannot hire so many strangers." @@ -1567,7 +1567,7 @@ - "$unit($unit) in $region($region): '$command' - The party cannot hire so many strangers." + "$unit($unit) in $region($region): '$command' - The faction cannot hire so many strangers." @@ -1879,7 +1879,7 @@ - "$unit($unit) in $region($region): '$command' - Too many magicians in the party." + "$unit($unit) in $region($region): '$command' - Too many magicians in the faction." @@ -1892,7 +1892,7 @@ - "$unit($unit) in $region($region): '$command' - Too many alchemists in the party." + "$unit($unit) in $region($region): '$command' - Too many alchemists in the faction." @@ -1905,7 +1905,7 @@ - "$unit($unit) in $region($region): '$command' - The party has a different magic sphere." + "$unit($unit) in $region($region): '$command' - The faction has a different magic sphere." @@ -3416,7 +3416,7 @@ - "Your party is immune against assaults for $int($turns) more weeks." + "Your faction is immune against assaults for $int($turns) more weeks." diff --git a/src/res/en/strings.xml b/src/res/en/strings.xml index 0bbec88d8..f4b6cfdb2 100644 --- a/src/res/en/strings.xml +++ b/src/res/en/strings.xml @@ -573,10 +573,10 @@ eye of dragons - fairyboot + fairy boots - fairyboot + fairy boots flaming sword diff --git a/src/res/eressea/de/strings.xml b/src/res/eressea/de/strings.xml index 4eb93d6d6..f4d82a2a5 100644 --- a/src/res/eressea/de/strings.xml +++ b/src/res/eressea/de/strings.xml @@ -1,11 +1,18 @@ - Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an eressea@eressea.amber.kn-bremen.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. + Bitte denke daran, deine Befehle mit dem Betreff ERESSEA BEFEHLE an eressea-server@eressea.upb.de zu senden. Am besten, du verwendest die Befehlsvorlage am Ende des Reports. + Remember to send your orders to eressea-server@eressea.upb.de with the subject ERESSEA ORDERS. Die ersten beiden Züge mußt du abgeben, sonst wird deine Partei sofort wieder gelöscht, um Karteileichen zu vermeiden. + If you fail to send in orders for one of the first two turns, your faction will be erased from the game to reduce the number of inactive players in Eressea. Mit der ersten Auswertung bekommst du einen Computerreport, den du mit vielen der Tools auf http://eressea-pbem.de/download.html benutzen kannst. Wenn du ihn weiterhin bekommen willst, gib einer deiner Einheiten den Befehl OPTION COMPUTER. + 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 + WORK diff --git a/src/res/timestrings b/src/res/timestrings index 050f826e4..df846bed4 100644 --- a/src/res/timestrings +++ b/src/res/timestrings @@ -1,20 +1,20 @@ -des zweiten Zeitalters +secondage 4 -Winter -Frühling -Sommer -Herbst +winter +spring +summer +fall 3 -die erste Woche:der ersten Woche -die zweite Woche:der zweiten Woche -die letzte Woche:der letzten Woche +firstweek:firstweek_d +secondweek:secondweek_d +thirdweek:thirdweek_d 9 -Feldsegen:2:30 -Nebeltage:3:60 -Sturmmond:3:80 -Herdfeuer:0:50 -Eiswind:0:30 -Schneebann:0:60 -Blütenregen:1:60 -Mond der milden Winde:1:10 -Sonnenfeuer:2:10 +month_1:2:30 +month_2:3:60 +month_3:3:80 +month_4:0:50 +month_5:0:30 +month_6:0:60 +month_7:1:60 +month_8:1:10 +month_9:2:10