forked from github/server
removing the old NEW_RESOURCEGROWTh macro
This commit is contained in:
parent
5cc18d1e37
commit
4ce88dad13
|
@ -1315,9 +1315,7 @@ report_computer(FILE * F, faction * f, struct seen_region ** seen, const faction
|
||||||
|
|
||||||
if (sd->mode>=see_unit) {
|
if (sd->mode>=see_unit) {
|
||||||
struct demand * dmd = r->land->demands;
|
struct demand * dmd = r->land->demands;
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
struct rawmaterial * res = r->resources;
|
struct rawmaterial * res = r->resources;
|
||||||
#endif
|
|
||||||
fprintf(F, "%d;Silber\n", rmoney(r));
|
fprintf(F, "%d;Silber\n", rmoney(r));
|
||||||
fprintf(F, "%d;Unterh\n", entertainmoney(r));
|
fprintf(F, "%d;Unterh\n", entertainmoney(r));
|
||||||
|
|
||||||
|
@ -1330,7 +1328,6 @@ report_computer(FILE * F, faction * f, struct seen_region ** seen, const faction
|
||||||
fprintf(F, "%d;Lohn\n", fwage(r, f, true));
|
fprintf(F, "%d;Lohn\n", fwage(r, f, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
while (res) {
|
while (res) {
|
||||||
int maxskill = 0;
|
int maxskill = 0;
|
||||||
int level = -1;
|
int level = -1;
|
||||||
|
@ -1363,26 +1360,6 @@ report_computer(FILE * F, faction * f, struct seen_region ** seen, const faction
|
||||||
}
|
}
|
||||||
res = res->next;
|
res = res->next;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
const unit * u;
|
|
||||||
int maxmining = 0;
|
|
||||||
for (u = r->units; u; u = u->next) {
|
|
||||||
if (u->faction == f) {
|
|
||||||
int s = eff_skill(u, SK_MINING, r);
|
|
||||||
maxmining = max(maxmining, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (u = r->units; u; u = u->next) {
|
|
||||||
if (u->faction == f) {
|
|
||||||
int s = eff_skill(u, SK_MINING, r);
|
|
||||||
maxmining = max(maxmining, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (maxmining >= 4 && riron(r) > 0)
|
|
||||||
fprintf(F, "%d;Eisen\n", riron(r));
|
|
||||||
if (maxmining >= 7 && rlaen(r) > 0)
|
|
||||||
fprintf(F, "%d;Laen\n", rlaen(r));
|
|
||||||
#endif
|
|
||||||
/* trade */
|
/* trade */
|
||||||
if (!TradeDisabled() && rpeasants(r)/TRADE_FRACTION > 0) {
|
if (!TradeDisabled() && rpeasants(r)/TRADE_FRACTION > 0) {
|
||||||
fputs("PREISE\n", F);
|
fputs("PREISE\n", F);
|
||||||
|
|
|
@ -1405,7 +1405,6 @@ 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)
|
||||||
{
|
{
|
||||||
|
@ -1474,7 +1473,6 @@ leveled_allocation(const allocator * self, region * r, allocation * alist)
|
||||||
} while (need>0);
|
} while (need>0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
attrib_allocation(const allocator * self, region * r, allocation * alist)
|
attrib_allocation(const allocator * self, region * r, allocation * alist)
|
||||||
|
@ -1537,9 +1535,7 @@ split_allocations(region * r)
|
||||||
assert(itype || !"not implemented for non-items");
|
assert(itype || !"not implemented for non-items");
|
||||||
i_change(&al->unit->items, itype, al->get);
|
i_change(&al->unit->items, itype, al->get);
|
||||||
produceexp(al->unit, itype->construction->skill, al->unit->number);
|
produceexp(al->unit, itype->construction->skill, al->unit->number);
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
fset(r, RF_DH);
|
fset(r, RF_DH);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (al->want==INT_MAX) al->want = al->get;
|
if (al->want==INT_MAX) al->want = al->get;
|
||||||
if (fval(al, AFL_LOWSKILL)) {
|
if (fval(al, AFL_LOWSKILL)) {
|
||||||
|
@ -3239,15 +3235,9 @@ 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));
|
||||||
#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));
|
||||||
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));
|
||||||
#else
|
|
||||||
add_allocator(make_allocator(item2resource(olditemtype[I_STONE]), attrib_allocation));
|
|
||||||
add_allocator(make_allocator(item2resource(olditemtype[I_IRON]), attrib_allocation));
|
|
||||||
add_allocator(make_allocator(item2resource(olditemtype[I_LAEN]), attrib_allocation));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -848,27 +848,6 @@ trees(region * r, const int current_season, const int last_weeks_season)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
extern attrib_type at_laen;
|
|
||||||
static void
|
|
||||||
iron(region * r)
|
|
||||||
{
|
|
||||||
if(is_cursed(r->attribs, C_CURSED_BY_THE_GODS, 0)) return;
|
|
||||||
|
|
||||||
#ifndef NO_GROWTH
|
|
||||||
if (rterrain(r) == T_MOUNTAIN) {
|
|
||||||
rsetiron(r, riron(r) + IRONPERTURN);
|
|
||||||
if(a_find(r->attribs, &at_laen)) {
|
|
||||||
rsetlaen(r, rlaen(r) + rand() % MAXLAENPERTURN);
|
|
||||||
}
|
|
||||||
} else if (rterrain(r) == T_GLACIER || rterrain(r) == T_ICEBERG_SLEEP) {
|
|
||||||
rsetiron(r, min(MAXGLIRON, riron(r)+GLIRONPERTURN));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif /* NEW_RESOURCEGROWTH */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
demographics(void)
|
demographics(void)
|
||||||
{
|
{
|
||||||
|
@ -910,11 +889,7 @@ demographics(void)
|
||||||
if(current_season != SEASON_WINTER) {
|
if(current_season != SEASON_WINTER) {
|
||||||
trees(r, current_season, last_weeks_season);
|
trees(r, current_season, last_weeks_season);
|
||||||
}
|
}
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
update_resources(r);
|
update_resources(r);
|
||||||
#else
|
|
||||||
iron(r);
|
|
||||||
#endif
|
|
||||||
migrate(r);
|
migrate(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1089,7 +1089,6 @@ describe(FILE * F, const region * r, int partial, faction * f)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iron & stone */
|
/* iron & stone */
|
||||||
#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) {
|
||||||
|
@ -1121,23 +1120,6 @@ describe(FILE * F, const region * r, int partial, faction * f)
|
||||||
res->level + itype->construction->minskill - 1);
|
res->level + itype->construction->minskill - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (partial == 0 && f != (faction *) NULL) {
|
|
||||||
int maxmining = 0;
|
|
||||||
const unit * u;
|
|
||||||
for (u = r->units; u; u = u->next) {
|
|
||||||
if (u->faction == f) {
|
|
||||||
int s = eff_skill(u, SK_MINING, r);
|
|
||||||
maxmining = max(maxmining, s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (riron(r) > 0 && maxmining >= 4) {
|
|
||||||
bufp += sprinf(bufp, ", %d Eisen", riron(r));
|
|
||||||
}
|
|
||||||
if (rlaen(r)>=0 && maxmining >= 7) {
|
|
||||||
bufp += sprintf(bufp, ", %d Laen", rlaen(r));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* peasants & silver */
|
/* peasants & silver */
|
||||||
|
|
|
@ -1057,14 +1057,6 @@ limit_oldtypes(const region * r, const resource_type * rtype)
|
||||||
{
|
{
|
||||||
if (rtype==oldresourcetype[R_WOOD]) {
|
if (rtype==oldresourcetype[R_WOOD]) {
|
||||||
return rtrees(r,2) + rtrees(r,1);
|
return rtrees(r,2) + rtrees(r,1);
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
} else if (rtype==oldresourcetype[R_EOG]) {
|
|
||||||
return rlaen(r);
|
|
||||||
} else if (rtype==oldresourcetype[R_IRON]) {
|
|
||||||
return riron(r);
|
|
||||||
} else if (rtype==oldresourcetype[R_STONE]) {
|
|
||||||
return terrain[rterrain(r)].quarries;
|
|
||||||
#endif
|
|
||||||
} else if (rtype==oldresourcetype[R_MALLORN]) {
|
} else if (rtype==oldresourcetype[R_MALLORN]) {
|
||||||
return rtrees(r,2) + rtrees(r,1);
|
return rtrees(r,2) + rtrees(r,1);
|
||||||
} else if (rtype==oldresourcetype[R_HORSE]) {
|
} else if (rtype==oldresourcetype[R_HORSE]) {
|
||||||
|
@ -1101,16 +1093,6 @@ use_oldresource(region * r, const resource_type * rtype, int norders)
|
||||||
} else {
|
} else {
|
||||||
woodcounts(r, wcount*2);
|
woodcounts(r, wcount*2);
|
||||||
}
|
}
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
} else if (rtype==oldresourcetype[R_EOG]) {
|
|
||||||
int avail = rlaen(r);
|
|
||||||
assert(norders <= avail);
|
|
||||||
rsetlaen(r, avail-norders);
|
|
||||||
} else if (rtype==oldresourcetype[R_IRON]) {
|
|
||||||
int avail = riron(r);
|
|
||||||
assert(norders <= avail);
|
|
||||||
rsetiron(r, avail-norders);
|
|
||||||
#endif
|
|
||||||
} else if (rtype==oldresourcetype[R_HORSE]) {
|
} else if (rtype==oldresourcetype[R_HORSE]) {
|
||||||
int avail = rhorses(r);
|
int avail = rhorses(r);
|
||||||
assert(norders <= avail);
|
assert(norders <= avail);
|
||||||
|
|
|
@ -511,14 +511,9 @@ attrib_type at_travelunit = {
|
||||||
NO_READ
|
NO_READ
|
||||||
};
|
};
|
||||||
|
|
||||||
#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
|
|
||||||
# define LAEN_READ DEFAULT_READ
|
|
||||||
# define LAEN_WRITE DEFAULT_WRITE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/***************/
|
/***************/
|
||||||
/* at_laen */
|
/* at_laen */
|
||||||
|
@ -864,15 +859,12 @@ 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");
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
rawmaterial **lrm;
|
rawmaterial **lrm;
|
||||||
int i;
|
int i;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* defaults: */
|
/* defaults: */
|
||||||
rsetterrain(r, t);
|
rsetterrain(r, t);
|
||||||
|
|
||||||
#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) {
|
||||||
|
@ -887,12 +879,7 @@ terraform(region * r, terrain_t t)
|
||||||
lrm = &rm->next;
|
lrm = &rm->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
rsetlaen(r, -1);
|
|
||||||
rsetiron(r, 0);
|
|
||||||
#endif
|
|
||||||
if (!landregion(t)) {
|
if (!landregion(t)) {
|
||||||
if (r->land) {
|
if (r->land) {
|
||||||
freeland(r->land);
|
freeland(r->land);
|
||||||
|
@ -902,10 +889,6 @@ terraform(region * r, terrain_t t)
|
||||||
rsettrees(r, 1, 0);
|
rsettrees(r, 1, 0);
|
||||||
rsettrees(r, 2, 0);
|
rsettrees(r, 2, 0);
|
||||||
rsethorses(r, 0);
|
rsethorses(r, 0);
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
rsetiron(r, 0);
|
|
||||||
rsetlaen(r, -1);
|
|
||||||
#endif
|
|
||||||
rsetpeasants(r, 0);
|
rsetpeasants(r, 0);
|
||||||
rsetmoney(r, 0);
|
rsetmoney(r, 0);
|
||||||
freset(r, RF_ENCOUNTER);
|
freset(r, RF_ENCOUNTER);
|
||||||
|
@ -1009,27 +992,13 @@ terraform(region * r, terrain_t t)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case T_MOUNTAIN:
|
case T_MOUNTAIN:
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
rsetiron(r, IRONSTART);
|
|
||||||
if (rand() % 100 < 8) rsetlaen(r, 5 + rand() % 5);
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_GLACIER:
|
case T_GLACIER:
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
if (riron(r) <= 0){
|
|
||||||
rsetiron(r, GLIRONSTART);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_ICEBERG_SLEEP:
|
case T_ICEBERG_SLEEP:
|
||||||
/* Kann aus Gletscher entstehen und sollte diesem gleichen */
|
/* Kann aus Gletscher entstehen und sollte diesem gleichen */
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
if (riron(r) <= 0){
|
|
||||||
rsetiron(r, GLIRONSTART);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_VOLCANO:
|
case T_VOLCANO:
|
||||||
|
@ -1044,10 +1013,6 @@ terraform(region * r, terrain_t t)
|
||||||
rsettrees(r, 0, rtrees(r, 2)/2);
|
rsettrees(r, 0, rtrees(r, 2)/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
terraform_resources(r);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (terrain[t].production_max && !fval(r, RF_CHAOTIC)) {
|
if (terrain[t].production_max && !fval(r, RF_CHAOTIC)) {
|
||||||
int peasants;
|
int peasants;
|
||||||
#if REDUCED_PEASANTGROWTH == 1
|
#if REDUCED_PEASANTGROWTH == 1
|
||||||
|
|
|
@ -76,9 +76,6 @@ typedef struct land_region {
|
||||||
int peasants;
|
int peasants;
|
||||||
int newpeasants;
|
int newpeasants;
|
||||||
int money;
|
int money;
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
int iron;
|
|
||||||
#endif
|
|
||||||
} land_region;
|
} land_region;
|
||||||
|
|
||||||
typedef struct donation {
|
typedef struct donation {
|
||||||
|
@ -108,9 +105,7 @@ typedef struct region {
|
||||||
struct region *nexthash;
|
struct region *nexthash;
|
||||||
struct donation * donations;
|
struct donation * donations;
|
||||||
terrain_t terrain;
|
terrain_t terrain;
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
struct rawmaterial * resources;
|
struct rawmaterial * resources;
|
||||||
#endif
|
|
||||||
#ifdef FAST_CONNECT
|
#ifdef FAST_CONNECT
|
||||||
struct region * connect[MAXDIRECTIONS];
|
struct region * connect[MAXDIRECTIONS];
|
||||||
#endif
|
#endif
|
||||||
|
@ -202,12 +197,6 @@ void rsethorses(const struct region * r, int value);
|
||||||
|
|
||||||
#define rbuildings(r) ((r)->buildings)
|
#define rbuildings(r) ((r)->buildings)
|
||||||
|
|
||||||
#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)
|
|
||||||
|
|
||||||
#endif /* NEW_RESOURCEGROWTH */
|
|
||||||
|
|
||||||
extern int rlaen(const struct region * r);
|
extern int rlaen(const struct region * r);
|
||||||
extern void rsetlaen(struct region * r, int value);
|
extern void rsetlaen(struct region * r, int value);
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "eressea.h"
|
#include "eressea.h"
|
||||||
#include "resources.h"
|
#include "resources.h"
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
/* kernel includes */
|
/* kernel includes */
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
@ -193,27 +192,6 @@ struct rawmaterial_type rm_laen = {
|
||||||
visible_default
|
visible_default
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
|
||||||
static struct rawmaterial_type rm_mallorn = {
|
|
||||||
"rm_mallorn",
|
|
||||||
I_MALLORN, NULL,
|
|
||||||
terraform_trees,
|
|
||||||
update_trees,
|
|
||||||
use_trees,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct rawmaterial_type rm_trees = {
|
|
||||||
"rm_trees",
|
|
||||||
I_WOOD, NULL,
|
|
||||||
terraform_trees,
|
|
||||||
update_trees,
|
|
||||||
use_trees,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
struct rawmaterial_type * rawmaterialtypes = 0;
|
struct rawmaterial_type * rawmaterialtypes = 0;
|
||||||
|
|
||||||
struct rawmaterial_type *
|
struct rawmaterial_type *
|
||||||
|
@ -238,10 +216,4 @@ init_rawmaterials(void)
|
||||||
add_rawmaterial(&rm_stones);
|
add_rawmaterial(&rm_stones);
|
||||||
add_rawmaterial(&rm_iron);
|
add_rawmaterial(&rm_iron);
|
||||||
add_rawmaterial(&rm_laen);
|
add_rawmaterial(&rm_laen);
|
||||||
#if 0
|
|
||||||
add_rawmaterial(&rm_wood);
|
|
||||||
add_rawmaterial(&rm_mallorn);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1388,7 +1388,6 @@ readregion(FILE * F, short x, short y)
|
||||||
rsettrees(r, 2, i);
|
rsettrees(r, 2, i);
|
||||||
}
|
}
|
||||||
i = ri(F); rsethorses(r, i);
|
i = ri(F); rsethorses(r, i);
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
if (global.data_version < NEWRESOURCE_VERSION) {
|
if (global.data_version < NEWRESOURCE_VERSION) {
|
||||||
i = ri(F);
|
i = ri(F);
|
||||||
#if RESOURCE_CONVERSION
|
#if RESOURCE_CONVERSION
|
||||||
|
@ -1426,9 +1425,6 @@ readregion(FILE * F, short x, short y)
|
||||||
pres=&res->next;
|
pres=&res->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
i = ri(F); rsetiron(r, i);
|
|
||||||
#endif
|
|
||||||
if (global.data_version>=ITEMTYPE_VERSION) {
|
if (global.data_version>=ITEMTYPE_VERSION) {
|
||||||
rs(F, buf);
|
rs(F, buf);
|
||||||
if (strcmp(buf, "noherb") != 0) {
|
if (strcmp(buf, "noherb") != 0) {
|
||||||
|
@ -1502,9 +1498,7 @@ writeregion(FILE * F, const region * r)
|
||||||
wi(F, rtrees(r,1));
|
wi(F, rtrees(r,1));
|
||||||
wi(F, rtrees(r,2));
|
wi(F, rtrees(r,2));
|
||||||
wi(F, rhorses(r));
|
wi(F, rhorses(r));
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
#if RELEASE_VERSION>=NEWRESOURCE_VERSION
|
||||||
wi(F, riron(r));
|
|
||||||
#elif RELEASE_VERSION>=NEWRESOURCE_VERSION
|
|
||||||
{
|
{
|
||||||
rawmaterial * res = r->resources;
|
rawmaterial * res = r->resources;
|
||||||
while (res) {
|
while (res) {
|
||||||
|
|
|
@ -70,11 +70,9 @@ 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,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_SWAMP */
|
/* T_SWAMP */
|
||||||
{
|
{
|
||||||
|
@ -86,11 +84,9 @@ const terraindata_t terrain[] = {
|
||||||
200, /* bewirtschaftbare Parzellen */
|
200, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
swamp_herbs,
|
swamp_herbs,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_DESERT */
|
/* T_DESERT */
|
||||||
{
|
{
|
||||||
|
@ -102,11 +98,9 @@ const terraindata_t terrain[] = {
|
||||||
50, /* bewirtschaftbare Parzellen */
|
50, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
desert_herbs,
|
desert_herbs,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_HIGHLAND */
|
/* T_HIGHLAND */
|
||||||
{
|
{
|
||||||
|
@ -118,11 +112,9 @@ const terraindata_t terrain[] = {
|
||||||
400, /* bewirtschaftbare Parzellen */
|
400, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
highland_herbs,
|
highland_herbs,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_MOUNTAIN */
|
/* T_MOUNTAIN */
|
||||||
{
|
{
|
||||||
|
@ -134,11 +126,9 @@ const terraindata_t terrain[] = {
|
||||||
100, /* bewirtschaftbare Parzellen */
|
100, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
mountain_herbs,
|
mountain_herbs,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_GLACIER */
|
/* T_GLACIER */
|
||||||
{
|
{
|
||||||
|
@ -150,11 +140,9 @@ const terraindata_t terrain[] = {
|
||||||
10, /* bewirtschaftbare Parzellen */
|
10, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
glacier_herbs,
|
glacier_herbs,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_FIREWALL */
|
/* T_FIREWALL */
|
||||||
{
|
{
|
||||||
|
@ -220,11 +208,9 @@ const terraindata_t terrain[] = {
|
||||||
50, /* bewirtschaftbare Parzellen */
|
50, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
NULL,
|
NULL,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"activevolcano", 'V',
|
"activevolcano", 'V',
|
||||||
|
@ -235,11 +221,9 @@ const terraindata_t terrain[] = {
|
||||||
50, /* bewirtschaftbare Parzellen */
|
50, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
NULL,
|
NULL,
|
||||||
#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} }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_ICEBERG_SLEEP */
|
/* T_ICEBERG_SLEEP */
|
||||||
{
|
{
|
||||||
|
@ -251,11 +235,9 @@ const terraindata_t terrain[] = {
|
||||||
10, /* bewirtschaftbare Parzellen */
|
10, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
glacier_herbs,
|
glacier_herbs,
|
||||||
#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 } }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_ICEBERG */
|
/* T_ICEBERG */
|
||||||
{
|
{
|
||||||
|
@ -267,11 +249,9 @@ const terraindata_t terrain[] = {
|
||||||
10, /* bewirtschaftbare Parzellen */
|
10, /* bewirtschaftbare Parzellen */
|
||||||
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
NORMAL_TERRAIN|LAND_REGION, /* Flags */
|
||||||
glacier_herbs,
|
glacier_herbs,
|
||||||
#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 } }
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
/* T_HALL1 */
|
/* T_HALL1 */
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,7 +81,6 @@ typedef struct terraindata_t {
|
||||||
*/
|
*/
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
const char ** herbs;
|
const char ** herbs;
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
struct {
|
struct {
|
||||||
const struct rawmaterial_type * type;
|
const struct rawmaterial_type * type;
|
||||||
const char *startlevel;
|
const char *startlevel;
|
||||||
|
@ -89,7 +88,6 @@ typedef struct terraindata_t {
|
||||||
const char *divisor;
|
const char *divisor;
|
||||||
double chance;
|
double chance;
|
||||||
} rawmaterials[3];
|
} rawmaterials[3];
|
||||||
#endif
|
|
||||||
} terraindata_t;
|
} terraindata_t;
|
||||||
|
|
||||||
extern const terraindata_t terrain[];
|
extern const terraindata_t terrain[];
|
||||||
|
|
|
@ -1686,10 +1686,6 @@ sp_great_drought(castorder *co)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_GLACIER:
|
case T_GLACIER:
|
||||||
#if NEW_RESOURCEGROWTH == 0
|
|
||||||
rsetiron(r, 0);
|
|
||||||
rsetlaen(r, -1);
|
|
||||||
#endif
|
|
||||||
if (rand() % 100 < 50){
|
if (rand() % 100 < 50){
|
||||||
rsetterrain(r, T_SWAMP);
|
rsetterrain(r, T_SWAMP);
|
||||||
destroy_all_roads(r);
|
destroy_all_roads(r);
|
||||||
|
|
|
@ -236,9 +236,7 @@ game_init(void)
|
||||||
init_races();
|
init_races();
|
||||||
init_itemtypes();
|
init_itemtypes();
|
||||||
init_economy();
|
init_economy();
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
init_rawmaterials();
|
init_rawmaterials();
|
||||||
#endif
|
|
||||||
|
|
||||||
init_gmcmd();
|
init_gmcmd();
|
||||||
#ifdef INFOCMD_MODULE
|
#ifdef INFOCMD_MODULE
|
||||||
|
|
|
@ -239,15 +239,11 @@ static int peasants, money, trees, horses, iron, laen, chaotisch;
|
||||||
|
|
||||||
static int ytrees, seeds;
|
static int ytrees, seeds;
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
static int ironlevel, laenlevel, stone, stonelevel;
|
static int ironlevel, laenlevel, stone, stonelevel;
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
get_region(region *r) {
|
get_region(region *r) {
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
struct rawmaterial *res;
|
struct rawmaterial *res;
|
||||||
#endif
|
|
||||||
|
|
||||||
peasants = rpeasants(r);
|
peasants = rpeasants(r);
|
||||||
money = rmoney(r);
|
money = rmoney(r);
|
||||||
|
@ -255,7 +251,6 @@ get_region(region *r) {
|
||||||
ytrees = rtrees(r,1);
|
ytrees = rtrees(r,1);
|
||||||
seeds = rtrees(r,0);
|
seeds = rtrees(r,0);
|
||||||
horses = rhorses(r);
|
horses = rhorses(r);
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
iron = -1;
|
iron = -1;
|
||||||
ironlevel = -1;
|
ironlevel = -1;
|
||||||
laen = -1;
|
laen = -1;
|
||||||
|
@ -275,18 +270,12 @@ get_region(region *r) {
|
||||||
stonelevel = res->level + itype->construction->minskill - 1;
|
stonelevel = res->level + itype->construction->minskill - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
iron = riron(r);
|
|
||||||
laen = rlaen(r);
|
|
||||||
#endif
|
|
||||||
chaotisch = fval(r, RF_CHAOTIC);
|
chaotisch = fval(r, RF_CHAOTIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
put_region(region *r) {
|
put_region(region *r) {
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
struct rawmaterial *res;
|
struct rawmaterial *res;
|
||||||
#endif
|
|
||||||
|
|
||||||
rsetpeasants(r, peasants);
|
rsetpeasants(r, peasants);
|
||||||
rsetmoney(r,money);
|
rsetmoney(r,money);
|
||||||
|
@ -294,7 +283,7 @@ put_region(region *r) {
|
||||||
rsettrees(r,1,ytrees);
|
rsettrees(r,1,ytrees);
|
||||||
rsettrees(r,0,seeds);
|
rsettrees(r,0,seeds);
|
||||||
rsethorses(r, horses);
|
rsethorses(r, horses);
|
||||||
#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]) {
|
||||||
|
@ -308,10 +297,6 @@ put_region(region *r) {
|
||||||
res->level = stonelevel - itype->construction->minskill + 1;
|
res->level = stonelevel - itype->construction->minskill + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
rsetiron(r, iron);
|
|
||||||
rsetlaen(r, laen);
|
|
||||||
#endif
|
|
||||||
if (chaotisch) fset(r, RF_CHAOTIC); else freset(r, RF_CHAOTIC);
|
if (chaotisch) fset(r, RF_CHAOTIC); else freset(r, RF_CHAOTIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,7 +323,7 @@ create_region_menu(menulist ** menu, region * r)
|
||||||
addmenulist(menu, "Seeds", &seeds);
|
addmenulist(menu, "Seeds", &seeds);
|
||||||
}
|
}
|
||||||
addmenulist(menu, "Horses", &horses);
|
addmenulist(menu, "Horses", &horses);
|
||||||
#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);
|
||||||
|
@ -351,12 +336,6 @@ create_region_menu(menulist ** menu, region * r)
|
||||||
addmenulist(menu, "Stone", &stone);
|
addmenulist(menu, "Stone", &stone);
|
||||||
addmenulist(menu, "Stonelevel", &stonelevel);
|
addmenulist(menu, "Stonelevel", &stonelevel);
|
||||||
/* } */
|
/* } */
|
||||||
#else
|
|
||||||
if (r->terrain == T_MOUNTAIN || r->terrain == T_GLACIER) {
|
|
||||||
addmenulist(menu, "Iron", &iron);
|
|
||||||
addmenulist(menu, "Laen", &laen);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
addmenulist(menu, "Chaos-Factor", &chaotisch);
|
addmenulist(menu, "Chaos-Factor", &chaotisch);
|
||||||
|
|
||||||
if (r->planep) {
|
if (r->planep) {
|
||||||
|
|
|
@ -325,7 +325,6 @@ alliancehere(region * r, int allied)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
static boolean
|
static boolean
|
||||||
has_laen(region *r)
|
has_laen(region *r)
|
||||||
{
|
{
|
||||||
|
@ -336,14 +335,6 @@ has_laen(region *r)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
static boolean
|
|
||||||
has_laen(region *r)
|
|
||||||
{
|
|
||||||
if(rlaen(r) >= 0) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
crwritemap(void)
|
crwritemap(void)
|
||||||
|
@ -1666,9 +1657,7 @@ main(int argc, char *argv[])
|
||||||
init_locales();
|
init_locales();
|
||||||
init_attributes();
|
init_attributes();
|
||||||
|
|
||||||
#if NEW_RESOURCEGROWTH
|
|
||||||
init_rawmaterials();
|
init_rawmaterials();
|
||||||
#endif
|
|
||||||
|
|
||||||
init_gmcmd();
|
init_gmcmd();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue