From 64fa29f9df45d3b038b428bb05a8ee7a39e6a340 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 25 Mar 2007 09:52:23 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=1162 "BENENNE und BESCHREIBE bei TEMP-Einheiten funktioniert nicht" Die neue generalisierte Logik hat zugeschlagen :-( Ausserdem wieder eine Reihe englischer Uebersetzungen. Issue: 1162 --- src/common/gamecode/laws.c | 8 ++++---- src/common/gamecode/report.c | 11 +++++++++++ src/common/spells/spells.c | 38 ++++++++++++++---------------------- src/res/messages.xml | 30 ++++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 29 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 3fd3ce0b0..a2b3a8254 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -3835,10 +3835,10 @@ process(void) while (*ordp) { order * ord = *ordp; if (get_keyword(ord) == porder->data.per_order.kword) { - if (u->number==0) { - ord = NULL; - } else if (porder->flags & PROC_LONGORDER) { - if (u->race == new_race[RC_INSECT] && r_insectstalled(r) && !is_cursed(u->attribs, C_KAELTESCHUTZ,0)) { + if (porder->flags & PROC_LONGORDER) { + if (u->number==0) { + ord = NULL; + } else if (u->race == new_race[RC_INSECT] && r_insectstalled(r) && !is_cursed(u->attribs, C_KAELTESCHUTZ,0)) { ord = NULL; } else if (LongHunger(u)) { cmistake(u, ord, 224, MSG_MAGIC); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 176b35adc..d86340c65 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -2849,6 +2849,16 @@ eval_unitid(struct opstack ** stack, const void * userdata) /* unit -> int */ opush(stack, var); } +static void +eval_unitsize(struct opstack ** stack, const void * userdata) /* unit -> int */ +{ + const struct unit * u = (const struct unit *)opop(stack).v; + variant var; + + var.i = u->number; + opush(stack, var); +} + static void eval_faction(struct opstack ** stack, const void * userdata) /* faction -> string */ { @@ -3080,6 +3090,7 @@ report_init(void) add_function("unit.dative", &eval_unit_dative); add_function("unit.name", &eval_unitname); add_function("unit.id", &eval_unitid); + add_function("unit.size", &eval_unitsize); add_function("building", &eval_building); add_function("skill", &eval_skill); add_function("order", &eval_order); diff --git a/src/common/spells/spells.c b/src/common/spells/spells.c index 26f0a4496..e17c3ebc0 100644 --- a/src/common/spells/spells.c +++ b/src/common/spells/spells.c @@ -1934,8 +1934,7 @@ sp_treewalkexit(castorder *co) if (!can_survive(u, rt)) { cmistake(mage, co->order, 231, MSG_MAGIC); } else if (remaining_cap - w < 0) { - sprintf(buf, "%s ist zu schwer.", unitname(u)); - addmessage(r, mage->faction, buf, MSG_MAGIC, ML_MISTAKE); + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "fail_tooheavy", "target", u)); } else { message * m; @@ -4315,9 +4314,8 @@ sp_migranten(castorder *co) } if (kontaktiert == 0) { - ADDMSG(&mage->faction->msgs, msg_message("spellfail::contact", - "mage region command target", mage, mage->region, co->order, - target)); + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, + "spellfail::contact", "target", target)); return 0; } u_setfaction(target,mage->faction); @@ -4668,9 +4666,7 @@ sp_seduce(castorder *co) scat("."); addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO); - sprintf(buf, "%s verfiel dem Glücksspiel und hat fast sein ganzes Hab " - "und Gut verspielt.", unitname(target)); - addmessage(r, target->faction, buf, MSG_EVENT, ML_WARN); + ADDMSG(&target->faction->msgs, msg_message("seduce_effect", "unit", target)); return cast_level; } @@ -5083,7 +5079,6 @@ sp_illusionary_shapeshift(castorder *co) { unit *u; const race * rc; - region *r = co->rt; unit *mage = co->magician.u; int cast_level = co->level; double power = co->force; @@ -5115,9 +5110,7 @@ sp_illusionary_shapeshift(castorder *co) } u->irace = rc; - sprintf(buf, "%s läßt %s als %s erscheinen.", - unitname(mage), unitname(u), LOC(u->faction->locale, rc_name(rc, u->number != 1))); - addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO); + ADDMSG(&mage->faction->msgs, msg_message("shapeshift_effect", "mage target race", mage, u, rc)); return cast_level; } @@ -5632,6 +5625,7 @@ sp_resist_magic_bonus(castorder *co) /* Schleife über alle angegebenen Einheiten */ for (n = 0; n < pa->length; n++) { + message * msg; /* sollte nie negativ werden */ if (opfer < 1) break; @@ -5655,13 +5649,14 @@ sp_resist_magic_bonus(castorder *co) create_curse(mage, &u->attribs, ct_find("magicresistance"), power, duration, resistbonus, m); - sprintf(buf, "%s wird kurz von einem magischen Licht umhüllt.", - unitname(u)); - addmessage(0, u->faction, buf, MSG_EVENT, ML_IMPORTANT); + msg = msg_message("magicresistance_effect", "unit", u); + add_message(&u->faction->msgs, msg); /* und noch einmal dem Magier melden */ - if (u->faction != mage->faction) - addmessage(mage->region, mage->faction, buf, MSG_MAGIC, ML_INFO); + if (u->faction != mage->faction) { + add_message(&mage->faction->msgs, msg); + } + msg_release(msg); } /* pro 5 nicht verzauberte Personen kann der Level und damit die * Kosten des Zaubers um 1 reduziert werden. (die Formel geht von @@ -5740,8 +5735,7 @@ sp_enterastral(castorder *co) if (!can_survive(u, rt)) { cmistake(mage, co->order, 231, MSG_MAGIC); } else if (remaining_cap - w < 0) { - addmessage(r, mage->faction, "Die Einheit ist zu schwer.", - MSG_MAGIC, ML_MISTAKE); + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "fail_tooheavy", "target", u)); } else { message * m; remaining_cap = remaining_cap - w; @@ -5874,8 +5868,7 @@ sp_pullastral(castorder *co) if (!can_survive(u, rt)) { cmistake(mage, co->order, 231, MSG_MAGIC); } else if (remaining_cap - w < 0) { - addmessage(r, mage->faction, "Die Einheit ist zu schwer.", - MSG_MAGIC, ML_MISTAKE); + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "fail_tooheavy", "target", u)); } else { message * m; @@ -5988,8 +5981,7 @@ sp_leaveastral(castorder *co) if (!can_survive(u, rt)) { cmistake(mage, co->order, 231, MSG_MAGIC); } else if (remaining_cap - w < 0) { - addmessage(r, mage->faction, "Die Einheit ist zu schwer.", - MSG_MAGIC, ML_MISTAKE); + ADDMSG(&mage->faction->msgs, msg_feedback(mage, co->order, "fail_tooheavy", "target", u)); } else { message * m; diff --git a/src/res/messages.xml b/src/res/messages.xml index d3c3e9dbc..ebb377132 100644 --- a/src/res/messages.xml +++ b/src/res/messages.xml @@ -2985,7 +2985,7 @@ - "$unit($unit) in $region($region): '$order($command)' - Die Einheit kann nicht bewachen, da sie veruscht zu fliehen." + "$unit($unit) in $region($region): '$order($command)' - Die Einheit kann nicht bewachen, da sie versucht zu fliehen." "$unit($unit) in $region($region): '$order($command)' - The unit cannot guard the region because it's trying to flee." "$unit($unit) in $region($region): '$order($command)' - The unit cannot guard the region because it's trying to flee." @@ -5511,6 +5511,32 @@ "$unit($unit) in $region($region): '$order($command)' - The unit could not be found." "$unit($unit) in $region($region): '$order($command)' - The unit could not be found." + + + + + + "$unit($unit) verfiel dem Glücksspiel und hat fast sein ganzes Hab und gut verspielt." + "$unit($unit) gambles for high stakes and loses almost everything." + + + + + + + + + "$unit($mage) läßt $unit($target) als $race($race,$unit.number($target)) erscheinen." + "$unit($mage) makes $unit($target) appear as $race($race,$unit.number($target))." + + + + + + + "$unit($unit) wird kurz von einem magischen Licht umhüllt." + "$unit($unit) is briefly surrounded by a magical light." + @@ -6619,7 +6645,7 @@ - +