forked from github/server
Lauter kleine Angleichungen an den HEAD-Code, damit die diffs kleiner bleiben.
Eigentlich keine Änderung. Gleich mal testen.
This commit is contained in:
parent
82119094a7
commit
f3244cd6c8
|
@ -117,7 +117,8 @@ RemoveNMRNewbie(void) {
|
|||
static void
|
||||
restart(unit *u, const race * rc)
|
||||
{
|
||||
faction *f = addfaction(u->faction->email, u->faction->passw, rc, u->faction->locale, u->faction->subscription);
|
||||
faction * oldf = u->faction;
|
||||
faction *f = addfaction(oldf->email, oldf->passw, rc, oldf->locale, oldf->subscription);
|
||||
unit * nu = addplayer(u->region, f);
|
||||
strlist ** o=&u->orders;
|
||||
f->subscription = u->faction->subscription;
|
||||
|
@ -911,11 +912,9 @@ iron(region * r)
|
|||
#ifndef NO_GROWTH
|
||||
if (rterrain(r) == T_MOUNTAIN) {
|
||||
rsetiron(r, riron(r) + IRONPERTURN);
|
||||
#if !NEW_LAEN
|
||||
if(a_find(r->attribs, &at_laen)) {
|
||||
rsetlaen(r, rlaen(r) + rand() % MAXLAENPERTURN);
|
||||
}
|
||||
#endif
|
||||
} else if (rterrain(r) == T_GLACIER || rterrain(r) == T_ICEBERG_SLEEP) {
|
||||
rsetiron(r, min(MAXGLIRON, riron(r)+GLIRONPERTURN));
|
||||
}
|
||||
|
@ -2719,7 +2718,6 @@ renumber_factions(void)
|
|||
for (rp=renum;rp;rp=rp->next) {
|
||||
f = rp->faction;
|
||||
a_remove(&f->attribs, rp->attrib);
|
||||
if (updatelog) fprintf(updatelog, "renum %s %s\n", itoa36(f->no), itoa36(rp->want));
|
||||
if (f->subscription) fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where "
|
||||
"id=%u;\n", itoa36(rp->want),
|
||||
f->subscription);
|
||||
|
@ -3646,11 +3644,6 @@ processorders (void)
|
|||
monthly_healing();
|
||||
regeneration_magiepunkte();
|
||||
|
||||
#if NEW_LAEN
|
||||
puts(" - Laenwachstum");
|
||||
growlaen();
|
||||
#endif
|
||||
|
||||
puts(" - Defaults setzen");
|
||||
defaultorders();
|
||||
|
||||
|
|
|
@ -1528,64 +1528,3 @@ randomevents(void)
|
|||
check_split();
|
||||
check_luck();
|
||||
}
|
||||
|
||||
#if NEW_LAEN
|
||||
void growlaen(void) {
|
||||
region *r;
|
||||
region_list *Berge=NULL, *rl;
|
||||
unit *u;
|
||||
int b=0, Laen, z, add;
|
||||
short *add_laen;
|
||||
|
||||
for (r = regions; r; r = r->next) {
|
||||
if (!fval(r, RF_CHAOTIC) &&
|
||||
rterrain(r) == T_MOUNTAIN)
|
||||
{
|
||||
add_regionlist(&Berge,r);
|
||||
b++;
|
||||
}
|
||||
}
|
||||
|
||||
add_laen=(short *)malloc(b*sizeof(short));
|
||||
memset(add_laen, 0, b*sizeof(short));
|
||||
|
||||
Laen=b*MAXLAENPERTURN/14; /* Anzahl Berge * MAXLAENPERTURN/2 * Chance pro Berg */
|
||||
|
||||
while(Laen) { /* Laenverteilung über alle Berge */
|
||||
z = rand()%b;
|
||||
add = min(10 + rand() % 30, Laen);
|
||||
add_laen[z] = (short)(add_laen[z]+add);
|
||||
Laen -= add;
|
||||
}
|
||||
|
||||
z=0;
|
||||
for (rl=Berge; rl; rl=rl->next, z++) {
|
||||
region * r = rl->region;
|
||||
if (add_laen[z]>0) {
|
||||
if (a_find(rl->region->attribs, &at_laen))
|
||||
rsetlaen(rl->region, add_laen[z]+rlaen(rl->region));
|
||||
}
|
||||
else {
|
||||
attrib *a=a_new(&at_laen);
|
||||
struct message * msg = NULL;
|
||||
a_add(&rl->region->attribs, a);
|
||||
rsetlaen(rl->region, add_laen[z]);
|
||||
|
||||
/* Meldungen generieren */
|
||||
for (u=r->units;u;u=u->next) freset(u->faction, FL_DH);
|
||||
for (u = r->units; u; u = u->next ) {
|
||||
if (!fval(u->faction, FL_DH) && eff_skill(u, SK_MINING, rl->region) >= olditemtype[I_LAEN]->minskill)
|
||||
{
|
||||
if (!msg) msg = msg_message("unveileog", "unit region", u, rl->region);
|
||||
r_addmessage(rl->region, u->faction, msg);
|
||||
fset(u->faction, FL_DH);
|
||||
}
|
||||
}
|
||||
if (msg) msg_release(msg);
|
||||
}
|
||||
}
|
||||
free(add_laen);
|
||||
free_regionlist(Berge);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -107,7 +107,7 @@ typedef struct building_list {
|
|||
extern void free_buildinglist(building_list *bl);
|
||||
extern void add_buildinglist(building_list **bl, struct building *b);
|
||||
|
||||
extern attrib_type at_building_generic_type;
|
||||
extern struct attrib_type at_building_generic_type;
|
||||
extern const char * buildingtype(const struct building * b, int bsize);
|
||||
extern const char * buildingname(const struct building * b);
|
||||
extern int buildingmaintenance(const building * b, const struct resource_type * rtype);
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
#include <errno.h>
|
||||
|
||||
/* exported variables */
|
||||
const char *xmlfile = "eressea.xml";
|
||||
region *regions;
|
||||
faction *factions;
|
||||
settings global;
|
||||
|
@ -107,6 +106,7 @@ static attrib_type at_creator = {
|
|||
"creator"
|
||||
/* Rest ist NULL; temporäres, nicht alterndes Attribut */
|
||||
};
|
||||
|
||||
static int
|
||||
MaxAge(void) {
|
||||
static int value = -1;
|
||||
|
@ -397,7 +397,6 @@ allied_skilllimit(const faction * f, skill_t sk)
|
|||
const char * str = get_param(global.parameters, "allied.skilllimit");
|
||||
return str?atoi(str):0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int
|
||||
|
@ -481,7 +480,7 @@ int quiet = 0;
|
|||
FILE *debug;
|
||||
|
||||
int
|
||||
shipspeed (ship * sh, const unit * u)
|
||||
shipspeed (const ship * sh, const unit * u)
|
||||
{
|
||||
int k = sh->type->range;
|
||||
static const curse_type * stormwind_ct, * nodrift_ct;
|
||||
|
@ -3101,7 +3100,6 @@ kernel_init(void)
|
|||
skill_init();
|
||||
attrib_init();
|
||||
translation_init();
|
||||
init_messages();
|
||||
|
||||
if (!turn) turn = lastturn();
|
||||
if (turn == 0)
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#ifndef ERESSEA_H
|
||||
#define ERESSEA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -74,13 +75,14 @@ struct weapon_type;
|
|||
struct ship_type;
|
||||
struct building_type;
|
||||
|
||||
#include <cvector.h>
|
||||
#include <umlaut.h>
|
||||
#include <language.h>
|
||||
#include <lists.h>
|
||||
#include <vmap.h>
|
||||
#include <vset.h>
|
||||
#include <attrib.h>
|
||||
#include <util/attrib.h>
|
||||
#include <util/cvector.h>
|
||||
#include <util/language.h>
|
||||
#include <util/lists.h>
|
||||
#include <util/log.h>
|
||||
#include <util/umlaut.h>
|
||||
#include <util/vmap.h>
|
||||
#include <util/vset.h>
|
||||
|
||||
#define AT_PERSISTENT
|
||||
#ifdef ALLIANCES
|
||||
|
@ -257,7 +259,6 @@ extern void read_laen(struct region * r, int laen);
|
|||
/* Zuwachs Eisen in Bergregionen */
|
||||
#define IRONPERTURN 25
|
||||
#define MAXLAENPERTURN 6
|
||||
#define NEW_LAEN 0
|
||||
/* Eisen in Gletschern */
|
||||
#define GLIRONSTART 20
|
||||
/* Zuwachs Eisen in Gletschern */
|
||||
|
@ -743,7 +744,8 @@ enum {
|
|||
|
||||
#define MAXSPEED 21
|
||||
|
||||
int shipspeed(struct ship * sh, const struct unit * u);
|
||||
extern int shipspeed(const struct ship * sh, const struct unit * u);
|
||||
extern int init_data(const char * filename);
|
||||
|
||||
/* MAXSPEED setzt die groesse fuer den Array, der die Kuesten Beschreibungen
|
||||
* enthaelt. MAXSPEED muss 2x +3 so gross wie die groesste Geschw. sein
|
||||
|
@ -886,7 +888,7 @@ typedef struct strlist {
|
|||
#define freset(u, i) ((u)->flags &= ~(i))
|
||||
|
||||
extern int turn;
|
||||
extern const char *xmlfile;
|
||||
extern int quiet;
|
||||
|
||||
/* parteinummern */
|
||||
extern int *used_faction_ids;
|
||||
|
@ -1163,7 +1165,6 @@ typedef struct settings {
|
|||
} settings;
|
||||
extern settings global;
|
||||
|
||||
extern FILE * updatelog;
|
||||
extern int produceexp(struct unit * u, skill_t sk, int n);
|
||||
|
||||
extern boolean sqlpatch;
|
||||
|
|
|
@ -133,22 +133,22 @@ addfaction(const char *email, const char * password,
|
|||
unit *
|
||||
addplayer(region *r, faction * f)
|
||||
{
|
||||
unit *u;
|
||||
unit *u;
|
||||
|
||||
assert(f->units==NULL);
|
||||
set_ursprung(f, 0, r->x, r->y);
|
||||
u = createunit(r, f, 1, f->race);
|
||||
give_starting_equipment(r, u);
|
||||
fset(u, UFL_ISNEW);
|
||||
if (old_race(f->race) == RC_DAEMON) {
|
||||
race_t urc;
|
||||
do
|
||||
urc = (race_t)(rand() % MAXRACES);
|
||||
while (urc == RC_DAEMON || !playerrace(new_race[urc]));
|
||||
u->irace = new_race[urc];
|
||||
}
|
||||
u = createunit(r, f, 1, f->race);
|
||||
give_starting_equipment(r, u);
|
||||
fset(u, UFL_ISNEW);
|
||||
if (old_race(f->race) == RC_DAEMON) {
|
||||
race_t urc;
|
||||
do
|
||||
urc = (race_t)(rand() % MAXRACES);
|
||||
while (urc == RC_DAEMON || !playerrace(new_race[urc]));
|
||||
u->irace = new_race[urc];
|
||||
}
|
||||
|
||||
return u;
|
||||
return u;
|
||||
}
|
||||
|
||||
boolean
|
||||
|
|
|
@ -2340,169 +2340,6 @@ attrib_type at_resourcelimit = {
|
|||
finalize_resourcelimit,
|
||||
};
|
||||
|
||||
#define DYNAMIC_TYPES
|
||||
#ifdef DYNAMIC_TYPES
|
||||
void
|
||||
rt_write(FILE * F, const resource_type * rt)
|
||||
{
|
||||
fprintf(F, "RESOURCETYPE %d\n", rt->hashkey);
|
||||
a_write(F, rt->attribs); /* scheisse, weil nicht CR. */
|
||||
fputc('\n', F);
|
||||
fprintf(F, "\"%s\";name_singular\n", rt->_name[0]);
|
||||
fprintf(F, "\"%s\";name_plural\n", rt->_name[1]);
|
||||
fprintf(F, "\"%s\";appearance_singular\n", rt->_appearance[0]);
|
||||
fprintf(F, "\"%s\";appearance_plural\n", rt->_appearance[1]);
|
||||
fprintf(F, "%d;flags\n", rt->flags);
|
||||
if (rt->uchange) {
|
||||
assert(rt->uchange==res_changeitem || !"not implemented");
|
||||
fputs("\"res_changeitem\";uchange\n", F);
|
||||
}
|
||||
if (rt->uget!=NULL) assert(!"not implemented");
|
||||
if (rt->name!=NULL) assert(!"not implemented");
|
||||
fputs("END RESOURCETYPE\n", F);
|
||||
}
|
||||
|
||||
void
|
||||
it_write(FILE * F, const item_type * it)
|
||||
/* Written at Gate E2 of Amsterdam Airport.
|
||||
* If someone had installed power outlets there,
|
||||
* I would have been able to test this stuff */
|
||||
{
|
||||
fprintf(F, "ITEMTYPE %s\n", it->rtype->_name[0]);
|
||||
fprintf(F, "%d;flags\n", it->flags);
|
||||
fprintf(F, "%d;weight\n", it->weight);
|
||||
fprintf(F, "%d;capacity\n", it->capacity);
|
||||
if (it->use!=NULL) {
|
||||
const char * name = get_functionname((pf_generic)it->use);
|
||||
fprintf(F, "\"%s\";use\n", name);
|
||||
}
|
||||
if (it->give!=NULL) {
|
||||
const char * name = get_functionname((pf_generic)it->give);
|
||||
fprintf(F, "\"%s\";give\n", name);
|
||||
}
|
||||
fputs("END ITEMTYPE\n", F);
|
||||
}
|
||||
|
||||
resource_type *
|
||||
rt_read(FILE * F)
|
||||
/* this function is pretty picky */
|
||||
{
|
||||
resource_type * rt = calloc(sizeof(resource_type), 1);
|
||||
unsigned int hash;
|
||||
int i = fscanf(F, "%u\n", &hash);
|
||||
if (i==0 || i==EOF) {
|
||||
free(rt);
|
||||
return NULL;
|
||||
}
|
||||
a_read(F, &rt->attribs); /* scheisse, weil nicht CR. */
|
||||
for (;;) {
|
||||
char * semi = buf;
|
||||
char * s = NULL;
|
||||
int i = 0;
|
||||
fgets(buf, sizeof(buf), F);
|
||||
if (strlen(buf)==1) continue;
|
||||
buf[strlen(buf)-1]=0;
|
||||
for(;;) {
|
||||
char * s = strchr(semi, ';');
|
||||
if (s==NULL) break;
|
||||
semi = s + 1;
|
||||
}
|
||||
if (semi==buf) {
|
||||
assert(!strcmp(buf, "END RESOURCETYPE"));
|
||||
break;
|
||||
}
|
||||
*(semi-1)=0;
|
||||
if (buf[0]=='\"') {
|
||||
s = buf+1;
|
||||
assert(*(semi-2)=='\"');
|
||||
*(semi-2)=0;
|
||||
}
|
||||
else {
|
||||
i = atoi(buf);
|
||||
}
|
||||
switch (semi[0]) {
|
||||
case 'a':
|
||||
if (!strcmp(semi, "appearance_singular")) rt->_appearance[0]=strdup(s);
|
||||
if (!strcmp(semi, "appearance_plural")) rt->_appearance[1]=strdup(s);
|
||||
break;
|
||||
case 'f':
|
||||
if (!strcmp(semi, "flags")) rt->flags=i;
|
||||
break;
|
||||
case 'n':
|
||||
if (!strcmp(semi, "name_singular")) rt->_name[0]=strdup(s);
|
||||
if (!strcmp(semi, "name_plural")) rt->_name[1]=strdup(s);
|
||||
break;
|
||||
case 'u':
|
||||
if (!strcmp(semi, "uchange")) {
|
||||
if (!strcmp(s, "res_changeitem")) rt->uchange = res_changeitem;
|
||||
}
|
||||
}
|
||||
}
|
||||
rt_register(rt);
|
||||
return rt;
|
||||
}
|
||||
|
||||
item_type *
|
||||
it_read(FILE * F)
|
||||
/* this function is pretty picky */
|
||||
{
|
||||
item_type * it = calloc(sizeof(item_type), 1);
|
||||
int i = fscanf(F, "%s\n", buf);
|
||||
if (i==0 || i==EOF) {
|
||||
free(it);
|
||||
return NULL;
|
||||
}
|
||||
it->rtype = rt_find(buf);
|
||||
assert(it->rtype || !"resource does not exist");
|
||||
for (;;) {
|
||||
char * semi = buf;
|
||||
char * s = NULL;
|
||||
int i = 0;
|
||||
fgets(buf, sizeof(buf), F);
|
||||
if (strlen(buf)==1) continue;
|
||||
buf[strlen(buf)-1]=0;
|
||||
for(;;) {
|
||||
char * s = strchr(semi, ';');
|
||||
if (s==NULL) break;
|
||||
semi = s + 1;
|
||||
}
|
||||
if (semi==buf) {
|
||||
assert(!strcmp(buf, "END ITEMTYPE"));
|
||||
break;
|
||||
}
|
||||
*(semi-1)=0;
|
||||
if (buf[0]=='\"') {
|
||||
s = buf+1;
|
||||
assert(*(semi-2)=='\"');
|
||||
*(semi-2)=0;
|
||||
}
|
||||
else {
|
||||
i = atoi(buf);
|
||||
}
|
||||
switch (semi[0]) {
|
||||
case 'c':
|
||||
if (!strcmp(semi, "capacity")) it->capacity=i;
|
||||
break;
|
||||
case 'f':
|
||||
if (!strcmp(semi, "flags")) it->flags=i;
|
||||
break;
|
||||
case 'g':
|
||||
if (!strcmp(semi, "give")) it->give = (boolean (*)(const unit*, const unit*, const struct item_type *, int, const char *))get_function(s);
|
||||
break;
|
||||
case 'u':
|
||||
if (!strcmp(semi, "use")) it->use = (int (*)(unit *, const struct item_type *, int, const char *))get_function(s);
|
||||
break;
|
||||
case 'w':
|
||||
if (!strcmp(semi, "weight")) it->weight=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
it_register(it);
|
||||
return it;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const char*
|
||||
resname(resource_t res, int index)
|
||||
{
|
||||
|
|
|
@ -546,10 +546,6 @@ int res_changeitem(struct unit * u, const resource_type * rtype, int delta);
|
|||
extern struct attrib_type at_showitem; /* show this potion's description */
|
||||
extern struct attrib_type at_seenitem; /* knows this potion's description, no need to reshow */
|
||||
|
||||
extern item_type * it_read(FILE * F);
|
||||
extern resource_type * rt_read(FILE * F);
|
||||
extern void it_write(FILE * F, const item_type * it);
|
||||
extern void rt_write(FILE * F, const resource_type * rt);
|
||||
extern void register_resources(void);
|
||||
extern void init_resources(void);
|
||||
|
||||
|
|
|
@ -499,7 +499,3 @@ read_msglevels(struct warning ** w, FILE * F)
|
|||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
init_messages(void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -59,7 +59,6 @@ extern struct message * msg_error(const struct unit *, const char *cmd,
|
|||
const char * name, const char* sig, ...);
|
||||
extern struct message * add_message(struct message_list** pm, struct message * m);
|
||||
extern void free_messages(struct message_list * m);
|
||||
extern void init_messages(void);
|
||||
|
||||
/* message sections */
|
||||
extern struct messageclass * msgclasses;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct obj_ID {
|
||||
int a, b;
|
||||
} obj_ID;
|
||||
|
|
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
#define PFL_NOSTEALTH 256 /* Tarnung außer Betrieb */
|
||||
#define PFL_NOTEACH 512 /* Lehre außer Betrieb */
|
||||
#define PFL_NOBUILD 1024 /* Bauen außer Betrieb */
|
||||
#define PFL_NOFEED 2048 /* Kein Unterhalt nötig TODO */
|
||||
#define PFL_NOFEED 2048 /* Kein Unterhalt nötig */
|
||||
#define PFL_FRIENDLY 4096 /* everyone is your ally */
|
||||
#define PFL_NOORCGROWTH 8192 /* orcs don't grow */
|
||||
#define PFL_NOMONSTERS 16384 /* no monster randenc */
|
||||
|
|
|
@ -183,8 +183,8 @@ give_starting_equipment(struct region *r, struct unit *u)
|
|||
if (token!=NULL) {
|
||||
i_add(&u->items, i_new(token, 1));
|
||||
}
|
||||
set_item(u, I_WOOD, 30);
|
||||
set_item(u, I_STONE, 30);
|
||||
set_item(u, I_WOOD, 30);
|
||||
set_item(u, I_STONE, 30);
|
||||
set_money(u, 2000 + turn * 10);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -167,6 +167,11 @@ render_cleanup(void)
|
|||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
v_order(const locale * l, void * data) {
|
||||
return (const char *)data;
|
||||
}
|
||||
|
||||
static const char *
|
||||
v_unit(const locale * l, void * data) {
|
||||
unit * u = (void*)data;
|
||||
|
@ -497,7 +502,8 @@ render_init(void)
|
|||
add_evalfun("dir", loc, v_dir);
|
||||
add_evalfun("dir", loc, v_dir);
|
||||
add_evalfun("travel", loc, v_travel);
|
||||
add_evalfun("unit", loc, v_unit);
|
||||
add_evalfun("unit", loc, v_unit);
|
||||
add_evalfun("order", loc, v_order);
|
||||
add_evalfun("of", loc, v_of_de);
|
||||
add_evalfun("sink", loc, v_sink_de);
|
||||
add_evalfun("mage", loc, v_mage_de);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,13 +46,11 @@ extern boolean is_persistent(const char *s, const struct locale * lang);
|
|||
/* Versionsänderungen: */
|
||||
#define HEX_VERSION 81
|
||||
extern int data_version;
|
||||
extern int minfaction;
|
||||
extern int maxregions;
|
||||
extern int firstx, firsty;
|
||||
extern int quiet;
|
||||
extern const char *xmlfile;
|
||||
|
||||
extern void init_locales(void);
|
||||
extern int init_data(const char * xmlfile);
|
||||
extern int lastturn(void);
|
||||
|
||||
extern void read_items(FILE *f, struct item **it);
|
||||
|
|
|
@ -102,18 +102,18 @@ typedef struct unit_list {
|
|||
extern void unitlist_clear(struct unit_list **ul);
|
||||
extern void unitlist_insert(struct unit_list **ul, struct unit *u);
|
||||
|
||||
extern attrib_type at_alias;
|
||||
extern attrib_type at_siege;
|
||||
extern attrib_type at_target;
|
||||
extern attrib_type at_potionuser;
|
||||
extern attrib_type at_contact;
|
||||
extern attrib_type at_effect;
|
||||
extern attrib_type at_private;
|
||||
extern attrib_type at_showskchange;
|
||||
extern struct attrib_type at_alias;
|
||||
extern struct attrib_type at_siege;
|
||||
extern struct attrib_type at_target;
|
||||
extern struct attrib_type at_potionuser;
|
||||
extern struct attrib_type at_contact;
|
||||
extern struct attrib_type at_effect;
|
||||
extern struct attrib_type at_private;
|
||||
extern struct attrib_type at_showskchange;
|
||||
|
||||
int ualias(const struct unit * u);
|
||||
|
||||
extern attrib_type at_stealth;
|
||||
extern struct attrib_type at_stealth;
|
||||
|
||||
void u_seteffstealth(struct unit * u, int value);
|
||||
int u_geteffstealth(const struct unit * u);
|
||||
|
@ -167,7 +167,7 @@ extern void destroy_unit(struct unit * u);
|
|||
|
||||
/* see resolve.h */
|
||||
extern void * resolve_unit(void * data);
|
||||
extern void write_unit_reference(const unit * u, FILE * F);
|
||||
extern void write_unit_reference(const struct unit * u, FILE * F);
|
||||
extern int read_unit_reference(unit ** up, FILE * F);
|
||||
|
||||
extern void leave(struct region * r, struct unit * u);
|
||||
|
|
|
@ -1012,22 +1012,19 @@ parse_main(xmlDocPtr doc)
|
|||
for (i=0;i!=nodes->nodeNr;++i) {
|
||||
xmlNodePtr node = nodes->nodeTab[i];
|
||||
xmlChar * name = xmlGetProp(node, BAD_CAST "name");
|
||||
xmlChar * disable = xmlGetProp(node, BAD_CAST "disable");
|
||||
boolean disable = xml_bvalue(node, "disable", false);
|
||||
|
||||
if (disable!=NULL) {
|
||||
if (strcmp((const char*)disable, "yes")==0) {
|
||||
int k;
|
||||
for (k=0;k!=MAXKEYWORDS;++k) {
|
||||
if (strcmp(keywords[k], (const char*)name)==0) {
|
||||
global.disabled[k]=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (k==MAXKEYWORDS) {
|
||||
log_error(("trying to disable unknown comand %s\n", (const char*)name));
|
||||
if (disable) {
|
||||
int k;
|
||||
for (k=0;k!=MAXKEYWORDS;++k) {
|
||||
if (strcmp(keywords[k], (const char*)name)==0) {
|
||||
global.disabled[k]=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
xmlFree(disable);
|
||||
if (k==MAXKEYWORDS) {
|
||||
log_error(("trying to disable unknown comand %s\n", (const char*)name));
|
||||
}
|
||||
}
|
||||
xmlFree(name);
|
||||
}
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef void (*afun)(void);
|
||||
|
||||
typedef struct attrib {
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "variant.h"
|
||||
|
||||
struct attrib;
|
||||
|
|
|
@ -93,3 +93,4 @@ chance(double x)
|
|||
if (x>=1.0) return true;
|
||||
return (boolean) (rand() % RAND_MAX < RAND_MAX * x);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
extern FILE * sqlstream;
|
||||
extern void sql_init(const char * filename);
|
||||
extern void sql_done(void);
|
||||
|
|
|
@ -41,6 +41,7 @@ xml_bvalue(xmlNodePtr node, const char * name, boolean dflt)
|
|||
xmlChar * property = xmlGetProp(node, BAD_CAST name);
|
||||
if (property!=NULL) {
|
||||
if (strcmp((const char*)property, "yes")==0) result = true;
|
||||
if (strcmp((const char*)property, "true")==0) result = true;
|
||||
if (strcmp((const char*)property, "1")==0) {
|
||||
log_warning(("boolean value is '1': %s::%s\n", node->name, name));
|
||||
result = true;
|
||||
|
|
14
src/config.h
14
src/config.h
|
@ -22,6 +22,15 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
# include <cstdio>
|
||||
# include <cstdlib>
|
||||
extern "C" {
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/**** ****
|
||||
** Debugging Libraries **
|
||||
**** ****/
|
||||
|
@ -92,7 +101,7 @@
|
|||
# define __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef WIN32
|
||||
# include <common/util/windir.h>
|
||||
# define HAVE_READDIR
|
||||
#endif
|
||||
|
@ -225,6 +234,9 @@ extern char * strdup(const char *s);
|
|||
# define false ((boolean)0)
|
||||
# define true ((boolean)!false)
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* this function must be implemented in a .o file */
|
||||
extern char * strnzcpy(char * dst, const char *src, size_t len);
|
||||
|
|
|
@ -608,7 +608,6 @@ main(int argc, char *argv[])
|
|||
char zText[MAX_PATH];
|
||||
|
||||
sqlpatch = true;
|
||||
updatelog = fopen("update.log", "w");
|
||||
log_open("eressea.log");
|
||||
printf("\n%s PBEM host\n"
|
||||
"Copyright (C) 1996-2001 C.Schlittchen, K.Zedel, E.Rehling, H.Peters.\n\n"
|
||||
|
@ -710,6 +709,5 @@ main(int argc, char *argv[])
|
|||
#endif
|
||||
kernel_done();
|
||||
log_close();
|
||||
fclose(updatelog);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* vi: set ts=2:
|
||||
*
|
||||
*
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea-pbem.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
* Eressea PB(E)M host Copyright (C) 1998-2003
|
||||
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
||||
* Katja Zedel (katze@felidae.kn-bremen.de)
|
||||
* Henning Peters (faroul@beyond.kn-bremen.de)
|
||||
* Enno Rehling (enno@eressea-pbem.de)
|
||||
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
||||
*
|
||||
* based on:
|
||||
*
|
||||
|
@ -65,21 +65,21 @@
|
|||
#include <kernel/building.h>
|
||||
#include <kernel/faction.h>
|
||||
#include <kernel/item.h>
|
||||
#include <kernel/spell.h>
|
||||
#include <kernel/message.h>
|
||||
#include <kernel/plane.h>
|
||||
#include <kernel/race.h>
|
||||
#include <kernel/region.h>
|
||||
#include <kernel/region.h>
|
||||
#include <kernel/reports.h>
|
||||
#include <kernel/resources.h>
|
||||
#include <kernel/save.h>
|
||||
#include <kernel/ship.h>
|
||||
#include <kernel/skill.h>
|
||||
#include <kernel/spell.h>
|
||||
#include <kernel/teleport.h>
|
||||
#include <kernel/unit.h>
|
||||
#include <kernel/xmlreader.h>
|
||||
|
||||
|
||||
/* util includes */
|
||||
#include <util/base36.h>
|
||||
#include <util/goodies.h>
|
||||
|
@ -99,6 +99,7 @@
|
|||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <clocale>
|
||||
|
||||
/**
|
||||
** global variables we are importing from other modules
|
||||
**/
|
||||
|
@ -144,8 +145,8 @@ static const char * luafile = "default.lua";
|
|||
|
||||
struct settings global = {
|
||||
"Eressea", /* gamename */
|
||||
"eressea", /* resourcepath */
|
||||
1000, /* maxunits */
|
||||
"eressea", /* resourcepath */
|
||||
1000, /* maxunits */
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -626,10 +627,9 @@ main(int argc, char *argv[])
|
|||
char zText[MAX_PATH];
|
||||
|
||||
sqlpatch = true;
|
||||
updatelog = fopen("update.log", "w");
|
||||
log_open("eressea.log");
|
||||
printf("\n%s PBEM host\n"
|
||||
"Copyright (C) 1996-2003 C. Schlittchen, K. Zedel, E. Rehling, H. Peters.\n\n"
|
||||
"Copyright (C) 1996-2004 C. Schlittchen, K. Zedel, E. Rehling, H. Peters.\n\n"
|
||||
"Compilation: " __DATE__ " at " __TIME__ "\nVersion: %f\n\n", global.gamename, version());
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
@ -663,6 +663,5 @@ main(int argc, char *argv[])
|
|||
kernel_done();
|
||||
lua_done(luaState);
|
||||
log_close();
|
||||
fclose(updatelog);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
|
||||
| | Enno Rehling <enno@eressea-pbem.de>
|
||||
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
|
||||
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
|
||||
| (c) 1998 - 2004 | Henning Peters <faroul@beyond.kn-bremen.de>
|
||||
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
|
||||
+-------------------+ Stefan Reich <reich@halbling.de>
|
||||
|
||||
|
|
|
@ -1,25 +1,21 @@
|
|||
<?xml version="1.0"?>
|
||||
<buildings>
|
||||
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
|
||||
|
||||
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes" auraregen="1.00"/>
|
||||
|
||||
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
|
||||
|
||||
<building name="illusioncastle" capacity="0" maxcapacity="0" maxsize="0" nobuild="yes" auraregen="1.00"/>
|
||||
|
||||
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes" auraregen="1.00"/>
|
||||
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes" auraregen="1.00"/>
|
||||
<building name="genericbuilding" maxsize="1" nobuild="yes" auraregen="1.00"/>
|
||||
<building name="blessedstonecircle" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
|
||||
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
|
||||
<requirement type="log" recycle="0.5" quantity="500"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="500"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="stonecircle" maxsize="100" auraregen="1.00">
|
||||
<construction skill="sk_building" minskill="2" reqsize="100" maxsize="100">
|
||||
<requirement type="log" recycle="0.5" quantity="500"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="500"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="inn" capacity="1" auraregen="1.00">
|
||||
<maintenance type="money" amount="5" variable="yes" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="2" reqsize="10">
|
||||
|
@ -27,8 +23,8 @@
|
|||
<requirement type="log" recycle="0.5" quantity="30"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="40"/>
|
||||
<requirement type="money" quantity="2000"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="tunnel" capacity="1" maxsize="100" auraregen="1.00">
|
||||
<maintenance type="stone" recycle="0.5" amount="2"/>
|
||||
<maintenance type="money" amount="100" vital="yes"/>
|
||||
|
@ -37,8 +33,8 @@
|
|||
<requirement type="log" recycle="0.5" quantity="500"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="1000"/>
|
||||
<requirement type="money" quantity="30000"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="caravan" capacity="1" maxsize="10" auraregen="1.00">
|
||||
<maintenance type="horse" amount="2"/>
|
||||
<maintenance type="money" amount="3000" vital="yes"/>
|
||||
|
@ -47,8 +43,8 @@
|
|||
<requirement type="log" recycle="0.5" quantity="50"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="10"/>
|
||||
<requirement type="money" quantity="5000"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="dam" capacity="1" maxsize="50" auraregen="1.00">
|
||||
<maintenance type="log" recycle="0.5" amount="3"/>
|
||||
<maintenance type="money" amount="1000" vital="yes"/>
|
||||
|
@ -57,16 +53,16 @@
|
|||
<requirement type="log" recycle="0.5" quantity="500"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="250"/>
|
||||
<requirement type="money" quantity="25000"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="monument" capacity="1" auraregen="1.00">
|
||||
<construction skill="sk_building" minskill="4" reqsize="1">
|
||||
<requirement type="log" recycle="0.5" quantity="1"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="1"/>
|
||||
<requirement type="iron" recycle="0.5" quantity="1"/>
|
||||
<requirement type="money" quantity="400"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="stables" capacity="1" auraregen="1.00">
|
||||
<maintenance type="money" amount="150" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="2" reqsize="1">
|
||||
|
@ -74,8 +70,8 @@
|
|||
<requirement type="stone" recycle="0.5" quantity="2"/>
|
||||
<requirement type="iron" recycle="0.5" quantity="1"/>
|
||||
<requirement type="money" quantity="100"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="sawmill" capacity="1" auraregen="1.00">
|
||||
<maintenance type="money" amount="250" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="3" reqsize="1">
|
||||
|
@ -83,8 +79,8 @@
|
|||
<requirement type="stone" recycle="0.5" quantity="5"/>
|
||||
<requirement type="iron" recycle="0.5" quantity="3"/>
|
||||
<requirement type="money" quantity="200"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="smithy" capacity="1" auraregen="1.00">
|
||||
<function name="init" value="init_smithy"/>
|
||||
<maintenance type="money" amount="300" vital="yes"/>
|
||||
|
@ -94,8 +90,8 @@
|
|||
<requirement type="stone" recycle="0.5" quantity="5"/>
|
||||
<requirement type="iron" recycle="0.5" quantity="2"/>
|
||||
<requirement type="money" quantity="200"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="magictower" maxcapacity="2" maxsize="50" magic="yes" magres="40" fumblebonus="10" auraregen="1.75">
|
||||
<maintenance type="money" amount="1000" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="5" reqsize="50" maxsize="50">
|
||||
|
@ -105,8 +101,8 @@
|
|||
<requirement type="iron" recycle="0.5" quantity="150"/>
|
||||
<requirement type="laen" quantity="100"/>
|
||||
<requirement type="money" quantity="25000"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="academy" maxcapacity="25" maxsize="25" auraregen="1.00">
|
||||
<maintenance type="money" amount="1000" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="3" reqsize="25" maxsize="25">
|
||||
|
@ -114,16 +110,16 @@
|
|||
<requirement type="stone" recycle="0.5" quantity="125"/>
|
||||
<requirement type="iron" recycle="0.5" quantity="25"/>
|
||||
<requirement type="money" quantity="12500"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="harbour" capacity="1" maxcapacity="25" maxsize="25" auraregen="1.00">
|
||||
<maintenance type="money" amount="250" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="3" reqsize="25" maxsize="25">
|
||||
<requirement type="log" recycle="0.5" quantity="125"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="125"/>
|
||||
<requirement type="money" quantity="6250"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="quarry" capacity="1" auraregen="1.00">
|
||||
<maintenance type="money" amount="250" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="2" reqsize="1">
|
||||
|
@ -131,8 +127,8 @@
|
|||
<requirement type="log" recycle="0.5" quantity="5"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="1"/>
|
||||
<requirement type="money" quantity="250"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="mine" capacity="1" auraregen="1.00">
|
||||
<maintenance type="money" amount="500" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="4" reqsize="1">
|
||||
|
@ -140,8 +136,8 @@
|
|||
<requirement type="log" recycle="0.5" quantity="10"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="5"/>
|
||||
<requirement type="money" quantity="250"/>
|
||||
</construction></building>
|
||||
|
||||
</construction>
|
||||
</building>
|
||||
<building name="lighthouse" capacity="1" maxcapacity="4" auraregen="1.00">
|
||||
<maintenance type="money" amount="100" vital="yes"/>
|
||||
<construction skill="sk_building" minskill="3" reqsize="1">
|
||||
|
@ -149,6 +145,7 @@
|
|||
<requirement type="log" recycle="0.5" quantity="1"/>
|
||||
<requirement type="stone" recycle="0.5" quantity="2"/>
|
||||
<requirement type="money" quantity="100"/>
|
||||
</construction></building>
|
||||
</construction>
|
||||
</building>
|
||||
</buildings>
|
||||
|
||||
|
|
|
@ -5744,17 +5744,13 @@
|
|||
</string>
|
||||
|
||||
<string name="nr_calendar">
|
||||
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s.
|
||||
</text>
|
||||
<text locale="en">It is %s of the month of %s in the %d. year of
|
||||
%s.</text>
|
||||
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s.</text>
|
||||
<text locale="en">It is %s of the month of %s in the %d. year of %s.</text>
|
||||
</string>
|
||||
|
||||
<string name="nr_calendar_season">
|
||||
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s.
|
||||
Es ist %s.</text>
|
||||
<text locale="en">It is %s of the month of %s in the %d. year of
|
||||
%s. It is %s.</text>
|
||||
<text locale="de">Wir schreiben %s des Monats %s im Jahre %d %s. Es ist %s.</text>
|
||||
<text locale="en">It is %s of the month of %s in the %d. year of %s. It is %s.</text>
|
||||
</string>
|
||||
|
||||
<string name="status_aggressive">
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<eressea xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<xi:include href="messages.xml"/>
|
||||
|
||||
<comment>Localization</comment>
|
||||
<!-- Localization -->
|
||||
<xi:include href="de/strings.xml"/>
|
||||
<xi:include href="en/strings.xml"/>
|
||||
|
||||
|
@ -10,6 +10,10 @@
|
|||
<xi:include href="resources.xml"/>
|
||||
<xi:include href="ships.xml"/>
|
||||
<xi:include href="buildings.xml"/>
|
||||
<xi:include file="terrains.xml"/>
|
||||
<xi:include file="alchemy.xml"/>
|
||||
<xi:include file="technologies.xml"/>
|
||||
<xi:include file="skills.xml"/>
|
||||
|
||||
<game name="Eressea" welcome="eressea">
|
||||
<comment>Game specific</comment>
|
||||
|
@ -20,8 +24,8 @@
|
|||
<param name="nmr.timeout" value="4"/>
|
||||
<param name="nmr.removenewbie" value="1"/>
|
||||
<param name="GiveRestriction" value="3"/>
|
||||
<param name="database.gameid" value="0"/>
|
||||
<param name="hunger.long" value="1"/>
|
||||
<param name="database.gameid" value="0"/>
|
||||
<param name="firstturn" value="184"/>
|
||||
</game>
|
||||
<xi:include href="eressea/de/strings.xml"/>
|
||||
|
|
11383
src/res/messages.xml
11383
src/res/messages.xml
File diff suppressed because it is too large
Load Diff
|
@ -19,9 +19,12 @@ function wyrm()
|
|||
local map = {}
|
||||
local mapsize = 0
|
||||
local r
|
||||
|
||||
for r in regions() do
|
||||
mapsize=mapsize+1
|
||||
map[mapsize] = r
|
||||
if r.plane_id==plane then
|
||||
mapsize=mapsize+1
|
||||
map[mapsize] = r
|
||||
end
|
||||
end
|
||||
|
||||
local u
|
||||
|
@ -35,7 +38,7 @@ function wyrm()
|
|||
local index
|
||||
for index in map do
|
||||
local r = map[index]
|
||||
if r.x~=grave.x or r.y~=grave.y then
|
||||
if r~=grave then
|
||||
if (math.mod(r.x,2)==math.mod(get_turn(),2)) then
|
||||
r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'")
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue