diff --git a/res/de/strings.xml b/res/de/strings.xml index aea55a6a9..3b7b88f43 100644 --- a/res/de/strings.xml +++ b/res/de/strings.xml @@ -2200,9 +2200,6 @@ LERNEN - - LIEFERE - MACHEN @@ -6980,6 +6977,81 @@ guards the region + + hungert + hungry + + + + Fernzauber + far + + + + Seezauber + sea + + + + Schiffszauber + ship + + + + Magier exklusiv + magicians only + + + + Keine + none + + + + Wir helfen der Partei + We are helping the faction + + + + Wir helfen den Parteien + We are helping the factions + + + + hilft der Partei + is helping the faction + + + + hilft den Parteien + is helping the factions + + + + hat die Region durchquert + has traveled through the region + + + + haben die Region durchquert + have traveled through the region + + + + durchgereist + travel + + + + benachbart + neighbour + + + + vom Turm erblickt + from lighthouse + + und and diff --git a/src/gamecode/economy.c b/src/gamecode/economy.c index 6668c3a21..859cdd079 100644 --- a/src/gamecode/economy.c +++ b/src/gamecode/economy.c @@ -1306,7 +1306,7 @@ void economics(region * r) ord = NULL; destroyed = true; } - } else if (kwd == K_GIVE || kwd == K_LIEFERE) { + } else if (kwd == K_GIVE) { give_cmd(u, ord); } else if (kwd == K_FORGET) { forget_cmd(u, ord); diff --git a/src/gamecode/report.c b/src/gamecode/report.c index 1a253cadb..c8b3d1179 100644 --- a/src/gamecode/report.c +++ b/src/gamecode/report.c @@ -218,11 +218,25 @@ rparagraph(FILE * F, const char *str, ptrdiff_t indent, int hanging_indent, } while (*begin); } +static size_t write_spell_modifier(spell * sp, int flag, const char * str, bool cont, char * bufp, size_t size) { + if (sp->sptyp & flag) { + size_t bytes = 0; + if (cont) { + bytes = strlcpy(bufp, ", ", size); + } else { + bytes = strlcpy(bufp, " ", size); + } + bytes += strlcpy(bufp+bytes, str, size-bytes); + return bytes; + } + return 0; +} + static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang) { int bytes, k, itemanz, costtyp; char buf[4096]; - char *bufp = buf; + char *startp, *bufp = buf; size_t size = sizeof(buf) - 1; spell * sp = sbe->sp; const char *params = sp->parameter; @@ -296,52 +310,29 @@ static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang) bytes = (int)strlcpy(buf, LOC(lang, "nr_spell_modifiers"), size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); - if (sp->sptyp & FARCASTING) { - bytes = (int)strlcpy(bufp, " Fernzauber", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - dh = 1; + + startp = bufp; + bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp!=bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); } - if (sp->sptyp & OCEANCASTABLE) { - if (dh == 1) { - bytes = (int)strlcpy(bufp, ",", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); + bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp!=bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + bytes = (int)write_spell_modifier(sp, ONSHIPCAST, LOC(lang, "smod_ship"), startp!=bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_nofamiliar"), startp!=bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); + } + if (startp==bufp) { + bytes = (int)write_spell_modifier(sp, NOTFAMILIARCAST, LOC(lang, "smod_none"), startp!=bufp, bufp, size); + if (bytes && wrptr(&bufp, &size, bytes) != 0) { + WARN_STATIC_BUFFER(); } - bytes = (int)strlcpy(bufp, " Seezauber", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - dh = 1; - } - if (sp->sptyp & ONSHIPCAST) { - if (dh == 1) { - bytes = (int)strlcpy(bufp, ",", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - } - bytes = (int)strlcpy(bufp, " Schiffszauber", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - dh = 1; - } - if (sp->sptyp & NOTFAMILIARCAST) { - if (dh == 1) { - bytes = (int)strlcpy(bufp, ", k", size); - } else { - bytes = (int)strlcpy(bufp, " K", size); - } - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - bytes = - (int)strlcpy(bufp, "ann nicht vom Vertrauten gezaubert werden", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); - dh = 1; - } - if (dh == 0) { - bytes = (int)strlcpy(bufp, " Keine", size); - if (wrptr(&bufp, &size, bytes) != 0) - WARN_STATIC_BUFFER(); } *bufp = 0; rparagraph(F, buf, 0, 0, 0); @@ -948,11 +939,11 @@ static void describe(FILE * F, const seen_region * sr, faction * f) WARN_STATIC_BUFFER(); if (sr->mode == see_travel) { - bytes = (int)strlcpy(bufp, " (durchgereist)", size); + bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_travel")); } else if (sr->mode == see_neighbour) { - bytes = (int)strlcpy(bufp, " (benachbart)", size); + bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_neighbour")); } else if (sr->mode == see_lighthouse) { - bytes = (int)strlcpy(bufp, " (vom Turm erblickt)", size); + bytes = snprintf(bufp, size, " (%s)", LOC(f->locale, "see_lighthouse")); } else { bytes = 0; } @@ -1440,9 +1431,9 @@ static void durchreisende(FILE * F, const region * r, const faction * f) } /* TODO: finish localization */ if (maxtravel == 1) { - bytes = (int)strlcpy(bufp, " hat die Region durchquert.", size); + bytes = snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_one")); } else { - bytes = (int)strlcpy(bufp, " haben die Region durchquert.", size); + bytes = snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_many")); } if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); @@ -1735,9 +1726,9 @@ static void allies(FILE * F, const faction * f) int bytes; size_t size = sizeof(buf); if (!f->allies->next) { - bytes = (int)strlcpy(buf, "Wir helfen der Partei ", size); + bytes = snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_one")); } else { - bytes = (int)strlcpy(buf, "Wir helfen den Parteien ", size); + bytes = snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_many")); } size -= bytes; show_allies(f, f->allies, buf + bytes, size); @@ -1750,9 +1741,9 @@ static void allies(FILE * F, const faction * f) int bytes; size_t size = sizeof(buf); if (!g->allies->next) { - bytes = snprintf(buf, size, "%s hilft der Partei ", g->name); + bytes = snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_one")); } else { - bytes = snprintf(buf, size, "%s hilft den Parteien ", g->name); + bytes = snprintf(buf, size, "%s %s ", g->name, LOC(f->locale, "group_help_many")); } size -= bytes; show_allies(f, g->allies, buf + bytes, size); diff --git a/src/kernel/config.c b/src/kernel/config.c index 224923bf3..caf72d6cb 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -410,7 +410,6 @@ const char *keywords[MAXKEYWORDS] = { "KONTAKTIEREN", "LEHREN", "LERNEN", - "LIEFERE", "MACHEN", "NACH", "PASSWORT", diff --git a/src/kernel/order.c b/src/kernel/order.c index 4457a5c6b..13cd7dc6d 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -260,10 +260,6 @@ static order *create_order_i(keyword_t kwd, const char *sptr, int persistent, case K_KOMMENTAR: case NOKEYWORD: return NULL; - case K_LIEFERE: - kwd = K_GIVE; - persistent = 1; - break; default: break; } @@ -575,7 +571,6 @@ bool is_persistent(const order * ord) return false; case K_KOMMENTAR: - case K_LIEFERE: return true; default: diff --git a/src/kernel/reports.c b/src/kernel/reports.c index 86995cb2d..54cdbb011 100644 --- a/src/kernel/reports.c +++ b/src/kernel/reports.c @@ -620,10 +620,12 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char *buf, WARN_STATIC_BUFFER(); } if (fval(u, UFL_HUNGER)) { - if (c) - bytes = (int)strlcpy(bufp, ", hungert", size); - else - bytes = (int)strlcpy(bufp, "hungert", size); + if (c) { + bytes = (int)strlcpy(bufp, ", ", size); + if (wrptr(&bufp, &size, bytes) != 0) + WARN_STATIC_BUFFER(); + } + bytes = (int)strlcpy(bufp, LOC(f->locale, "unit_hungers"), size); if (wrptr(&bufp, &size, bytes) != 0) WARN_STATIC_BUFFER(); } diff --git a/src/kernel/types.h b/src/kernel/types.h index f6f1e4099..f023e435a 100644 --- a/src/kernel/types.h +++ b/src/kernel/types.h @@ -101,7 +101,6 @@ typedef enum { K_CONTACT, K_TEACH, K_STUDY, - K_LIEFERE, K_MAKE, K_MOVE, K_PASSWORD,