forked from github/server
Merge branch 'master' of github.com:eressea/core
This commit is contained in:
commit
f4761867cd
|
@ -2200,9 +2200,6 @@
|
||||||
<string name="LERNEN">
|
<string name="LERNEN">
|
||||||
<text locale="de">LERNEN</text>
|
<text locale="de">LERNEN</text>
|
||||||
</string>
|
</string>
|
||||||
<string name="LIEFERE">
|
|
||||||
<text locale="de">LIEFERE</text>
|
|
||||||
</string>
|
|
||||||
<string name="MACHEN">
|
<string name="MACHEN">
|
||||||
<text locale="de">MACHEN</text>
|
<text locale="de">MACHEN</text>
|
||||||
</string>
|
</string>
|
||||||
|
@ -6980,6 +6977,81 @@
|
||||||
<text locale="en">guards the region</text>
|
<text locale="en">guards the region</text>
|
||||||
</string>
|
</string>
|
||||||
|
|
||||||
|
<string name="unit_hungers">
|
||||||
|
<text locale="de">hungert</text>
|
||||||
|
<text locale="en">hungry</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="smod_far">
|
||||||
|
<text locale="de">Fernzauber</text>
|
||||||
|
<text locale="en">far</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="smod_sea">
|
||||||
|
<text locale="de">Seezauber</text>
|
||||||
|
<text locale="en">sea</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="smod_ship">
|
||||||
|
<text locale="de">Schiffszauber</text>
|
||||||
|
<text locale="en">ship</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="smod_nofamiliar">
|
||||||
|
<text locale="de">Magier exklusiv</text>
|
||||||
|
<text locale="en">magicians only</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="smod_none">
|
||||||
|
<text locale="de">Keine</text>
|
||||||
|
<text locale="en">none</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="faction_help_one">
|
||||||
|
<text locale="de">Wir helfen der Partei</text>
|
||||||
|
<text locale="en">We are helping the faction</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="faction_help_many">
|
||||||
|
<text locale="de">Wir helfen den Parteien</text>
|
||||||
|
<text locale="en">We are helping the factions</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="group_help_one">
|
||||||
|
<text locale="de">hilft der Partei</text>
|
||||||
|
<text locale="en">is helping the faction</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="group_help_many">
|
||||||
|
<text locale="de">hilft den Parteien</text>
|
||||||
|
<text locale="en">is helping the factions</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="has_moved_one">
|
||||||
|
<text locale="de">hat die Region durchquert</text>
|
||||||
|
<text locale="en">has traveled through the region</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="has_moved_many">
|
||||||
|
<text locale="de">haben die Region durchquert</text>
|
||||||
|
<text locale="en">have traveled through the region</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="see_travel">
|
||||||
|
<text locale="de">durchgereist</text>
|
||||||
|
<text locale="en">travel</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="see_neighbour">
|
||||||
|
<text locale="de">benachbart</text>
|
||||||
|
<text locale="en">neighbour</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
|
<string name="see_lighthouse">
|
||||||
|
<text locale="de">vom Turm erblickt</text>
|
||||||
|
<text locale="en">from lighthouse</text>
|
||||||
|
</string>
|
||||||
|
|
||||||
<string name="list_and">
|
<string name="list_and">
|
||||||
<text locale="de"> und </text>
|
<text locale="de"> und </text>
|
||||||
<text locale="en"> and </text>
|
<text locale="en"> and </text>
|
||||||
|
|
|
@ -1306,7 +1306,7 @@ void economics(region * r)
|
||||||
ord = NULL;
|
ord = NULL;
|
||||||
destroyed = true;
|
destroyed = true;
|
||||||
}
|
}
|
||||||
} else if (kwd == K_GIVE || kwd == K_LIEFERE) {
|
} else if (kwd == K_GIVE) {
|
||||||
give_cmd(u, ord);
|
give_cmd(u, ord);
|
||||||
} else if (kwd == K_FORGET) {
|
} else if (kwd == K_FORGET) {
|
||||||
forget_cmd(u, ord);
|
forget_cmd(u, ord);
|
||||||
|
|
|
@ -218,11 +218,25 @@ rparagraph(FILE * F, const char *str, ptrdiff_t indent, int hanging_indent,
|
||||||
} while (*begin);
|
} 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)
|
static void nr_spell(FILE * F, spellbook_entry * sbe, const struct locale *lang)
|
||||||
{
|
{
|
||||||
int bytes, k, itemanz, costtyp;
|
int bytes, k, itemanz, costtyp;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
char *bufp = buf;
|
char *startp, *bufp = buf;
|
||||||
size_t size = sizeof(buf) - 1;
|
size_t size = sizeof(buf) - 1;
|
||||||
spell * sp = sbe->sp;
|
spell * sp = sbe->sp;
|
||||||
const char *params = sp->parameter;
|
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);
|
bytes = (int)strlcpy(buf, LOC(lang, "nr_spell_modifiers"), size);
|
||||||
if (wrptr(&bufp, &size, bytes) != 0)
|
if (wrptr(&bufp, &size, bytes) != 0)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
if (sp->sptyp & FARCASTING) {
|
|
||||||
bytes = (int)strlcpy(bufp, " Fernzauber", size);
|
startp = bufp;
|
||||||
if (wrptr(&bufp, &size, bytes) != 0)
|
bytes = (int)write_spell_modifier(sp, FARCASTING, LOC(lang, "smod_far"), startp!=bufp, bufp, size);
|
||||||
WARN_STATIC_BUFFER();
|
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
|
||||||
dh = 1;
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
if (sp->sptyp & OCEANCASTABLE) {
|
bytes = (int)write_spell_modifier(sp, OCEANCASTABLE, LOC(lang, "smod_sea"), startp!=bufp, bufp, size);
|
||||||
if (dh == 1) {
|
if (bytes && wrptr(&bufp, &size, bytes) != 0) {
|
||||||
bytes = (int)strlcpy(bufp, ",", size);
|
WARN_STATIC_BUFFER();
|
||||||
if (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;
|
*bufp = 0;
|
||||||
rparagraph(F, buf, 0, 0, 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();
|
WARN_STATIC_BUFFER();
|
||||||
|
|
||||||
if (sr->mode == see_travel) {
|
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) {
|
} 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) {
|
} 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 {
|
} else {
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
}
|
}
|
||||||
|
@ -1440,9 +1431,9 @@ static void durchreisende(FILE * F, const region * r, const faction * f)
|
||||||
}
|
}
|
||||||
/* TODO: finish localization */
|
/* TODO: finish localization */
|
||||||
if (maxtravel == 1) {
|
if (maxtravel == 1) {
|
||||||
bytes = (int)strlcpy(bufp, " hat die Region durchquert.", size);
|
bytes = snprintf(bufp, size, " %s", LOC(f->locale, "has_moved_one"));
|
||||||
} else {
|
} 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)
|
if (wrptr(&bufp, &size, bytes) != 0)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
|
@ -1735,9 +1726,9 @@ static void allies(FILE * F, const faction * f)
|
||||||
int bytes;
|
int bytes;
|
||||||
size_t size = sizeof(buf);
|
size_t size = sizeof(buf);
|
||||||
if (!f->allies->next) {
|
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 {
|
} else {
|
||||||
bytes = (int)strlcpy(buf, "Wir helfen den Parteien ", size);
|
bytes = snprintf(buf, size, "%s ", LOC(f->locale, "faction_help_many"));
|
||||||
}
|
}
|
||||||
size -= bytes;
|
size -= bytes;
|
||||||
show_allies(f, f->allies, buf + bytes, size);
|
show_allies(f, f->allies, buf + bytes, size);
|
||||||
|
@ -1750,9 +1741,9 @@ static void allies(FILE * F, const faction * f)
|
||||||
int bytes;
|
int bytes;
|
||||||
size_t size = sizeof(buf);
|
size_t size = sizeof(buf);
|
||||||
if (!g->allies->next) {
|
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 {
|
} 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;
|
size -= bytes;
|
||||||
show_allies(f, g->allies, buf + bytes, size);
|
show_allies(f, g->allies, buf + bytes, size);
|
||||||
|
|
|
@ -410,7 +410,6 @@ const char *keywords[MAXKEYWORDS] = {
|
||||||
"KONTAKTIEREN",
|
"KONTAKTIEREN",
|
||||||
"LEHREN",
|
"LEHREN",
|
||||||
"LERNEN",
|
"LERNEN",
|
||||||
"LIEFERE",
|
|
||||||
"MACHEN",
|
"MACHEN",
|
||||||
"NACH",
|
"NACH",
|
||||||
"PASSWORT",
|
"PASSWORT",
|
||||||
|
|
|
@ -260,10 +260,6 @@ static order *create_order_i(keyword_t kwd, const char *sptr, int persistent,
|
||||||
case K_KOMMENTAR:
|
case K_KOMMENTAR:
|
||||||
case NOKEYWORD:
|
case NOKEYWORD:
|
||||||
return NULL;
|
return NULL;
|
||||||
case K_LIEFERE:
|
|
||||||
kwd = K_GIVE;
|
|
||||||
persistent = 1;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -575,7 +571,6 @@ bool is_persistent(const order * ord)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
case K_KOMMENTAR:
|
case K_KOMMENTAR:
|
||||||
case K_LIEFERE:
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -620,10 +620,12 @@ bufunit(const faction * f, const unit * u, int indent, int mode, char *buf,
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
if (fval(u, UFL_HUNGER)) {
|
if (fval(u, UFL_HUNGER)) {
|
||||||
if (c)
|
if (c) {
|
||||||
bytes = (int)strlcpy(bufp, ", hungert", size);
|
bytes = (int)strlcpy(bufp, ", ", size);
|
||||||
else
|
if (wrptr(&bufp, &size, bytes) != 0)
|
||||||
bytes = (int)strlcpy(bufp, "hungert", size);
|
WARN_STATIC_BUFFER();
|
||||||
|
}
|
||||||
|
bytes = (int)strlcpy(bufp, LOC(f->locale, "unit_hungers"), size);
|
||||||
if (wrptr(&bufp, &size, bytes) != 0)
|
if (wrptr(&bufp, &size, bytes) != 0)
|
||||||
WARN_STATIC_BUFFER();
|
WARN_STATIC_BUFFER();
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,6 @@ typedef enum {
|
||||||
K_CONTACT,
|
K_CONTACT,
|
||||||
K_TEACH,
|
K_TEACH,
|
||||||
K_STUDY,
|
K_STUDY,
|
||||||
K_LIEFERE,
|
|
||||||
K_MAKE,
|
K_MAKE,
|
||||||
K_MOVE,
|
K_MOVE,
|
||||||
K_PASSWORD,
|
K_PASSWORD,
|
||||||
|
|
Loading…
Reference in New Issue