More English translations for spells and other parts of the code (addmessage replacements FTW)

This commit is contained in:
Enno Rehling 2007-02-23 21:18:35 +00:00
parent 5d1f883f45
commit 61a479ad3f
8 changed files with 134 additions and 104 deletions

View File

@ -1025,32 +1025,32 @@ gebaeude_stuerzt_ein(region * r, building * b)
void void
maintain_buildings(region * r, boolean crash) maintain_buildings(region * r, boolean crash)
{ {
building **bp = &r->buildings; building **bp = &r->buildings;
while (*bp) { while (*bp) {
building * b = *bp; building * b = *bp;
boolean maintained = maintain(b, !crash); boolean maintained = maintain(b, !crash);
/* the second time, send a message */ /* the second time, send a message */
if (crash) { if (crash) {
if (!maintained && (rng_int() % 100 < EINSTURZCHANCE)) { if (!maintained && (rng_int() % 100 < EINSTURZCHANCE)) {
gebaeude_stuerzt_ein(r, b); gebaeude_stuerzt_ein(r, b);
continue; continue;
} else if (!fval(b, BLD_WORKING)) { } else if (!fval(b, BLD_WORKING)) {
unit * u = buildingowner(r, b); unit * u = buildingowner(r, b);
const char * msgtype = maintained?"maintenance_nowork":"maintenance_none"; const char * msgtype = maintained?"maintenance_nowork":"maintenance_none";
struct message * msg = msg_message(msgtype, "building", b); struct message * msg = msg_message(msgtype, "building", b);
if (u) { if (u) {
add_message(&u->faction->msgs, msg); add_message(&u->faction->msgs, msg);
r_addmessage(r, u->faction, msg); r_addmessage(r, u->faction, msg);
} else { } else {
add_message(&r->msgs, msg); add_message(&r->msgs, msg);
} }
msg_release(msg); msg_release(msg);
} }
} }
bp=&b->next; bp=&b->next;
} }
} }
@ -1665,6 +1665,7 @@ make_cmd(unit * u, struct order * ord)
} }
build_road(r, u, m, d); build_road(r, u, m, d);
} else { } else {
/* Die Richtung wurde nicht erkannt */
cmistake(u, ord, 71, MSG_PRODUCE); cmistake(u, ord, 71, MSG_PRODUCE);
} }
} }

View File

@ -1843,8 +1843,7 @@ mail_cmd(unit * u, struct order * ord)
cmistake(u, ord, 30, MSG_MESSAGE); cmistake(u, ord, 30, MSG_MESSAGE);
break; break;
} else { } else {
sprintf(buf, "von %s: '%s'", unitname(u), s); ADDMSG(&r->msgs, msg_message("mail_result", "unit message", u, s));
addmessage(r, 0, buf, MSG_MESSAGE, ML_IMPORTANT);
break; break;
} }
break; break;
@ -2665,29 +2664,25 @@ renumber_factions(void)
if (!a) continue; if (!a) continue;
want = a->data.i; want = a->data.i;
if (fval(f, FFL_NEWID)) { if (fval(f, FFL_NEWID)) {
sprintf(buf, "NUMMER PARTEI %s: Die Partei kann nicht mehr als einmal ihre Nummer wecheln", itoa36(want)); ADDMSG(&f->msgs, msg_message("renumber_twice", "id", want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT); continue;
} }
old = findfaction(want); old = findfaction(want);
if (old) { if (old) {
a_remove(&f->attribs, a); a_remove(&f->attribs, a);
sprintf(buf, "Die Nummer %s wird von einer anderen Partei benutzt.", itoa36(want)); ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
continue; continue;
} }
if (!faction_id_is_unused(want)) { if (!faction_id_is_unused(want)) {
a_remove(&f->attribs, a); a_remove(&f->attribs, a);
sprintf(buf, "Die Nummer %s wurde schon einmal von einer anderen Partei benutzt.", itoa36(want)); ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
continue; continue;
} }
for (rn=&renum; *rn; rn=&(*rn)->next) { for (rn=&renum; *rn; rn=&(*rn)->next) {
if ((*rn)->want>=want) break; if ((*rn)->want>=want) break;
} }
if (*rn && (*rn)->want==want) { if (*rn && (*rn)->want==want) {
a_remove(&f->attribs, a); ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
sprintf(buf, "Die Nummer %s wurde bereits einer anderen Partei zugeteilt.", itoa36(want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
} else { } else {
struct renum * r = calloc(sizeof(struct renum), 1); struct renum * r = calloc(sizeof(struct renum), 1);
r->next = *rn; r->next = *rn;

View File

@ -316,6 +316,7 @@ destroy_road(unit *u, int nmax, struct order * ord)
} }
if (d==NODIRECTION) { if (d==NODIRECTION) {
/* Die Richtung wurde nicht erkannt */
cmistake(u, ord, 71, MSG_PRODUCE); cmistake(u, ord, 71, MSG_PRODUCE);
} else { } else {
short road = rroad(r, d); short road = rroad(r, d);

View File

@ -187,46 +187,46 @@ caddmessage(region * r, faction * f, const char *s, msg_t mtype, int level)
log_warning(("message for locale \"%s\": %s\n", locale_name(f->locale), s)); log_warning(("message for locale \"%s\": %s\n", locale_name(f->locale), s));
} }
#endif #endif
unused(level); unused(level);
switch (mtype) { switch (mtype) {
case MSG_INCOME: case MSG_INCOME:
assert(f); assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s)); m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break; break;
case MSG_BATTLE: case MSG_BATTLE:
assert(0 || !"battle-meldungen nicht über addmessage machen"); assert(0 || !"battle-meldungen nicht über addmessage machen");
break; break;
case MSG_MOVE: case MSG_MOVE:
assert(f); assert(f);
m = add_message(&f->msgs, msg_message("msg_movement", "string", s)); m = add_message(&f->msgs, msg_message("msg_movement", "string", s));
break; break;
case MSG_COMMERCE: case MSG_COMMERCE:
assert(f); assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s)); m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break; break;
case MSG_PRODUCE: case MSG_PRODUCE:
assert(f); assert(f);
m = add_message(&f->msgs, msg_message("msg_production", "string", s)); m = add_message(&f->msgs, msg_message("msg_production", "string", s));
break; break;
case MSG_MAGIC: case MSG_MAGIC:
case MSG_COMMENT: case MSG_COMMENT:
case MSG_MESSAGE: case MSG_MESSAGE:
case MSG_ORCVERMEHRUNG: case MSG_ORCVERMEHRUNG:
case MSG_EVENT: case MSG_EVENT:
/* Botschaften an REGION oder einzelne PARTEI */ /* Botschaften an REGION oder einzelne PARTEI */
m = msg_message("msg_event", "string", s); m = msg_message("msg_event", "string", s);
if (!r) { if (!r) {
assert(f); assert(f);
m = add_message(&f->msgs, m); m = add_message(&f->msgs, m);
} else { } else {
if (f==NULL) add_message(&r->msgs, m); if (f==NULL) add_message(&r->msgs, m);
else r_addmessage(r, f, m); else r_addmessage(r, f, m);
} }
break; break;
default: default:
assert(!"Ungültige Msg-Klasse!"); assert(!"Ungültige Msg-Klasse!");
} }
if (m) msg_release(m); if (m) msg_release(m);
} }
void void

View File

@ -1451,9 +1451,10 @@ sp_sparkle(castorder *co)
ADDMSG(&mage->faction->msgs, msg_message( ADDMSG(&mage->faction->msgs, msg_message(
"sparkle_effect", "mage target", mage, u)); "sparkle_effect", "mage target", mage, u));
if (u->faction!=mage->faction) if (u->faction!=mage->faction) {
ADDMSG(&u->faction->msgs, msg_message( ADDMSG(&u->faction->msgs, msg_message(
"sparkle_effect", "mage target", mage, u)); "sparkle_effect", "mage target", mage, u));
}
return cast_level; return cast_level;
} }
@ -2172,6 +2173,7 @@ sp_fog_of_confusion(castorder *co)
for (rl2 = rl; rl2; rl2 = rl2->next) { for (rl2 = rl; rl2; rl2 = rl2->next) {
curse * c; curse * c;
variant effect; variant effect;
message * m = NULL;
if (!fval(rl2->data->terrain, SEA_REGION) if (!fval(rl2->data->terrain, SEA_REGION)
&& !r_isforest(rl2->data)) continue; && !r_isforest(rl2->data)) continue;
@ -2192,16 +2194,15 @@ sp_fog_of_confusion(castorder *co)
for (u = rl2->data->units; u; u = u->next ) { for (u = rl2->data->units; u; u = u->next ) {
if (!fval(u->faction, FL_DH) ) { if (!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s beschwört einen Schleier der Verwirrung.", if (!m) m = msg_message("confusion_result", "mage", mage);
cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand"); add_message(&u->faction->msgs, m);
addmessage(rl2->data, u->faction, buf, MSG_EVENT, ML_INFO);
} }
} }
if (!fval(mage->faction, FL_DH)) { if (!fval(mage->faction, FL_DH)) {
sprintf(buf, "%s beschwört einen Schleier der Verwirrung.", if (!m) m = msg_message("confusion_result", "mage", mage);
unitname(mage)); add_message(&mage->faction->msgs, m);
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_INFO);
} }
if (m) msg_release(m);
} }
free_regionlist(rl); free_regionlist(rl);
return cast_level; return cast_level;
@ -5478,6 +5479,8 @@ sp_dream_of_confusion(castorder *co)
region * r2 = rl2->data; region * r2 = rl2->data;
variant effect; variant effect;
curse * c; curse * c;
message * m = NULL;
/* Magieresistenz jeder Region prüfen */ /* Magieresistenz jeder Region prüfen */
if (target_resists_magic(mage, r2, TYP_REGION, 0)) { if (target_resists_magic(mage, r2, TYP_REGION, 0)) {
report_failure(mage, co->order); report_failure(mage, co->order);
@ -5494,16 +5497,15 @@ sp_dream_of_confusion(castorder *co)
for (u = r2->units; u; u = u->next ) { for (u = r2->units; u; u = u->next ) {
if (!fval(u->faction, FL_DH) ) { if (!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s beschwört einen Schleier der Verwirrung.", if (!m) m = msg_message("confusion_result", "mage", mage);
cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand"); add_message(&u->faction->msgs, m);
addmessage(r2, u->faction, buf, MSG_EVENT, ML_INFO);
} }
} }
if (!fval(mage->faction, FL_DH)) { if (!fval(mage->faction, FL_DH)) {
sprintf(buf, "%s beschwört einen Schleier der Verwirrung.", if (!m) m = msg_message("confusion_result", "mage", mage);
unitname(mage)); add_message(&u->faction->msgs, m);
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_INFO);
} }
if (m) msg_release(m);
} }
free_regionlist(rl); free_regionlist(rl);
return cast_level; return cast_level;
@ -5698,10 +5700,7 @@ sp_enterastral(castorder *co)
ro = r; ro = r;
break; break;
default: default:
sprintf(buf, "%s in %s: 'ZAUBER %s': Dieser Zauber funktioniert " cmistake(mage, co->order, 190, MSG_MAGIC);
"nur in der materiellen Welt.", unitname(mage),
regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -5945,8 +5944,7 @@ sp_leaveastral(castorder *co)
free_regionlist(rl); free_regionlist(rl);
break; break;
default: default:
sprintf(buf, "Der Zauber funktioniert nur in der astralen Welt."); ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spell_astral_only", ""));
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -6244,7 +6242,7 @@ sp_viewreality(castorder *co)
if (getplaneid(r) != 1) { if (getplaneid(r) != 1) {
/* sprintf(buf, "Dieser Zauber kann nur im Astralraum gezaubert werden."); */ /* sprintf(buf, "Dieser Zauber kann nur im Astralraum gezaubert werden."); */
cmistake(mage, co->order, 217, MSG_MAGIC); ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spell_astral_only", ""));
return 0; return 0;
} }
@ -6511,11 +6509,8 @@ sp_movecastle(castorder *co)
dir = finddirection(pa->param[1]->data.s, mage->faction->locale); dir = finddirection(pa->param[1]->data.s, mage->faction->locale);
if (dir == NODIRECTION) { if (dir == NODIRECTION) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Ungültige Richtung %s.", /* Die Richtung wurde nicht erkannt */
unitname(mage), regionname(mage->region, mage->faction), cmistake(mage, co->order, 71, MSG_PRODUCE);
spell_name(sp, mage->faction->locale),
pa->param[1]->data.s);
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
return 0; return 0;
} }
@ -6597,6 +6592,7 @@ sp_flying_ship(castorder *co)
int cast_level = co->level; int cast_level = co->level;
double power = co->force; double power = co->force;
spellparameter *pa = co->par; spellparameter *pa = co->par;
message * m = NULL;
/* wenn kein Ziel gefunden, Zauber abbrechen */ /* wenn kein Ziel gefunden, Zauber abbrechen */
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0; if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
@ -6629,13 +6625,11 @@ sp_flying_ship(castorder *co)
/* das sehen natürlich auch die Leute an Land */ /* das sehen natürlich auch die Leute an Land */
if (!fval(u->faction, FL_DH) ) { if (!fval(u->faction, FL_DH) ) {
fset(u->faction, FL_DH); fset(u->faction, FL_DH);
sprintf(buf, "%s beschwört einen Luftgeist, der die %s in " if (!m) m = msg_message("flying_ship_result", "mage ship", mage, sh);
"die Wolken hebt.", add_message(&u->faction->msgs, m);
cansee(u->faction, r, mage, 0) ? unitname(mage) : "Jemand",
shipname(sh));
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO);
} }
} }
if (m) msg_release(m);
return cast_level; return cast_level;
} }

View File

@ -59,16 +59,16 @@ unitmessage_free(trigger * t)
static int static int
unitmessage_handle(trigger * t, void * data) unitmessage_handle(trigger * t, void * data)
{ {
/* call an event handler on unitmessage. /* call an event handler on unitmessage.
* data.v -> ( variant event, int timer ) * data.v -> ( variant event, int timer )
*/ */
unitmessage_data * td = (unitmessage_data*)t->data.v; unitmessage_data * td = (unitmessage_data*)t->data.v;
if (td->target!=NULL) { if (td->target!=NULL) {
addmessage(td->target->region, td->target->faction, td->string, td->type, td->level); addmessage(td->target->region, td->target->faction, td->string, td->type, td->level);
} else } else
log_error(("could not perform unitmessage::handle()\n")); log_error(("could not perform unitmessage::handle()\n"));
unused(data); unused(data);
return 0; return 0;
} }
static void static void

View File

@ -162,8 +162,7 @@ message_faction(unit& sender, faction& target, const char * str)
static void static void
message_region(unit& sender, const char * str) message_region(unit& sender, const char * str)
{ {
sprintf(buf, "von %s: '%s'", unitname(&sender), str); ADDMSG(&sender.region->msgs, msg_message("mail_result", "unit message", &sender, str));
addmessage(sender.region, 0, buf, MSG_MESSAGE, ML_IMPORTANT);
} }
static void static void

View File

@ -24,6 +24,21 @@
<text locale="fr">"The power of $unit($mage) flows into the region and the trees which survived the spell appear stronger now."</text> <text locale="fr">"The power of $unit($mage) flows into the region and the trees which survived the spell appear stronger now."</text>
<text locale="en">"The power of $unit($mage) flows into the region and the trees which survived the spell appear stronger now."</text> <text locale="en">"The power of $unit($mage) flows into the region and the trees which survived the spell appear stronger now."</text>
</message> </message>
<message name="flying_ship_result" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="ship" type="ship"/>
</type>
<text locale="de">"$unit($mage) beschwört einen Luftgeist, der die $ship($ship) in die Wolken hebt."</text>
<text locale="en">"$unit($mage) summons a wind spirit that lifts the $ship($ship) into the clouds."</text>
</message>
<message name="confusion_result" section="magic">
<type>
<arg name="mage" type="unit"/>
</type>
<text locale="de">"$unit($mage) beschwört einen Schleier der Verwirrung."</text>
<text locale="en">"$unit($mage) summons a fog of confusion."</text>
</message>
<message name="curseinfo::riotzone" section="events"> <message name="curseinfo::riotzone" section="events">
<type> <type>
<arg name="id" type="int"/> <arg name="id" type="int"/>
@ -3817,7 +3832,7 @@
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die materielle Welt ist hier nicht sichtbar."</text> <text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die materielle Welt ist hier nicht sichtbar."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The material world is not visible from here."</text> <text locale="en">"$unit($unit) in $region($region): '$order($command)' - The material world is not visible from here."</text>
</message> </message>
<message name="error217" section="errors"> <message name="spell_astral_only" section="errors">
<type> <type>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>
<arg name="region" type="region"/> <arg name="region" type="region"/>
@ -6814,4 +6829,29 @@
<text locale="fr">"$unit($unit) tried but failed to send $unit($target) to another world."</text> <text locale="fr">"$unit($unit) tried but failed to send $unit($target) to another world."</text>
</message> </message>
<message name="renumber_twice" section="errors">
<type>
<arg name="id" type="int"/>
</type>
<text locale="de">"NUMMER PARTEI $int36($id): Die Partei kann nicht mehr als einmal ihre Nummer wecheln."</text>
<text locale="en">"NUMBER FACTION $int36($id): Your faction can only change its number once."</text>
</message>
<message name="renumber_inuse" section="errors">
<type>
<arg name="id" type="int"/>
</type>
<text locale="de">"NUMMER PARTEI $int36($id): Diese Nummer wird von einer anderen Partei benutzt."</text>
<text locale="en">"NUMBER FACTION $int36($id): This number is being used by another faction."</text>
</message>
<message name="mail_result" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="message" type="string"/>
</type>
<text locale="de">"Eine Botschaft von $unit($unit): '$message'"</text>
<text locale="en">"A message from $unit($unit): '$message'"</text>
</message>
</messages> </messages>