forked from github/server
dev-version: einbau allen neuen sources aus beta-branch. otherfaction.h fehlt, corwin
This commit is contained in:
parent
c106e40fb7
commit
7dfb177044
|
@ -26,7 +26,8 @@ LDFLAGS = $(LIBS)
|
||||||
LIBS = -L$(PUBLISH_DIR)
|
LIBS = -L$(PUBLISH_DIR)
|
||||||
|
|
||||||
LINTFLAGS = -booltype boolean -boolops +posixlib +matchanyintegral \
|
LINTFLAGS = -booltype boolean -boolops +posixlib +matchanyintegral \
|
||||||
-predboolint -retvalint -retvalother -realcompare -exportlocal
|
-predboolint -retvalint -retvalother -realcompare -exportlocal \
|
||||||
|
-DHAVE_READDIR
|
||||||
|
|
||||||
ARCHITECTURE = Linux
|
ARCHITECTURE = Linux
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
#include "iceberg.h"
|
#include "iceberg.h"
|
||||||
#include "hate.h"
|
#include "hate.h"
|
||||||
#include "overrideroads.h"
|
#include "overrideroads.h"
|
||||||
|
#include "otherfaction.h"
|
||||||
#include "racename.h"
|
#include "racename.h"
|
||||||
#ifdef AT_OPTION
|
#ifdef AT_OPTION
|
||||||
# include "option.h"
|
# include "option.h"
|
||||||
|
@ -53,6 +55,7 @@ init_attributes(void)
|
||||||
init_orcification();
|
init_orcification();
|
||||||
init_hate();
|
init_hate();
|
||||||
init_reduceproduction();
|
init_reduceproduction();
|
||||||
|
init_otherfaction();
|
||||||
init_racename();
|
init_racename();
|
||||||
#ifdef AT_MOVED
|
#ifdef AT_MOVED
|
||||||
init_moved();
|
init_moved();
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -24,6 +25,7 @@
|
||||||
|
|
||||||
/* attributes include */
|
/* attributes include */
|
||||||
#include <attributes/follow.h>
|
#include <attributes/follow.h>
|
||||||
|
#include <attributes/otherfaction.h>
|
||||||
#include <attributes/racename.h>
|
#include <attributes/racename.h>
|
||||||
|
|
||||||
/* gamecode includes */
|
/* gamecode includes */
|
||||||
|
@ -413,7 +415,7 @@ cr_output_unit(FILE * F, region * r,
|
||||||
if (strlen(u->display))
|
if (strlen(u->display))
|
||||||
fprintf(F, "\"%s\";Beschr\n", u->display);
|
fprintf(F, "\"%s\";Beschr\n", u->display);
|
||||||
|
|
||||||
if ((u->faction == f || omniscient(f)) || !fval(u, FL_PARTEITARNUNG)) {
|
if( u->faction == f || omniscient(f)) {
|
||||||
#ifdef GROUPS
|
#ifdef GROUPS
|
||||||
if (u->faction == f) {
|
if (u->faction == f) {
|
||||||
const attrib * a = a_find(u->attribs, &at_group);
|
const attrib * a = a_find(u->attribs, &at_group);
|
||||||
|
@ -424,6 +426,13 @@ cr_output_unit(FILE * F, region * r,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fprintf(F, "%d;Partei\n", u->faction->no);
|
fprintf(F, "%d;Partei\n", u->faction->no);
|
||||||
|
} else if(!fval(u, FL_PARTEITARNUNG)) {
|
||||||
|
attrib *a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
if(a) {
|
||||||
|
fprintf(F, "%d;Partei\n", a->data.i);
|
||||||
|
} else {
|
||||||
|
fprintf(F, "%d;Partei\n", u->faction->no);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(u->faction != f && a_fshidden
|
if(u->faction != f && a_fshidden
|
||||||
|
@ -463,6 +472,8 @@ cr_output_unit(FILE * F, region * r,
|
||||||
unit * u = (unit*)a->data.v;
|
unit * u = (unit*)a->data.v;
|
||||||
if (u) fprintf(F, "%d;folgt\n", u->no);
|
if (u) fprintf(F, "%d;folgt\n", u->no);
|
||||||
}
|
}
|
||||||
|
a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
if(a) fprintf(F, "%d;verkleidung\n", a->data.i);
|
||||||
i = ualias(u);
|
i = ualias(u);
|
||||||
if (i>0)
|
if (i>0)
|
||||||
fprintf(F, "%d;temp\n", i);
|
fprintf(F, "%d;temp\n", i);
|
||||||
|
|
|
@ -254,16 +254,16 @@ expandrecruit(region * r, request * recruitorders)
|
||||||
race_t rc = u->faction->race;
|
race_t rc = u->faction->race;
|
||||||
int recruitcost = race[rc].rekrutieren;
|
int recruitcost = race[rc].rekrutieren;
|
||||||
|
|
||||||
/* check if recruiting is limited. either horses or peasant fraction or not at all */
|
/* check if recruiting is limited.
|
||||||
|
* either horses or peasant fraction or not at all */
|
||||||
if ((race[rc].ec_flags & ECF_REC_UNLIMITED)==0) {
|
if ((race[rc].ec_flags & ECF_REC_UNLIMITED)==0) {
|
||||||
/* not unlimited, and everything's gone: */
|
/* not unlimited, and everything's gone: */
|
||||||
if (race[rc].ec_flags & ECF_REC_HORSES) {
|
if (race[rc].ec_flags & ECF_REC_HORSES) {
|
||||||
/* recruit from horses if not all gone */
|
/* recruit from horses if not all gone */
|
||||||
if (h <= 0) continue;
|
if (h <= 0) continue;
|
||||||
}
|
} else if ((race[rc].ec_flags & ECF_REC_ETHEREAL) == 0) {
|
||||||
else if ((race[rc].ec_flags & ECF_REC_ETHEREAL) == 0) {
|
|
||||||
/* recruit from peasants if any space left */
|
/* recruit from peasants if any space left */
|
||||||
if (n > rfrac) continue;
|
if (n >= rfrac) continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (recruitcost) {
|
if (recruitcost) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -80,6 +81,8 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include <attributes/otherfaction.h>
|
||||||
|
|
||||||
/* - external symbols ------------------------------------------ */
|
/* - external symbols ------------------------------------------ */
|
||||||
extern int dropouts[2];
|
extern int dropouts[2];
|
||||||
extern int * age;
|
extern int * age;
|
||||||
|
@ -96,6 +99,7 @@ findoption(char *s)
|
||||||
static void
|
static void
|
||||||
destroyfaction(faction * f)
|
destroyfaction(faction * f)
|
||||||
{
|
{
|
||||||
|
region *rc;
|
||||||
unit *u;
|
unit *u;
|
||||||
faction *ff;
|
faction *ff;
|
||||||
|
|
||||||
|
@ -198,16 +202,27 @@ destroyfaction(faction * f)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* units of other factions that were disguised as this faction
|
||||||
|
* have their disguise replaced by ordinary faction hiding. */
|
||||||
|
for(rc=regions; rc; rc=rc->next) {
|
||||||
|
for(u=rc->units; u; u=u->next) {
|
||||||
|
attrib *a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
if(!a) continue;
|
||||||
|
if(a->data.i == f->no) {
|
||||||
|
a_removeall(&u->attribs, &at_otherfaction);
|
||||||
|
fset(u, FL_PARTEITARNUNG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
restart(unit *u, int race)
|
restart(unit *u, int race)
|
||||||
{
|
{
|
||||||
#ifdef ALLOW_RESTART
|
|
||||||
faction *f = addplayer(u->region, u->faction->email, race)->faction;
|
faction *f = addplayer(u->region, u->faction->email, race)->faction;
|
||||||
f->magiegebiet = u->faction->magiegebiet;
|
f->magiegebiet = u->faction->magiegebiet;
|
||||||
destroyfaction(u->faction);
|
destroyfaction(u->faction);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
@ -2246,7 +2261,18 @@ renumber_factions(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (rp=renum;rp;rp=rp->next) {
|
for (rp=renum;rp;rp=rp->next) {
|
||||||
|
region *r;
|
||||||
|
unit *u;
|
||||||
a_remove(&rp->faction->attribs, rp->attrib);
|
a_remove(&rp->faction->attribs, rp->attrib);
|
||||||
|
/* all units disguised as belonging to this faction have their
|
||||||
|
* attribute changed */
|
||||||
|
for(r=regions; r; r=r->next) {
|
||||||
|
for(u=r->units; u; u=u->next) {
|
||||||
|
attrib *a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
if(!a) continue;
|
||||||
|
a->data.i = rp->want;
|
||||||
|
}
|
||||||
|
}
|
||||||
rp->faction->no = rp->want;
|
rp->faction->no = rp->want;
|
||||||
register_faction_id(rp->want);
|
register_faction_id(rp->want);
|
||||||
fset(rp->faction, FF_NEWID);
|
fset(rp->faction, FF_NEWID);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -488,8 +489,9 @@ monster_seeks_target(region *r, unit *u)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: prüfen, ob target überhaupt noch existiert... */
|
/* TODO: prüfen, ob target überhaupt noch existiert... */
|
||||||
|
if(!target) return; /* this is a bug workaround! remove!! */
|
||||||
|
|
||||||
if( r == target->region ) { /* Wir haben ihn! */
|
if(r == target->region ) { /* Wir haben ihn! */
|
||||||
switch( u->race ) {
|
switch( u->race ) {
|
||||||
case RC_ALP:
|
case RC_ALP:
|
||||||
alp_findet_opfer(u, r);
|
alp_findet_opfer(u, r);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -1282,8 +1283,9 @@ randomevents(void)
|
||||||
set_skill(u, SK_OBSERVATION, u->number * (rand() % 180));
|
set_skill(u, SK_OBSERVATION, u->number * (rand() % 180));
|
||||||
set_skill(u, SK_AUSDAUER, u->number * 30);
|
set_skill(u, SK_AUSDAUER, u->number * 30);
|
||||||
set_skill(u, SK_STEALTH, u->number * 30);
|
set_skill(u, SK_STEALTH, u->number * 30);
|
||||||
fprintf(stderr, "%d %s in %s.\n", u->number,
|
log_printf("%d %s in %s.\n", u->number,
|
||||||
race[u->race].name[1], regionname(r, NULL));
|
race[u->race].name[1], regionname(r, NULL));
|
||||||
|
|
||||||
name_unit(u);
|
name_unit(u);
|
||||||
set_string(&u->lastorder, "WARTEN");
|
set_string(&u->lastorder, "WARTEN");
|
||||||
|
|
||||||
|
@ -1362,8 +1364,9 @@ randomevents(void)
|
||||||
set_string(&u->lastorder, "WARTEN");
|
set_string(&u->lastorder, "WARTEN");
|
||||||
name_unit(u);
|
name_unit(u);
|
||||||
|
|
||||||
fprintf(stderr, "%d %s in %s.\n", u->number,
|
log_printf("%d %s in %s.\n", u->number,
|
||||||
race[u->race].name[1], regionname(r, NULL));
|
race[u->race].name[1], regionname(r, NULL));
|
||||||
|
|
||||||
add_message(&r->msgs, new_message(NULL,
|
add_message(&r->msgs, new_message(NULL,
|
||||||
"undeadrise%r:region", r));
|
"undeadrise%r:region", r));
|
||||||
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
|
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
|
||||||
|
@ -1414,7 +1417,8 @@ randomevents(void)
|
||||||
else
|
else
|
||||||
set_string(&u->name, "Wütende Ents");
|
set_string(&u->name, "Wütende Ents");
|
||||||
|
|
||||||
fprintf(stderr, "%d Ents in %s.\n", u->number, regionname(r, NULL));
|
log_printf("%d Ents in %s.\n", u->number, regionname(r, NULL));
|
||||||
|
|
||||||
add_message(&r->msgs, new_message(NULL,
|
add_message(&r->msgs, new_message(NULL,
|
||||||
"entrise%r:region", r));
|
"entrise%r:region", r));
|
||||||
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
|
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -22,6 +23,7 @@
|
||||||
|
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/overrideroads.h>
|
#include <attributes/overrideroads.h>
|
||||||
|
#include <attributes/otherfaction.h>
|
||||||
#ifdef AT_OPTION
|
#ifdef AT_OPTION
|
||||||
# include <attributes/option.h>
|
# include <attributes/option.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -62,6 +64,7 @@
|
||||||
#include <nrmessage.h>
|
#include <nrmessage.h>
|
||||||
#include <translation.h>
|
#include <translation.h>
|
||||||
#include <util/message.h>
|
#include <util/message.h>
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -101,7 +104,7 @@ read_datenames(const char *filename)
|
||||||
int i, l;
|
int i, l;
|
||||||
|
|
||||||
if( (namesFP=fopen(filename,"r")) == NULL) {
|
if( (namesFP=fopen(filename,"r")) == NULL) {
|
||||||
fprintf(stderr, "Kann Datei '%s' nicht öffnen, Abbruch\n",filename);
|
log_error(("Kann Datei '%s' nicht öffnen, Abbruch\n", filename));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2778,10 +2781,9 @@ can_find(faction * f, faction * f2)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
add_find(faction * f, unit * u)
|
add_find(faction * f, unit * u, faction *f2)
|
||||||
{
|
{
|
||||||
/* faction f sees f2 through u */
|
/* faction f sees f2 through u */
|
||||||
faction * f2 = u->faction;
|
|
||||||
int key = f->no % FMAXHASH;
|
int key = f->no % FMAXHASH;
|
||||||
struct fsee ** fp = &fsee[key];
|
struct fsee ** fp = &fsee[key];
|
||||||
struct fsee * fs;
|
struct fsee * fs;
|
||||||
|
@ -2817,8 +2819,15 @@ update_find(void)
|
||||||
if (u2->faction==lastf || u2->faction==u->faction)
|
if (u2->faction==lastf || u2->faction==u->faction)
|
||||||
continue;
|
continue;
|
||||||
if (seefaction(u->faction, r, u2, 0)) {
|
if (seefaction(u->faction, r, u2, 0)) {
|
||||||
lastf=u2->faction;
|
attrib *a = a_find(u2->attribs, &at_otherfaction);
|
||||||
add_find(u->faction, u2);
|
if(a) {
|
||||||
|
faction *f = findfaction(a->data.i);
|
||||||
|
lastf=f;
|
||||||
|
add_find(u->faction, u2, f);
|
||||||
|
} else {
|
||||||
|
lastf=u2->faction;
|
||||||
|
add_find(u->faction, u2, u2->faction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -51,6 +52,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <attributes/otherfaction.h>
|
||||||
|
|
||||||
void
|
void
|
||||||
spy(region * r, unit * u)
|
spy(region * r, unit * u)
|
||||||
{
|
{
|
||||||
|
@ -136,12 +139,30 @@ setstealth(unit * u, strlist * S)
|
||||||
|
|
||||||
switch(findparam(s)) {
|
switch(findparam(s)) {
|
||||||
case P_FACTION:
|
case P_FACTION:
|
||||||
/* TARNE PARTEI [NICHT] */
|
/* TARNE PARTEI [NICHT|NUMMER abcd] */
|
||||||
s = getstrtoken();
|
s = getstrtoken();
|
||||||
if (findparam(s) == P_NOT) {
|
if(!s || *s == 0) {
|
||||||
freset(u, FL_PARTEITARNUNG);
|
|
||||||
} else {
|
|
||||||
fset(u, FL_PARTEITARNUNG);
|
fset(u, FL_PARTEITARNUNG);
|
||||||
|
} else if (findparam(s) == P_NOT) {
|
||||||
|
freset(u, FL_PARTEITARNUNG);
|
||||||
|
} else if (findkeyword(s) == K_NUMBER) {
|
||||||
|
char *s2 = getstrtoken();
|
||||||
|
int nr;
|
||||||
|
if(!s2 || *s2 == 0 || (nr = atoi36(s2)) == u->faction->no) {
|
||||||
|
a_removeall(&u->faction->attribs, &at_otherfaction);
|
||||||
|
} else {
|
||||||
|
/* TODO: Prüfung ob Partei sichtbar */
|
||||||
|
if(!findfaction(nr)) {
|
||||||
|
cmistake(u, S->s, 66, MSG_EVENT);
|
||||||
|
} else {
|
||||||
|
attrib *a;
|
||||||
|
a = a_find(u->attribs, &at_otherfaction);
|
||||||
|
if(!a) a = a_add(&u->attribs, a_new(&at_otherfaction));
|
||||||
|
a->data.i = nr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cmistake(u, S->s, 289, MSG_EVENT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case P_ANY:
|
case P_ANY:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
|
*
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -59,6 +60,7 @@ typedef enum combatmagic {
|
||||||
#include <base36.h>
|
#include <base36.h>
|
||||||
#include <cvector.h>
|
#include <cvector.h>
|
||||||
#include <rand.h>
|
#include <rand.h>
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/key.h>
|
#include <attributes/key.h>
|
||||||
|
@ -3020,7 +3022,7 @@ make_battle(region * r)
|
||||||
sprintf(zFilename, "%s/battle-%d-%s.log", zText, obs_count, simplename(r));
|
sprintf(zFilename, "%s/battle-%d-%s.log", zText, obs_count, simplename(r));
|
||||||
bdebug = fopen(zFilename, "w");
|
bdebug = fopen(zFilename, "w");
|
||||||
#endif
|
#endif
|
||||||
if (!bdebug) fputs("battles können nicht debugged werden\n", stderr);
|
if (!bdebug) log_error(("battles können nicht debugged werden\n"));
|
||||||
else {
|
else {
|
||||||
dbgprintf((bdebug, "In %s findet ein Kampf statt:", rname(r, NULL)));
|
dbgprintf((bdebug, "In %s findet ein Kampf statt:", rname(r, NULL)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -846,7 +846,7 @@ typedef struct skillvalue {
|
||||||
löschen müssen! (Ist dafür nicht eigentlich FL_DH gedacht?) */
|
löschen müssen! (Ist dafür nicht eigentlich FL_DH gedacht?) */
|
||||||
#define FL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
#define FL_NOIDLEOUT (1<<24) /* Partei stirbt nicht an NMRs */
|
||||||
#define FL_TAKEALL (1<<25) /* Einheit nimmt alle Gegenstände an */
|
#define FL_TAKEALL (1<<25) /* Einheit nimmt alle Gegenstände an */
|
||||||
#define FL_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */
|
#define FL_UNNAMED (1<<26) /* Partei/Einheit/Gebäude/Schiff ist unbenannt */
|
||||||
|
|
||||||
/* Flags, die gespeichert werden sollen: */
|
/* Flags, die gespeichert werden sollen: */
|
||||||
#ifdef NOAID
|
#ifdef NOAID
|
||||||
|
|
|
@ -11,15 +11,21 @@
|
||||||
* This program may not be used, modified or distributed without
|
* This program may not be used, modified or distributed without
|
||||||
* prior permission by the authors of Eressea.
|
* prior permission by the authors of Eressea.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "eressea.h"
|
#include "eressea.h"
|
||||||
#include "faction.h"
|
#include "faction.h"
|
||||||
|
#include "unit.h"
|
||||||
|
#include "race.h"
|
||||||
|
#include "region.h"
|
||||||
|
#include "plane.h"
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
#include <base36.h>
|
#include <base36.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
factionname(const faction * f)
|
factionname(const faction * f)
|
||||||
|
@ -42,3 +48,65 @@ void *
|
||||||
resolve_faction(void * id) {
|
resolve_faction(void * id) {
|
||||||
return findfaction((int)id);
|
return findfaction((int)id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MAX_FACTION_ID (36*36*36*36)
|
||||||
|
|
||||||
|
static int
|
||||||
|
unused_faction_id(void)
|
||||||
|
{
|
||||||
|
int id = rand()%MAX_FACTION_ID;
|
||||||
|
|
||||||
|
while(!faction_id_is_unused(id)) {
|
||||||
|
id++; if(id == MAX_FACTION_ID) id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
unit *
|
||||||
|
addplayer(region *r, char *email, race_t frace)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
unit *u;
|
||||||
|
|
||||||
|
faction *f = (faction *) calloc(1, sizeof(faction));
|
||||||
|
|
||||||
|
set_string(&f->email, email);
|
||||||
|
|
||||||
|
for (i = 0; i < 6; i++) buf[i] = (char) (97 + rand() % 26); buf[i] = 0;
|
||||||
|
set_string(&f->passw, buf);
|
||||||
|
|
||||||
|
f->lastorders = turn;
|
||||||
|
f->alive = 1;
|
||||||
|
f->age = 0;
|
||||||
|
f->race = frace;
|
||||||
|
f->magiegebiet = 0;
|
||||||
|
set_ursprung(f, 0, r->x, r->y);
|
||||||
|
|
||||||
|
f->options = Pow(O_REPORT) | Pow(O_ZUGVORLAGE) | Pow(O_SILBERPOOL);
|
||||||
|
|
||||||
|
f->no = unused_faction_id();
|
||||||
|
register_faction_id(f->no);
|
||||||
|
|
||||||
|
f->unique_id = max_unique_id + 1;
|
||||||
|
max_unique_id++;
|
||||||
|
|
||||||
|
sprintf(buf, "Partei %s", factionid(f));
|
||||||
|
set_string(&f->name, buf);
|
||||||
|
fset(f, FL_UNNAMED);
|
||||||
|
|
||||||
|
addlist(&factions, f);
|
||||||
|
|
||||||
|
u = createunit(r, f, 1, f->race);
|
||||||
|
give_starting_equipment(r, u);
|
||||||
|
fset(u, FL_ISNEW);
|
||||||
|
if (f->race == RC_DAEMON) {
|
||||||
|
do
|
||||||
|
u->irace = (char) (rand() % MAXRACES);
|
||||||
|
while (u->irace == RC_DAEMON || race[u->irace].nonplayer);
|
||||||
|
}
|
||||||
|
fset(u, FL_PARTEITARNUNG);
|
||||||
|
|
||||||
|
return u;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,5 +65,6 @@ typedef struct faction {
|
||||||
|
|
||||||
extern const char * factionname(const struct faction * f);
|
extern const char * factionname(const struct faction * f);
|
||||||
extern void * resolve_faction(void * data);
|
extern void * resolve_faction(void * data);
|
||||||
|
extern struct unit * addplayer(struct region *r, char *email, race_t frace);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -251,8 +251,8 @@ struct fspecialdata fspecials[MAXFACTIONSPECIALS] = {
|
||||||
"komplett.",
|
"komplett.",
|
||||||
100
|
100
|
||||||
},
|
},
|
||||||
{ /* TODO: Namen ändern */
|
{
|
||||||
"Schnell",
|
"Windvolk",
|
||||||
"Ein solches Volk ist sehr athletisch und die Kinder üben besonders "
|
"Ein solches Volk ist sehr athletisch und die Kinder üben besonders "
|
||||||
"den Langstreckenlauf von kleinauf. Nach jahrelangem Training sind "
|
"den Langstreckenlauf von kleinauf. Nach jahrelangem Training sind "
|
||||||
"sie dann in der Lage, sich zu Fuß so schnell zu bewegen als würden "
|
"sie dann in der Lage, sich zu Fuß so schnell zu bewegen als würden "
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
@ -31,11 +30,12 @@
|
||||||
#include "building.h"
|
#include "building.h"
|
||||||
|
|
||||||
/* util includes */
|
/* util includes */
|
||||||
#include <goodies.h>
|
|
||||||
#include <base36.h>
|
#include <base36.h>
|
||||||
|
#include <goodies.h>
|
||||||
#include <message.h>
|
#include <message.h>
|
||||||
#include <nrmessage.h>
|
#include <nrmessage.h>
|
||||||
#include <crmessage.h>
|
#include <crmessage.h>
|
||||||
|
#include <log.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -428,7 +428,7 @@ caddmessage(region * r, faction * f, char *s, msg_t mtype, int level)
|
||||||
m = add_message(&r->msgs, new_message(f, "msg_event%s:string", s));
|
m = add_message(&r->msgs, new_message(f, "msg_event%s:string", s));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, "Warnung: Ungültige Msg-Klasse!");
|
assert(!"Ungültige Msg-Klasse!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
|
|
||||||
/* attributes includes */
|
/* attributes includes */
|
||||||
#include <attributes/follow.h>
|
#include <attributes/follow.h>
|
||||||
|
#include <attributes/otherfaction.h>
|
||||||
#include <attributes/racename.h>
|
#include <attributes/racename.h>
|
||||||
|
|
||||||
const char * g_reportdir;
|
const char * g_reportdir;
|
||||||
|
@ -124,8 +125,10 @@ hp_status(const unit * u)
|
||||||
{
|
{
|
||||||
double p = (double) ((double) u->hp / (double) (u->number * unit_max_hp(u)));
|
double p = (double) ((double) u->hp / (double) (u->number * unit_max_hp(u)));
|
||||||
|
|
||||||
if (p > 1.25)
|
if (p > 2.00)
|
||||||
return "magisch gestärkt";
|
return "sehr stark";
|
||||||
|
if (p > 1.50)
|
||||||
|
return "stark";
|
||||||
if (p < 0.50)
|
if (p < 0.50)
|
||||||
return "schwer verwundet";
|
return "schwer verwundet";
|
||||||
if (p < 0.75)
|
if (p < 0.75)
|
||||||
|
@ -178,6 +181,8 @@ bufunit(const faction * f, const unit * u, int indent,
|
||||||
int i, dh;
|
int i, dh;
|
||||||
skill_t sk;
|
skill_t sk;
|
||||||
int getarnt = fval(u, FL_PARTEITARNUNG);
|
int getarnt = fval(u, FL_PARTEITARNUNG);
|
||||||
|
attrib *a_otherfaction = NULL;
|
||||||
|
const char *c;
|
||||||
const char *pzTmp;
|
const char *pzTmp;
|
||||||
spell *sp;
|
spell *sp;
|
||||||
building * b;
|
building * b;
|
||||||
|
@ -187,28 +192,41 @@ bufunit(const faction * f, const unit * u, int indent,
|
||||||
attrib *a_fshidden = NULL;
|
attrib *a_fshidden = NULL;
|
||||||
item * itm;
|
item * itm;
|
||||||
item * show;
|
item * show;
|
||||||
|
|
||||||
if(fspecial(u->faction, FS_HIDDEN))
|
if(fspecial(u->faction, FS_HIDDEN))
|
||||||
a_fshidden = a_find(u->attribs, &at_fshidden);
|
a_fshidden = a_find(u->attribs, &at_fshidden);
|
||||||
|
|
||||||
strcpy(buf, unitname(u));
|
strcpy(buf, unitname(u));
|
||||||
|
|
||||||
|
a_otherfaction = a_find(u->attribs, &at_otherfaction);
|
||||||
|
|
||||||
if (!getarnt && (u->faction != f)) {
|
if (u->faction == f) {
|
||||||
scat(", ");
|
|
||||||
scat(factionname(u->faction));
|
|
||||||
} else {
|
|
||||||
#ifdef GROUPS
|
#ifdef GROUPS
|
||||||
if (u->faction==f) {
|
attrib *a = a_find(u->attribs, &at_group);
|
||||||
attrib * a = a_find(u->attribs, &at_group);
|
if (a) {
|
||||||
if (a) {
|
group * g = (group*)a->data.v;
|
||||||
group * g = (group*)a->data.v;
|
scat(", ");
|
||||||
scat(", ");
|
scat(groupid(g, f));
|
||||||
scat(groupid(g, f));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (getarnt) scat(", parteigetarnt");
|
if (getarnt) {
|
||||||
|
scat(", parteigetarnt");
|
||||||
|
} else if (a_otherfaction) {
|
||||||
|
scat(", ");
|
||||||
|
scat(factionname(findfaction(a_otherfaction->data.i)));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (getarnt) {
|
||||||
|
scat(", parteigetarnt");
|
||||||
|
} else if(a_otherfaction) {
|
||||||
|
scat(", ");
|
||||||
|
scat(factionname(findfaction(a_otherfaction->data.i)));
|
||||||
|
} else {
|
||||||
|
scat(", ");
|
||||||
|
scat(factionname(u->faction));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scat(", ");
|
scat(", ");
|
||||||
if(u->faction != f && a_fshidden
|
if(u->faction != f && a_fshidden
|
||||||
&& a_fshidden->data.ca[0] == 1 && effskill(u, SK_STEALTH) >= 6) {
|
&& a_fshidden->data.ca[0] == 1 && effskill(u, SK_STEALTH) >= 6) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ extern const char *neue_gebiete[];
|
||||||
|
|
||||||
/* kann_finden speedups */
|
/* kann_finden speedups */
|
||||||
extern boolean kann_finden(struct faction * f1, struct faction * f2);
|
extern boolean kann_finden(struct faction * f1, struct faction * f2);
|
||||||
extern void add_find(struct faction *, struct unit *);
|
extern void add_find(struct faction *, struct unit *, struct faction *);
|
||||||
extern struct unit * can_find(struct faction *, struct faction *);
|
extern struct unit * can_find(struct faction *, struct faction *);
|
||||||
/* funktionen zum schreiben eines reports */
|
/* funktionen zum schreiben eines reports */
|
||||||
extern int read_datenames(const char *filename);
|
extern int read_datenames(const char *filename);
|
||||||
|
|
|
@ -1134,7 +1134,7 @@ fix_age(void)
|
||||||
for (f=factions;f;f=f->next) {
|
for (f=factions;f;f=f->next) {
|
||||||
if (f->no!=MONSTER_FACTION && !nonplayer_race(f->race)) continue;
|
if (f->no!=MONSTER_FACTION && !nonplayer_race(f->race)) continue;
|
||||||
if (f->age!=turn) {
|
if (f->age!=turn) {
|
||||||
fprintf(stderr, " - Alter von Partei %s anpassen", factionid(f));
|
log_printf("Alter von Partei %s auf %d angepasst.\n", factionid(f), turn);
|
||||||
f->age = turn;
|
f->age = turn;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1915,7 +1915,10 @@ fix_herbs(void)
|
||||||
|
|
||||||
for (r=regions; r; r=r->next) if (rterrain(r) == T_PLAIN) {
|
for (r=regions; r; r=r->next) if (rterrain(r) == T_PLAIN) {
|
||||||
const herb_type *htype = rherbtype(r);
|
const herb_type *htype = rherbtype(r);
|
||||||
assert(htype);
|
if (htype==NULL) {
|
||||||
|
htype = htypes[i];
|
||||||
|
rsetherbtype(r, htype);
|
||||||
|
}
|
||||||
for (i=0;i!=6;++i) if (htypes[i]==htype) break;
|
for (i=0;i!=6;++i) if (htypes[i]==htype) break;
|
||||||
assert(i!=6);
|
assert(i!=6);
|
||||||
herbs[i]++;
|
herbs[i]++;
|
||||||
|
|
24
src/files
24
src/files
|
@ -1,17 +1,7 @@
|
||||||
alchemy.h
|
common/gamecode/economy.c
|
||||||
creation.h
|
common/gamecode/randenc.c
|
||||||
economy.h
|
common/gamecode/report.c
|
||||||
magic.h
|
common/kernel/karma.c
|
||||||
race.h
|
common/kernel/message.c
|
||||||
randenc.h
|
common/kernel/reports.c
|
||||||
alp.c
|
mapper/map_partei.c
|
||||||
build.c
|
|
||||||
creation.c
|
|
||||||
creport.c
|
|
||||||
economy.c
|
|
||||||
laws.c
|
|
||||||
monster.c
|
|
||||||
randenc.c
|
|
||||||
report.c
|
|
||||||
spy.c
|
|
||||||
study.c
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/* vi: set ts=2:
|
/* vi: set ts=2:
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* Eressea PB(E)M host Copyright (C) 1998-2000
|
* Eressea PB(E)M host Copyright (C) 1998-2000
|
||||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||||
|
|
|
@ -54,7 +54,7 @@ error48;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist nicht bewa
|
||||||
error49;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist nicht der Eigentümer.
|
error49;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist nicht der Eigentümer.
|
||||||
error50;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist nicht erfahren genug dafür.
|
error50;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist nicht erfahren genug dafür.
|
||||||
error51;errors:0;de;{unit} in {region}: '{command}' - Die Einheit hat nicht genug Silber.
|
error51;errors:0;de;{unit} in {region}: '{command}' - Die Einheit hat nicht genug Silber.
|
||||||
error52;errors:0;de;{unit} in {region}: '{command}' - Die Einheit ist vom Kampf erschöpft.
|
error52;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann keinen langen Befehl mehr ausführen.
|
||||||
error53;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann keine Tränke herstellen.
|
error53;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann keine Tränke herstellen.
|
||||||
error54;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann nicht handeln.
|
error54;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann nicht handeln.
|
||||||
error55;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann sich nicht fortbewegen.
|
error55;errors:0;de;{unit} in {region}: '{command}' - Die Einheit kann sich nicht fortbewegen.
|
||||||
|
@ -287,6 +287,7 @@ error285;errors:0;de;{unit} in {region}: '{command}' - Diese Einheit kennt keine
|
||||||
error286;errors:0;de;{unit} in {region}: '{command}' - Die Einheit transportiert uns nicht.
|
error286;errors:0;de;{unit} in {region}: '{command}' - Die Einheit transportiert uns nicht.
|
||||||
error287;errors:0;de;{unit} in {region}: '{command}' - Dorthin können wir die Einheit nicht transportieren.
|
error287;errors:0;de;{unit} in {region}: '{command}' - Dorthin können wir die Einheit nicht transportieren.
|
||||||
error288;errors:0;de;{unit} in {region}: '{command}' - Wieviel sollen wir einreißen?
|
error288;errors:0;de;{unit} in {region}: '{command}' - Wieviel sollen wir einreißen?
|
||||||
|
error289;errors:0;de;{unit} in {region}: '{command}' - Tarne wie?
|
||||||
|
|
||||||
# Meldungen und Ereignisse
|
# Meldungen und Ereignisse
|
||||||
msg_event;events:0;de;{string}
|
msg_event;events:0;de;{string}
|
||||||
|
|
Loading…
Reference in New Issue