improved messages when following a ship.
This commit is contained in:
Enno Rehling 2021-01-08 19:44:20 +01:00
parent 8ef95e6729
commit 31f589e76f
4 changed files with 48 additions and 1 deletions

View File

@ -2216,6 +2216,18 @@
<arg name="unit" type="unit"/>
</type>
</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">
<type>
<arg name="unit" type="unit"/>

View File

@ -2603,6 +2603,12 @@ msgstr "\"$unit($follower) konnte $unit($unit) nicht folgen.\""
msgid "followdetect"
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"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Einheit $id wurde nicht gefunden.\""

View File

@ -2597,6 +2597,12 @@ msgstr "\"$unit($mage) makes $unit($target) appear as $race($race,$unit.size($ta
msgid "error248"
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"
msgstr "\"$unit($follower) could not follow $unit($unit).\""

View File

@ -897,6 +897,29 @@ static bool present(region * r, unit * u)
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)
{
attrib *a = a_find(u->attribs, &at_follow);
@ -1971,7 +1994,7 @@ static void sail(unit * u, order * ord, bool drifting)
/* Verfolgungen melden */
if (fval(u, UFL_FOLLOWING)) {
caught_target(current_point, u);
caught_target_ship(current_point, u);
}
move_ship(sh, starting_point, current_point, route);