diff --git a/src/common/kernel/alchemy.h b/src/common/kernel/alchemy.h index fcb3f0e96..9170335fa 100644 --- a/src/common/kernel/alchemy.h +++ b/src/common/kernel/alchemy.h @@ -59,7 +59,6 @@ extern void init_potions(void); extern int get_effect(const struct unit * u, const struct potion_type * effect); extern int change_effect(struct unit * u, const struct potion_type * effect, int value); extern struct attrib_type at_effect; -extern struct attrib_type at_potiondelay; /* rausnehmen, sobald man attribute splitten kann: */ typedef struct effect_data { diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 1058206e1..be3c23c9c 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2955,7 +2955,6 @@ attrib_init(void) /* neue UNIT-Attribute */ at_register(&at_siege); at_register(&at_effect); - at_register(&at_potiondelay); at_register(&at_private); at_register(&at_icastle); diff --git a/src/common/modules/autoseed.c b/src/common/modules/autoseed.c index c6573b429..783d3d8bf 100644 --- a/src/common/modules/autoseed.c +++ b/src/common/modules/autoseed.c @@ -810,8 +810,8 @@ random_neighbours(region * r, region_list ** rlist, const terrain_type *(*terraf const terrain_type * terrain = terraformer(dir); rn = new_region(r->x+delta_x[dir], r->y+delta_y[dir], 0); terraform_region(rn, terrain); + regionqueue_push(rlist, rn); if (rn->land) { - regionqueue_push(rlist, rn); ++nsize; } } @@ -824,11 +824,10 @@ const terrain_type * get_ocean(direction_t dir) return newterrain(T_OCEAN); } -int region_quality(const region * r) +int region_quality(const region * r, region * rn[]) { - region * rn[MAXDIRECTIONS]; int n, result = 0; - get_neighbours(r, rn); + for (n=0;n!=MAXDIRECTIONS;++n) { if (rn[n] && rn[n]->land) { if (rn[n]->terrain==newterrain(T_VOLCANO)) { @@ -841,7 +840,22 @@ int region_quality(const region * r) return result; } -static void smooth_island(region_list * island) +static void +oceans_around(region * r, region * rn[]) +{ + int n; + for (n=0;n!=MAXDIRECTIONS;++n) { + region * rx = rn[n]; + if (rx==NULL) { + rx = new_region(r->x+delta_x[n], r->y+delta_y[n], 0); + terraform_region(rx, newterrain(T_OCEAN)); + rn[n] = rx; + } + } +} + +static void +smooth_island(region_list * island) { region * rn[MAXDIRECTIONS]; region_list * rlist = NULL; @@ -849,47 +863,59 @@ static void smooth_island(region_list * island) region * r = rlist->data; int n, nland = 0; - assert(r->land); - get_neighbours(r, rn); - for (n=0;n!=MAXDIRECTIONS && nland<=1;++n) { - if (rn[n]->land) { - ++nland; - r = rn[n]; - } - } - - if (nland==1) { + if (r->land) { get_neighbours(r, rn); - for (n=0;n!=MAXDIRECTIONS;++n) { - int n1 = (n+1)%MAXDIRECTIONS; - int n2 = (n+1+MAXDIRECTIONS)%MAXDIRECTIONS; - if (!rn[n]->land && rn[n1]!=r && rn[n2]!=r) { - r = rlist->data; - runhash(r); - runhash(rn[n]); - SWAP(short, r->x, rn[n]->x); - SWAP(short, r->y, rn[n]->y); - rhash(r); - rhash(rn[n]); - rlist->data = r; - for (n=0;n!=MAXDIRECTIONS;++n) { - region * rx = rconnect(r, n); - if (rx==NULL) { - rx = new_region(r->x+delta_x[n], r->y+delta_y[n], 0); - terraform_region(rx, newterrain(T_OCEAN)); - } + for (n=0;n!=MAXDIRECTIONS && nland<=1;++n) { + if (rn[n]->land) { + ++nland; + r = rn[n]; + } + } + + if (nland==1) { + get_neighbours(r, rn); + for (n=0;n!=MAXDIRECTIONS;++n) { + int n1 = (n+1)%MAXDIRECTIONS; + int n2 = (n+1+MAXDIRECTIONS)%MAXDIRECTIONS; + if (!rn[n]->land && rn[n1]!=r && rn[n2]!=r) { + r = rlist->data; + runhash(r); + runhash(rn[n]); + SWAP(short, r->x, rn[n]->x); + SWAP(short, r->y, rn[n]->y); + rhash(r); + rhash(rn[n]); + rlist->data = r; + oceans_around(r, rn); + break; } - break; } } } } } +static void +starting_region(region * r, region * rn[]) +{ + unit * u; + int n; + + freset(r, RF_MARK); + for (n=0;n!=MAXDIRECTIONS;++n) { + freset(rn[n], RF_MARK); + } + terraform_region(r, newterrain(T_PLAIN)); + prepare_starting_region(r); + r->land->money = 50 * 1000; /* 2% = 1000 silver */ + u = addplayer(r, addfaction("enno@eressea.de", itoa36(rng_int()), races, + default_locale, 0)); +} /* E3A island generation */ int build_island_e3(short x, short y, int numfactions, int minsize) { +#define MIN_QUALITY 1000 int nfactions = 0; region_list * rlist = NULL; region_list * island = NULL; @@ -900,15 +926,15 @@ build_island_e3(short x, short y, int numfactions, int minsize) terraform_region(r, random_terrain_e3(NODIRECTION)); while (r) { + fset(r, RF_MARK); if (r->land) { - fset(r, RF_MARK); - regionqueue_push(&island, r); - } - if (nsizenext) { r = rlist->data; - if (fval(r, RF_MARK)) { + if (r->land && fval(r, RF_MARK)) { region *rn[MAXDIRECTIONS]; - int n; - unit * u; - freset(r, RF_MARK); get_neighbours(r, rn); - for (n=0;n!=MAXDIRECTIONS;++n) { - freset(rn[n], RF_MARK); - } - q = region_quality(r); - if (q>=1000 && nfactions=MIN_QUALITY && nfactionsnext) { + r = rlist->data; + if (!r->land && fval(r, RF_MARK)) { + region *rn[MAXDIRECTIONS]; + get_neighbours(r, rn); + q = region_quality(r, rn); + if (q>=MIN_QUALITY*4/3 && nfactionsland->money = 50 * 1000; /* 2% = 1000 silver */ - u = addplayer(r, addfaction("enno@eressea.de", itoa36(rng_int()), races, - default_locale, 0)); ++nfactions; } } diff --git a/src/res/e2k9/items.xml b/src/res/e2k9/items.xml index 0c2e5053b..1e4bb925e 100644 --- a/src/res/e2k9/items.xml +++ b/src/res/e2k9/items.xml @@ -44,7 +44,7 @@ - +