* Plane-Flag: Keine Monster in Questen

* Meldung bei nicht aureichendem Lehrer-Talent ist missverständlich
* bei FAHRE wird auf Hunger geprueft
* Daemonenpanik im Kampf nur noch, wenn nicht als andere Rasse getarnt.
* watchers kriegen kampfreports
* fix der behandlung von einheiten mit massenhaft keksen.
This commit is contained in:
Enno Rehling 2002-03-12 20:48:10 +00:00
parent ba95eb0be1
commit 0f88c0bffa
5 changed files with 32 additions and 31 deletions

View File

@ -273,45 +273,43 @@ void
battlerecord(battle * b, const char *s)
{
bfaction * bf;
#if 0
static char * lasts = NULL;
struct message * m = msg_message("msg_battle", "string", strdup(s));
plane * p = rplane(b->region);
watcher * w;
if (lasts!=s) {
battledebug(s);
lasts = s;
}
#endif
s = gc_add(strdup(s));
for (bf = b->factions;bf;bf=bf->next) {
faction * f = bf->faction;
struct message * m = new_message(f, "msg_battle%s:string", s);
brecord(f, b->region, m);
brecord(bf->faction, b->region, m);
}
if (p) for (w=p->watchers;w;w=w->next) {
for (bf = b->factions;bf;bf=bf->next) if (bf->faction==w->faction) break;
if (bf==NULL) brecord(w->faction, b->region, m);
}
msg_release(m);
}
void
battlemsg(battle * b, unit * u, const char * s)
{
bfaction * bf;
struct message * m;
plane * p = rplane(b->region);
watcher * w;
sprintf(buf, "%s %s", unitname(u), s);
m = msg_message("msg_battle", "string", strdup(buf));
for (bf=b->factions;bf;bf=bf->next) {
faction * f = bf->faction;
brecord(f, u->region, new_message(f, "msg_battle%s:string", strdup(buf)));
brecord(bf->faction, u->region, m);
}
if (p) for (w=p->watchers;w;w=w->next) {
for (bf = b->factions;bf;bf=bf->next) if (bf->faction==w->faction) break;
if (bf==NULL) brecord(w->faction, b->region, m);
}
msg_release(m);
}
static void
fbattlerecord(faction * f, region * r, const char *s)
{
#if 0
static char * lasts = NULL;
if (lasts!=s) {
battledebug(s);
lasts = s;
}
#endif
s = gc_add(strdup(s));
brecord(f, r, new_message(f, "msg_battle%s:string", s));
}
@ -1181,7 +1179,7 @@ terminate(troop dt, troop at, int type, const char *damage, boolean missile)
if (df->person[dt.index].hp > 0) { /* Hat überlebt */
battledebug(debugbuf);
if (old_race(au->race) == RC_DAEMON) {
if (old_race(au->irace) == RC_DAEMON) {
#ifdef TODO_RUNESWORD
if (select_weapon(dt, 0, -1) == WP_RUNESWORD) continue;
#endif

View File

@ -785,7 +785,7 @@ init_drive(void)
* doesn't seem to be an easy way to speed this up. */
for(u=r->units; u; u=u->next) {
if(igetkeyword(u->thisorder, u->faction->locale) == K_DRIVE && !fval(u, FL_LONGACTION)) {
if(igetkeyword(u->thisorder, u->faction->locale) == K_DRIVE && !fval(u, FL_LONGACTION) && !fval(u, FL_HUNGER)) {
boolean found = false;
ut = getunit(r, u->faction);
if(!ut) {
@ -821,7 +821,7 @@ init_drive(void)
ut = getunit(r, u->faction);
if(!ut) continue;
if (igetkeyword(ut->thisorder, u->faction->locale) == K_DRIVE && !fval(ut, FL_LONGACTION)) {
if (igetkeyword(ut->thisorder, u->faction->locale) == K_DRIVE && !fval(ut, FL_LONGACTION) && !fval(ut, FL_HUNGER)) {
u2 = getunit(r, u->faction);
if(u2 == u) {
w += weight(ut);
@ -1170,7 +1170,7 @@ travel(region * first, unit * u, region * next, int flucht)
if (ut) {
boolean found = false;
if (igetkeyword(ut->thisorder, u->faction->locale) == K_DRIVE
&& !fval(ut, FL_LONGACTION)) {
&& !fval(ut, FL_LONGACTION) && !fval(ut, FL_HUNGER)) {
u2 = getunit(first, ut->faction);
if(u2 == u) {
found = true;

View File

@ -35,8 +35,9 @@
#define PFL_NOFEED 2048 /* Kein Unterhalt nötig TODO */
#define PFL_FRIENDLY 4096 /* everyone is your ally */
#define PFL_NOORCGROWTH 8192 /* orcs don't grow */
#define PFL_NOMONSTERS 16384 /* no monster randenc */
#define PFL_MUSEUM PFL_NOCOORDS | PFL_NORECRUITS | PFL_NOGIVE | PFL_NOATTACK | PFL_NOTERRAIN | PFL_NOMAGIC | PFL_NOSTEALTH | PFL_NOTEACH | PFL_NOBUILD | PFL_NOFEED
#define PFL_MUSEUM PFL_NOMONSTERS | PFL_NOCOORDS | PFL_NORECRUITS | PFL_NOGIVE | PFL_NOATTACK | PFL_NOTERRAIN | PFL_NOMAGIC | PFL_NOSTEALTH | PFL_NOTEACH | PFL_NOBUILD | PFL_NOFEED
typedef struct watcher {
struct watcher * next;

View File

@ -143,7 +143,7 @@ warn_items(void)
for (u=r->units;u;u=u->next) {
item * itm;
for (itm=u->items;itm;itm=itm->next) {
if (itm->number>100000) {
if (itm->number>1000000) {
found = 1;
log_error(("Einheit %s hat %u %s\n",
unitid(u), itm->number,
@ -1792,23 +1792,25 @@ secondfaction(faction * pf)
static void
update_gmquests(void)
{
/* gm04 will keine Orks */
faction * f = findfaction(atoi36("gm04"));
if (f) {
unit * u = f->units;
potion_t p;
attrib * permissions = a_find(f->attribs, &at_permissions);
do_once("et02", secondfaction(f));
if (u!=NULL) {
plane * p = rplane(u->region);
/* gm04 will keine Orks */
if (p!=NULL) p->flags |= PFL_NOORCGROWTH;
/* gm04 will keine Monster */
if (p!=NULL) p->flags |= PFL_NOMONSTERS;
}
for (p=0;p!=MAX_POTIONS;++p) {
attrib * a = a_find(permissions, &at_gmcreate);
while (a && a->data.v!=(void*)oldpotiontype[p]->itype) a=a->nexttype;
if (!a) a_add((attrib**)&permissions->data.v, make_atgmcreate(oldpotiontype[p]->itype));
}
do_once("et02", secondfaction(f));
}
do_once("rq01", regatta_quest());
}

View File

@ -7251,8 +7251,8 @@
<arg name="command" type="string"></arg>
<arg name="student" type="unit"></arg>
</type>
<text locale="de">"$unit($unit) in $region($region): '$command' - $unit($student) ist mindestens gleich gut wie wir."</text>
<text locale="en">"$unit($unit) in $region($region): '$command' - $unit($student) is at least as good as we are."</text>
<text locale="de">"$unit($unit) in $region($region): '$command' - $unit($unit) muß mindestens 2 Stufen besser sein als $unit($student)."</text>
<text locale="en">"$unit($unit) in $region($region): '$command' - $unit($unit) needs to be at least 2 levels better than $unit($student)."</text>
</message>
<message name="battle_spacer" section="battle">