WIP feature: STIRB <password> [PARTEI <nr>]

This commit is contained in:
Enno Rehling 2019-04-30 18:40:24 +02:00
parent a2b89b5354
commit bbcb2113d7
6 changed files with 39 additions and 35 deletions

View File

@ -2937,13 +2937,6 @@
<arg name="command" type="order"/>
</type>
</message>
<message name="error282" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="error281" section="errors">
<type>
<arg name="unit" type="unit"/>
@ -3244,13 +3237,6 @@
<arg name="target" type="region"/>
</type>
</message>
<message name="error241" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="error240" section="errors">
<type>
<arg name="unit" type="unit"/>

View File

@ -587,9 +587,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Unbekannte Opti
msgid "error131"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Um in Gletschern Straßen bauen zu können, muß zuerst ein Tunnel errichtet werden.\""
msgid "error241"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Partei muß mindestens 81 Wochen alt sein, um einen Neustart mit einer anderen Rasse zu versuchen.\""
msgid "feedback_unit_not_found"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit wurde nicht gefunden.\""
@ -1119,7 +1116,7 @@ msgid "dissolve_units_4"
msgstr "\"$unit($unit) in $region($region): $int($number) $race($race,$number) $if($eq($number,1),\"zerfiel\", \"zerfielen\") zu Staub.\""
msgid "error281"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Gegen welche Rasse soll der Jihad ausgerufen werden?\""
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Zielpartei muss die selbe Rasse haben.\""
msgid "error171"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Diesen Kampfzauber gibt es nicht.\""
@ -1784,9 +1781,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es konnte kein
msgid "error50"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit ist nicht erfahren genug dafür.\""
msgid "error282"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Gegen diese Rasse kann kein Jihad ausgerufen werden.\""
msgid "nmr_warning_final"
msgstr "\"Bitte sende die Befehle nächste Runde ein, wenn du weiterspielen möchtest.\""

View File

@ -587,9 +587,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Unknown option.
msgid "error131"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - You must build a tunnel before building roads through glaciers.\""
msgid "error241"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The faction must be at least 81 weeks old to restart with a new race.\""
msgid "feedback_unit_not_found"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit could not be found.\""
@ -1119,7 +1116,7 @@ msgid "dissolve_units_4"
msgstr "\"$unit($unit) in $region($region): $int($number) $race($race,$number) turned to dust.\""
msgid "error281"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - What race did you want the jihad to be against?\""
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The target faction must have the same race as yours.\""
msgid "error171"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - This combat spell does not exist.\""
@ -1784,9 +1781,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - No peasant coul
msgid "error50"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit is not experienced enough to do this.\""
msgid "error282"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - You cannot start a jihad against this race.\""
msgid "nmr_warning_final"
msgstr "\"Please send in orders for the next turn if you want to continue playing.\""

View File

@ -395,8 +395,7 @@ static void peasants(region * r, int rule)
dead += (int)(0.5 + n * PEASANT_STARVATION_CHANCE);
if (dead > 0) {
message *msg = add_message(&r->msgs, msg_message("phunger", "dead", dead));
msg_release(msg);
ADDMSG(&r->msgs, msg_message("phunger", "dead", dead));
peasants -= dead;
}
@ -941,6 +940,10 @@ int leave_cmd(unit * u, struct order *ord)
return 0;
}
int transfer_faction(faction *fsrc, faction *fdst) {
return 0;
}
int quit_cmd(unit * u, struct order *ord)
{
char token[128];
@ -952,6 +955,34 @@ int quit_cmd(unit * u, struct order *ord)
assert(kwd == K_QUIT);
passwd = gettoken(token, sizeof(token));
if (checkpasswd(f, (const char *)passwd)) {
param_t p;
p = getparam(f->locale);
if (p == P_FACTION) {
faction *f2 = getfaction();
if (f2 == NULL) {
cmistake(u, ord, 66, MSG_EVENT);
}
else if (f->race != f2->race) {
cmistake(u, ord, 281, MSG_EVENT);
}
else {
unit *u2;
for (u2 = u->region->units; u2; u2 = u2->next) {
if (u2->faction == f2 && ucontact(u2, u)) {
int err = transfer_faction(u->faction, u2->faction);
if (err != 0) {
/* something went wrong */
cmistake(u, ord, err, MSG_EVENT);
}
break;
}
}
if (u2 == NULL) {
/* no target unit found */
cmistake(u, ord, 0, MSG_EVENT);
}
}
}
fset(f, FFL_QUIT);
}
else {
@ -2077,7 +2108,7 @@ int banner_cmd(unit * u, struct order *ord)
init_order_depr(ord);
s = getstrtoken();
faction_setbanner(u->faction, s);
add_message(&u->faction->msgs, msg_message("changebanner", "value", s));
ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s));
return 0;
}

View File

@ -603,8 +603,7 @@ void plagues(region * r)
}
if (dead > 0) {
message *msg = add_message(&r->msgs, msg_message("pest", "dead", dead));
msg_release(msg);
ADDMSG(&r->msgs, msg_message("pest", "dead", dead));
deathcounts(r, dead);
rsetpeasants(r, peasants - dead);
}

View File

@ -3110,8 +3110,8 @@ static int sp_chaossuction(castorder * co)
create_special_direction(rt, r, 2, "vortex_desc", "vortex", false);
new_border(&bt_chaosgate, r, rt);
add_message(&r->msgs, msg_message("chaosgate_effect_1", "mage", caster));
add_message(&rt->msgs, msg_message("chaosgate_effect_2", ""));
ADDMSG(&r->msgs, msg_message("chaosgate_effect_1", "mage", caster));
ADDMSG(&rt->msgs, msg_message("chaosgate_effect_2", ""));
return cast_level;
}