forked from github/server
improved messages when following a ship.
This commit is contained in:
parent
8ef95e6729
commit
31f589e76f
|
@ -2216,6 +2216,18 @@
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
</type>
|
</type>
|
||||||
</message>
|
</message>
|
||||||
|
<message name="followdetect_ship" section="movement">
|
||||||
|
<type>
|
||||||
|
<arg name="follower" type="ship"/>
|
||||||
|
<arg name="ship" type="ship"/>
|
||||||
|
</type>
|
||||||
|
</message>
|
||||||
|
<message name="followfail_ship" section="movement">
|
||||||
|
<type>
|
||||||
|
<arg name="follower" type="ship"/>
|
||||||
|
<arg name="ship" type="ship"/>
|
||||||
|
</type>
|
||||||
|
</message>
|
||||||
<message name="moveblocked" section="errors">
|
<message name="moveblocked" section="errors">
|
||||||
<type>
|
<type>
|
||||||
<arg name="unit" type="unit"/>
|
<arg name="unit" type="unit"/>
|
||||||
|
|
|
@ -2603,6 +2603,12 @@ msgstr "\"$unit($follower) konnte $unit($unit) nicht folgen.\""
|
||||||
msgid "followdetect"
|
msgid "followdetect"
|
||||||
msgstr "\"$unit($follower) ist $unit($unit) gefolgt.\""
|
msgstr "\"$unit($follower) ist $unit($unit) gefolgt.\""
|
||||||
|
|
||||||
|
msgid "followfail_ship"
|
||||||
|
msgstr "\"Die $ship($follower) konnte die $ship($ship) nicht einholen.\""
|
||||||
|
|
||||||
|
msgid "followdetect_ship"
|
||||||
|
msgstr "\"Die $ship($ship) wurde von $ship($follower) verfolgt.\""
|
||||||
|
|
||||||
msgid "unitnotfound_id"
|
msgid "unitnotfound_id"
|
||||||
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Einheit $id wurde nicht gefunden.\""
|
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Einheit $id wurde nicht gefunden.\""
|
||||||
|
|
||||||
|
|
|
@ -2597,6 +2597,12 @@ msgstr "\"$unit($mage) makes $unit($target) appear as $race($race,$unit.size($ta
|
||||||
msgid "error248"
|
msgid "error248"
|
||||||
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The faction has to be 10 turns old.\""
|
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The faction has to be 10 turns old.\""
|
||||||
|
|
||||||
|
msgid "followfail_ship"
|
||||||
|
msgstr "\"$ship($follower) could not catch up to $ship($ship).\""
|
||||||
|
|
||||||
|
msgid "followdetect_ship"
|
||||||
|
msgstr "\"$ship($follower) followed $ship($ship).\""
|
||||||
|
|
||||||
msgid "followfail"
|
msgid "followfail"
|
||||||
msgstr "\"$unit($follower) could not follow $unit($unit).\""
|
msgstr "\"$unit($follower) could not follow $unit($unit).\""
|
||||||
|
|
||||||
|
|
25
src/move.c
25
src/move.c
|
@ -897,6 +897,29 @@ static bool present(region * r, unit * u)
|
||||||
return (u && u->region == r);
|
return (u && u->region == r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void caught_target_ship(region* r, unit* u)
|
||||||
|
{
|
||||||
|
attrib* a = a_find(u->attribs, &at_follow);
|
||||||
|
|
||||||
|
/* Verfolgungen melden */
|
||||||
|
/* Misserfolgsmeldung, oder bei erfolgreichem Verfolgen unter
|
||||||
|
* Umstaenden eine Warnung. */
|
||||||
|
|
||||||
|
if (a) {
|
||||||
|
unit* target = (unit*)a->data.v;
|
||||||
|
|
||||||
|
if (target == u || !present(r, target)) {
|
||||||
|
ADDMSG(&u->faction->msgs, msg_message("followfail_ship",
|
||||||
|
"ship follower", target->ship, u->ship));
|
||||||
|
}
|
||||||
|
else if (!alliedunit(target, u->faction, HELP_ALL)
|
||||||
|
&& cansee(target->faction, r, u, 0)) {
|
||||||
|
ADDMSG(&target->faction->msgs, msg_message("followdetect_ship",
|
||||||
|
"ship follower", target->ship, u->ship));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void caught_target(region * r, unit * u)
|
static void caught_target(region * r, unit * u)
|
||||||
{
|
{
|
||||||
attrib *a = a_find(u->attribs, &at_follow);
|
attrib *a = a_find(u->attribs, &at_follow);
|
||||||
|
@ -1971,7 +1994,7 @@ static void sail(unit * u, order * ord, bool drifting)
|
||||||
|
|
||||||
/* Verfolgungen melden */
|
/* Verfolgungen melden */
|
||||||
if (fval(u, UFL_FOLLOWING)) {
|
if (fval(u, UFL_FOLLOWING)) {
|
||||||
caught_target(current_point, u);
|
caught_target_ship(current_point, u);
|
||||||
}
|
}
|
||||||
|
|
||||||
move_ship(sh, starting_point, current_point, route);
|
move_ship(sh, starting_point, current_point, route);
|
||||||
|
|
Loading…
Reference in New Issue