Generic spell messages translated (but not effects)

This commit is contained in:
Enno Rehling 2007-02-22 23:15:58 +00:00
parent 6c74bce4cd
commit 7af7ab381c
2 changed files with 102 additions and 116 deletions

View File

@ -170,6 +170,7 @@ sp_versteinern(fighter * fi, int level, double power, spell * sp)
/* Wirkt auf erste und zweite Reihe */ /* Wirkt auf erste und zweite Reihe */
int force, enemies; int force, enemies;
int stoned = 0; int stoned = 0;
message * m;
force = lovar(get_force(power, 0)); force = lovar(get_force(power, 0));
@ -180,10 +181,6 @@ sp_versteinern(fighter * fi, int level, double power, spell * sp)
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(fi->unit),
spell_name(sp, default_locale));
battlerecord(b, buf);
while (force && stoned < enemies) { while (force && stoned < enemies) {
troop dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); troop dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
@ -201,9 +198,11 @@ sp_versteinern(fighter * fi, int level, double power, spell * sp)
--force; --force;
} }
sprintf(buf, "%d Personen %s versteinert.", sprintf(buf, "%d Personen %s versteinert",
stoned, stoned == 1 ? "wurde" : "wurden"); stoned, stoned == 1 ? "wurde" : "wurden");
battlerecord(b, buf); m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -213,14 +212,15 @@ sp_stun(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; unit *mage = fi->unit;
message * m;
troop at; troop at;
/* Aus beiden Reihen nehmen */ /* Aus beiden Reihen nehmen */
int force=0, enemies; int force=0, enemies;
int stunned; int stunned;
at.fighter = fi;
at.index = 0;
if (power <= 0) return 0; if (power <= 0) return 0;
at.fighter = fi;
at.index = 0;
switch(sp->id) { switch(sp->id) {
case SPL_SHOCKWAVE: case SPL_SHOCKWAVE:
@ -237,10 +237,6 @@ sp_stun(fighter * fi, int level, double power, spell * sp)
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(fi->unit),
spell_name(sp, default_locale));
battlerecord(b, buf);
stunned = 0; stunned = 0;
while (force && stunned < enemies) { while (force && stunned < enemies) {
@ -255,11 +251,11 @@ sp_stun(fighter * fi, int level, double power, spell * sp)
} }
} }
sprintf(buf, "%d Krieger %s für einen Moment benommen.", sprintf(buf, "%d Krieger %s für einen Moment benommen",
stunned, stunned == 1 ? "ist" : "sind"); stunned, stunned == 1 ? "ist" : "sind");
m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
scat("."); message_all(b, m);
battlerecord(b, buf); msg_release(m);
return level; return level;
} }
@ -365,21 +361,18 @@ sp_sleep(fighter * fi, int level, double power, spell * sp)
troop dt; troop dt;
int force, enemies; int force, enemies;
int k = 0; int k = 0;
message * m;
/* Immer aus der ersten Reihe nehmen */ /* Immer aus der ersten Reihe nehmen */
force = lovar(power * 25); force = lovar(power * 25);
enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
if (!enemies) { if (!enemies) {
message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
message_all(b, m); message_all(b, m);
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(mage),
spell_name(sp, default_locale));
battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
assert(dt.fighter); assert(dt.fighter);
@ -392,9 +385,11 @@ sp_sleep(fighter * fi, int level, double power, spell * sp)
--force; --force;
} }
sprintf(buf, "%d Krieger %s in Schlaf versetzt.", sprintf(buf, "%d Krieger %s in Schlaf versetzt",
k, k == 1 ? "wurde" : "wurden"); k, k == 1 ? "wurde" : "wurden");
battlerecord(b, buf); m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -441,11 +436,7 @@ sp_speed(fighter * fi, int level, double power, spell * sp)
int force; int force;
int allies; int allies;
int targets = 0; int targets = 0;
message * m;
sprintf(buf, "%s zaubert %s", unitname(fi->unit),
spell_name(sp, default_locale));
scat(":");
battlerecord(b, buf);
force = lovar(power * power * 5); force = lovar(power * power * 5);
@ -468,9 +459,11 @@ sp_speed(fighter * fi, int level, double power, spell * sp)
} }
} }
sprintf(buf, "%d Krieger %s magisch beschleunigt.", sprintf(buf, "%d Krieger %s magisch beschleunigt",
targets, targets == 1 ? "wurde" : "wurden"); targets, targets == 1 ? "wurde" : "wurden");
battlerecord(b, buf); m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, buf);
message_all(b, m);
msg_release(m);
return 1; return 1;
} }
@ -510,19 +503,17 @@ sp_mindblast(fighter * fi, int level, double power, spell * sp)
int killed = 0; int killed = 0;
int force, enemies; int force, enemies;
int k = 0; int k = 0;
message * m;
force = lovar(power * 25); force = lovar(power * 25);
enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
if (!enemies) { if (!enemies) {
message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
message_all(b, m); message_all(b, m);
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(mage),
spell_name(sp, default_locale));
battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
@ -559,9 +550,10 @@ sp_mindblast(fighter * fi, int level, double power, spell * sp)
} }
scat(" getötet"); scat(" getötet");
} }
scat(".");
battlerecord(b, buf); m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -619,6 +611,7 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
const char *damage; const char *damage;
cvector *fgs; cvector *fgs;
void **fig; void **fig;
message * m;
/* 2d4 HP */ /* 2d4 HP */
damage = spell_damage(5); damage = spell_damage(5);
@ -631,9 +624,6 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(fi->unit),
spell_name(sp, default_locale));
battlerecord(b, buf);
at.fighter = fi; at.fighter = fi;
at.index = 0; at.index = 0;
@ -655,11 +645,9 @@ sp_immolation(fighter * fi, int level, double power, spell * sp)
cv_kill(fgs); cv_kill(fgs);
free(fgs); free(fgs);
sprintf(buf, "%d Personen %s getötet", m = msg_message("battle::combatspell", "mage spell killed", fi->unit, sp, killed);
killed, killed == 1 ? "wurde" : "wurden"); message_all(b, m);
msg_release(m);
scat(".");
battlerecord(b, buf);
return level; return level;
} }
@ -673,6 +661,7 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
int drained = 0; int drained = 0;
int killed = 0; int killed = 0;
const char *damage; const char *damage;
message * m;
/* 11-26 HP */ /* 11-26 HP */
damage = spell_damage(4); damage = spell_damage(4);
@ -682,14 +671,11 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE); enemies = count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE);
if (!enemies) { if (!enemies) {
message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
message_all(b, m); message_all(b, m);
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(fi->unit),
spell_name(sp, default_locale));
battlerecord(b, buf);
at.fighter = fi; at.fighter = fi;
at.index = 0; at.index = 0;
@ -708,8 +694,9 @@ sp_drainodem(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%d Person%s wurde ihre Lebenskraft entzogen", sprintf(buf, "%d Person%s wurde ihre Lebenskraft entzogen",
drained, drained == 1 ? " wurde" : "en wurden"); drained, drained == 1 ? " wurde" : "en wurden");
scat("."); m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, buf);
battlerecord(b, buf); message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -1017,9 +1004,8 @@ sp_hero(fighter * fi, int level, double power, spell * sp)
int force = 0; int force = 0;
int allies; int allies;
int targets = 0; int targets = 0;
message * m;
sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale));
switch(sp->id) { switch(sp->id) {
case SPL_HERO: case SPL_HERO:
df_bonus = (int)(power/5); df_bonus = (int)(power/5);
@ -1030,8 +1016,6 @@ sp_hero(fighter * fi, int level, double power, spell * sp)
df_bonus = 1; df_bonus = 1;
force = max(1, (int)power); force = max(1, (int)power);
} }
scat(":");
battlerecord(b, buf);
allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE); allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE);
/* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände
@ -1055,9 +1039,10 @@ sp_hero(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%d Krieger %s moralisch gestärkt", sprintf(buf, "%d Krieger %s moralisch gestärkt",
targets, targets == 1 ? "wurde" : "wurden"); targets, targets == 1 ? "wurde" : "wurden");
m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
message_all(b, m);
msg_release(m);
scat(".");
battlerecord(b, buf);
return level; return level;
} }
@ -1071,9 +1056,8 @@ sp_berserk(fighter * fi, int level, double power, spell * sp)
int force = 0; int force = 0;
int allies = 0; int allies = 0;
int targets = 0; int targets = 0;
message * m;
sprintf(buf, "%s zaubert %s", unitname(mage),
spell_name(sp, default_locale));
switch(sp->id) { switch(sp->id) {
case SPL_BERSERK: case SPL_BERSERK:
case SPL_BLOODTHIRST: case SPL_BLOODTHIRST:
@ -1087,8 +1071,6 @@ sp_berserk(fighter * fi, int level, double power, spell * sp)
df_malus = 0; df_malus = 0;
force = (int)power; force = (int)power;
} }
scat(":");
battlerecord(b, buf);
allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE); allies = count_allies(fi->side, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE);
/* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände /* maximal 2*allies Versuche ein Opfer zu finden, ansonsten bestände
@ -1113,9 +1095,9 @@ sp_berserk(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%d Krieger %s in Blutrausch versetzt", sprintf(buf, "%d Krieger %s in Blutrausch versetzt",
targets, targets == 1 ? "wurde" : "wurden"); targets, targets == 1 ? "wurde" : "wurden");
m = msg_message("cast_spell_effect", "mage spell effect", mage, sp, buf);
scat("."); message_all(b, m);
battlerecord(b, buf); msg_release(m);
return level; return level;
} }
@ -1129,6 +1111,7 @@ sp_frighten(fighter * fi, int level, double power, spell * sp)
int force = 0; int force = 0;
int enemies = 0; int enemies = 0;
int targets = 0; int targets = 0;
message * m;
at_malus = max(1,level - 4); at_malus = max(1,level - 4);
df_malus = 2; df_malus = 2;
@ -1141,9 +1124,6 @@ sp_frighten(fighter * fi, int level, double power, spell * sp)
msg_release(m); msg_release(m);
return 0; return 0;
} }
sprintf(buf, "%s zaubert %s:", unitname(mage),
spell_name(sp, default_locale));
battlerecord(b, buf);
while (force && enemies) { while (force && enemies) {
troop dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE); troop dt = select_enemy(fi, FIGHT_ROW, BEHIND_ROW-1, SELECT_ADVANCE);
@ -1168,9 +1148,9 @@ sp_frighten(fighter * fi, int level, double power, spell * sp)
sprintf(buf, "%d Krieger %s eingeschüchtert", sprintf(buf, "%d Krieger %s eingeschüchtert",
targets, targets == 1 ? "wurde" : "wurden"); targets, targets == 1 ? "wurde" : "wurden");
m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, buf);
scat("."); message_all(b, m);
battlerecord(b, buf); msg_release(m);
return level; return level;
} }
@ -1182,6 +1162,8 @@ sp_tiredsoldiers(fighter * fi, int level, double power, spell * sp)
unit *mage = fi->unit; unit *mage = fi->unit;
int n = 0; int n = 0;
int force = (int)(power * power * 4); int force = (int)(power * power * 4);
message * m;
const char * effect;
if (!count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE|SELECT_FIND)) { if (!count_enemies(b, fi, FIGHT_ROW, BEHIND_ROW, SELECT_ADVANCE|SELECT_FIND)) {
message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
@ -1208,17 +1190,17 @@ sp_tiredsoldiers(fighter * fi, int level, double power, spell * sp)
--force; --force;
} }
sprintf(buf, "%s zaubert %s:", unitname(mage),
spell_name(sp, default_locale));
if (n == 0) { if (n == 0) {
scat("Der Zauber konnte keinen Krieger ermüden."); effect = "Der Zauber konnte keinen Krieger ermüden";
} else if (n == 1) { } else if (n == 1) {
scat("Ein Krieger schleppt sich müde in den Kampf."); effect = "Ein Krieger schleppt sich müde in den Kampf";
} else { } else {
icat(n); sprintf(buf, "%d Krieger schleppen sich müde in den Kampf", n);
scat(" Krieger schleppen sich müde in den Kampf."); effect = buf;
} }
battlerecord(b, buf); m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, effect);
message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -1229,6 +1211,7 @@ sp_windshield(fighter * fi, int level, double power, spell * sp)
unit *mage = fi->unit; unit *mage = fi->unit;
int force, at_malus; int force, at_malus;
int enemies; int enemies;
message * m;
switch(sp->id) { switch(sp->id) {
case SPL_WINDSHIELD: case SPL_WINDSHIELD:
@ -1242,7 +1225,7 @@ sp_windshield(fighter * fi, int level, double power, spell * sp)
} }
enemies = count_enemies(b, fi, BEHIND_ROW, BEHIND_ROW, SELECT_ADVANCE); enemies = count_enemies(b, fi, BEHIND_ROW, BEHIND_ROW, SELECT_ADVANCE);
if (!enemies) { if (!enemies) {
message * m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp); m = msg_message("battle::out_of_range", "mage spell", fi->unit, sp);
message_all(b, m); message_all(b, m);
msg_release(m); msg_release(m);
return 0; return 0;
@ -1264,10 +1247,10 @@ sp_windshield(fighter * fi, int level, double power, spell * sp)
} }
} }
sprintf(buf, "%s zaubert %s:", unitname(mage), m = msg_message("cast_spell_effect", "mage spell effect", mage, sp,
spell_name(sp, default_locale)); "Ein Sturm kommt auf und die Schützen können kaum noch zielen");
scat("Ein Sturm kommt auf und die Schützen können kaum noch zielen."); message_all(b, m);
battlerecord(b, buf); msg_release(m);
return level; return level;
} }
@ -1275,16 +1258,15 @@ int
sp_reeling_arrows(fighter * fi, int level, double power, spell * sp) sp_reeling_arrows(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; message * m;
unused(power); unused(power);
b->reelarrow = true; b->reelarrow = true;
sprintf(buf, "%s zaubert %s", unitname(mage), m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp,
spell_name(sp, default_locale)); "Ein Sturm kommt auf und die Schützen können kaum noch zielen");
scat(": "); message_all(b, m);
scat("Ein Sturm kommt auf und die Schützen können kaum noch zielen."); msg_release(m);
battlerecord(b, buf);
return level; return level;
} }
@ -1297,11 +1279,9 @@ sp_denyattack(fighter * fi, int level, double power, spell * sp)
battle *b = fi->side->battle; battle *b = fi->side->battle;
unit *mage = fi->unit; unit *mage = fi->unit;
region *r = b->region; region *r = b->region;
unused(power); message * m;
sprintf(buf, "%s zaubert %s", unitname(mage), unused(power);
spell_name(sp, default_locale));
scat(": ");
/* Fliehende Einheiten verlassen auf jeden Fall Gebäude und Schiffe. */ /* Fliehende Einheiten verlassen auf jeden Fall Gebäude und Schiffe. */
leave(r, mage); leave(r, mage);
@ -1337,9 +1317,10 @@ sp_denyattack(fighter * fi, int level, double power, spell * sp)
/* fighter leeren */ /* fighter leeren */
rmfighter(fi, mage->number); rmfighter(fi, mage->number);
scat("Das Kampfgetümmel erstirbt und er kann unbehelligt " m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp,
"seines Weges ziehen."); "Das Kampfgetümmel erstirbt und er kann unbehelligt seines Weges ziehen");
battlerecord(b, buf); message_all(b, m);
msg_release(m);
return level; return level;
} }
@ -1361,12 +1342,11 @@ sp_armorshield(fighter * fi, int level, double power, spell * sp)
{ {
int effect; int effect;
int duration; int duration;
unit *mage = fi->unit;
battle *b = fi->side->battle; battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
sprintf(buf, "%s zaubert %s", unitname(mage), message_all(b, m);
spell_name(sp, default_locale)); msg_release(m);
battlerecord(b, buf);
/* gibt Rüstung +effect für duration Treffer */ /* gibt Rüstung +effect für duration Treffer */
@ -1389,12 +1369,10 @@ sp_reduceshield(fighter * fi, int level, double power, spell * sp)
{ {
int effect; int effect;
int duration; int duration;
unit *mage = fi->unit;
battle *b = fi->side->battle; battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
sprintf(buf, "%s zaubert %s", unitname(mage), message_all(b, m);
spell_name(sp, default_locale)); msg_release(m);
battlerecord(b, buf);
/* jeder Schaden wird um effect% reduziert bis der Schild duration /* jeder Schaden wird um effect% reduziert bis der Schild duration
* Trefferpunkte aufgefangen hat */ * Trefferpunkte aufgefangen hat */
@ -1418,12 +1396,11 @@ sp_fumbleshield(fighter * fi, int level, double power, spell * sp)
{ {
int effect; int effect;
int duration; int duration;
unit *mage = fi->unit;
battle *b = fi->side->battle; battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
sprintf(buf, "%s zaubert %s", unitname(mage), message_all(b, m);
spell_name(sp, default_locale)); msg_release(m);
battlerecord(b, buf);
/* der erste Zauber schlägt mit 100% fehl */ /* der erste Zauber schlägt mit 100% fehl */
@ -1537,10 +1514,10 @@ int
sp_keeploot(fighter * fi, int level, double power, spell * sp) sp_keeploot(fighter * fi, int level, double power, spell * sp)
{ {
battle *b = fi->side->battle; battle *b = fi->side->battle;
message * m = msg_message("cast_spell_effect", "mage spell effect", fi->unit, sp, "");
sprintf(buf, "%s zaubert %s.", unitname(fi->unit), message_all(b, m);
spell_name(sp, default_locale)); msg_release(m);
battlerecord(b, buf);
b->keeploot = (int)max(25, b->keeploot + 5*power); b->keeploot = (int)max(25, b->keeploot + 5*power);

View File

@ -6383,6 +6383,15 @@
<text locale="de">"$unit($mage) zaubert $spell($spell): $int($dead) $if($eq($dead,1),"Krieger wurde", "Krieger wurden") getötet."</text> <text locale="de">"$unit($mage) zaubert $spell($spell): $int($dead) $if($eq($dead,1),"Krieger wurde", "Krieger wurden") getötet."</text>
<text locale="en">"$unit($mage) casts $spell($spell): $int($dead) $if($eq($dead,1),"enemy was", "enemies were") killed."</text> <text locale="en">"$unit($mage) casts $spell($spell): $int($dead) $if($eq($dead,1),"enemy was", "enemies were") killed."</text>
</message> </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>
</message>
<message name="battle::killed" section="battle"> <message name="battle::killed" section="battle">
<type> <type>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>