Unicode WIP:

- completed i18n for spells.c
- started on i18n for combatspells
This commit is contained in:
Enno Rehling 2007-07-19 07:25:28 +00:00
parent d37f068104
commit 7e36df93a4
5 changed files with 109 additions and 60 deletions

View file

@ -239,14 +239,6 @@ message_all(battle * b, message * m)
}
}
void
battlerecord(battle * b, const char *s)
{
struct message * m = msg_message("battle_msg", "string", s);
message_all(b, m);
msg_release(m);
}
static void
fbattlerecord(battle * b, faction * f, const char *s)
{

View file

@ -238,7 +238,6 @@ extern "C" {
extern troop select_enemy(struct fighter * af, int minrow, int maxrow, int select);
extern int count_enemies(struct battle * b, const struct fighter * af, int minrow, int maxrow, int select);
extern boolean terminate(troop dt, troop at, int type, const char *damage, boolean missile);
extern void battlerecord(battle * b, const char *s);
extern void message_all(battle * b, struct message * m);
extern void message_faction(battle * b, struct faction * f, struct message * m);
extern int hits(troop at, troop dt, weapon * awp);

View file

@ -525,21 +525,7 @@ sp_mindblast(fighter * fi, int level, double power, spell * sp)
--force;
}
sprintf(buf, "%d Krieger %s Erinnerungen", k, k == 1 ? "verliert" : "verlieren");
if (killed > 0) {
scat(", ");
icat(killed);
scat(" Krieger ");
if (killed == 1) {
scat("wurde");
} else {
scat("wurden");
}
scat(" getötet");
}
m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
m = msg_message("sp_midblast_effect", "mage spell amount dead", mage, sp, k, killed);
message_all(b, m);
msg_release(m);
return level;
@ -699,6 +685,7 @@ sp_shadowcall(fighter * fi, int level, double power, spell * sp)
unit *u;
const char * races[3] = { "shadowbat", "nightmare", "vampunicorn" };
const race *rc = rc_find(races[rng_int()%3]);
message * msg;
unused(sp);
@ -715,9 +702,9 @@ sp_shadowcall(fighter * fi, int level, double power, spell * sp)
a_add(&u->attribs, a);
make_fighter(b, u, fi->side, is_attacker(fi));
sprintf(buf, "%s ruft %d %s zu Hilfe", unitname(mage), force,
racename(default_locale, u, u->race));
battlerecord(b, buf);
msg = msg_message("sp_shadowcall_effect", "mage amount race", mage, u->number, u->race);
message_all(b, msg);
msg_release(msg);
return level;
}
@ -1308,7 +1295,7 @@ sp_armorshield(fighter * fi, int level, double power, spell * sp)
int effect;
int duration;
battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
message * m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);
message_all(b, m);
msg_release(m);
@ -1335,7 +1322,7 @@ sp_reduceshield(fighter * fi, int level, double power, spell * sp)
int effect;
int duration;
battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
message * m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);
message_all(b, m);
msg_release(m);
@ -1362,7 +1349,7 @@ sp_fumbleshield(fighter * fi, int level, double power, spell * sp)
int effect;
int duration;
battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
message * m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);
message_all(b, m);
msg_release(m);
@ -1464,7 +1451,7 @@ int
sp_keeploot(fighter * fi, int level, double power, spell * sp)
{
battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
message * m = msg_message("cast_spell_effect", "mage spell", fi->unit, sp);
message_all(b, m);
msg_release(m);

View file

@ -5506,7 +5506,7 @@ sp_pullastral(castorder *co)
rl2 = rl2->next;
}
if (!rl2) {
ADDMSG(&u->faction->msgs, msg_feedback(u, co->order, "spellfail::nocontact",
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "spellfail::nocontact",
"target", rt));
free_regionlist(rl);
return 0;
@ -6079,6 +6079,7 @@ sp_eternizewall(castorder *co)
int cast_level = co->level;
double power = co->force;
spellparameter *pa = co->par;
message * msg;
/* wenn kein Ziel gefunden, Zauber abbrechen */
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
@ -6094,17 +6095,21 @@ sp_eternizewall(castorder *co)
/* melden, 1x pro Partei in der Burg */
for (u = r->units; u; u = u->next) freset(u->faction, FFL_SELECT);
msg = msg_message("sp_eternizewall_effect", "mage building region", mage, b, r);
for (u = r->units; u; u = u->next) {
if (!fval(u->faction, FFL_SELECT)) {
fset(u->faction, FFL_SELECT);
if (u->building == b) {
sprintf(buf, "Mit einem Ritual bindet %s die magischen Kräfte "
"der Erde in die Mauern von %s", unitname(mage),
buildingname(b));
addmessage(r, u->faction, buf, MSG_EVENT, ML_INFO);
r_addmessage(r, u->faction, msg);
}
}
}
if (r!=mage->region) {
add_message(&mage->faction->msgs, msg);
} else if (mage->building!=b) {
r_addmessage(r, mage->faction, msg);
}
msg_release(msg);
return cast_level;
}
@ -6133,11 +6138,11 @@ sp_permtransfer(castorder *co)
{
int aura;
unit *tu;
region *r = co->rt;
unit *mage = co->magician.u;
int cast_level = co->level;
spellparameter *pa = co->par;
const spell *sp = co->sp;
message * msg;
/* wenn kein Ziel gefunden, Zauber abbrechen */
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
@ -6167,8 +6172,12 @@ sp_permtransfer(castorder *co)
change_maxspellpoints(tu, aura/3);
}
sprintf(buf, "%s opfert %s %d Aura.", unitname(mage), unitname(tu), aura);
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
msg = msg_message("sp_permtransfer_effect", "mage target amount", mage, tu, aura);
add_message(&mage->faction->msgs, msg);
if (tu->faction!=mage->faction) {
add_message(&tu->faction->msgs, msg);
}
msg_release(msg);
return cast_level;
}
@ -6187,7 +6196,7 @@ sp_movecastle(castorder *co)
unit *mage = co->magician.u;
int cast_level = co->level;
spellparameter *pa = co->par;
const spell *sp = co->sp;
message* msg;
/* wenn kein Ziel gefunden, Zauber abbrechen */
if (pa->param[0]->flag == TARGET_NOTFOUND) return 0;
@ -6202,22 +6211,14 @@ sp_movecastle(castorder *co)
}
if (b->size > (cast_level-12) * 250) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Der Elementar ist "
"zu klein, um das Gebäude zu tragen.", unitname(mage),
regionname(mage->region, mage->faction), spell_name(sp, mage->faction->locale));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "sp_movecastle_fail_0", ""));
return cast_level;
}
target_region = rconnect(r,dir);
if (!(target_region->terrain->flags & LAND_REGION)) {
sprintf(buf, "%s in %s: 'ZAUBER %s': Der Erdelementar "
"weigert sich, nach %s zu gehen.",
unitname(mage), regionname(mage->region, mage->faction),
spell_name(sp, mage->faction->locale),
locale_string(mage->faction->locale, directions[dir]));
addmessage(0, mage->faction, buf, MSG_MAGIC, ML_MISTAKE);
ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "sp_movecastle_fail_1", "direction", dir));
return cast_level;
}
@ -6237,10 +6238,6 @@ sp_movecastle(castorder *co)
u = unext;
}
sprintf(buf, "Ein Beben erschüttert %s. Viele kleine Pseudopodien "
"erheben das Gebäude und tragen es in Richtung %s.",
buildingname(b), locale_string(mage->faction->locale, directions[dir]));
if ((b->type==bt_find("caravan") || b->type==bt_find("dam") || b->type==bt_find("tunnel"))) {
boolean damage = false;
direction_t d;
@ -6250,9 +6247,12 @@ sp_movecastle(castorder *co)
damage = true;
}
}
if (damage) strcat(buf, " Die Straßen der Region wurden beschädigt.");
/* if (damage) strcat(buf, " Die Straßen der Region wurden beschädigt."); */
}
addmessage(r, 0, buf, MSG_MAGIC, ML_INFO);
msg = msg_message("sp_movecastle_effect", "building direction", b, dir);
r_addmessage(r, NULL, msg);
msg_release(msg);
return cast_level;
}

View file

@ -1251,6 +1251,24 @@
<text locale="de">"$unit($mage) kümmert sich um die Verletzten und benutzt ein $resource($item,1), um den Zauber zu verstärken. $int($amount) Verwundete werden geheilt."</text>
</message>
<message name="sp_eternizewall_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="building" type="building"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"Mit einem Ritual bindet $unit($mage) die magischen Kräfte der Erde von $region($region) in die Mauern von $building($building)."</text>
</message>
<message name="sp_permtransfer_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="target" type="unit"/>
<arg name="amount" type="int"/>
</type>
<text locale="de">"$unit($mage) opfert $unit($target) $int($amount) Aura."</text>
</message>
<message name="reanimate_effect_0" section="magic">
<type>
<arg name="mage" type="unit"/>
@ -1575,8 +1593,31 @@
<arg name="race" type="race"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - $unit($target) kann keine $race($race,1)-Gestalt annehmen."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($target) cannot assume the shape of a $race($race,1)."</text>
</message>
<message name="sp_movecastle_fail_0" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Der Elementar ist zu klein, um das Gebäude zu tragen."</text>
</text>
</message>
<message name="sp_movecastle_fail_1" section="magic">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
<arg name="direction" type="direction"/>
</type>
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Der Elementar weigert sich, nach $direction($direction) zu gehen."</text>
</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The elemental refuses to go $direction($direction)."</text>
</text>
</message>
<message name="sp_migranten_fail1" section="magic">
<type>
<arg name="unit" type="unit"/>
@ -1607,6 +1648,7 @@
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) ruft Drachen nach $region($target)."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) calls dragons to $region($target)."</text>
</message>
<message name="magiccreate_effect" section="magic">
<type>
<arg name="unit" type="unit"/>
@ -1619,6 +1661,15 @@
<text locale="fr">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) creates $int($amount) ${item}."</text>
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - $unit($unit) creates $int($amount) ${item}."</text>
</message>
<message name="sp_movecastle_effect" section="magic">
<type>
<arg name="building" type="building"/>
<arg name="direction" type="direction"/>
</type>
<text locale="de">"Ein Beben erschüttert $building($building). Viele kleine Pseudopodien erheben das Gebäude und tragen es in Richtung $direction($direction)."</text>
</message>
<message name="use_tacticcrystal" section="magic">
<type>
<arg name="unit" type="unit"/>
@ -7270,15 +7321,35 @@
<text locale="de">"$unit($mage) beschwört $int($number) Dämonen aus dem Reich der Schatten."</text>
<text locale="en">"$unit($mage) summons $int($number) demons from the realm of shadows."</text>
</message>
<message name="cast_spell_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="spell" type="spell"/>
<arg name="effect" type="string"/>
</type>
<text locale="de">"$unit($mage) zaubert $spell($spell)$if($strlen($effect),": $effect","")."</text>
<text locale="en">"$unit($mage) casts $spell($spell)$if($strlen($effect),": $effect","")."</text>
<text locale="de">"$unit($mage) zaubert $spell($spell)."</text>
<text locale="en">"$unit($mage) casts $spell($spell)."</text>
</message>
<message name="sp_mindblast_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="spell" type="spell"/>
<arg name="amount" type="int"/>
<arg name="dead" type="int"/>
</type>
<text locale="de">"$unit($mage) zaubert $spell($spell). $int($amount) Krieger verloren Erinnerungen, $int($dead) wurden getötet."</text>
</message>
<message name="sp_shadowcall_effect" section="magic">
<type>
<arg name="mage" type="unit"/>
<arg name="amount" type="int"/>
<arg name="race" type="race"/>
</type>
<text locale="de">"$unit($mage) ruft $int($amount) $race($race, 0) zu Hilfe."</text>
</message>
<message name="battle::killed" section="battle">
<type>
<arg name="unit" type="unit"/>