defines für die spiele in settings-file ausgelagert.

code angepasst.
einheitenlimit in xml datei.
achtung: nach dem update muss eine settings.h datei angelegt werden.
This commit is contained in:
Enno Rehling 2001-12-15 12:26:04 +00:00
parent 9e183e4393
commit a44a17585d
37 changed files with 232 additions and 180 deletions

View file

@ -36,9 +36,7 @@
#ifdef AT_OPTION #ifdef AT_OPTION
# include "option.h" # include "option.h"
#endif #endif
#ifdef AT_MOVED #include "moved.h"
# include "moved.h"
#endif
/* util includes */ /* util includes */
#include <attrib.h> #include <attrib.h>
@ -65,9 +63,7 @@ init_attributes(void)
init_racename(); init_racename();
init_synonym(); init_synonym();
#ifdef AT_MOVED
init_moved(); init_moved();
#endif
#ifdef AT_OPTION #ifdef AT_OPTION
init_option(); init_option();
#endif #endif

View file

@ -1014,7 +1014,7 @@ report_computer(FILE * F, faction * f, const seen_region * seen,
fprintf(F, "\"%s\";Beschr\n", r->display); fprintf(F, "\"%s\";Beschr\n", r->display);
#endif #endif
if (landregion(rterrain(r))) { if (landregion(rterrain(r))) {
#ifdef GROWING_TREES #if GROWING_TREES
int trees = rtrees(r,2); int trees = rtrees(r,2);
int ytrees = rtrees(r,1); int ytrees = rtrees(r,1);
# ifdef RESOURCECOMPAT # ifdef RESOURCECOMPAT
@ -1050,7 +1050,7 @@ report_computer(FILE * F, faction * f, const seen_region * seen,
if (seemode>=see_unit) { if (seemode>=see_unit) {
struct demand * dmd = r->land->demands; struct demand * dmd = r->land->demands;
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
struct rawmaterial * res = r->resources; struct rawmaterial * res = r->resources;
fprintf(F, "%d;Silber\n", rmoney(r)); fprintf(F, "%d;Silber\n", rmoney(r));

View file

@ -73,7 +73,9 @@
#include <attributes/racename.h> #include <attributes/racename.h>
#include <attributes/orcification.h> #include <attributes/orcification.h>
#include <items/seed.h> #if GROWING_TREES
# include <items/seed.h>
#endif
/* - static global symbols ------------------------------------- */ /* - static global symbols ------------------------------------- */
typedef struct spende { typedef struct spende {
@ -1606,7 +1608,7 @@ enum {
AFL_DONE = 1<<0, AFL_DONE = 1<<0,
AFL_LOWSKILL = 1<<1 AFL_LOWSKILL = 1<<1
}; };
#ifdef NEW_RESOURCEGROWTH
static int static int
required(int want, double save) required(int want, double save)
{ {
@ -1615,6 +1617,7 @@ required(int want, double save)
return norders; return norders;
} }
#if NEW_RESOURCEGROWTH
static void static void
leveled_allocation(const allocator * self, region * r, allocation * alist) leveled_allocation(const allocator * self, region * r, allocation * alist)
{ {
@ -1737,7 +1740,7 @@ split_allocations(region * r)
i_change(&al->unit->items, itype, al->get); i_change(&al->unit->items, itype, al->get);
change_skill(al->unit, itype->construction->skill, change_skill(al->unit, itype->construction->skill,
al->unit->number * PRODUCEEXP); al->unit->number * PRODUCEEXP);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
fset(r, RF_DH); fset(r, RF_DH);
#endif #endif
} }
@ -2507,7 +2510,7 @@ plant(region *r, unit *u, int raw)
"plant%u:unit%r:region%i:amount%X:herb", u, r, planted, htype->itype->rtype)); "plant%u:unit%r:region%i:amount%X:herb", u, r, planted, htype->itype->rtype));
} }
#ifdef GROWING_TREES #if GROWING_TREES
void void
planttrees(region *r, unit *u, int raw) planttrees(region *r, unit *u, int raw)
{ {
@ -2589,21 +2592,21 @@ pflanze(region *r, unit *u)
plant(r, u, m); plant(r, u, m);
return; return;
} }
#if GROWING_TREES
else if (p==P_TREES){ else if (p==P_TREES){
planttrees(r, u, m); planttrees(r, u, m);
return; return;
} }
else if (itype!=NULL){ else if (itype!=NULL){
#ifdef GROWING_TREES
if (itype==&it_mallornseed || itype==&it_seed){ if (itype==&it_mallornseed || itype==&it_seed){
planttrees(r, u, m); planttrees(r, u, m);
return; return;
} }
#endif
} }
#endif
} }
#ifdef GROWING_TREES #if GROWING_TREES
/* züchte bäume */ /* züchte bäume */
void void
@ -2725,9 +2728,11 @@ zuechte(region *r, unit *u)
case P_HERBS: case P_HERBS:
plant(r, u, m); plant(r, u, m);
return; return;
#if GROWING_TREES
case P_TREES: case P_TREES:
breedtrees(r, u, m); breedtrees(r, u, m);
return; return;
#endif
default: default:
breedhorses(r, u); breedhorses(r, u);
return; return;
@ -3260,7 +3265,7 @@ produce(void)
zuechte(r, u); zuechte(r, u);
break; break;
#ifdef GROWING_TREES #if GROWING_TREES
case K_PFLANZE: case K_PFLANZE:
planttrees(r, u, INT_MAX); planttrees(r, u, INT_MAX);
break; break;
@ -3309,11 +3314,11 @@ init_economy(void)
add_allocator(make_allocator(item2resource(olditemtype[I_HORSE]), attrib_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_HORSE]), attrib_allocation));
add_allocator(make_allocator(item2resource(olditemtype[I_WOOD]), attrib_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_WOOD]), attrib_allocation));
add_allocator(make_allocator(item2resource(olditemtype[I_MALLORN]), attrib_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_MALLORN]), attrib_allocation));
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
add_allocator(make_allocator(item2resource(olditemtype[I_STONE]), leveled_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_STONE]), leveled_allocation));
add_allocator(make_allocator(item2resource(olditemtype[I_IRON]), leveled_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_IRON]), leveled_allocation));
add_allocator(make_allocator(item2resource(olditemtype[I_LAEN]), leveled_allocation)); add_allocator(make_allocator(item2resource(olditemtype[I_LAEN]), leveled_allocation));
#ifdef GROWING_TREES #if GROWING_TREES
add_allocator(make_allocator(&rt_seed, attrib_allocation)); add_allocator(make_allocator(&rt_seed, attrib_allocation));
add_allocator(make_allocator(&rt_mallornseed, attrib_allocation)); add_allocator(make_allocator(&rt_mallornseed, attrib_allocation));
#endif #endif

View file

@ -579,7 +579,7 @@ migrate(region * r)
* das hatte ich geändert. jemand hat es wieder gelöscht, toll. * das hatte ich geändert. jemand hat es wieder gelöscht, toll.
* ich habe es wieder aktiviert, muß getestet werden. * ich habe es wieder aktiviert, muß getestet werden.
*/ */
#ifndef GROWING_TREES #if GROWING_TREES == 0
rsettrees(r, rtrees(r) + m->trees); rsettrees(r, rtrees(r) + m->trees);
#endif #endif
*hp = m->next; *hp = m->next;
@ -643,7 +643,7 @@ horses(region * r)
assert(rhorses(r) >= 0); assert(rhorses(r) >= 0);
} }
#ifdef GROWING_TREES #if GROWING_TREES
static int static int
count_race(const region *r, const race *rc) count_race(const region *r, const race *rc)
@ -878,7 +878,7 @@ trees(region * r)
} }
#endif #endif
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
extern attrib_type at_laen; extern attrib_type at_laen;
static void static void
iron(region * r) iron(region * r)
@ -909,7 +909,7 @@ void
demographics(void) demographics(void)
{ {
region *r; region *r;
#ifdef GROWING_TREES #if GROWING_TREES
int current_season = season(turn); int current_season = season(turn);
int last_weeks_season = season(turn-1); int last_weeks_season = season(turn-1);
#endif #endif
@ -956,17 +956,17 @@ demographics(void)
r->age++; r->age++;
horses(r); horses(r);
#ifdef GROWING_TREES #if GROWING_TREES
if(current_season != SEASON_WINTER) { if(current_season != SEASON_WINTER) {
trees(r, current_season, last_weeks_season); trees(r, current_season, last_weeks_season);
} }
#else #else
trees(r); trees(r);
#endif #endif
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
iron(r);
#else
update_resources(r); update_resources(r);
#else
iron(r);
#endif #endif
migrate(r); migrate(r);
} }
@ -2859,7 +2859,7 @@ ageing(void)
static int static int
maxunits(faction *f) maxunits(faction *f)
{ {
return MAXUNITS + 400 * fspecial(f, FS_ADMINISTRATOR); return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR)));
} }
static void static void
@ -2981,7 +2981,9 @@ setdefaults (void)
case K_TAX: case K_TAX:
case K_TEACH: case K_TEACH:
case K_ZUECHTE: case K_ZUECHTE:
#if GROWING_TREES
case K_PFLANZE: case K_PFLANZE:
#endif
case K_BIETE: case K_BIETE:
case K_PIRACY: case K_PIRACY:
if (idle (u->faction)) { if (idle (u->faction)) {

View file

@ -42,7 +42,7 @@ extern void sinkships(void);
void processorders(void); void processorders(void);
extern int count_migrants (const struct faction * f); extern int count_migrants (const struct faction * f);
#ifdef GROWING_TREES #if GROWING_TREES
extern attrib_type at_germs; extern attrib_type at_germs;
#endif #endif

View file

@ -125,7 +125,7 @@ dissolve_units(void)
break; break;
case 2: case 2:
if(r->land) { if(r->land) {
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2) + n); rsettrees(r, 2, rtrees(r,2) + n);
#else #else
rsettrees(r, rtrees(r) + n); rsettrees(r, rtrees(r) + n);
@ -733,7 +733,7 @@ volcano_outbreak(region *r)
/* Vulkan-Region verwüsten */ /* Vulkan-Region verwüsten */
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, 0); rsettrees(r, 2, 0);
rsettrees(r, 1, 0); rsettrees(r, 1, 0);
rsettrees(r, 0, 0); rsettrees(r, 0, 0);
@ -777,7 +777,7 @@ volcano_outbreak(region *r)
if (rn) { if (rn) {
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, 0); rsettrees(r, 2, 0);
rsettrees(r, 1, 0); rsettrees(r, 1, 0);
rsettrees(r, 0, 0); rsettrees(r, 0, 0);
@ -1205,7 +1205,7 @@ randomevents(void)
* bekommen. */ * bekommen. */
if (r->land && !fval(r, RF_MALLORN)) { if (r->land && !fval(r, RF_MALLORN)) {
#ifdef GROWING_TREES #if GROWING_TREES
int trees = rtrees(r,2); int trees = rtrees(r,2);
#else #else
int trees = rtrees(r); int trees = rtrees(r);
@ -1221,7 +1221,7 @@ randomevents(void)
} }
} }
} }
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, trees); rsettrees(r, 2, trees);
#else #else
rsettrees(r, trees); rsettrees(r, trees);
@ -1479,7 +1479,7 @@ randomevents(void)
for (r = regions; r; r = r->next) { for (r = regions; r; r = r->next) {
if (fval(r, RF_CHAOTIC) ||(r->x >= -13 && r->x <= -6 && r->y >= 50 && r->y <= 57)) { if (fval(r, RF_CHAOTIC) ||(r->x >= -13 && r->x <= -6 && r->y >= 50 && r->y <= 57)) {
if (woodcount(r) >= 40 && rand()%100 < 33) { if (woodcount(r) >= 40 && rand()%100 < 33) {
#ifdef GROWING_TREES #if GROWING_TREES
int trees = rtrees(r,2); int trees = rtrees(r,2);
#else #else
int trees = rtrees(r); int trees = rtrees(r);
@ -1490,7 +1490,7 @@ randomevents(void)
treemen = max(25, treemen); treemen = max(25, treemen);
woodcounts(r, -40); woodcounts(r, -40);
trees = max(0, trees-treemen); trees = max(0, trees-treemen);
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, trees); rsettrees(r, 2, trees);
#else #else
rsettrees(r, trees); rsettrees(r, trees);

View file

@ -988,7 +988,7 @@ describe(FILE * F, region * r, int partial, faction * f)
boolean dh; boolean dh;
direction_t d; direction_t d;
int trees; int trees;
#ifdef GROWING_TREES #if GROWING_TREES
int ytrees; int ytrees;
#endif #endif
attrib *a; attrib *a;
@ -1059,7 +1059,7 @@ describe(FILE * F, region * r, int partial, faction * f)
/* Bäume */ /* Bäume */
#ifdef GROWING_TREES #if GROWING_TREES
trees = rtrees(r,2); trees = rtrees(r,2);
ytrees = rtrees(r,1); ytrees = rtrees(r,1);
if (production(r)) { if (production(r)) {
@ -1101,7 +1101,7 @@ describe(FILE * F, region * r, int partial, faction * f)
#endif #endif
/* Eisen */ /* Eisen */
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
if (partial == 0 && f != (faction *) NULL) { if (partial == 0 && f != (faction *) NULL) {
struct rawmaterial * res; struct rawmaterial * res;
for (res=r->resources;res;res=res->next) { for (res=r->resources;res;res=res->next) {

View file

@ -18,7 +18,9 @@
#include "demonseye.h" #include "demonseye.h"
#include "weapons.h" #include "weapons.h"
#include "xerewards.h" #include "xerewards.h"
#include "seed.h" #if GROWING_TREES
# include "seed.h"
#endif
#include "birthday_firework.h" #include "birthday_firework.h"
void void
@ -28,8 +30,10 @@ register_items(void)
register_demonseye(); register_demonseye();
init_lmsreward(); init_lmsreward();
register_xerewards(); register_xerewards();
#if GROWING_TREES
init_seed(); init_seed();
init_mallornseed(); init_mallornseed();
#endif
register_birthday_firework(); register_birthday_firework();
register_lebkuchenherz(); register_lebkuchenherz();
} }

View file

@ -1,25 +1,24 @@
/* vi: set ts=2: /* vi: set ts=2:
* +-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
* | | Enno Rehling <enno@eressea-pbem.de>
* Eressea PB(E)M host Copyright (C) 1998-2000 | Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
* Christian Schlittchen (corwin@amber.kn-bremen.de) | (c) 1998 - 2001 | Henning Peters <faroul@beyond.kn-bremen.de>
* Katja Zedel (katze@felidae.kn-bremen.de) | | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
* Henning Peters (faroul@beyond.kn-bremen.de) +-------------------+ Stefan Reich <reich@halbling.de>
* Enno Rehling (enno@eressea-pbem.de)
* Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
*
* This program may not be used, modified or distributed without
* prior permission by the authors of Eressea.
*/
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#include <config.h> #include <config.h>
#include <eressea.h> #include <eressea.h>
#include <build.h>
#include <region.h> #if GROWING_TREES
#include "seed.h" #include "seed.h"
#ifdef GROWING_TREES #include <build.h>
#include <region.h>
/* kernel includes */ /* kernel includes */
#include <item.h> #include <item.h>

View file

@ -12,6 +12,7 @@
* prior permission by the authors of Eressea. * prior permission by the authors of Eressea.
*/ */
#if GROWING_TREES
extern struct item_type it_seed; extern struct item_type it_seed;
extern struct resource_type rt_seed; extern struct resource_type rt_seed;
extern void init_seed(void); extern void init_seed(void);
@ -19,3 +20,6 @@ extern void init_seed(void);
extern struct item_type it_mallornseed; extern struct item_type it_mallornseed;
extern struct resource_type rt_mallornseed; extern struct resource_type rt_mallornseed;
extern void init_mallornseed(void); extern void init_mallornseed(void);
#else
#error seed.h should not be included when building with GROWING_TREES==0
#endif

View file

@ -114,7 +114,7 @@ use_potion(unit * u, const item_type * itype, const char * cmd)
holz = new_use_pooled(u, oldresourcetype[R_WOOD], holz = new_use_pooled(u, oldresourcetype[R_WOOD],
GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 10); GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 10);
} }
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 1, rtrees(r, 1) + holz); rsettrees(r, 1, rtrees(r, 1) + holz);
#else #else
rsettrees(r, rtrees(r) + holz); rsettrees(r, rtrees(r) + holz);

View file

@ -66,9 +66,7 @@ typedef enum combatmagic {
#include <attributes/key.h> #include <attributes/key.h>
#include <attributes/racename.h> #include <attributes/racename.h>
#include <attributes/otherfaction.h> #include <attributes/otherfaction.h>
#ifdef AT_MOVED #include <attributes/moved.h>
# include <attributes/moved.h>
#endif
/* libc includes */ /* libc includes */
#include <assert.h> #include <assert.h>
@ -79,10 +77,6 @@ typedef enum combatmagic {
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if !defined(AT_MOVED) && defined(DELAYED_OFFENSE)
# error "must define AT_MOVED to use combat option DELAYED_OFFENSE"
#endif
#ifdef HAVE_ZLIB #ifdef HAVE_ZLIB
# include <zlib.h> # include <zlib.h>
# define dbgprintf(a) gzprintf a; # define dbgprintf(a) gzprintf a;

View file

@ -30,7 +30,7 @@
enum { enum {
B_SITE, B_SITE,
#ifdef LARGE_CASTLES #if LARGE_CASTLES
B_TRADEPOST, B_TRADEPOST,
#endif #endif
B_FORTIFICATION, B_FORTIFICATION,

View file

@ -179,7 +179,7 @@ findbuilding(int i)
#ifdef NEW_BUILDINGS #ifdef NEW_BUILDINGS
enum { enum {
B_SITE, B_SITE,
#ifdef LARGE_CASTLES #if LARGE_CASTLES
B_TRADEPOST, B_TRADEPOST,
#endif #endif
B_FORTIFICATION, B_FORTIFICATION,
@ -196,7 +196,7 @@ castle_name(int bsize)
{ {
const char * fname[MAXBUILDINGS] = { const char * fname[MAXBUILDINGS] = {
"site", "site",
#ifdef LARGE_CASTLES #if LARGE_CASTLES
"tradepost", "tradepost",
#endif #endif
"fortification", "fortification",
@ -221,7 +221,7 @@ static requirement castle_req[] = {
{ NORESOURCE, 0, 0.0 }, { NORESOURCE, 0, 0.0 },
}; };
#ifdef LARGE_CASTLES #if LARGE_CASTLES
static const construction castle_bld[MAXBUILDINGS] = { static const construction castle_bld[MAXBUILDINGS] = {
{ SK_BUILDING, 1, 2, 1, castle_req, &castle_bld[1] }, { SK_BUILDING, 1, 2, 1, castle_req, &castle_bld[1] },
{ SK_BUILDING, 1, 8, 1, castle_req, &castle_bld[2] }, { SK_BUILDING, 1, 8, 1, castle_req, &castle_bld[2] },

View file

@ -229,7 +229,7 @@ const char *keywords[MAXKEYWORDS] =
#endif #endif
"PRÄFIX", "PRÄFIX",
"SYNONYM", "SYNONYM",
#ifdef GROWING_TREES #if GROWING_TREES
"PFLANZEN", "PFLANZEN",
#endif #endif
}; };
@ -1732,7 +1732,7 @@ idle (faction * f)
int int
maxworkingpeasants(const struct region * r) maxworkingpeasants(const struct region * r)
{ {
#ifdef GROWING_TREES #if GROWING_TREES
int i = production(r) * MAXPEASANTS_PER_AREA int i = production(r) * MAXPEASANTS_PER_AREA
- ((rtrees(r,2)+rtrees(r,1)/2) * TREESIZE); - ((rtrees(r,2)+rtrees(r,1)/2) * TREESIZE);
#else #else
@ -2096,6 +2096,16 @@ parse_tagbegin(struct xml_stack *stack, void *data)
log_printf("required tag 'file' missing from include"); log_printf("required tag 'file' missing from include");
return XML_USERERROR; return XML_USERERROR;
} }
} else if (strcmp(tag->name, "game")==0) {
const char * name = xml_value(tag, "name");
int maxunits = xml_ivalue(tag, "units");
if (name!=NULL) {
global.gamename = strdup(name);
}
if (maxunits!=0) {
global.maxunits = maxunits;
}
} else if (strcmp(tag->name, "game")==0) {
} else if (strcmp(tag->name, "order")==0) { } else if (strcmp(tag->name, "order")==0) {
const char * name = xml_value(tag, "name"); const char * name = xml_value(tag, "name");
if (xml_bvalue(tag, "disable")) { if (xml_bvalue(tag, "disable")) {
@ -2304,7 +2314,7 @@ attrib_init(void)
#endif #endif
at_register(&at_jihad); at_register(&at_jihad);
at_register(&at_skillmod); at_register(&at_skillmod);
#ifdef GROWING_TREES #if GROWING_TREES
at_register(&at_germs); at_register(&at_germs);
#endif #endif
at_register(&at_laen); /* required for old datafiles */ at_register(&at_laen); /* required for old datafiles */

View file

@ -21,19 +21,20 @@
#ifndef ERESSEA_H #ifndef ERESSEA_H
#define ERESSEA_H #define ERESSEA_H
/* Features currently in development (change makefile please): */ /*
#ifndef MSG_LEVELS * Features enabled:
# undef MSG_LEVELS /* msg-levels active */ * If you are lacking the settings.h, create a new file common/settings.h,
#endif * 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 !!!
*/
#include <settings.h>
/* Features enabled: */
#define RESOURCE_FIX /* Should be removed soon! */
#define NEW_RESOURCEGROWTH
#define LARGE_CASTLES
#define GROWING_TREES
#define STEALTHFACTION #define STEALTHFACTION
#define AT_MOVED
#undef RACE_ADJUSTMENTS /* Features currently in development (change makefile please): */
/* #define MSG_LEVELS -- msg-levels active */
/* #define RACE_ADJUSTMENTS */
/* basic types used in the eressea "kernel" */ /* basic types used in the eressea "kernel" */
typedef unsigned char order_t; typedef unsigned char order_t;
@ -167,7 +168,7 @@ struct xml_stack;
#endif #endif
*/ */
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
extern void init_resourcefix(void); extern void init_resourcefix(void);
extern void read_iron(struct region * r, int iron); extern void read_iron(struct region * r, int iron);
extern void read_laen(struct region * r, int laen); extern void read_laen(struct region * r, int laen);
@ -300,9 +301,6 @@ extern void plagues(struct region * r, boolean ismagic);
/* Schiffsbeschädigungen */ /* Schiffsbeschädigungen */
#define SHIPDAMAGE #define SHIPDAMAGE
/* Maximale Einheitenzahl */
#define MAXUNITS 1000
/* regionen im Report der Parteien werden nur einmal berechnet: */ /* regionen im Report der Parteien werden nur einmal berechnet: */
#define FAST_REGION #define FAST_REGION
@ -437,7 +435,7 @@ enum {
#endif #endif
K_PREFIX, K_PREFIX,
K_SYNONYM, K_SYNONYM,
#ifdef GROWING_TREES #if GROWING_TREES
K_PFLANZE, K_PFLANZE,
#endif #endif
MAXKEYWORDS, MAXKEYWORDS,
@ -1170,6 +1168,7 @@ extern const struct race * new_race[];
/* globale settings des Spieles */ /* globale settings des Spieles */
typedef struct settings { typedef struct settings {
const char *gamename; const char *gamename;
unsigned int maxunits;
struct attrib *attribs; struct attrib *attribs;
unsigned int data_version; unsigned int data_version;
boolean disabled[MAXKEYWORDS]; boolean disabled[MAXKEYWORDS];

View file

@ -1223,12 +1223,12 @@ limit_oldtypes(const region * r, const resource_type * rtype)
/* TODO: split into seperate functions. really much nicer. */ /* TODO: split into seperate functions. really much nicer. */
{ {
if (rtype==oldresourcetype[R_WOOD]) { if (rtype==oldresourcetype[R_WOOD]) {
#ifdef GROWING_TREES #if GROWING_TREES
return rtrees(r,2) + rtrees(r,1); return rtrees(r,2) + rtrees(r,1);
#else #else
return rtrees(r); return rtrees(r);
#endif #endif
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
} else if (rtype==oldresourcetype[R_EOG]) { } else if (rtype==oldresourcetype[R_EOG]) {
return rlaen(r); return rlaen(r);
} else if (rtype==oldresourcetype[R_IRON]) { } else if (rtype==oldresourcetype[R_IRON]) {
@ -1237,7 +1237,7 @@ limit_oldtypes(const region * r, const resource_type * rtype)
return terrain[rterrain(r)].quarries; return terrain[rterrain(r)].quarries;
#endif #endif
} else if (rtype==oldresourcetype[R_MALLORN]) { } else if (rtype==oldresourcetype[R_MALLORN]) {
#ifdef GROWING_TREES #if GROWING_TREES
return rtrees(r,2) + rtrees(r,1); return rtrees(r,2) + rtrees(r,1);
#else #else
return rtrees(r); return rtrees(r);
@ -1257,7 +1257,7 @@ use_oldresource(region * r, const resource_type * rtype, int norders)
{ {
assert(norders>0); assert(norders>0);
if (rtype==oldresourcetype[R_WOOD] || rtype==oldresourcetype[R_MALLORN]) { if (rtype==oldresourcetype[R_WOOD] || rtype==oldresourcetype[R_MALLORN]) {
#ifdef GROWING_TREES #if GROWING_TREES
int avail_grownup = rtrees(r,2); int avail_grownup = rtrees(r,2);
int avail_young = rtrees(r,1); int avail_young = rtrees(r,1);
int avail = avail_grownup + avail_young; int avail = avail_grownup + avail_young;
@ -1284,7 +1284,7 @@ use_oldresource(region * r, const resource_type * rtype, int norders)
rsettrees(r, avail-norders); rsettrees(r, avail-norders);
woodcounts(r, norders); woodcounts(r, norders);
#endif #endif
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
} else if (rtype==oldresourcetype[R_EOG]) { } else if (rtype==oldresourcetype[R_EOG]) {
int avail = rlaen(r); int avail = rlaen(r);
assert(norders <= avail); assert(norders <= avail);

View file

@ -458,9 +458,8 @@ attrib_type at_travelunit = {
NO_READ NO_READ
}; };
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
extern int laen_read(attrib * a, FILE * F); extern int laen_read(attrib * a, FILE * F);
# define LAEN_READ laen_read # define LAEN_READ laen_read
# define LAEN_WRITE NULL # define LAEN_WRITE NULL
#else #else
@ -555,7 +554,7 @@ rroad(const region * r, direction_t d)
boolean boolean
r_isforest(const region * r) r_isforest(const region * r)
{ {
#ifdef GROWING_TREES #if GROWING_TREES
if (r->terrain==T_PLAIN && rtrees(r,2) + rtrees(r,1) >= 600) return true; if (r->terrain==T_PLAIN && rtrees(r,2) + rtrees(r,1) >= 600) return true;
#else #else
if (r->terrain==T_PLAIN && rtrees(r) >= 600) return true; if (r->terrain==T_PLAIN && rtrees(r) >= 600) return true;
@ -647,7 +646,7 @@ rname(const region * r, const locale * lang) {
return locale_string(lang, terrain[rterrain(r)].name); return locale_string(lang, terrain[rterrain(r)].name);
} }
#ifdef GROWING_TREES #if GROWING_TREES
int int
rtrees(const region *r, int ageclass) rtrees(const region *r, int ageclass)
{ {
@ -797,7 +796,7 @@ void
terraform(region * r, terrain_t t) terraform(region * r, terrain_t t)
{ {
const struct locale * locale_de = find_locale("de"); const struct locale * locale_de = find_locale("de");
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
rawmaterial **lrm; rawmaterial **lrm;
int i; int i;
#endif #endif
@ -805,7 +804,7 @@ terraform(region * r, terrain_t t)
/* defaults: */ /* defaults: */
rsetterrain(r, t); rsetterrain(r, t);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
/* Resourcen, die nicht mehr vorkommen können, löschen */ /* Resourcen, die nicht mehr vorkommen können, löschen */
lrm = &r->resources; lrm = &r->resources;
while (*lrm) { while (*lrm) {
@ -822,7 +821,7 @@ terraform(region * r, terrain_t t)
} }
#endif #endif
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
rsetlaen(r, -1); rsetlaen(r, -1);
rsetiron(r, 0); rsetiron(r, 0);
#endif #endif
@ -831,7 +830,7 @@ terraform(region * r, terrain_t t)
freeland(r->land); freeland(r->land);
r->land = NULL; r->land = NULL;
} }
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 0, 0); rsettrees(r, 0, 0);
rsettrees(r, 1, 0); rsettrees(r, 1, 0);
rsettrees(r, 2, 0); rsettrees(r, 2, 0);
@ -839,7 +838,7 @@ terraform(region * r, terrain_t t)
rsettrees(r, 0); rsettrees(r, 0);
#endif #endif
rsethorses(r, 0); rsethorses(r, 0);
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
rsetiron(r, 0); rsetiron(r, 0);
rsetlaen(r, -1); rsetlaen(r, -1);
#endif #endif
@ -938,7 +937,7 @@ terraform(region * r, terrain_t t)
case T_PLAIN: case T_PLAIN:
rsethorses(r, rand() % (terrain[t].production_max / 5)); rsethorses(r, rand() % (terrain[t].production_max / 5));
if(rand()%100 < 40) { if(rand()%100 < 40) {
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, terrain[t].production_max * (30+rand()%40)/100); rsettrees(r, 2, terrain[t].production_max * (30+rand()%40)/100);
rsettrees(r, 1, rtrees(r, 2)/4); rsettrees(r, 1, rtrees(r, 2)/4);
rsettrees(r, 0, rtrees(r, 2)/2); rsettrees(r, 0, rtrees(r, 2)/2);
@ -948,14 +947,14 @@ terraform(region * r, terrain_t t)
} }
break; break;
case T_MOUNTAIN: case T_MOUNTAIN:
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
rsetiron(r, IRONSTART); rsetiron(r, IRONSTART);
if (rand() % 100 < 8) rsetlaen(r, 5 + rand() % 5); if (rand() % 100 < 8) rsetlaen(r, 5 + rand() % 5);
#endif #endif
break; break;
case T_GLACIER: case T_GLACIER:
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
if (riron(r) <= 0){ if (riron(r) <= 0){
rsetiron(r, GLIRONSTART); rsetiron(r, GLIRONSTART);
} }
@ -964,7 +963,7 @@ terraform(region * r, terrain_t t)
case T_ICEBERG_SLEEP: case T_ICEBERG_SLEEP:
/* Kann aus Gletscher entstehen und sollte diesem gleichen */ /* Kann aus Gletscher entstehen und sollte diesem gleichen */
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
if (riron(r) <= 0){ if (riron(r) <= 0){
rsetiron(r, GLIRONSTART); rsetiron(r, GLIRONSTART);
} }
@ -976,7 +975,7 @@ terraform(region * r, terrain_t t)
break; break;
} }
#ifdef GROWING_TREES #if GROWING_TREES
/* Initialisierung irgendwann über rm_-Mechamismus machen */ /* Initialisierung irgendwann über rm_-Mechamismus machen */
if(t != T_PLAIN && rand()%100 < 20) { if(t != T_PLAIN && rand()%100 < 20) {
rsettrees(r, 2, terrain[t].production_max * (30 + rand() % 40) / 100); rsettrees(r, 2, terrain[t].production_max * (30 + rand() % 40) / 100);
@ -985,7 +984,7 @@ terraform(region * r, terrain_t t)
} }
#endif #endif
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
terraform_resources(r); terraform_resources(r);
#endif #endif

View file

@ -53,7 +53,7 @@ typedef struct land_region {
} * demands; } * demands;
const struct herb_type * herbtype; const struct herb_type * herbtype;
short herbs; short herbs;
#ifdef GROWING_TREES #if GROWING_TREES
int trees[3]; /* 0 -> Samen, 1 -> Sprößlinge, 2 -> Bäume */ int trees[3]; /* 0 -> Samen, 1 -> Sprößlinge, 2 -> Bäume */
#else #else
int trees; int trees;
@ -62,7 +62,7 @@ typedef struct land_region {
int peasants; int peasants;
int newpeasants; int newpeasants;
int money; int money;
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
int iron; int iron;
#endif #endif
} land_region; } land_region;
@ -90,7 +90,7 @@ typedef struct region {
#ifdef WEATHER #ifdef WEATHER
weather_t weathertype; weather_t weathertype;
#endif #endif
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
struct rawmaterial * resources; struct rawmaterial * resources;
#endif #endif
} region; } region;
@ -159,7 +159,7 @@ void rsetroad(struct region * r, direction_t d, int value);
int is_coastregion(struct region *r); int is_coastregion(struct region *r);
#ifdef GROWING_TREES #if GROWING_TREES
int rtrees(const struct region * r, int ageclass); int rtrees(const struct region * r, int ageclass);
int rsettrees(const struct region *r, int ageclass, int value); int rsettrees(const struct region *r, int ageclass, int value);
#else #else
@ -177,7 +177,7 @@ void rsetmoney(struct region * r, int value);
#define rbuildings(r) ((r)->buildings) #define rbuildings(r) ((r)->buildings)
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
#define riron(r) ((r)->land?(r)->land->iron:0) #define riron(r) ((r)->land?(r)->land->iron:0)
#define rsetiron(r, value) ((r)->land?((r)->land->iron=(value)):(value),0) #define rsetiron(r, value) ((r)->land?((r)->land->iron=(value)):(value),0)

View file

@ -14,7 +14,7 @@
#include "eressea.h" #include "eressea.h"
#include "resources.h" #include "resources.h"
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
/* kernel includes */ /* kernel includes */
#include "build.h" #include "build.h"
#include "item.h" #include "item.h"

View file

@ -9,7 +9,8 @@
This program may not be used, modified or distributed This program may not be used, modified or distributed
without prior permission by the authors of Eressea. without prior permission by the authors of Eressea.
*/ */
#ifdef NEW_RESOURCEGROWTH #ifndef RESOURCES_H
#if NEW_RESOURCEGROWTH
enum { enum {
RM_USED = 1<<0, /* resource has been used */ RM_USED = 1<<0, /* resource has been used */
@ -56,3 +57,4 @@ extern struct rawmaterial_type rm_iron;
extern struct rawmaterial_type rm_laen; extern struct rawmaterial_type rm_laen;
#endif #endif
#endif

View file

@ -88,7 +88,7 @@ static region * current_region;
int firstx = 0, firsty = 0; int firstx = 0, firsty = 0;
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
int laen_read(attrib * a, FILE * F) int laen_read(attrib * a, FILE * F)
{ {
int laen; int laen;
@ -728,7 +728,7 @@ read_items(FILE *F, item **ilist)
} }
} }
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
struct attrib_type at_resources = { struct attrib_type at_resources = {
"resources", NULL, NULL, NULL, NULL, NULL, ATF_UNIQUE "resources", NULL, NULL, NULL, NULL, NULL, ATF_UNIQUE
}; };
@ -1120,7 +1120,7 @@ readgame(boolean backup)
} }
if (global.data_version < MEMSAVE_VERSION || r->land) { if (global.data_version < MEMSAVE_VERSION || r->land) {
int i; int i;
#ifdef GROWING_TREES #if GROWING_TREES
if(global.data_version < GROWTREE_VERSION) { if(global.data_version < GROWTREE_VERSION) {
i = ri(F); rsettrees(r, 2, i); i = ri(F); rsettrees(r, 2, i);
} else { } else {
@ -1132,10 +1132,10 @@ readgame(boolean backup)
i = ri(F); rsettrees(r, i); i = ri(F); rsettrees(r, i);
#endif #endif
i = ri(F); rsethorses(r, i); i = ri(F); rsethorses(r, i);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
if (global.data_version < NEWRESOURCE_VERSION) { if (global.data_version < NEWRESOURCE_VERSION) {
i = ri(F); i = ri(F);
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
if (i!=0) read_iron(r, i); if (i!=0) read_iron(r, i);
#endif #endif
} else { } else {
@ -1192,12 +1192,12 @@ readgame(boolean backup)
rsetherbs(r, (short)ri(F)); rsetherbs(r, (short)ri(F));
} else if (global.data_version<MEMSAVE_VERSION) { } else if (global.data_version<MEMSAVE_VERSION) {
int i = ri(F); int i = ri(F);
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
rsetlaen(r, i); #if RESOURCE_CONVERSION
#else
#ifdef RESOURCE_FIX
if (i!=0) read_laen(r, i); if (i!=0) read_laen(r, i);
#endif #endif
#else
rsetlaen(r, i);
#endif #endif
if (ri(F)) fset(r, RF_MALLORN); if (ri(F)) fset(r, RF_MALLORN);
if (ri(F)) fset(r, RF_ENCOUNTER); if (ri(F)) fset(r, RF_ENCOUNTER);
@ -1934,7 +1934,7 @@ writegame(char *path, char quiet)
struct demand * demand; struct demand * demand;
ws(F, r->land->name); ws(F, r->land->name);
wspace(F); wspace(F);
#ifdef GROWING_TREES #if GROWING_TREES
wi(F, rtrees(r,0)); wi(F, rtrees(r,0));
wspace(F); wspace(F);
wi(F, rtrees(r,1)); wi(F, rtrees(r,1));
@ -1947,7 +1947,7 @@ writegame(char *path, char quiet)
#endif #endif
wi(F, rhorses(r)); wi(F, rhorses(r));
wspace(F); wspace(F);
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
wi(F, riron(r)); wi(F, riron(r));
#elif RELEASE_VERSION>=NEWRESOURCE_VERSION #elif RELEASE_VERSION>=NEWRESOURCE_VERSION
{ {

View file

@ -62,7 +62,7 @@ extern int read_faction_reference(struct faction ** f, FILE * F);
extern const char * datapath(void); extern const char * datapath(void);
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
extern struct attrib_type at_resources; extern struct attrib_type at_resources;
#endif #endif

View file

@ -920,7 +920,7 @@ sp_summonent(castorder *co)
attrib *a; attrib *a;
int ents; int ents;
#ifdef GROWING_TREES #if GROWING_TREES
if(rtrees(r,2) == 0) { if(rtrees(r,2) == 0) {
#else #else
if(rtrees(r) == 0) { if(rtrees(r) == 0) {
@ -930,7 +930,7 @@ sp_summonent(castorder *co)
return 0; return 0;
} }
#ifdef GROWING_TREES #if GROWING_TREES
ents = min(power*power, rtrees(r,2)); ents = min(power*power, rtrees(r,2));
#else #else
ents = min(power*power, rtrees(r)); ents = min(power*power, rtrees(r));
@ -944,7 +944,7 @@ sp_summonent(castorder *co)
a_add(&u->attribs, a); a_add(&u->attribs, a);
fset(u, FL_LOCKED); fset(u, FL_LOCKED);
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2) - ents); rsettrees(r, 2, rtrees(r,2) - ents);
#else #else
rsettrees(r, rtrees(r) - ents); rsettrees(r, rtrees(r) - ents);
@ -1082,7 +1082,7 @@ sp_mallorn(castorder *co)
} }
/* half the trees will die */ /* half the trees will die */
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 2, rtrees(r,2)/2);
rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 1, rtrees(r,1)/2);
rsettrees(r, 0, rtrees(r,0)/2); rsettrees(r, 0, rtrees(r,0)/2);
@ -1163,7 +1163,7 @@ sp_hain(castorder *co)
} }
trees = lovar(force * 10) + force; trees = lovar(force * 10) + force;
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 1, rtrees(r,1) + trees); rsettrees(r, 1, rtrees(r,1) + trees);
#else #else
rsettrees(r, rtrees(r) + trees); rsettrees(r, rtrees(r) + trees);
@ -1580,7 +1580,7 @@ sp_great_drought(castorder *co)
/* sterben */ /* sterben */
rsetpeasants(r, rpeasants(r)/2); /* evtl wuerfeln */ rsetpeasants(r, rpeasants(r)/2); /* evtl wuerfeln */
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 2, rtrees(r,2)/2);
rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 1, rtrees(r,1)/2);
rsettrees(r, 0, rtrees(r,0)/2); rsettrees(r, 0, rtrees(r,0)/2);
@ -1613,7 +1613,7 @@ sp_great_drought(castorder *co)
break; break;
case T_GLACIER: case T_GLACIER:
#ifndef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH == 0
rsetiron(r, 0); rsetiron(r, 0);
rsetlaen(r, -1); rsetlaen(r, -1);
#endif #endif
@ -2097,7 +2097,7 @@ sp_drought(castorder *co)
c->duration = max(c->duration, power); c->duration = max(c->duration, power);
} else { } else {
/* Baeume und Pferde sterben */ /* Baeume und Pferde sterben */
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 2, rtrees(r,2)/2);
rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 1, rtrees(r,1)/2);
rsettrees(r, 0, rtrees(r,0)/2); rsettrees(r, 0, rtrees(r,0)/2);
@ -2466,7 +2466,7 @@ sp_forest_fire(castorder *co)
unit *u; unit *u;
region *nr; region *nr;
int prozent, chance, vernichtet; int prozent, chance, vernichtet;
#ifdef GROWING_TREES #if GROWING_TREES
int vernichtet_schoesslinge; int vernichtet_schoesslinge;
#endif #endif
direction_t i; direction_t i;
@ -2475,7 +2475,7 @@ sp_forest_fire(castorder *co)
int cast_level = co->level; int cast_level = co->level;
prozent = (rand() % 71) + 10; /* 10 - 80% */ prozent = (rand() % 71) + 10; /* 10 - 80% */
#ifdef GROWING_TREES #if GROWING_TREES
vernichtet = rtrees(r,2) * prozent / 100; vernichtet = rtrees(r,2) * prozent / 100;
vernichtet_schoesslinge = rtrees(r,1) * prozent / 100; vernichtet_schoesslinge = rtrees(r,1) * prozent / 100;
#else #else
@ -2487,7 +2487,7 @@ sp_forest_fire(castorder *co)
return 0; return 0;
} }
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, rtrees(r,2) - vernichtet); rsettrees(r, 2, rtrees(r,2) - vernichtet);
rsettrees(r, 1, rtrees(r,1) - vernichtet_schoesslinge); rsettrees(r, 1, rtrees(r,1) - vernichtet_schoesslinge);
#else #else
@ -2510,7 +2510,7 @@ sp_forest_fire(castorder *co)
} }
} }
if(!fval(mage->faction, FL_DH)){ if(!fval(mage->faction, FL_DH)){
#ifdef GROWING_TREES #if GROWING_TREES
sprintf(buf, "%s erzeugt eine verheerende Feuersbrunst. %d %s " sprintf(buf, "%s erzeugt eine verheerende Feuersbrunst. %d %s "
"den Flammen zum Opfer.", unitname(mage), vernichtet+vernichtet_schoesslinge, "den Flammen zum Opfer.", unitname(mage), vernichtet+vernichtet_schoesslinge,
vernichtet+vernichtet_schoesslinge == 1 ? "Baum fiel" : "Bäume fielen"); vernichtet+vernichtet_schoesslinge == 1 ? "Baum fiel" : "Bäume fielen");
@ -2527,7 +2527,7 @@ sp_forest_fire(castorder *co)
assert(nr); assert(nr);
vernichtet = 0; vernichtet = 0;
#ifdef GROWING_TREES #if GROWING_TREES
if(rtrees(nr,2) + rtrees(nr,1) >= 800) { if(rtrees(nr,2) + rtrees(nr,1) >= 800) {
if((rand() % 100) < chance ) { if((rand() % 100) < chance ) {
vernichtet = rtrees(nr,2) * prozent / 200; vernichtet = rtrees(nr,2) * prozent / 200;

View file

@ -70,7 +70,7 @@ const terraindata_t terrain[] = {
1000, /* bewirtschaftbare Parzellen */ 1000, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LARGE_SHIPS|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LARGE_SHIPS|LAND_REGION, /* Flags */
plain_herbs, plain_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "2d4-1", "5d8", "2d20+10", 10.0 }, { { &rm_iron, "2d4-1", "5d8", "2d20+10", 10.0 },
{ &rm_stones, "1d4", "5d8", "2d30+20", 15.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 15.0 },
{ &rm_laen, "1d4", "1d4", "2d20+50", 1.0} } { &rm_laen, "1d4", "1d4", "2d20+50", 1.0} }
@ -86,7 +86,7 @@ const terraindata_t terrain[] = {
200, /* bewirtschaftbare Parzellen */ 200, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
swamp_herbs, swamp_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "2d4-1", "5d8", "2d20+10", 2.0 }, { { &rm_iron, "2d4-1", "5d8", "2d20+10", 2.0 },
{ &rm_stones, "1d4", "5d8", "2d30+20", 2.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 2.0 },
{ &rm_laen, "1d4", "1d4", "2d20+50", 2.0} } { &rm_laen, "1d4", "1d4", "2d20+50", 2.0} }
@ -102,7 +102,7 @@ const terraindata_t terrain[] = {
50, /* bewirtschaftbare Parzellen */ 50, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
desert_herbs, desert_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 }, { { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 },
{ &rm_stones, "1d4", "5d8", "2d30+20", 25.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 25.0 },
{ &rm_laen, "1d4", "1d4", "2d20+50", 2.5} } { &rm_laen, "1d4", "1d4", "2d20+50", 2.5} }
@ -118,7 +118,7 @@ const terraindata_t terrain[] = {
400, /* bewirtschaftbare Parzellen */ 400, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
highland_herbs, highland_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 }, { { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 },
{ &rm_stones, "1d4", "5d8", "2d30+20", 20.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 20.0 },
{ &rm_laen, "1d4", "1d4", "2d20+50", 2.5} } { &rm_laen, "1d4", "1d4", "2d20+50", 2.5} }
@ -134,7 +134,7 @@ const terraindata_t terrain[] = {
100, /* bewirtschaftbare Parzellen */ 100, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
mountain_herbs, mountain_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "50", "50", 100.0 }, { { &rm_iron, "1", "50", "50", 100.0 },
{ &rm_stones, "1", "100", "100", 100.0 }, { &rm_stones, "1", "100", "100", 100.0 },
{ &rm_laen, "1", "4", "100", 5.0} } { &rm_laen, "1", "4", "100", 5.0} }
@ -150,7 +150,7 @@ const terraindata_t terrain[] = {
10, /* bewirtschaftbare Parzellen */ 10, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
glacier_herbs, glacier_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "3", "50", 100.0 }, { { &rm_iron, "1", "3", "50", 100.0 },
{ &rm_stones, "1", "2", "100", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 },
{ &rm_laen, "1", "4", "100", 0.5} } { &rm_laen, "1", "4", "100", 0.5} }
@ -220,7 +220,7 @@ const terraindata_t terrain[] = {
50, /* bewirtschaftbare Parzellen */ 50, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
NULL, NULL,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "50", "50", 50.0 }, { { &rm_iron, "1", "50", "50", 50.0 },
{ &rm_stones, "1", "100", "100", 50.0 }, { &rm_stones, "1", "100", "100", 50.0 },
{ &rm_laen, "1", "4", "100", 7.5} } { &rm_laen, "1", "4", "100", 7.5} }
@ -235,7 +235,7 @@ const terraindata_t terrain[] = {
50, /* bewirtschaftbare Parzellen */ 50, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
NULL, NULL,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "50", "50", 50.0 }, { { &rm_iron, "1", "50", "50", 50.0 },
{ &rm_stones, "1", "100", "100", 50.0 }, { &rm_stones, "1", "100", "100", 50.0 },
{ &rm_laen, "1", "4", "100", 7.5} } { &rm_laen, "1", "4", "100", 7.5} }
@ -251,7 +251,7 @@ const terraindata_t terrain[] = {
10, /* bewirtschaftbare Parzellen */ 10, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
glacier_herbs, glacier_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "3", "50", 100.0 }, { { &rm_iron, "1", "3", "50", 100.0 },
{ &rm_stones, "1", "2", "100", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 },
{ NULL, NULL, NULL, NULL, 100.0 } } { NULL, NULL, NULL, NULL, 100.0 } }
@ -267,7 +267,7 @@ const terraindata_t terrain[] = {
10, /* bewirtschaftbare Parzellen */ 10, /* bewirtschaftbare Parzellen */
NORMAL_TERRAIN|LAND_REGION, /* Flags */ NORMAL_TERRAIN|LAND_REGION, /* Flags */
glacier_herbs, glacier_herbs,
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
{ { &rm_iron, "1", "3", "50", 100.0 }, { { &rm_iron, "1", "3", "50", 100.0 },
{ &rm_stones, "1", "2", "100", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 },
{ NULL, NULL, NULL, NULL, 100.0 } } { NULL, NULL, NULL, NULL, 100.0 } }

View file

@ -77,7 +77,7 @@ typedef struct terraindata_t {
*/ */
unsigned int flags; unsigned int flags;
const char ** herbs; const char ** herbs;
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
struct { struct {
const struct rawmaterial_type * type; const struct rawmaterial_type * type;
const char *startlevel; const char *startlevel;

View file

@ -34,9 +34,7 @@
#include "region.h" #include "region.h"
#include "ship.h" #include "ship.h"
#ifdef AT_MOVED #include <attributes/moved.h>
# include <attributes/moved.h>
#endif
/* util includes */ /* util includes */
#include <resolve.h> #include <resolve.h>
@ -684,9 +682,7 @@ move_unit(unit * u, region * r, unit ** ulist)
if (u->region == r) return; if (u->region == r) return;
if (!ulist) ulist = (&r->units); if (!ulist) ulist = (&r->units);
if (u->region) { if (u->region) {
#ifdef AT_MOVED
set_moved(&u->attribs); set_moved(&u->attribs);
#endif
setguard(u, GUARD_NONE); setguard(u, GUARD_NONE);
fset(u, FL_MOVED); fset(u, FL_MOVED);
if (u->ship || u->building) leave(u->region, u); if (u->ship || u->building) leave(u->region, u);

View file

@ -213,7 +213,7 @@ create_xmas2000(int x, int y)
r = new_region(x, y); r = new_region(x, y);
terraform(r, T_PLAIN); terraform(r, T_PLAIN);
set_string(&r->land->name, "Weihnachtsinsel"); set_string(&r->land->name, "Weihnachtsinsel");
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r, 2, 1000); rsettrees(r, 2, 1000);
#else #else
rsettrees(r, 1000); rsettrees(r, 1000);

View file

@ -0,0 +1,20 @@
/* vi: set ts=2:
+-------------------+ 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 - 2001 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
/*
* Contains defines for the "free" game (Eressea) .
* Include this file from settings.h to make eressea work.
*/
#define RESOURCE_CONVERSION 1
#define NEW_RESOURCEGROWTH 1
#define LARGE_CASTLES 1
#define GROWING_TREES 1

View file

@ -0,0 +1,20 @@
/* vi: set ts=2:
+-------------------+ 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 - 2001 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
/*
* Contains defines for the "classic" game (Vinyambar I) .
* Include this file from settings.h to make eressea work.
*/
#define RESOURCE_CONVERSION 0
#define NEW_RESOURCEGROWTH 0
#define LARGE_CASTLES 0
#define GROWING_TREES 0

View file

@ -27,12 +27,10 @@
#include <attributes/overrideroads.h> #include <attributes/overrideroads.h>
#include <attributes/racename.h> #include <attributes/racename.h>
#include <attributes/otherfaction.h> #include <attributes/otherfaction.h>
#include <attributes/moved.h>
#ifdef AT_OPTION #ifdef AT_OPTION
# include <attributes/option.h> # include <attributes/option.h>
#endif #endif
#ifdef AT_MOVED
# include <attributes/moved.h>
#endif
/* util includes */ /* util includes */
#include <attrib.h> #include <attrib.h>
@ -51,9 +49,7 @@ init_attributes(void)
init_reduceproduction(); init_reduceproduction();
init_racename(); init_racename();
init_otherfaction(); init_otherfaction();
#ifdef AT_MOVED
init_moved(); init_moved();
#endif
#ifdef AT_OPTION #ifdef AT_OPTION
init_option(); init_option();
#endif #endif

View file

@ -2346,7 +2346,7 @@ update_igjarjuk_quest(void)
} }
#ifdef RESOURCE_FIX #if RESOURCE_CONVERSION
extern struct attrib_type at_resources; extern struct attrib_type at_resources;
void void
init_resourcefix(void) init_resourcefix(void)
@ -2572,7 +2572,7 @@ fix_negpotion(void)
} }
} }
#ifdef GROWING_TREES #if GROWING_TREES
int int
growing_trees(void) growing_trees(void)
{ {
@ -2689,6 +2689,7 @@ fix_ratfamiliar(void)
return 0; return 0;
} }
#if NEW_RESOURCEGROWTH
static int static int
randomized_resources(void) randomized_resources(void)
{ {
@ -2704,6 +2705,7 @@ randomized_resources(void)
} }
return 0; return 0;
} }
#endif
void void
korrektur(void) korrektur(void)
@ -2773,21 +2775,22 @@ korrektur(void)
} }
do_once("sql2", dump_sql()); do_once("sql2", dump_sql());
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
/* do not remove do_once calls - old datafiles need them! */ /* do not remove do_once calls - old datafiles need them! */
do_once("rgrw", convert_resources()); do_once("rgrw", convert_resources());
do_once("rsfx", read_resfix()); do_once("rsfx", read_resfix());
#endif #endif
/* do_once("xepl", create_xe()); */ /* do_once("xepl", create_xe()); */
#ifdef GROWING_TREES #if GROWING_TREES
do_once("grtr", growing_trees()); do_once("grtr", growing_trees());
#endif #endif
do_once("grat", fix_ratfamiliar()); do_once("grat", fix_ratfamiliar());
do_once("fdmd", fix_demand()); do_once("fdmd", fix_demand());
#if NEW_RESOURCEGROWTH
do_once("rndr", randomized_resources()); do_once("rndr", randomized_resources());
#endif
{ {
/* Test der Message-Funktion. Ist leider noch nicht /* Test der Message-Funktion. Ist leider noch nicht
* Plane-übergreifend, deshalb die Waldelfen. */ * Plane-übergreifend, deshalb die Waldelfen. */

View file

@ -120,6 +120,7 @@ static boolean g_killeiswald = false;
struct settings global = { struct settings global = {
"Eressea", /* gamename */ "Eressea", /* gamename */
1000, /* maxunits */
}; };
static int static int
@ -172,7 +173,7 @@ game_init(void)
init_attributes(); init_attributes();
init_economy(); init_economy();
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
init_rawmaterials(); init_rawmaterials();
#endif #endif

View file

@ -244,23 +244,23 @@ addmenulist(menulist ** SP, const char *s, int *val)
static int peasants, money, trees, horses, iron, laen, chaotisch; static int peasants, money, trees, horses, iron, laen, chaotisch;
#ifdef GROWING_TREES #if GROWING_TREES
static int ytrees, seeds; static int ytrees, seeds;
#endif #endif
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
static int ironlevel, laenlevel, stone, stonelevel; static int ironlevel, laenlevel, stone, stonelevel;
#endif #endif
static void static void
get_region(region *r) { get_region(region *r) {
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
struct rawmaterial *res; struct rawmaterial *res;
#endif #endif
peasants = rpeasants(r); peasants = rpeasants(r);
money = rmoney(r); money = rmoney(r);
#ifdef GROWING_TREES #if GROWING_TREES
trees = rtrees(r,2); trees = rtrees(r,2);
ytrees = rtrees(r,1); ytrees = rtrees(r,1);
seeds = rtrees(r,0); seeds = rtrees(r,0);
@ -268,7 +268,7 @@ get_region(region *r) {
trees = rtrees(r); trees = rtrees(r);
#endif #endif
horses = rhorses(r); horses = rhorses(r);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
iron = -1; iron = -1;
ironlevel = -1; ironlevel = -1;
laen = -1; laen = -1;
@ -297,13 +297,13 @@ get_region(region *r) {
static void static void
put_region(region *r) { put_region(region *r) {
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
struct rawmaterial *res; struct rawmaterial *res;
#endif #endif
rsetpeasants(r, peasants); rsetpeasants(r, peasants);
rsetmoney(r,money); rsetmoney(r,money);
#ifdef GROWING_TREES #if GROWING_TREES
rsettrees(r,2,trees); rsettrees(r,2,trees);
rsettrees(r,1,ytrees); rsettrees(r,1,ytrees);
rsettrees(r,0,seeds); rsettrees(r,0,seeds);
@ -311,7 +311,7 @@ put_region(region *r) {
rsettrees(r,trees); rsettrees(r,trees);
#endif #endif
rsethorses(r, horses); rsethorses(r, horses);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
for (res=r->resources;res;res=res->next) { for (res=r->resources;res;res=res->next) {
const item_type * itype = resource2item(res->type->rtype); const item_type * itype = resource2item(res->type->rtype);
if(itype == olditemtype[I_IRON]) { if(itype == olditemtype[I_IRON]) {
@ -347,19 +347,19 @@ create_region_menu(menulist ** menu, region * r)
addmenulist(menu, "Silver", &money); addmenulist(menu, "Silver", &money);
if (fval(r, RF_MALLORN)) { if (fval(r, RF_MALLORN)) {
addmenulist(menu, "Mallorntrees", &trees); addmenulist(menu, "Mallorntrees", &trees);
#ifdef GROWING_TREES #if GROWING_TREES
addmenulist(menu, "Mallornsprouts", &ytrees); addmenulist(menu, "Mallornsprouts", &ytrees);
addmenulist(menu, "Mallornseeds", &seeds); addmenulist(menu, "Mallornseeds", &seeds);
#endif #endif
} else { } else {
addmenulist(menu, "Trees", &trees); addmenulist(menu, "Trees", &trees);
#ifdef GROWING_TREES #if GROWING_TREES
addmenulist(menu, "Sprouts", &ytrees); addmenulist(menu, "Sprouts", &ytrees);
addmenulist(menu, "Seeds", &seeds); addmenulist(menu, "Seeds", &seeds);
#endif #endif
} }
addmenulist(menu, "Horses", &horses); addmenulist(menu, "Horses", &horses);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
if(iron != -1) { if(iron != -1) {
addmenulist(menu, "Iron", &iron); addmenulist(menu, "Iron", &iron);
addmenulist(menu, "Ironlevel", &ironlevel); addmenulist(menu, "Ironlevel", &ironlevel);

View file

@ -173,7 +173,7 @@ showregion(region * r, char full)
faction *f; faction *f;
int d,pp=0, ecount[MAXRACES], count[MAXRACES]; int d,pp=0, ecount[MAXRACES], count[MAXRACES];
char str[256]; char str[256];
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
int iron = -1, ironlevel = -1, int iron = -1, ironlevel = -1,
laen = -1, laenlevel = -1, laen = -1, laenlevel = -1,
stone = -1, stonelevel = -1; stone = -1, stonelevel = -1;
@ -200,7 +200,7 @@ showregion(region * r, char full)
adddbllist(&reglist, buf); adddbllist(&reglist, buf);
sprintf(buf, " %d peasants, %d(%d) silver", rpeasants(r), rmoney(r), count_all_money(r)); sprintf(buf, " %d peasants, %d(%d) silver", rpeasants(r), rmoney(r), count_all_money(r));
adddbllist(&reglist, buf); adddbllist(&reglist, buf);
#ifdef GROWING_TREES #if GROWING_TREES
sprintf(buf, " %d horses, %d/%d/%d ", sprintf(buf, " %d horses, %d/%d/%d ",
rhorses(r), rtrees(r,2), rtrees(r,1), rtrees(r,0)); rhorses(r), rtrees(r,2), rtrees(r,1), rtrees(r,0));
if (fval(r,RF_MALLORN)) if (fval(r,RF_MALLORN))
@ -216,7 +216,7 @@ showregion(region * r, char full)
#endif #endif
adddbllist(&reglist, buf); adddbllist(&reglist, buf);
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
for(res=r->resources;res;res=res->next) { for(res=r->resources;res;res=res->next) {
const item_type * itype = resource2item(res->type->rtype); const item_type * itype = resource2item(res->type->rtype);
if(itype == olditemtype[I_IRON]) { if(itype == olditemtype[I_IRON]) {

View file

@ -261,6 +261,7 @@ factionhere(region * r, int f)
return false; return false;
} }
#if NEW_RESOURCEGROWTH
static boolean static boolean
has_laen(region *r) has_laen(region *r)
{ {
@ -271,6 +272,7 @@ has_laen(region *r)
} }
return false; return false;
} }
#endif
void void
drawmap(boolean maponly) { drawmap(boolean maponly) {
@ -1362,7 +1364,7 @@ main(int argc, char *argv[])
init_resources(); init_resources();
register_items(); register_items();
init_attributes(); init_attributes();
#ifdef NEW_RESOURCEGROWTH #if NEW_RESOURCEGROWTH
init_rawmaterials(); init_rawmaterials();
#endif #endif

View file

@ -10,7 +10,7 @@
<include file="races.xml"></include> <include file="races.xml"></include>
<include file="items.xml"></include> <include file="items.xml"></include>
<game name="Vinyambar"> <game name="Vinyambar II" units="250">
<comment>Game specific</comment> <comment>Game specific</comment>
<order name="ARBEITEN" disable></order> <order name="ARBEITEN" disable></order>
<order name="MEINUNG" disable></order> <order name="MEINUNG" disable></order>