2001-01-25 10:37:55 +01:00
|
|
|
|
/* vi: set ts=2:
|
|
|
|
|
*
|
2003-07-29 11:48:03 +02:00
|
|
|
|
* Eressea PB(E)M host Copyright (C) 1998-2003
|
2001-01-25 10:37:55 +01:00
|
|
|
|
* Christian Schlittchen (corwin@amber.kn-bremen.de)
|
|
|
|
|
* Katja Zedel (katze@felidae.kn-bremen.de)
|
|
|
|
|
* Henning Peters (faroul@beyond.kn-bremen.de)
|
2007-09-02 20:11:17 +02:00
|
|
|
|
* Enno Rehling (enno@eressea.de)
|
2001-01-25 10:37:55 +01:00
|
|
|
|
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
|
|
|
|
|
*
|
|
|
|
|
* based on:
|
|
|
|
|
*
|
|
|
|
|
* Atlantis v1.0 13 September 1993 Copyright 1993 by Russell Wallace
|
|
|
|
|
* Atlantis v1.7 Copyright 1996 by Alex Schr<EFBFBD>der
|
|
|
|
|
*
|
|
|
|
|
* This program may not be used, modified or distributed without
|
|
|
|
|
* prior permission by the authors of Eressea.
|
|
|
|
|
* This program may not be sold or used commercially without prior written
|
|
|
|
|
* permission from the authors.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ERESSEA_H
|
|
|
|
|
#define ERESSEA_H
|
2004-04-12 01:56:47 +02:00
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2001-12-15 13:26:04 +01:00
|
|
|
|
/*
|
2003-07-29 11:48:03 +02:00
|
|
|
|
* Features enabled:
|
2001-12-15 13:26:04 +01:00
|
|
|
|
* If you are lacking the settings.h, create a new file common/settings.h,
|
|
|
|
|
* and write #include <settings-eressea.h> (or whatever settings you want
|
|
|
|
|
* your game to use) in there.
|
|
|
|
|
* !!! DO NOT COMMIT THE SETTINGS.H FILE TO CVS !!!
|
|
|
|
|
*/
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#include "types.h"
|
2001-12-10 01:13:39 +01:00
|
|
|
|
|
2004-06-27 18:56:01 +02:00
|
|
|
|
#define ALLIED(f1, f2) (f1==f2 || (f1->alliance && f1->alliance==f2->alliance))
|
2001-02-04 11:04:36 +01:00
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
/* experimental gameplay features (that don't affect the savefile) */
|
|
|
|
|
#define GOBLINKILL /* Goblin-Spezialklau kann t<>dlich enden */
|
|
|
|
|
#define HERBS_ROT /* herbs owned by units have a chance to rot. */
|
|
|
|
|
#define SHIPDAMAGE /* Schiffsbesch<63>digungen */
|
|
|
|
|
#define INSECT_POTION /* Spezialtrank f<>r Insekten */
|
2008-02-05 16:23:07 +01:00
|
|
|
|
#define ORCIFICATION /* giving snotlings to the peasants gets counted */
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#undef TROLLSAVE /* saving throw for dead trolls */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#include <settings.h>
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
#define MONSTER_FACTION 0 /* Die Partei, in der die Monster sind. */
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#define MAXPEASANTS_PER_AREA 10 /* number of peasants per region-size */
|
|
|
|
|
#define TREESIZE (MAXPEASANTS_PER_AREA-2) /* space used by trees (in #peasants) */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#define PEASANTFORCE 0.75 /* Chance einer Vermehrung trotz 90% Auslastung */
|
|
|
|
|
#define HERBROTCHANCE 5 /* Verrottchance f<>r Kr<4B>uter (ifdef HERBS_ROT) */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* Geb<65>udegr<67><72>e = Minimalbelagerer */
|
|
|
|
|
#define SIEGEFACTOR 2
|
|
|
|
|
|
|
|
|
|
/** Magic */
|
|
|
|
|
#define MAXMAGICIANS 3
|
|
|
|
|
#define MAXALCHEMISTS 3
|
|
|
|
|
|
|
|
|
|
/** Plagues **/
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#define PLAGUE_CHANCE 0.1F /* Seuchenwahrscheinlichkeit (siehe plagues()) */
|
|
|
|
|
#define PLAGUE_VICTIMS 0.2F /* % Betroffene */
|
|
|
|
|
#define PLAGUE_HEALCHANCE 0.25F /* Wahrscheinlichkeit Heilung */
|
|
|
|
|
#define PLAGUE_HEALCOST 30 /* Heilkosten */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/** Monster */
|
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#define MONSTERATTACK 0.4F /* Chance f<>r Monsterangriff */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/** Geb<65>ude */
|
2007-06-20 02:34:02 +02:00
|
|
|
|
#define COLLAPSE_CHANCE 0.4F /* Chance f<>r Einsturz bei unversorgtem Gebaeude */
|
|
|
|
|
#define COLLAPSE_SURVIVAL 0.5F /* Soviele % <20>berleben den Einsturz */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* Magiesystem */
|
|
|
|
|
#define NIGHT_EYE_TALENT 5
|
|
|
|
|
|
|
|
|
|
/* Bewegungsweiten: */
|
|
|
|
|
#define BP_WALKING 4
|
|
|
|
|
#define BP_RIDING 6
|
|
|
|
|
#define BP_UNICORN 9
|
|
|
|
|
#define BP_DRAGON 4
|
|
|
|
|
|
|
|
|
|
#define BP_NORMAL 3
|
|
|
|
|
#define BP_ROAD 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Hier endet der Teil von eressea.h, der die defines f<EFBFBD>r die
|
|
|
|
|
* Spielwelt Eressea enth<EFBFBD>lt, und beginnen die allgemeinen Routinen
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#define ENCCHANCE 10 /* %-Chance f<>r einmalige Zufallsbegegnung */
|
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
#define DISPLAYSIZE 8191 /* max. L<>nge einer Beschreibung, ohne trailing 0 */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#define NAMESIZE 127 /* max. L<>nge eines Namens, ohne trailing 0 */
|
|
|
|
|
#define IDSIZE 15 /* max. L<>nge einer no (als String), ohne trailing 0 */
|
|
|
|
|
#define KEYWORDSIZE 15 /* max. L<>nge eines Keyword, ohne trailing 0 */
|
|
|
|
|
#define OBJECTIDSIZE (NAMESIZE+5+IDSIZE) /* max. L<>nge der Strings, die
|
2005-01-19 21:33:13 +01:00
|
|
|
|
* von struct unitname, etc. zur<EFBFBD>ckgegeben werden. ohne die 0 */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
#define BAGCAPACITY 20000 /* soviel pa<70>t in einen Bag of Holding */
|
2004-11-07 10:01:22 +01:00
|
|
|
|
#define STRENGTHCAPACITY 50000 /* zus<75>tzliche Tragkraft beim Kraftzauber (deprecated) */
|
|
|
|
|
#define STRENGTHMULTIPLIER 50 /* multiplier for trollbelt */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* ----------------- Befehle ----------------------------------- */
|
|
|
|
|
|
|
|
|
|
extern const char *keywords[MAXKEYWORDS];
|
|
|
|
|
extern const char *parameters[MAXPARAMS];
|
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
/** report options **/
|
|
|
|
|
#define want(option) (1<<option)
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern const char *options[MAXOPTIONS];
|
|
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------- */
|
|
|
|
|
|
2004-04-12 01:56:47 +02:00
|
|
|
|
extern int shipspeed(const struct ship * sh, const struct unit * u);
|
|
|
|
|
extern int init_data(const char * filename);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
#define i2b(i) ((boolean)((i)?(true):(false)))
|
|
|
|
|
|
|
|
|
|
typedef struct ally {
|
|
|
|
|
struct ally *next;
|
|
|
|
|
struct faction *faction;
|
|
|
|
|
int status;
|
|
|
|
|
} ally;
|
|
|
|
|
|
|
|
|
|
void remove_empty_units_in_region(struct region *r);
|
|
|
|
|
void remove_empty_units(void);
|
2002-05-02 01:47:32 +02:00
|
|
|
|
void remove_empty_factions(boolean writedropouts);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
typedef struct strlist {
|
|
|
|
|
struct strlist *next;
|
|
|
|
|
char * s;
|
|
|
|
|
} strlist;
|
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
#define fval(u, i) ((u)->flags & (i))
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#define fset(u, i) ((u)->flags |= (i))
|
|
|
|
|
#define freset(u, i) ((u)->flags &= ~(i))
|
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern int turn;
|
2004-04-12 01:56:47 +02:00
|
|
|
|
extern int quiet;
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* parteinummern */
|
|
|
|
|
extern boolean faction_id_is_unused(int);
|
|
|
|
|
|
|
|
|
|
/* leuchtturm */
|
|
|
|
|
extern boolean check_leuchtturm(struct region * r, struct faction * f);
|
|
|
|
|
extern void update_lighthouse(struct building * lh);
|
2004-02-21 16:09:06 +01:00
|
|
|
|
extern struct unit_list * get_lighthouses(const struct region * r);
|
2005-04-27 23:03:08 +02:00
|
|
|
|
extern int lighthouse_range(const struct building * b, const struct faction * f);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* skills */
|
magicskillboost
-- implementiert. Kann nur einmal pro Partei verwendet werden, und nur von einem Magier. Müssen wir erklären.
Amulett des wahren Sehens und Ring der Unsichtbarkeit geben lediglich einen Bonus auf Wahrnehmung (+2) und Tarnung (+4).
-- das define war nicht aktiviert
Halblinge haben Armbrustschiessen +0 (statt +1).
-- spearates Rassenfile für WDW
Es gibt spezielle Regeln für Allianzen, und der HELFE und KONTAKTIERE Befehl sind eingeschränkt. Konkret kann kein HELP_FIGHT HELP_GUARD HELP_FSTEALTH HELP_MONEY gegeben werden (die anderen sind erlaubt).
-- mit #defeine ALLIES_ONLY definiert
Jede Allianz kann bis zu 15 Magier und 15 Alchemisten haben. Jede einzelne Partei der Allianz kann dabei nicht mehr als 15/Anzahl_Parteien (aufgerundet) Magier bzw. Alchemisten haben, und die Gesamtsumme darf 15 nicht übersteigen.
-- mit #define ALLIANCE_LIMITS gemacht.
Die Startgeschenke (Personen, Silber, ...) werden pro Allianz, nicht pro Spieler verteilt. Größere Allianzen bekommen also weniger pro Spieler.
-- Nochmal geändert: Die Allianzen kriegen jede 168 Personen zum Start, weil sich das gut aufteilen lässt. Das wird auf 28 Einheiten pro Partei gesplittet, jede Einheit hat eines der Talente, außer der Starteinheit, die hat den magicskillboost. Einige Skills kommen öfter vor als andere, das ist nicht einfach vermeidbar. Sollte aber auch wurscht sein, es geht primär darum, lehren zu können.
Es gibt ein Einheitenlimit von 1000 Einheiten pro Allianz.
-- die Regel sparen wir uns einfach mal.
2003-12-14 22:45:47 +01:00
|
|
|
|
extern int max_skill(struct faction * f, skill_t sk);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern int count_skill(struct faction * f, skill_t sk);
|
|
|
|
|
|
|
|
|
|
/* direction, geography */
|
|
|
|
|
extern const char *directions[];
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern direction_t finddirection(const char *s, const struct locale *);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern int findoption(const char *s, const struct locale * lang);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* special units */
|
2005-02-12 22:25:03 +01:00
|
|
|
|
void make_undead_unit(struct unit *);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
extern struct region *regions;
|
|
|
|
|
extern struct faction *factions;
|
|
|
|
|
|
|
|
|
|
void addstrlist(strlist ** SP, const char *s);
|
|
|
|
|
|
|
|
|
|
int armedmen(const struct unit * u);
|
|
|
|
|
|
2007-06-26 11:32:28 +02:00
|
|
|
|
unsigned int atoip(const char *s);
|
|
|
|
|
unsigned int getuint(void);
|
|
|
|
|
int getint(void);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern const char *igetstrtoken(const char *s);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
|
2004-06-21 18:45:27 +02:00
|
|
|
|
extern void init_tokens(const struct order * ord); /* initialize token parsing */
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern skill_t findskill(const char *s, const struct locale * lang);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern keyword_t findkeyword(const char *s, const struct locale * lang);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern param_t findparam(const char *s, const struct locale * lang);
|
2001-04-16 16:34:19 +02:00
|
|
|
|
extern param_t getparam(const struct locale * lang);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
extern int atoi36(const char * s);
|
2007-06-26 11:32:28 +02:00
|
|
|
|
#define getid() atoi36((const char *)getstrtoken())
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#define unitid(x) itoa36((x)->no)
|
|
|
|
|
|
|
|
|
|
#define getshipid() getid()
|
|
|
|
|
#define getfactionid() getid()
|
|
|
|
|
|
|
|
|
|
#define buildingid(x) itoa36((x)->no)
|
|
|
|
|
#define shipid(x) itoa36((x)->no)
|
|
|
|
|
#define factionid(x) itoa36((x)->no)
|
|
|
|
|
#define curseid(x) itoa36((x)->no)
|
|
|
|
|
|
|
|
|
|
extern boolean cansee(const struct faction * f, const struct region * r, const struct unit * u, int modifier);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
boolean cansee_durchgezogen(const struct faction * f, const struct region * r, const struct unit * u, int modifier);
|
2007-02-14 23:06:06 +01:00
|
|
|
|
extern boolean cansee_unit(const struct unit * u, const struct unit * target, int modifier);
|
2001-12-10 01:13:39 +01:00
|
|
|
|
boolean seefaction(const struct faction * f, const struct region * r, const struct unit * u, int modifier);
|
|
|
|
|
extern int effskill(const struct unit * u, skill_t sk);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2004-02-09 22:12:46 +01:00
|
|
|
|
extern int lovar(double xpct_x2);
|
|
|
|
|
/* returns a value between [0..xpct_2], generated with two dice */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
int distribute(int old, int new_value, int n);
|
|
|
|
|
|
|
|
|
|
int newunitid(void);
|
|
|
|
|
int forbiddenid(int id);
|
|
|
|
|
int newcontainerid(void);
|
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
extern struct unit *createunit(struct region * r, struct faction * f, int number, const struct race * rc);
|
|
|
|
|
extern void create_unitid(struct unit *u, int id);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern boolean getunitpeasants;
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern struct unit *getunitg(const struct region * r, const struct faction * f);
|
|
|
|
|
extern struct unit *getunit(const struct region * r, const struct faction * f);
|
|
|
|
|
|
|
|
|
|
extern int read_unitid(const struct faction * f, const struct region * r);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2002-09-02 22:36:12 +02:00
|
|
|
|
extern int alliedunit(const struct unit * u, const struct faction * f2, int mode);
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern int alliedfaction(const struct plane * pl, const struct faction * f,
|
2002-12-14 16:49:18 +01:00
|
|
|
|
const struct faction * f2, int mode);
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern int alliedgroup(const struct plane * pl, const struct faction * f,
|
|
|
|
|
const struct faction * f2, const struct ally * sf,
|
2002-12-14 16:49:18 +01:00
|
|
|
|
int mode);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
struct faction *findfaction(int n);
|
|
|
|
|
struct faction *getfaction(void);
|
|
|
|
|
|
2001-04-26 19:41:06 +02:00
|
|
|
|
struct unit *findunitg(int n, const struct region * hint);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
struct unit *findunit(int n);
|
|
|
|
|
|
|
|
|
|
struct unit *findunitr(const struct region * r, int n);
|
|
|
|
|
struct region *findunitregion(const struct unit * su);
|
|
|
|
|
|
2007-06-27 22:39:49 +02:00
|
|
|
|
extern char *estring(const char *s);
|
|
|
|
|
extern char *estring_i(char *s);
|
|
|
|
|
extern char *cstring(const char *s);
|
|
|
|
|
extern char *cstring_i(char *s);
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern const char *unitname(const struct unit * u);
|
|
|
|
|
extern char * write_unitname(const struct unit * u, char * buffer, size_t size);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
struct building *largestbuilding(const struct region * r, boolean img);
|
|
|
|
|
|
2004-06-21 18:45:27 +02:00
|
|
|
|
extern int count_all(const struct faction * f);
|
|
|
|
|
extern int count_migrants (const struct faction * f);
|
|
|
|
|
extern int count_maxmigrants(const struct faction * f);
|
|
|
|
|
|
2002-02-15 17:13:30 +01:00
|
|
|
|
extern boolean teure_talente(const struct unit * u);
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern const struct race * findrace(const char *, const struct locale *);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
int eff_stealth(const struct unit * u, const struct region * r);
|
|
|
|
|
void scale_number(struct unit * u, int n);
|
|
|
|
|
int unit_max_hp(const struct unit * u);
|
|
|
|
|
int ispresent(const struct faction * f, const struct region * r);
|
|
|
|
|
|
|
|
|
|
int check_option(struct faction * f, int option);
|
2004-06-21 18:45:27 +02:00
|
|
|
|
extern void parse(keyword_t kword, int (*dofun)(struct unit *, struct order *), boolean thisorder);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* Anzahl Personen in einer Einheit festlegen. NUR (!) mit dieser Routine,
|
|
|
|
|
* sonst gro<EFBFBD>es Ungl<EFBFBD>ck. Durch asserts an ein paar Stellen abgesichert. */
|
|
|
|
|
void verify_data(void);
|
|
|
|
|
|
|
|
|
|
void stripfaction(struct faction * f);
|
|
|
|
|
void freestrlist(strlist * s);
|
|
|
|
|
|
|
|
|
|
int change_hitpoints(struct unit *u, int value);
|
|
|
|
|
|
|
|
|
|
int weight(const struct unit * u);
|
|
|
|
|
void changeblockchaos(void);
|
|
|
|
|
|
2004-02-21 16:52:44 +01:00
|
|
|
|
/* intervall, in dem die regionen der partei zu finden sind */
|
|
|
|
|
extern struct region *firstregion(struct faction * f);
|
|
|
|
|
extern struct region *lastregion(struct faction * f);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
void inituhash(void);
|
|
|
|
|
void uhash(struct unit * u);
|
|
|
|
|
void uunhash(struct unit * u);
|
|
|
|
|
struct unit *ufindhash(int i);
|
|
|
|
|
|
2001-12-30 09:39:21 +01:00
|
|
|
|
void fhash(struct faction * f);
|
|
|
|
|
void funhash(struct faction * f);
|
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
boolean idle(struct faction * f);
|
|
|
|
|
boolean unit_has_cursed_item(struct unit *u);
|
|
|
|
|
|
|
|
|
|
/* simple garbage collection: */
|
|
|
|
|
void * gc_add(void * p);
|
2007-08-10 09:03:23 +02:00
|
|
|
|
void addmessage(struct region * r, struct faction * f, const char *s, msg_t mtype, int level);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
/* grammatik-flags: */
|
|
|
|
|
#define GF_NONE 0
|
|
|
|
|
/* singular, ohne was dran */
|
|
|
|
|
#define GF_PLURAL 1
|
|
|
|
|
/* Angaben in Mehrzahl */
|
|
|
|
|
#define GF_ARTICLE 8
|
|
|
|
|
/* der, die, eine */
|
|
|
|
|
#define GF_SPECIFIC 16
|
|
|
|
|
/* der, die, das vs. ein, eine */
|
|
|
|
|
#define GF_DETAILED 32
|
|
|
|
|
/* mehr Informationen. z.b. stra<72>e zu 50% */
|
2007-12-18 23:58:58 +01:00
|
|
|
|
#define GF_PURE 64
|
|
|
|
|
/* untranslated */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
|
|
|
|
#define GUARD_NONE 0
|
|
|
|
|
#define GUARD_TAX 1
|
|
|
|
|
/* Verhindert Steuereintreiben */
|
|
|
|
|
#define GUARD_MINING 2
|
|
|
|
|
/* Verhindert Bergbau */
|
|
|
|
|
#define GUARD_TREES 4
|
|
|
|
|
/* Verhindert Waldarbeiten */
|
|
|
|
|
#define GUARD_TRAVELTHRU 8
|
|
|
|
|
/* Blockiert Durchreisende */
|
|
|
|
|
#define GUARD_LANDING 16
|
|
|
|
|
/* Verhindert Ausstieg + Weiterreise */
|
|
|
|
|
#define GUARD_CREWS 32
|
|
|
|
|
/* Verhindert Unterhaltung auf Schiffen */
|
2002-04-21 09:31:27 +02:00
|
|
|
|
#define GUARD_RECRUIT 64
|
|
|
|
|
/* Verhindert Rekrutieren */
|
2002-04-21 19:22:48 +02:00
|
|
|
|
#define GUARD_PRODUCE 128
|
|
|
|
|
/* Verhindert Abbau von Resourcen mit RTF_LIMITED */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#define GUARD_ALL 0xFFFF
|
|
|
|
|
|
2007-02-12 08:27:04 +01:00
|
|
|
|
extern void setstatus(struct unit * u, int status);
|
|
|
|
|
/* !< sets combatstatus of a unit */
|
|
|
|
|
extern void setguard(struct unit * u, unsigned int flags);
|
|
|
|
|
/* !< setzt die guard-flags der Einheit */
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern unsigned int getguard(const struct unit * u);
|
|
|
|
|
/* liest die guard-flags der Einheit */
|
|
|
|
|
extern void guard(struct unit * u, unsigned int mask);
|
|
|
|
|
/* Einheit setzt "BEWACHE", rassenspezifzisch.
|
|
|
|
|
* 'mask' kann einzelne flags zus<EFBFBD>tzlich und-maskieren.
|
|
|
|
|
*/
|
|
|
|
|
|
2003-03-24 23:42:41 +01:00
|
|
|
|
extern boolean hunger(int number, struct unit * u);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern int lifestyle(const struct unit*);
|
|
|
|
|
extern int besieged(const struct unit * u);
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern int maxworkingpeasants(const struct region * r);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2005-11-20 13:58:59 +01:00
|
|
|
|
extern int wage(const struct region *r, const struct faction *f, const struct race * rc);
|
2005-11-25 23:09:59 +01:00
|
|
|
|
extern int maintenance_cost(const struct unit * u);
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern struct message * movement_error(struct unit * u, const char * token, struct order * ord, int error_code);
|
2004-05-31 18:21:03 +02:00
|
|
|
|
extern boolean move_blocked(const struct unit * u, const struct region *src, const struct region *dest);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern void add_income(struct unit * u, int type, int want, int qty);
|
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
/* movewhere error codes */
|
|
|
|
|
enum {
|
|
|
|
|
E_MOVE_OK = 0, /* possible to move */
|
|
|
|
|
E_MOVE_NOREGION, /* no region exists in this direction */
|
|
|
|
|
E_MOVE_BLOCKED /* cannot see this region, there is a blocking border. */
|
|
|
|
|
};
|
2007-08-10 09:03:23 +02:00
|
|
|
|
extern int movewhere(const struct unit *u, const char * token, struct region * r, struct region** resultp);
|
2007-06-20 02:34:02 +02:00
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
extern const char * basepath(void);
|
2001-02-03 14:45:35 +01:00
|
|
|
|
extern const char * resourcepath(void);
|
2001-02-05 17:11:59 +01:00
|
|
|
|
extern void kernel_init(void);
|
|
|
|
|
extern void kernel_done(void);
|
2001-01-25 10:37:55 +01:00
|
|
|
|
|
2001-04-13 16:39:57 +02:00
|
|
|
|
extern void reorder_owners(struct region * r);
|
|
|
|
|
|
2002-09-02 22:36:12 +02:00
|
|
|
|
extern const char *localenames[];
|
2001-05-28 20:24:44 +02:00
|
|
|
|
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
#include <stdafx.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-12-10 01:13:39 +01:00
|
|
|
|
/** compatibility: **/
|
|
|
|
|
extern race_t old_race(const struct race *);
|
|
|
|
|
extern const struct race * new_race[];
|
|
|
|
|
|
2001-12-13 22:57:46 +01:00
|
|
|
|
/* globale settings des Spieles */
|
|
|
|
|
typedef struct settings {
|
2004-06-07 06:53:28 +02:00
|
|
|
|
const char *gamename;
|
2005-05-20 11:08:39 +02:00
|
|
|
|
boolean unitsperalliance;
|
2004-06-07 06:53:28 +02:00
|
|
|
|
unsigned int maxunits;
|
|
|
|
|
struct attrib *attribs;
|
|
|
|
|
unsigned int data_version;
|
2004-01-04 23:29:33 +01:00
|
|
|
|
unsigned int data_turn;
|
2004-06-07 06:53:28 +02:00
|
|
|
|
boolean disabled[MAXKEYWORDS];
|
|
|
|
|
struct param * parameters;
|
|
|
|
|
void * vm_state;
|
2006-11-04 22:23:45 +01:00
|
|
|
|
float producexpchance;
|
2005-11-20 13:58:59 +01:00
|
|
|
|
|
2005-11-25 23:09:59 +01:00
|
|
|
|
struct global_functions {
|
|
|
|
|
int (*wage)(const struct region *r, const struct faction * f, const struct race * rc);
|
|
|
|
|
int (*maintenance)(const struct unit * u);
|
|
|
|
|
} functions;
|
2001-12-13 22:57:46 +01:00
|
|
|
|
} settings;
|
|
|
|
|
extern settings global;
|
|
|
|
|
|
2002-02-06 09:06:02 +01:00
|
|
|
|
extern int produceexp(struct unit * u, skill_t sk, int n);
|
|
|
|
|
|
2002-10-13 13:08:04 +02:00
|
|
|
|
extern boolean sqlpatch;
|
2005-04-23 11:47:03 +02:00
|
|
|
|
extern boolean lomem; /* save memory */
|
|
|
|
|
|
2002-11-02 18:24:41 +01:00
|
|
|
|
extern const char * dbrace(const struct race * rc);
|
2003-07-29 11:48:03 +02:00
|
|
|
|
|
|
|
|
|
extern void set_param(struct param ** p, const char * name, const char * data);
|
|
|
|
|
extern const char* get_param(const struct param * p, const char * name);
|
|
|
|
|
|
2004-06-27 18:56:01 +02:00
|
|
|
|
extern boolean ExpensiveMigrants(void);
|
2003-07-29 12:04:55 +02:00
|
|
|
|
extern int NMRTimeout(void);
|
2004-08-03 17:34:26 +02:00
|
|
|
|
extern int LongHunger(const struct unit * u);
|
2003-07-29 12:04:55 +02:00
|
|
|
|
extern boolean TradeDisabled(void);
|
2003-07-29 11:48:03 +02:00
|
|
|
|
extern int SkillCap(skill_t sk);
|
2005-01-08 12:40:14 +01:00
|
|
|
|
extern int NewbieImmunity(void);
|
2004-06-27 18:56:01 +02:00
|
|
|
|
extern int AllianceAuto(void); /* flags that allied factions get automatically */
|
|
|
|
|
extern int AllianceRestricted(void); /* flags restricted to allied factions */
|
2004-06-21 18:45:27 +02:00
|
|
|
|
extern struct order * default_order(const struct locale * lang);
|
2004-06-23 00:00:36 +02:00
|
|
|
|
extern int entertainmoney(const struct region * r);
|
2004-06-21 18:45:27 +02:00
|
|
|
|
|
2007-06-20 02:34:02 +02:00
|
|
|
|
extern void plagues(struct region * r, boolean ismagic);
|
|
|
|
|
|
|
|
|
|
extern struct attrib_type at_guard;
|
2006-07-29 16:07:45 +02:00
|
|
|
|
|
|
|
|
|
#if 1 /* disable to count all units */
|
|
|
|
|
# define count_unit(u) playerrace(u->race)
|
|
|
|
|
#else
|
|
|
|
|
# define count_unit(u) 1
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-04-20 17:18:43 +02:00
|
|
|
|
#if XECMD_MODULE
|
2007-12-03 20:26:17 +01:00
|
|
|
|
extern struct attrib_type at_xontormiaexpress;
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-07-29 11:48:03 +02:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2001-01-25 10:37:55 +01:00
|
|
|
|
#endif
|