- GUARD_DISABLES_PRODUCTION

- Bewache wirkt nur noch, wenn der Bewacher den Bewachten sieht
This commit is contained in:
Christian Schlittchen 2002-04-21 17:22:48 +00:00
parent d81be270aa
commit 4e076dd4ae
12 changed files with 434 additions and 399 deletions

File diff suppressed because it is too large Load Diff

View File

@ -688,7 +688,7 @@ horses(region * r)
rsethorses(r, (int)(horses*0.9)); rsethorses(r, (int)(horses*0.9));
} else if (maxhorses > 0) { } else if (maxhorses > 0) {
int i; int i;
int growth = (HORSEGROWTH * 200 * (maxhorses-horses))/maxhorses; int growth = (RESOURCE_QUANTITY * HORSEGROWTH * 200 * (maxhorses-horses))/maxhorses;
if(a_find(r->attribs, &at_horseluck)) growth *= 2; if(a_find(r->attribs, &at_horseluck)) growth *= 2;
/* printf("Horses: <%d> %d -> ", growth, horses); */ /* printf("Horses: <%d> %d -> ", growth, horses); */
@ -3029,6 +3029,7 @@ maxunits(faction *f)
return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR))); return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR)));
} }
static void static void
new_units (void) new_units (void)
{ {

View File

@ -1866,15 +1866,14 @@ report(FILE *F, faction * f, const faction_list * addresses,
} }
if (f->age <= 2) { if (f->age <= 2) {
/* doppelt gemoppelt und funktioniert nicht. */
if (f->age <= 1) { if (f->age <= 1) {
ADDMSG(&f->msgs, msg_message("changepasswd", ADDMSG(&f->msgs, msg_message("changepasswd",
"value", gc_add(strdup(f->passw)))); "value", gc_add(strdup(f->passw))));
} }
/* Was tut das? */
RENDER(f, buf, sizeof(buf), ("newbie_password", "password", f->passw)); RENDER(f, buf, sizeof(buf), ("newbie_password", "password", f->passw));
rnl(F); rnl(F);
centre(F, buf, true); centre(F, buf, true);
rnl(F);
centre(F, LOC(f->locale, "newbie_info_1"), true); centre(F, LOC(f->locale, "newbie_info_1"), true);
rnl(F); rnl(F);
centre(F, LOC(f->locale, "newbie_info_2"), true); centre(F, LOC(f->locale, "newbie_info_2"), true);

View File

@ -33,6 +33,7 @@
#include "race.h" #include "race.h"
#include "unit.h" #include "unit.h"
#include "skill.h" #include "skill.h"
#include "movement.h"
/* util includes */ /* util includes */
#include <rand.h> #include <rand.h>
@ -50,11 +51,17 @@ herbsearch(region * r, unit * u, int max)
{ {
int herbsfound; int herbsfound;
const herb_type * whichherb; const herb_type * whichherb;
if (eff_skill(u, SK_HERBALISM, r) == 0) { if (eff_skill(u, SK_HERBALISM, r) == 0) {
cmistake(u, u->thisorder, 59, MSG_PRODUCE); cmistake(u, u->thisorder, 59, MSG_PRODUCE);
return; return;
} }
if(is_guarded(r, u, GUARD_PRODUCE)) {
cmistake(u, findorder(u, u->thisorder), 70, MSG_EVENT);
return;
}
whichherb = rherbtype(r); whichherb = rherbtype(r);
if (whichherb == NULL) { if (whichherb == NULL) {
cmistake(u, u->thisorder, 108, MSG_PRODUCE); cmistake(u, u->thisorder, 108, MSG_PRODUCE);

View File

@ -796,31 +796,41 @@ cansee(const faction * f, const region * r, const unit * u, int modifier)
int n; int n;
boolean cansee = false; boolean cansee = false;
unit *u2; unit *u2;
if (u->faction == f || omniscient(f)) cansee = true;
else if (old_race(u->race) == RC_SPELL || u->number == 0) return false;
else {
n = eff_stealth(u, r) - modifier;
for (u2 = r->units; u2; u2 = u2->next) {
if (u2->faction == f) {
int o;
if (getguard(u) || usiege(u) || u->building || u->ship) { if (u->faction == f || omniscient(f)) {
cansee = true; return true;
break; } else if (old_race(u->race) == RC_SPELL) {
} return false;
if (get_item(u, I_RING_OF_INVISIBILITY) >= u->number } else if (u->number == 0) {
&& !get_item(u2, I_AMULET_OF_TRUE_SEEING)) attrib *a = a_find(u->attribs, &at_creator);
continue; if(a) { /* u is an empty temporary unit. In this special case
we look at the creating unit. */
u = (unit *)a->data.v;
} else {
return false;
}
}
n = eff_stealth(u, r) - modifier;
for (u2 = r->units; u2; u2 = u2->next) {
if (u2->faction == f) {
int o;
o = eff_skill(u2, SK_OBSERVATION, r); if (getguard(u) || usiege(u) || u->building || u->ship) {
cansee = true;
break;
}
if (get_item(u, I_RING_OF_INVISIBILITY) >= u->number
&& !get_item(u2, I_AMULET_OF_TRUE_SEEING))
continue;
o = eff_skill(u2, SK_OBSERVATION, r);
#if NIGHTEYES #if NIGHTEYES
if (u2->enchanted == SP_NIGHT_EYES && o < NIGHT_EYE_TALENT) if (u2->enchanted == SP_NIGHT_EYES && o < NIGHT_EYE_TALENT)
o = NIGHT_EYE_TALENT; o = NIGHT_EYE_TALENT;
#endif #endif
if (o >= n) { if (o >= n) {
cansee = true; cansee = true;
break; break;
}
} }
} }
} }
@ -1615,6 +1625,11 @@ createunit(region * r, faction * f, int number, const struct race * rc)
return create_unit(r, f, number, rc, 0, NULL, NULL); return create_unit(r, f, number, rc, 0, NULL, NULL);
} }
attrib_type at_creator = {
"creator"
/* Rest ist NULL; temporäres, nicht alterndes Attribut */
};
unit * unit *
create_unit(region * r, faction * f, int number, const struct race *urace, int id, const char * dname, unit *creator) create_unit(region * r, faction * f, int number, const struct race *urace, int id, const char * dname, unit *creator)
{ {
@ -1686,6 +1701,9 @@ create_unit(region * r, faction * f, int number, const struct race *urace, int i
if (a) { if (a) {
a_add(&u->attribs, make_otherfaction(get_otherfaction(a))); a_add(&u->attribs, make_otherfaction(get_otherfaction(a)));
} }
a = a_add(&u->attribs, a_new(&at_creator));
a->data.v = creator;
} }
/* Monster sind grundsätzlich parteigetarnt */ /* Monster sind grundsätzlich parteigetarnt */
if(f->no <= 0) fset(u, FL_PARTEITARNUNG); if(f->no <= 0) fset(u, FL_PARTEITARNUNG);

View File

@ -1107,6 +1107,7 @@ void cmistake(const struct unit * u, const char *cmd, int mno, int mtype);
extern struct attrib_type at_guard; extern struct attrib_type at_guard;
extern struct attrib_type at_lighthouse; extern struct attrib_type at_lighthouse;
extern struct attrib_type at_creator;
#define GUARD_NONE 0 #define GUARD_NONE 0
#define GUARD_TAX 1 #define GUARD_TAX 1
@ -1123,6 +1124,8 @@ extern struct attrib_type at_lighthouse;
/* Verhindert Unterhaltung auf Schiffen */ /* Verhindert Unterhaltung auf Schiffen */
#define GUARD_RECRUIT 64 #define GUARD_RECRUIT 64
/* Verhindert Rekrutieren */ /* Verhindert Rekrutieren */
#define GUARD_PRODUCE 128
/* Verhindert Abbau von Resourcen mit RTF_LIMITED */
#define GUARD_ALL 0xFFFF #define GUARD_ALL 0xFFFF
extern void setguard(struct unit * u, unsigned int flags); extern void setguard(struct unit * u, unsigned int flags);

View File

@ -695,14 +695,14 @@ boolean
is_guardian(unit * u2, unit *u, unsigned int mask) is_guardian(unit * u2, unit *u, unsigned int mask)
{ {
if (u2->faction != u->faction if (u2->faction != u->faction
&& getguard(u2)&mask && getguard(u2)&mask
&& u2->number && u2->number
&& !ucontact(u2, u) && !besieged(u2) && !ucontact(u2, u) && !besieged(u2)
&& allied(u2, u->faction, HELP_GUARD) && allied(u2, u->faction, HELP_GUARD) != HELP_GUARD
!= HELP_GUARD
#ifdef WACH_WAFF #ifdef WACH_WAFF
&& armedmen(u2) && armedmen(u2)
#endif #endif
&& cansee(u2->faction, u->region, u, 0)
) return true; ) return true;
return false; return false;

View File

@ -30,7 +30,8 @@
#define SKILLPOINTS 0 #define SKILLPOINTS 0
#define NEW_MIGRATION 1 #define NEW_MIGRATION 1
#define PEASANTS_DO_NOT_STARVE 0 #define PEASANTS_DO_NOT_STARVE 0
#define GUARD_DISABLES_RECRUIT 0 #define GUARD_DISABLES_RECRUIT 1
#define GUARD_DISABLES_PRODUCTION 1
#define RESOURCE_QUANTITY 1.0 #define RESOURCE_QUANTITY 1.0

View File

@ -103,8 +103,7 @@ nr_render(const struct message * msg, const struct locale * lang, char * buffer,
if (m) { if (m) {
strcpy(buffer, m); strcpy(buffer, m);
return 0; return 0;
} } else {
else {
log_error(("Couldn't render message %s\n", nrt->mtype->name)); log_error(("Couldn't render message %s\n", nrt->mtype->name));
} }
} }

View File

@ -244,6 +244,6 @@ extern char * strdup(const char *s);
#ifdef STRNCPY_HAS_ZEROTERMINATION #ifdef STRNCPY_HAS_ZEROTERMINATION
# define strnzcpy(dst, src, len) strncpy(dst, src, len) # define strnzcpy(dst, src, len) strncpy(dst, src, len)
#else #else
# define strnzcpy(dst, src, len) (strncpy(dst, src, len), len?dst[len-1]=0:0, dst) # define strnzcpy(dst, src, len) (strncpy(dst, src, len), len?dst[len]=0:0, dst)
#endif #endif
#endif #endif

View File

@ -31,6 +31,11 @@
<text locale="en">very few </text> <text locale="en">very few </text>
</string> </string>
<string name="sehr viele">
<text locale="de">sehr viele</text>
<text locale="en">a great many </text>
</string>
<string name="prefix_Dunkel"> <string name="prefix_Dunkel">
<text locale="de">Dunkel</text> <text locale="de">Dunkel</text>
<text locale="en">dark </text> <text locale="en">dark </text>

View File

@ -955,13 +955,6 @@
<text locale="en">Belts of Heroic Legends</text> <text locale="en">Belts of Heroic Legends</text>
</string> </string>
<string name="viele">
<text locale="en">many</text>
</string>
<string name="sehr viele">
<text locale="en">a great many</text>
</string>
<comment> intranslatables:</comment> <comment> intranslatables:</comment>
<string name="h0"> <string name="h0">
<text locale="en">Flachwurz</text> <text locale="en">Flachwurz</text>