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
maintain_buildings(region * r, boolean crash)
{
building **bp = &r->buildings;
while (*bp) {
building * b = *bp;
building **bp = &r->buildings;
while (*bp) {
building * b = *bp;
boolean maintained = maintain(b, !crash);
/* the second time, send a message */
if (crash) {
if (!maintained && (rng_int() % 100 < EINSTURZCHANCE)) {
gebaeude_stuerzt_ein(r, b);
continue;
gebaeude_stuerzt_ein(r, b);
continue;
} else if (!fval(b, BLD_WORKING)) {
unit * u = buildingowner(r, b);
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) {
add_message(&u->faction->msgs, msg);
r_addmessage(r, u->faction, msg);
add_message(&u->faction->msgs, msg);
r_addmessage(r, u->faction, msg);
} else {
add_message(&r->msgs, 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);
} else {
/* Die Richtung wurde nicht erkannt */
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);
break;
} else {
sprintf(buf, "von %s: '%s'", unitname(u), s);
addmessage(r, 0, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&r->msgs, msg_message("mail_result", "unit message", u, s));
break;
}
break;
@ -2665,29 +2664,25 @@ renumber_factions(void)
if (!a) continue;
want = a->data.i;
if (fval(f, FFL_NEWID)) {
sprintf(buf, "NUMMER PARTEI %s: Die Partei kann nicht mehr als einmal ihre Nummer wecheln", itoa36(want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&f->msgs, msg_message("renumber_twice", "id", want));
continue;
}
old = findfaction(want);
if (old) {
a_remove(&f->attribs, a);
sprintf(buf, "Die Nummer %s wird von einer anderen Partei benutzt.", itoa36(want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
continue;
}
if (!faction_id_is_unused(want)) {
a_remove(&f->attribs, a);
sprintf(buf, "Die Nummer %s wurde schon einmal von einer anderen Partei benutzt.", itoa36(want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
continue;
}
for (rn=&renum; *rn; rn=&(*rn)->next) {
if ((*rn)->want>=want) break;
}
if (*rn && (*rn)->want==want) {
a_remove(&f->attribs, a);
sprintf(buf, "Die Nummer %s wurde bereits einer anderen Partei zugeteilt.", itoa36(want));
addmessage(0, f, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&f->msgs, msg_message("renumber_inuse", "id", want));
} else {
struct renum * r = calloc(sizeof(struct renum), 1);
r->next = *rn;

View File

@ -316,6 +316,7 @@ destroy_road(unit *u, int nmax, struct order * ord)
}
if (d==NODIRECTION) {
/* Die Richtung wurde nicht erkannt */
cmistake(u, ord, 71, MSG_PRODUCE);
} else {
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));
}
#endif
unused(level);
switch (mtype) {
case MSG_INCOME:
assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break;
case MSG_BATTLE:
assert(0 || !"battle-meldungen nicht über addmessage machen");
break;
case MSG_MOVE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_movement", "string", s));
break;
case MSG_COMMERCE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break;
case MSG_PRODUCE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_production", "string", s));
break;
case MSG_MAGIC:
case MSG_COMMENT:
case MSG_MESSAGE:
case MSG_ORCVERMEHRUNG:
case MSG_EVENT:
/* Botschaften an REGION oder einzelne PARTEI */
m = msg_message("msg_event", "string", s);
if (!r) {
assert(f);
m = add_message(&f->msgs, m);
} else {
if (f==NULL) add_message(&r->msgs, m);
else r_addmessage(r, f, m);
}
break;
default:
assert(!"Ungültige Msg-Klasse!");
}
if (m) msg_release(m);
unused(level);
switch (mtype) {
case MSG_INCOME:
assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break;
case MSG_BATTLE:
assert(0 || !"battle-meldungen nicht über addmessage machen");
break;
case MSG_MOVE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_movement", "string", s));
break;
case MSG_COMMERCE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_economy", "string", s));
break;
case MSG_PRODUCE:
assert(f);
m = add_message(&f->msgs, msg_message("msg_production", "string", s));
break;
case MSG_MAGIC:
case MSG_COMMENT:
case MSG_MESSAGE:
case MSG_ORCVERMEHRUNG:
case MSG_EVENT:
/* Botschaften an REGION oder einzelne PARTEI */
m = msg_message("msg_event", "string", s);
if (!r) {
assert(f);
m = add_message(&f->msgs, m);
} else {
if (f==NULL) add_message(&r->msgs, m);
else r_addmessage(r, f, m);
}
break;
default:
assert(!"Ungültige Msg-Klasse!");
}
if (m) msg_release(m);
}
void

View File

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

View File

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

View File

@ -162,8 +162,7 @@ message_faction(unit& sender, faction& target, const char * str)
static void
message_region(unit& sender, const char * str)
{
sprintf(buf, "von %s: '%s'", unitname(&sender), str);
addmessage(sender.region, 0, buf, MSG_MESSAGE, ML_IMPORTANT);
ADDMSG(&sender.region->msgs, msg_message("mail_result", "unit message", &sender, str));
}
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="en">"The power of $unit($mage) flows into the region and the trees which survived the spell appear stronger now."</text>
</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">
<type>
<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="en">"$unit($unit) in $region($region): '$order($command)' - The material world is not visible from here."</text>
</message>
<message name="error217" section="errors">
<message name="spell_astral_only" section="errors">
<type>
<arg name="unit" type="unit"/>
<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>
</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>