From a44a17585dff082558616f7129f93667cbfc9bc2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 15 Dec 2001 12:26:04 +0000 Subject: [PATCH] =?UTF-8?q?defines=20f=C3=BCr=20die=20spiele=20in=20settin?= =?UTF-8?q?gs-file=20ausgelagert.=20code=20angepasst.=20einheitenlimit=20i?= =?UTF-8?q?n=20xml=20datei.=20achtung:=20nach=20dem=20update=20muss=20eine?= =?UTF-8?q?=20settings.h=20datei=20angelegt=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/attributes/attributes.c | 6 +---- src/common/gamecode/creport.c | 4 ++-- src/common/gamecode/economy.c | 25 ++++++++++++-------- src/common/gamecode/laws.c | 20 +++++++++------- src/common/gamecode/laws.h | 2 +- src/common/gamecode/randenc.c | 14 +++++------ src/common/gamecode/report.c | 6 ++--- src/common/items/items.c | 6 ++++- src/common/items/seed.c | 29 +++++++++++------------ src/common/items/seed.h | 4 ++++ src/common/kernel/alchemy.c | 2 +- src/common/kernel/battle.c | 8 +------ src/common/kernel/build.h | 2 +- src/common/kernel/building.c | 6 ++--- src/common/kernel/eressea.c | 16 ++++++++++--- src/common/kernel/eressea.h | 31 ++++++++++++------------- src/common/kernel/item.c | 10 ++++---- src/common/kernel/region.c | 29 +++++++++++------------ src/common/kernel/region.h | 10 ++++---- src/common/kernel/resources.c | 2 +- src/common/kernel/resources.h | 4 +++- src/common/kernel/save.c | 22 +++++++++--------- src/common/kernel/save.h | 2 +- src/common/kernel/spell.c | 26 ++++++++++----------- src/common/kernel/terrain.c | 20 ++++++++-------- src/common/kernel/terrain.h | 2 +- src/common/kernel/unit.c | 6 +---- src/common/modules/xmas2000.c | 2 +- src/common/settings-eressea.h | 20 ++++++++++++++++ src/common/settings-vinyambar-classic.h | 20 ++++++++++++++++ src/eressea/attributes.c | 6 +---- src/eressea/korrektur.c | 13 +++++++---- src/eressea/main.c | 3 ++- src/mapper/map_modify.c | 22 +++++++++--------- src/mapper/map_region.c | 6 ++--- src/mapper/mapper.c | 4 +++- src/res/vinyambar.xml | 2 +- 37 files changed, 232 insertions(+), 180 deletions(-) create mode 100644 src/common/settings-eressea.h create mode 100644 src/common/settings-vinyambar-classic.h diff --git a/src/common/attributes/attributes.c b/src/common/attributes/attributes.c index b145ae1f9..8eed873f8 100644 --- a/src/common/attributes/attributes.c +++ b/src/common/attributes/attributes.c @@ -36,9 +36,7 @@ #ifdef AT_OPTION # include "option.h" #endif -#ifdef AT_MOVED -# include "moved.h" -#endif +#include "moved.h" /* util includes */ #include @@ -65,9 +63,7 @@ init_attributes(void) init_racename(); init_synonym(); -#ifdef AT_MOVED init_moved(); -#endif #ifdef AT_OPTION init_option(); #endif diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 2239877b9..53d4ad129 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -1014,7 +1014,7 @@ report_computer(FILE * F, faction * f, const seen_region * seen, fprintf(F, "\"%s\";Beschr\n", r->display); #endif if (landregion(rterrain(r))) { -#ifdef GROWING_TREES +#if GROWING_TREES int trees = rtrees(r,2); int ytrees = rtrees(r,1); # ifdef RESOURCECOMPAT @@ -1050,7 +1050,7 @@ report_computer(FILE * F, faction * f, const seen_region * seen, if (seemode>=see_unit) { struct demand * dmd = r->land->demands; -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH struct rawmaterial * res = r->resources; fprintf(F, "%d;Silber\n", rmoney(r)); diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 10761bee9..b723ce3d4 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -73,7 +73,9 @@ #include #include -#include +#if GROWING_TREES +# include +#endif /* - static global symbols ------------------------------------- */ typedef struct spende { @@ -1606,7 +1608,7 @@ enum { AFL_DONE = 1<<0, AFL_LOWSKILL = 1<<1 }; -#ifdef NEW_RESOURCEGROWTH + static int required(int want, double save) { @@ -1615,6 +1617,7 @@ required(int want, double save) return norders; } +#if NEW_RESOURCEGROWTH static void 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); change_skill(al->unit, itype->construction->skill, al->unit->number * PRODUCEEXP); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH fset(r, RF_DH); #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)); } -#ifdef GROWING_TREES +#if GROWING_TREES void planttrees(region *r, unit *u, int raw) { @@ -2589,21 +2592,21 @@ pflanze(region *r, unit *u) plant(r, u, m); return; } +#if GROWING_TREES else if (p==P_TREES){ planttrees(r, u, m); return; } else if (itype!=NULL){ -#ifdef GROWING_TREES if (itype==&it_mallornseed || itype==&it_seed){ planttrees(r, u, m); return; } -#endif } +#endif } -#ifdef GROWING_TREES +#if GROWING_TREES /* züchte bäume */ void @@ -2725,9 +2728,11 @@ zuechte(region *r, unit *u) case P_HERBS: plant(r, u, m); return; +#if GROWING_TREES case P_TREES: breedtrees(r, u, m); return; +#endif default: breedhorses(r, u); return; @@ -3260,7 +3265,7 @@ produce(void) zuechte(r, u); break; -#ifdef GROWING_TREES +#if GROWING_TREES case K_PFLANZE: planttrees(r, u, INT_MAX); 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_WOOD]), 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_IRON]), 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_mallornseed, attrib_allocation)); #endif diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 3e4040c9e..2c7b8ba29 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -579,7 +579,7 @@ migrate(region * r) * das hatte ich geändert. jemand hat es wieder gelöscht, toll. * ich habe es wieder aktiviert, muß getestet werden. */ -#ifndef GROWING_TREES +#if GROWING_TREES == 0 rsettrees(r, rtrees(r) + m->trees); #endif *hp = m->next; @@ -643,7 +643,7 @@ horses(region * r) assert(rhorses(r) >= 0); } -#ifdef GROWING_TREES +#if GROWING_TREES static int count_race(const region *r, const race *rc) @@ -878,7 +878,7 @@ trees(region * r) } #endif -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 extern attrib_type at_laen; static void iron(region * r) @@ -909,7 +909,7 @@ void demographics(void) { region *r; -#ifdef GROWING_TREES +#if GROWING_TREES int current_season = season(turn); int last_weeks_season = season(turn-1); #endif @@ -956,17 +956,17 @@ demographics(void) r->age++; horses(r); -#ifdef GROWING_TREES +#if GROWING_TREES if(current_season != SEASON_WINTER) { trees(r, current_season, last_weeks_season); } #else trees(r); #endif -#ifndef NEW_RESOURCEGROWTH - iron(r); -#else +#if NEW_RESOURCEGROWTH update_resources(r); +#else + iron(r); #endif migrate(r); } @@ -2859,7 +2859,7 @@ ageing(void) static int maxunits(faction *f) { - return MAXUNITS + 400 * fspecial(f, FS_ADMINISTRATOR); + return (int) (global.maxunits * (1 + 0.4 * fspecial(f, FS_ADMINISTRATOR))); } static void @@ -2981,7 +2981,9 @@ setdefaults (void) case K_TAX: case K_TEACH: case K_ZUECHTE: +#if GROWING_TREES case K_PFLANZE: +#endif case K_BIETE: case K_PIRACY: if (idle (u->faction)) { diff --git a/src/common/gamecode/laws.h b/src/common/gamecode/laws.h index 834b5cf47..18af73255 100644 --- a/src/common/gamecode/laws.h +++ b/src/common/gamecode/laws.h @@ -42,7 +42,7 @@ extern void sinkships(void); void processorders(void); extern int count_migrants (const struct faction * f); -#ifdef GROWING_TREES +#if GROWING_TREES extern attrib_type at_germs; #endif diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index a30aa88fa..2ce99a494 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -125,7 +125,7 @@ dissolve_units(void) break; case 2: if(r->land) { -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2) + n); #else rsettrees(r, rtrees(r) + n); @@ -733,7 +733,7 @@ volcano_outbreak(region *r) /* Vulkan-Region verwüsten */ -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, 0); rsettrees(r, 1, 0); rsettrees(r, 0, 0); @@ -777,7 +777,7 @@ volcano_outbreak(region *r) if (rn) { -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, 0); rsettrees(r, 1, 0); rsettrees(r, 0, 0); @@ -1205,7 +1205,7 @@ randomevents(void) * bekommen. */ if (r->land && !fval(r, RF_MALLORN)) { -#ifdef GROWING_TREES +#if GROWING_TREES int trees = rtrees(r,2); #else int trees = rtrees(r); @@ -1221,7 +1221,7 @@ randomevents(void) } } } -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, trees); #else rsettrees(r, trees); @@ -1479,7 +1479,7 @@ randomevents(void) 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 (woodcount(r) >= 40 && rand()%100 < 33) { -#ifdef GROWING_TREES +#if GROWING_TREES int trees = rtrees(r,2); #else int trees = rtrees(r); @@ -1490,7 +1490,7 @@ randomevents(void) treemen = max(25, treemen); woodcounts(r, -40); trees = max(0, trees-treemen); -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, trees); #else rsettrees(r, trees); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 605a64b81..f124e8791 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -988,7 +988,7 @@ describe(FILE * F, region * r, int partial, faction * f) boolean dh; direction_t d; int trees; -#ifdef GROWING_TREES +#if GROWING_TREES int ytrees; #endif attrib *a; @@ -1059,7 +1059,7 @@ describe(FILE * F, region * r, int partial, faction * f) /* Bäume */ -#ifdef GROWING_TREES +#if GROWING_TREES trees = rtrees(r,2); ytrees = rtrees(r,1); if (production(r)) { @@ -1101,7 +1101,7 @@ describe(FILE * F, region * r, int partial, faction * f) #endif /* Eisen */ -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH if (partial == 0 && f != (faction *) NULL) { struct rawmaterial * res; for (res=r->resources;res;res=res->next) { diff --git a/src/common/items/items.c b/src/common/items/items.c index 954ddbca4..8b8e5be8e 100644 --- a/src/common/items/items.c +++ b/src/common/items/items.c @@ -18,7 +18,9 @@ #include "demonseye.h" #include "weapons.h" #include "xerewards.h" -#include "seed.h" +#if GROWING_TREES +# include "seed.h" +#endif #include "birthday_firework.h" void @@ -28,8 +30,10 @@ register_items(void) register_demonseye(); init_lmsreward(); register_xerewards(); +#if GROWING_TREES init_seed(); init_mallornseed(); +#endif register_birthday_firework(); register_lebkuchenherz(); } diff --git a/src/common/items/seed.c b/src/common/items/seed.c index 35f2e3932..ac44744c2 100644 --- a/src/common/items/seed.c +++ b/src/common/items/seed.c @@ -1,25 +1,24 @@ /* vi: set ts=2: - * - * - * Eressea PB(E)M host Copyright (C) 1998-2000 - * 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) - * - * This program may not be used, modified or distributed without - * prior permission by the authors of Eressea. - */ + +-------------------+ Christian Schlittchen + | | Enno Rehling + | Eressea PBEM host | Katja Zedel + | (c) 1998 - 2001 | Henning Peters + | | Ingo Wilken + +-------------------+ Stefan Reich + This program may not be used, modified or distributed + without prior permission by the authors of Eressea. +*/ #include #include -#include -#include + +#if GROWING_TREES #include "seed.h" -#ifdef GROWING_TREES +#include +#include + /* kernel includes */ #include diff --git a/src/common/items/seed.h b/src/common/items/seed.h index cee6d045c..f403772b7 100644 --- a/src/common/items/seed.h +++ b/src/common/items/seed.h @@ -12,6 +12,7 @@ * prior permission by the authors of Eressea. */ +#if GROWING_TREES extern struct item_type it_seed; extern struct resource_type rt_seed; extern void init_seed(void); @@ -19,3 +20,6 @@ extern void init_seed(void); extern struct item_type it_mallornseed; extern struct resource_type rt_mallornseed; extern void init_mallornseed(void); +#else +#error seed.h should not be included when building with GROWING_TREES==0 +#endif diff --git a/src/common/kernel/alchemy.c b/src/common/kernel/alchemy.c index 2a683e0d1..0011d5db7 100644 --- a/src/common/kernel/alchemy.c +++ b/src/common/kernel/alchemy.c @@ -114,7 +114,7 @@ use_potion(unit * u, const item_type * itype, const char * cmd) holz = new_use_pooled(u, oldresourcetype[R_WOOD], GET_SLACK|GET_RESERVE|GET_POOLED_SLACK, 10); } -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 1, rtrees(r, 1) + holz); #else rsettrees(r, rtrees(r) + holz); diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 34efabccf..112fec1c8 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -66,9 +66,7 @@ typedef enum combatmagic { #include #include #include -#ifdef AT_MOVED -# include -#endif +#include /* libc includes */ #include @@ -79,10 +77,6 @@ typedef enum combatmagic { #include #include -#if !defined(AT_MOVED) && defined(DELAYED_OFFENSE) -# error "must define AT_MOVED to use combat option DELAYED_OFFENSE" -#endif - #ifdef HAVE_ZLIB # include # define dbgprintf(a) gzprintf a; diff --git a/src/common/kernel/build.h b/src/common/kernel/build.h index 19663a502..905e72ac8 100644 --- a/src/common/kernel/build.h +++ b/src/common/kernel/build.h @@ -30,7 +30,7 @@ enum { B_SITE, -#ifdef LARGE_CASTLES +#if LARGE_CASTLES B_TRADEPOST, #endif B_FORTIFICATION, diff --git a/src/common/kernel/building.c b/src/common/kernel/building.c index b52016443..47f87a51a 100644 --- a/src/common/kernel/building.c +++ b/src/common/kernel/building.c @@ -179,7 +179,7 @@ findbuilding(int i) #ifdef NEW_BUILDINGS enum { B_SITE, -#ifdef LARGE_CASTLES +#if LARGE_CASTLES B_TRADEPOST, #endif B_FORTIFICATION, @@ -196,7 +196,7 @@ castle_name(int bsize) { const char * fname[MAXBUILDINGS] = { "site", -#ifdef LARGE_CASTLES +#if LARGE_CASTLES "tradepost", #endif "fortification", @@ -221,7 +221,7 @@ static requirement castle_req[] = { { NORESOURCE, 0, 0.0 }, }; -#ifdef LARGE_CASTLES +#if LARGE_CASTLES static const construction castle_bld[MAXBUILDINGS] = { { SK_BUILDING, 1, 2, 1, castle_req, &castle_bld[1] }, { SK_BUILDING, 1, 8, 1, castle_req, &castle_bld[2] }, diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 09fe5182c..ddce167f0 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -229,7 +229,7 @@ const char *keywords[MAXKEYWORDS] = #endif "PRÄFIX", "SYNONYM", -#ifdef GROWING_TREES +#if GROWING_TREES "PFLANZEN", #endif }; @@ -1732,7 +1732,7 @@ idle (faction * f) int maxworkingpeasants(const struct region * r) { -#ifdef GROWING_TREES +#if GROWING_TREES int i = production(r) * MAXPEASANTS_PER_AREA - ((rtrees(r,2)+rtrees(r,1)/2) * TREESIZE); #else @@ -2096,6 +2096,16 @@ parse_tagbegin(struct xml_stack *stack, void *data) log_printf("required tag 'file' missing from include"); 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) { const char * name = xml_value(tag, "name"); if (xml_bvalue(tag, "disable")) { @@ -2304,7 +2314,7 @@ attrib_init(void) #endif at_register(&at_jihad); at_register(&at_skillmod); -#ifdef GROWING_TREES +#if GROWING_TREES at_register(&at_germs); #endif at_register(&at_laen); /* required for old datafiles */ diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 9b93daf56..d30540039 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -21,19 +21,20 @@ #ifndef ERESSEA_H #define ERESSEA_H -/* Features currently in development (change makefile please): */ -#ifndef MSG_LEVELS -# undef MSG_LEVELS /* msg-levels active */ -#endif +/* + * Features enabled: + * If you are lacking the settings.h, create a new file common/settings.h, + * and write #include (or whatever settings you want + * your game to use) in there. + * !!! DO NOT COMMIT THE SETTINGS.H FILE TO CVS !!! + */ +#include -/* Features enabled: */ -#define RESOURCE_FIX /* Should be removed soon! */ -#define NEW_RESOURCEGROWTH -#define LARGE_CASTLES -#define GROWING_TREES #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" */ typedef unsigned char order_t; @@ -167,7 +168,7 @@ struct xml_stack; #endif */ -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION extern void init_resourcefix(void); extern void read_iron(struct region * r, int iron); extern void read_laen(struct region * r, int laen); @@ -300,9 +301,6 @@ extern void plagues(struct region * r, boolean ismagic); /* Schiffsbeschädigungen */ #define SHIPDAMAGE -/* Maximale Einheitenzahl */ -#define MAXUNITS 1000 - /* regionen im Report der Parteien werden nur einmal berechnet: */ #define FAST_REGION @@ -437,7 +435,7 @@ enum { #endif K_PREFIX, K_SYNONYM, -#ifdef GROWING_TREES +#if GROWING_TREES K_PFLANZE, #endif MAXKEYWORDS, @@ -1170,6 +1168,7 @@ extern const struct race * new_race[]; /* globale settings des Spieles */ typedef struct settings { const char *gamename; + unsigned int maxunits; struct attrib *attribs; unsigned int data_version; boolean disabled[MAXKEYWORDS]; diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index b95a0bd3c..f39ce04be 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -1223,12 +1223,12 @@ limit_oldtypes(const region * r, const resource_type * rtype) /* TODO: split into seperate functions. really much nicer. */ { if (rtype==oldresourcetype[R_WOOD]) { -#ifdef GROWING_TREES +#if GROWING_TREES return rtrees(r,2) + rtrees(r,1); #else return rtrees(r); #endif -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 } else if (rtype==oldresourcetype[R_EOG]) { return rlaen(r); } else if (rtype==oldresourcetype[R_IRON]) { @@ -1237,7 +1237,7 @@ limit_oldtypes(const region * r, const resource_type * rtype) return terrain[rterrain(r)].quarries; #endif } else if (rtype==oldresourcetype[R_MALLORN]) { -#ifdef GROWING_TREES +#if GROWING_TREES return rtrees(r,2) + rtrees(r,1); #else return rtrees(r); @@ -1257,7 +1257,7 @@ use_oldresource(region * r, const resource_type * rtype, int norders) { assert(norders>0); if (rtype==oldresourcetype[R_WOOD] || rtype==oldresourcetype[R_MALLORN]) { -#ifdef GROWING_TREES +#if GROWING_TREES int avail_grownup = rtrees(r,2); int avail_young = rtrees(r,1); int avail = avail_grownup + avail_young; @@ -1284,7 +1284,7 @@ use_oldresource(region * r, const resource_type * rtype, int norders) rsettrees(r, avail-norders); woodcounts(r, norders); #endif -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 } else if (rtype==oldresourcetype[R_EOG]) { int avail = rlaen(r); assert(norders <= avail); diff --git a/src/common/kernel/region.c b/src/common/kernel/region.c index dbf2d08d9..610e9cd96 100644 --- a/src/common/kernel/region.c +++ b/src/common/kernel/region.c @@ -458,9 +458,8 @@ attrib_type at_travelunit = { NO_READ }; -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH extern int laen_read(attrib * a, FILE * F); - # define LAEN_READ laen_read # define LAEN_WRITE NULL #else @@ -555,7 +554,7 @@ rroad(const region * r, direction_t d) boolean 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; #else 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); } -#ifdef GROWING_TREES +#if GROWING_TREES int rtrees(const region *r, int ageclass) { @@ -797,7 +796,7 @@ void terraform(region * r, terrain_t t) { const struct locale * locale_de = find_locale("de"); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH rawmaterial **lrm; int i; #endif @@ -805,7 +804,7 @@ terraform(region * r, terrain_t t) /* defaults: */ rsetterrain(r, t); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH /* Resourcen, die nicht mehr vorkommen können, löschen */ lrm = &r->resources; while (*lrm) { @@ -822,7 +821,7 @@ terraform(region * r, terrain_t t) } #endif -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 rsetlaen(r, -1); rsetiron(r, 0); #endif @@ -831,7 +830,7 @@ terraform(region * r, terrain_t t) freeland(r->land); r->land = NULL; } -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 0, 0); rsettrees(r, 1, 0); rsettrees(r, 2, 0); @@ -839,7 +838,7 @@ terraform(region * r, terrain_t t) rsettrees(r, 0); #endif rsethorses(r, 0); -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 rsetiron(r, 0); rsetlaen(r, -1); #endif @@ -938,7 +937,7 @@ terraform(region * r, terrain_t t) case T_PLAIN: rsethorses(r, rand() % (terrain[t].production_max / 5)); if(rand()%100 < 40) { -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, terrain[t].production_max * (30+rand()%40)/100); rsettrees(r, 1, rtrees(r, 2)/4); rsettrees(r, 0, rtrees(r, 2)/2); @@ -948,14 +947,14 @@ terraform(region * r, terrain_t t) } break; case T_MOUNTAIN: -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 rsetiron(r, IRONSTART); if (rand() % 100 < 8) rsetlaen(r, 5 + rand() % 5); #endif break; case T_GLACIER: -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 if (riron(r) <= 0){ rsetiron(r, GLIRONSTART); } @@ -964,7 +963,7 @@ terraform(region * r, terrain_t t) case T_ICEBERG_SLEEP: /* Kann aus Gletscher entstehen und sollte diesem gleichen */ -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 if (riron(r) <= 0){ rsetiron(r, GLIRONSTART); } @@ -976,7 +975,7 @@ terraform(region * r, terrain_t t) break; } -#ifdef GROWING_TREES +#if GROWING_TREES /* Initialisierung irgendwann über rm_-Mechamismus machen */ if(t != T_PLAIN && rand()%100 < 20) { rsettrees(r, 2, terrain[t].production_max * (30 + rand() % 40) / 100); @@ -985,7 +984,7 @@ terraform(region * r, terrain_t t) } #endif -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH terraform_resources(r); #endif diff --git a/src/common/kernel/region.h b/src/common/kernel/region.h index adbab9dcb..55a13ad66 100644 --- a/src/common/kernel/region.h +++ b/src/common/kernel/region.h @@ -53,7 +53,7 @@ typedef struct land_region { } * demands; const struct herb_type * herbtype; short herbs; -#ifdef GROWING_TREES +#if GROWING_TREES int trees[3]; /* 0 -> Samen, 1 -> Sprößlinge, 2 -> Bäume */ #else int trees; @@ -62,7 +62,7 @@ typedef struct land_region { int peasants; int newpeasants; int money; -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 int iron; #endif } land_region; @@ -90,7 +90,7 @@ typedef struct region { #ifdef WEATHER weather_t weathertype; #endif -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH struct rawmaterial * resources; #endif } region; @@ -159,7 +159,7 @@ void rsetroad(struct region * r, direction_t d, int value); int is_coastregion(struct region *r); -#ifdef GROWING_TREES +#if GROWING_TREES int rtrees(const struct region * r, int ageclass); int rsettrees(const struct region *r, int ageclass, int value); #else @@ -177,7 +177,7 @@ void rsetmoney(struct region * r, int value); #define rbuildings(r) ((r)->buildings) -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 #define riron(r) ((r)->land?(r)->land->iron:0) #define rsetiron(r, value) ((r)->land?((r)->land->iron=(value)):(value),0) diff --git a/src/common/kernel/resources.c b/src/common/kernel/resources.c index c8867a91b..3d45621de 100644 --- a/src/common/kernel/resources.c +++ b/src/common/kernel/resources.c @@ -14,7 +14,7 @@ #include "eressea.h" #include "resources.h" -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH /* kernel includes */ #include "build.h" #include "item.h" diff --git a/src/common/kernel/resources.h b/src/common/kernel/resources.h index befcf0d53..a7be7a695 100644 --- a/src/common/kernel/resources.h +++ b/src/common/kernel/resources.h @@ -9,7 +9,8 @@ This program may not be used, modified or distributed without prior permission by the authors of Eressea. */ -#ifdef NEW_RESOURCEGROWTH +#ifndef RESOURCES_H +#if NEW_RESOURCEGROWTH enum { RM_USED = 1<<0, /* resource has been used */ @@ -56,3 +57,4 @@ extern struct rawmaterial_type rm_iron; extern struct rawmaterial_type rm_laen; #endif +#endif diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 7c9919562..740c1a1b9 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -88,7 +88,7 @@ static region * current_region; int firstx = 0, firsty = 0; -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION int laen_read(attrib * a, FILE * F) { int laen; @@ -728,7 +728,7 @@ read_items(FILE *F, item **ilist) } } -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION struct attrib_type at_resources = { "resources", NULL, NULL, NULL, NULL, NULL, ATF_UNIQUE }; @@ -1120,7 +1120,7 @@ readgame(boolean backup) } if (global.data_version < MEMSAVE_VERSION || r->land) { int i; -#ifdef GROWING_TREES +#if GROWING_TREES if(global.data_version < GROWTREE_VERSION) { i = ri(F); rsettrees(r, 2, i); } else { @@ -1132,10 +1132,10 @@ readgame(boolean backup) i = ri(F); rsettrees(r, i); #endif i = ri(F); rsethorses(r, i); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH if (global.data_version < NEWRESOURCE_VERSION) { i = ri(F); -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION if (i!=0) read_iron(r, i); #endif } else { @@ -1192,12 +1192,12 @@ readgame(boolean backup) rsetherbs(r, (short)ri(F)); } else if (global.data_versionland->name); wspace(F); -#ifdef GROWING_TREES +#if GROWING_TREES wi(F, rtrees(r,0)); wspace(F); wi(F, rtrees(r,1)); @@ -1947,7 +1947,7 @@ writegame(char *path, char quiet) #endif wi(F, rhorses(r)); wspace(F); -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 wi(F, riron(r)); #elif RELEASE_VERSION>=NEWRESOURCE_VERSION { diff --git a/src/common/kernel/save.h b/src/common/kernel/save.h index 00ff2a871..a000cc2fb 100644 --- a/src/common/kernel/save.h +++ b/src/common/kernel/save.h @@ -62,7 +62,7 @@ extern int read_faction_reference(struct faction ** f, FILE * F); extern const char * datapath(void); -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION extern struct attrib_type at_resources; #endif diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index 9750c2eda..662184909 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -920,7 +920,7 @@ sp_summonent(castorder *co) attrib *a; int ents; -#ifdef GROWING_TREES +#if GROWING_TREES if(rtrees(r,2) == 0) { #else if(rtrees(r) == 0) { @@ -930,7 +930,7 @@ sp_summonent(castorder *co) return 0; } -#ifdef GROWING_TREES +#if GROWING_TREES ents = min(power*power, rtrees(r,2)); #else ents = min(power*power, rtrees(r)); @@ -944,7 +944,7 @@ sp_summonent(castorder *co) a_add(&u->attribs, a); fset(u, FL_LOCKED); -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2) - ents); #else rsettrees(r, rtrees(r) - ents); @@ -1082,7 +1082,7 @@ sp_mallorn(castorder *co) } /* half the trees will die */ -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 0, rtrees(r,0)/2); @@ -1163,7 +1163,7 @@ sp_hain(castorder *co) } trees = lovar(force * 10) + force; -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 1, rtrees(r,1) + trees); #else rsettrees(r, rtrees(r) + trees); @@ -1580,7 +1580,7 @@ sp_great_drought(castorder *co) /* sterben */ rsetpeasants(r, rpeasants(r)/2); /* evtl wuerfeln */ -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 0, rtrees(r,0)/2); @@ -1613,7 +1613,7 @@ sp_great_drought(castorder *co) break; case T_GLACIER: -#ifndef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH == 0 rsetiron(r, 0); rsetlaen(r, -1); #endif @@ -2097,7 +2097,7 @@ sp_drought(castorder *co) c->duration = max(c->duration, power); } else { /* Baeume und Pferde sterben */ -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2)/2); rsettrees(r, 1, rtrees(r,1)/2); rsettrees(r, 0, rtrees(r,0)/2); @@ -2466,7 +2466,7 @@ sp_forest_fire(castorder *co) unit *u; region *nr; int prozent, chance, vernichtet; -#ifdef GROWING_TREES +#if GROWING_TREES int vernichtet_schoesslinge; #endif direction_t i; @@ -2475,7 +2475,7 @@ sp_forest_fire(castorder *co) int cast_level = co->level; prozent = (rand() % 71) + 10; /* 10 - 80% */ -#ifdef GROWING_TREES +#if GROWING_TREES vernichtet = rtrees(r,2) * prozent / 100; vernichtet_schoesslinge = rtrees(r,1) * prozent / 100; #else @@ -2487,7 +2487,7 @@ sp_forest_fire(castorder *co) return 0; } -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, rtrees(r,2) - vernichtet); rsettrees(r, 1, rtrees(r,1) - vernichtet_schoesslinge); #else @@ -2510,7 +2510,7 @@ sp_forest_fire(castorder *co) } } if(!fval(mage->faction, FL_DH)){ -#ifdef GROWING_TREES +#if GROWING_TREES sprintf(buf, "%s erzeugt eine verheerende Feuersbrunst. %d %s " "den Flammen zum Opfer.", unitname(mage), vernichtet+vernichtet_schoesslinge, vernichtet+vernichtet_schoesslinge == 1 ? "Baum fiel" : "Bäume fielen"); @@ -2527,7 +2527,7 @@ sp_forest_fire(castorder *co) assert(nr); vernichtet = 0; -#ifdef GROWING_TREES +#if GROWING_TREES if(rtrees(nr,2) + rtrees(nr,1) >= 800) { if((rand() % 100) < chance ) { vernichtet = rtrees(nr,2) * prozent / 200; diff --git a/src/common/kernel/terrain.c b/src/common/kernel/terrain.c index 97d083887..239083458 100644 --- a/src/common/kernel/terrain.c +++ b/src/common/kernel/terrain.c @@ -70,7 +70,7 @@ const terraindata_t terrain[] = { 1000, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LARGE_SHIPS|LAND_REGION, /* Flags */ plain_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "2d4-1", "5d8", "2d20+10", 10.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 15.0 }, { &rm_laen, "1d4", "1d4", "2d20+50", 1.0} } @@ -86,7 +86,7 @@ const terraindata_t terrain[] = { 200, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ swamp_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "2d4-1", "5d8", "2d20+10", 2.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 2.0 }, { &rm_laen, "1d4", "1d4", "2d20+50", 2.0} } @@ -102,7 +102,7 @@ const terraindata_t terrain[] = { 50, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ desert_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 25.0 }, { &rm_laen, "1d4", "1d4", "2d20+50", 2.5} } @@ -118,7 +118,7 @@ const terraindata_t terrain[] = { 400, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ highland_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "2d4-1", "5d8", "2d20+10", 15.0 }, { &rm_stones, "1d4", "5d8", "2d30+20", 20.0 }, { &rm_laen, "1d4", "1d4", "2d20+50", 2.5} } @@ -134,7 +134,7 @@ const terraindata_t terrain[] = { 100, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ mountain_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "50", "50", 100.0 }, { &rm_stones, "1", "100", "100", 100.0 }, { &rm_laen, "1", "4", "100", 5.0} } @@ -150,7 +150,7 @@ const terraindata_t terrain[] = { 10, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ glacier_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "3", "50", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 }, { &rm_laen, "1", "4", "100", 0.5} } @@ -220,7 +220,7 @@ const terraindata_t terrain[] = { 50, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ NULL, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "50", "50", 50.0 }, { &rm_stones, "1", "100", "100", 50.0 }, { &rm_laen, "1", "4", "100", 7.5} } @@ -235,7 +235,7 @@ const terraindata_t terrain[] = { 50, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ NULL, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "50", "50", 50.0 }, { &rm_stones, "1", "100", "100", 50.0 }, { &rm_laen, "1", "4", "100", 7.5} } @@ -251,7 +251,7 @@ const terraindata_t terrain[] = { 10, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ glacier_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "3", "50", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 }, { NULL, NULL, NULL, NULL, 100.0 } } @@ -267,7 +267,7 @@ const terraindata_t terrain[] = { 10, /* bewirtschaftbare Parzellen */ NORMAL_TERRAIN|LAND_REGION, /* Flags */ glacier_herbs, -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH { { &rm_iron, "1", "3", "50", 100.0 }, { &rm_stones, "1", "2", "100", 100.0 }, { NULL, NULL, NULL, NULL, 100.0 } } diff --git a/src/common/kernel/terrain.h b/src/common/kernel/terrain.h index 4a7e98ece..d4f35610c 100644 --- a/src/common/kernel/terrain.h +++ b/src/common/kernel/terrain.h @@ -77,7 +77,7 @@ typedef struct terraindata_t { */ unsigned int flags; const char ** herbs; -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH struct { const struct rawmaterial_type * type; const char *startlevel; diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index e4c1b53b2..361cea7d9 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -34,9 +34,7 @@ #include "region.h" #include "ship.h" -#ifdef AT_MOVED -# include -#endif +#include /* util includes */ #include @@ -684,9 +682,7 @@ move_unit(unit * u, region * r, unit ** ulist) if (u->region == r) return; if (!ulist) ulist = (&r->units); if (u->region) { -#ifdef AT_MOVED set_moved(&u->attribs); -#endif setguard(u, GUARD_NONE); fset(u, FL_MOVED); if (u->ship || u->building) leave(u->region, u); diff --git a/src/common/modules/xmas2000.c b/src/common/modules/xmas2000.c index 98af6fcb5..433caaf1f 100644 --- a/src/common/modules/xmas2000.c +++ b/src/common/modules/xmas2000.c @@ -213,7 +213,7 @@ create_xmas2000(int x, int y) r = new_region(x, y); terraform(r, T_PLAIN); set_string(&r->land->name, "Weihnachtsinsel"); -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r, 2, 1000); #else rsettrees(r, 1000); diff --git a/src/common/settings-eressea.h b/src/common/settings-eressea.h new file mode 100644 index 000000000..b3191130a --- /dev/null +++ b/src/common/settings-eressea.h @@ -0,0 +1,20 @@ +/* vi: set ts=2: + +-------------------+ Christian Schlittchen + | | Enno Rehling + | Eressea PBEM host | Katja Zedel + | (c) 1998 - 2001 | Henning Peters + | | Ingo Wilken + +-------------------+ Stefan Reich + + 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 diff --git a/src/common/settings-vinyambar-classic.h b/src/common/settings-vinyambar-classic.h new file mode 100644 index 000000000..808027f0a --- /dev/null +++ b/src/common/settings-vinyambar-classic.h @@ -0,0 +1,20 @@ +/* vi: set ts=2: + +-------------------+ Christian Schlittchen + | | Enno Rehling + | Eressea PBEM host | Katja Zedel + | (c) 1998 - 2001 | Henning Peters + | | Ingo Wilken + +-------------------+ Stefan Reich + + 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 diff --git a/src/eressea/attributes.c b/src/eressea/attributes.c index 5458d0065..42d982e1b 100644 --- a/src/eressea/attributes.c +++ b/src/eressea/attributes.c @@ -27,12 +27,10 @@ #include #include #include +#include #ifdef AT_OPTION # include #endif -#ifdef AT_MOVED -# include -#endif /* util includes */ #include @@ -51,9 +49,7 @@ init_attributes(void) init_reduceproduction(); init_racename(); init_otherfaction(); -#ifdef AT_MOVED init_moved(); -#endif #ifdef AT_OPTION init_option(); #endif diff --git a/src/eressea/korrektur.c b/src/eressea/korrektur.c index 6c4996031..f0da54660 100644 --- a/src/eressea/korrektur.c +++ b/src/eressea/korrektur.c @@ -2346,7 +2346,7 @@ update_igjarjuk_quest(void) } -#ifdef RESOURCE_FIX +#if RESOURCE_CONVERSION extern struct attrib_type at_resources; void init_resourcefix(void) @@ -2572,7 +2572,7 @@ fix_negpotion(void) } } -#ifdef GROWING_TREES +#if GROWING_TREES int growing_trees(void) { @@ -2689,6 +2689,7 @@ fix_ratfamiliar(void) return 0; } +#if NEW_RESOURCEGROWTH static int randomized_resources(void) { @@ -2704,6 +2705,7 @@ randomized_resources(void) } return 0; } +#endif void korrektur(void) @@ -2773,21 +2775,22 @@ korrektur(void) } do_once("sql2", dump_sql()); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH /* do not remove do_once calls - old datafiles need them! */ do_once("rgrw", convert_resources()); do_once("rsfx", read_resfix()); #endif /* do_once("xepl", create_xe()); */ -#ifdef GROWING_TREES +#if GROWING_TREES do_once("grtr", growing_trees()); #endif do_once("grat", fix_ratfamiliar()); do_once("fdmd", fix_demand()); +#if NEW_RESOURCEGROWTH do_once("rndr", randomized_resources()); - +#endif { /* Test der Message-Funktion. Ist leider noch nicht * Plane-übergreifend, deshalb die Waldelfen. */ diff --git a/src/eressea/main.c b/src/eressea/main.c index b50d815c4..5dda624a8 100644 --- a/src/eressea/main.c +++ b/src/eressea/main.c @@ -120,6 +120,7 @@ static boolean g_killeiswald = false; struct settings global = { "Eressea", /* gamename */ + 1000, /* maxunits */ }; static int @@ -172,7 +173,7 @@ game_init(void) init_attributes(); init_economy(); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH init_rawmaterials(); #endif diff --git a/src/mapper/map_modify.c b/src/mapper/map_modify.c index 96fba66fe..544b76185 100644 --- a/src/mapper/map_modify.c +++ b/src/mapper/map_modify.c @@ -244,23 +244,23 @@ addmenulist(menulist ** SP, const char *s, int *val) static int peasants, money, trees, horses, iron, laen, chaotisch; -#ifdef GROWING_TREES +#if GROWING_TREES static int ytrees, seeds; #endif -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH static int ironlevel, laenlevel, stone, stonelevel; #endif static void get_region(region *r) { -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH struct rawmaterial *res; #endif peasants = rpeasants(r); money = rmoney(r); -#ifdef GROWING_TREES +#if GROWING_TREES trees = rtrees(r,2); ytrees = rtrees(r,1); seeds = rtrees(r,0); @@ -268,7 +268,7 @@ get_region(region *r) { trees = rtrees(r); #endif horses = rhorses(r); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH iron = -1; ironlevel = -1; laen = -1; @@ -297,13 +297,13 @@ get_region(region *r) { static void put_region(region *r) { -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH struct rawmaterial *res; #endif rsetpeasants(r, peasants); rsetmoney(r,money); -#ifdef GROWING_TREES +#if GROWING_TREES rsettrees(r,2,trees); rsettrees(r,1,ytrees); rsettrees(r,0,seeds); @@ -311,7 +311,7 @@ put_region(region *r) { rsettrees(r,trees); #endif rsethorses(r, horses); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH for (res=r->resources;res;res=res->next) { const item_type * itype = resource2item(res->type->rtype); if(itype == olditemtype[I_IRON]) { @@ -347,19 +347,19 @@ create_region_menu(menulist ** menu, region * r) addmenulist(menu, "Silver", &money); if (fval(r, RF_MALLORN)) { addmenulist(menu, "Mallorntrees", &trees); -#ifdef GROWING_TREES +#if GROWING_TREES addmenulist(menu, "Mallornsprouts", &ytrees); addmenulist(menu, "Mallornseeds", &seeds); #endif } else { addmenulist(menu, "Trees", &trees); -#ifdef GROWING_TREES +#if GROWING_TREES addmenulist(menu, "Sprouts", &ytrees); addmenulist(menu, "Seeds", &seeds); #endif } addmenulist(menu, "Horses", &horses); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH if(iron != -1) { addmenulist(menu, "Iron", &iron); addmenulist(menu, "Ironlevel", &ironlevel); diff --git a/src/mapper/map_region.c b/src/mapper/map_region.c index 95629c5d7..a36266c03 100644 --- a/src/mapper/map_region.c +++ b/src/mapper/map_region.c @@ -173,7 +173,7 @@ showregion(region * r, char full) faction *f; int d,pp=0, ecount[MAXRACES], count[MAXRACES]; char str[256]; -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH int iron = -1, ironlevel = -1, laen = -1, laenlevel = -1, stone = -1, stonelevel = -1; @@ -200,7 +200,7 @@ showregion(region * r, char full) adddbllist(®list, buf); sprintf(buf, " %d peasants, %d(%d) silver", rpeasants(r), rmoney(r), count_all_money(r)); adddbllist(®list, buf); -#ifdef GROWING_TREES +#if GROWING_TREES sprintf(buf, " %d horses, %d/%d/%d ", rhorses(r), rtrees(r,2), rtrees(r,1), rtrees(r,0)); if (fval(r,RF_MALLORN)) @@ -216,7 +216,7 @@ showregion(region * r, char full) #endif adddbllist(®list, buf); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH for(res=r->resources;res;res=res->next) { const item_type * itype = resource2item(res->type->rtype); if(itype == olditemtype[I_IRON]) { diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index 9ead61537..8e03599c2 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -261,6 +261,7 @@ factionhere(region * r, int f) return false; } +#if NEW_RESOURCEGROWTH static boolean has_laen(region *r) { @@ -271,6 +272,7 @@ has_laen(region *r) } return false; } +#endif void drawmap(boolean maponly) { @@ -1362,7 +1364,7 @@ main(int argc, char *argv[]) init_resources(); register_items(); init_attributes(); -#ifdef NEW_RESOURCEGROWTH +#if NEW_RESOURCEGROWTH init_rawmaterials(); #endif diff --git a/src/res/vinyambar.xml b/src/res/vinyambar.xml index 09eebc3d9..dba4f7898 100644 --- a/src/res/vinyambar.xml +++ b/src/res/vinyambar.xml @@ -10,7 +10,7 @@ - + Game specific