forked from github/server
- WACH_WAFF
define removed, because it will never be turned off again. - bewache_an() renamed to guard_on_cmd, guard_cmd renamed to guard_on_cmd. now uses parse() - http://eressea.upb.de/mantis/bug_view_page.php?bug_id=0000242 Hungernde Einheiten können Bewache nicht zurücknehmen. GUARD is a short command, should be allowed when hungry.
This commit is contained in:
parent
fa1ab26cfe
commit
eb10f3e429
|
@ -1098,9 +1098,7 @@ allocate_resource(unit * u, const resource_type * rtype, int want)
|
|||
&& !ucontact(u2, u)
|
||||
&& !besieged(u2)
|
||||
&& !alliedunit(u2, u->faction, HELP_GUARD)
|
||||
#ifdef WACH_WAFF
|
||||
&& armedmen(u2)
|
||||
#endif
|
||||
) {
|
||||
add_message(&u->faction->msgs,
|
||||
msg_feedback(u, u->thisorder, "region_guarded", "guard", u2));
|
||||
|
|
|
@ -2565,16 +2565,12 @@ origin_cmd(unit * u, struct order * ord)
|
|||
}
|
||||
|
||||
static int
|
||||
guard_cmd(unit * u, struct order * ord)
|
||||
guard_off_cmd(unit * u, struct order * ord)
|
||||
{
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
|
||||
if (u->faction->age < IMMUN_GEGEN_ANGRIFF) {
|
||||
cmistake(u, ord, 304, MSG_EVENT);
|
||||
} else if (fval(u, UFL_HUNGER)) {
|
||||
cmistake(u, ord, 223, MSG_EVENT);
|
||||
} else if (getparam(u->faction->locale) == P_NOT) {
|
||||
if (getparam(u->faction->locale) == P_NOT) {
|
||||
setguard(u, GUARD_NONE);
|
||||
}
|
||||
return 0;
|
||||
|
@ -2765,7 +2761,7 @@ instant_orders(void)
|
|||
if (name_cmd(u, ord)!=0) ord = NULL;
|
||||
break;
|
||||
case K_GUARD:
|
||||
if (guard_cmd(u, ord)!=0) ord = NULL;
|
||||
if (guard_off_cmd(u, ord)!=0) ord = NULL;
|
||||
break;
|
||||
case K_RESHOW:
|
||||
if (reshow_cmd(u, ord)!=0) ord = NULL;
|
||||
|
@ -2791,49 +2787,34 @@ remove_unequipped_guarded(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bewache_an(void)
|
||||
static int
|
||||
guard_on_cmd(unit * u, struct order * ord)
|
||||
{
|
||||
region *r;
|
||||
unit *u;
|
||||
if (fval(u, UFL_MOVED)) return 0;
|
||||
|
||||
/* letzte schnellen befehle - bewache */
|
||||
for (r = regions; r; r = r->next) {
|
||||
for (u = r->units; u; u = u->next) {
|
||||
if (!fval(u, UFL_MOVED)) {
|
||||
struct order * ord;
|
||||
for (ord = u->orders; ord; ord = ord->next) {
|
||||
if (get_keyword(ord) == K_GUARD) {
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
if (getparam(u->faction->locale) == P_NOT) continue;
|
||||
if (rterrain(r) != T_OCEAN) {
|
||||
if (!fval(u, RCF_ILLUSIONARY) && u->race != new_race[RC_SPELL]) {
|
||||
#ifdef WACH_WAFF
|
||||
/* Monster der Monsterpartei dürfen immer bewachen */
|
||||
if (u->faction == findfaction(MONSTER_FACTION)){
|
||||
guard(u, GUARD_ALL);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!armedmen(u)) {
|
||||
ADDMSG(&u->faction->msgs,
|
||||
msg_feedback(u, ord, "unit_unarmed", ""));
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
/* GUARD NOT is handled in goard_off_cmd earlier in the turn */
|
||||
if (getparam(u->faction->locale) == P_NOT) return 0;
|
||||
|
||||
if (rterrain(u->region) != T_OCEAN) {
|
||||
if (!fval(u, RCF_ILLUSIONARY) && u->race != new_race[RC_SPELL]) {
|
||||
/* Monster der Monsterpartei dürfen immer bewachen */
|
||||
if (u->faction == findfaction(MONSTER_FACTION)) {
|
||||
guard(u, GUARD_ALL);
|
||||
} else if (!armedmen(u)) {
|
||||
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "unit_unarmed", ""));
|
||||
} else {
|
||||
guard(u, GUARD_ALL);
|
||||
}
|
||||
} else {
|
||||
cmistake(u, ord, 95, MSG_EVENT);
|
||||
}
|
||||
} else {
|
||||
cmistake(u, ord, 2, MSG_EVENT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3835,7 +3816,7 @@ processorders (void)
|
|||
movement();
|
||||
|
||||
puts(" - Bewache (an)");
|
||||
bewache_an();
|
||||
parse(K_USE, guard_on_cmd, false);
|
||||
|
||||
puts(" - Zufallsbegegnungen");
|
||||
encounters();
|
||||
|
|
|
@ -303,7 +303,6 @@ extern void plagues(struct region * r, boolean ismagic);
|
|||
#define BLOCKSIZE 9
|
||||
|
||||
/* Nur Bewaffnete bewachen */
|
||||
#define WACH_WAFF
|
||||
#undef TROLLSAVE
|
||||
|
||||
/* Spezialtrank für Insekten */
|
||||
|
|
|
@ -781,9 +781,7 @@ is_guardian(unit * u2, unit *u, unsigned int mask)
|
|||
&& u2->number
|
||||
&& !ucontact(u2, u) && !besieged(u2)
|
||||
&& alliedunit(u2, u->faction, HELP_GUARD) != HELP_GUARD
|
||||
#ifdef WACH_WAFF
|
||||
&& armedmen(u2)
|
||||
#endif
|
||||
&& cansee(u2->faction, u->region, u, 0)
|
||||
) return true;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@
|
|||
Name="Text Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="..\commit.txt">
|
||||
RelativePath="..\changelog.txt">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\header.txt">
|
||||
|
|
|
@ -302,9 +302,7 @@ processturn(char *filename)
|
|||
}
|
||||
processorders();
|
||||
score();
|
||||
#ifdef WACH_WAFF
|
||||
remove_unequipped_guarded();
|
||||
#endif
|
||||
korrektur_end();
|
||||
if (!noreports) reports();
|
||||
free_units();
|
||||
|
|
|
@ -352,9 +352,7 @@ process_orders()
|
|||
#endif
|
||||
processorders();
|
||||
score();
|
||||
#ifdef WACH_WAFF
|
||||
remove_unequipped_guarded();
|
||||
#endif
|
||||
korrektur_end();
|
||||
|
||||
end = make_summary(true);
|
||||
|
|
Loading…
Reference in New Issue