More gentle terraforming: If a region is terraformed and has the same size as before, no need to change the trees. No need to change peasants or money either

This commit is contained in:
Enno Rehling 2005-11-11 22:53:58 +00:00
parent 3081922ad7
commit 29b84b640e
1 changed files with 27 additions and 24 deletions

View File

@ -855,6 +855,8 @@ void
terraform_region(region * r, const terrain_type * terrain) terraform_region(region * r, const terrain_type * terrain)
{ {
/* Resourcen, die nicht mehr vorkommen können, löschen */ /* Resourcen, die nicht mehr vorkommen können, löschen */
const terrain_type * oldterrain = r->terrain;
rawmaterial **lrm = &r->resources; rawmaterial **lrm = &r->resources;
while (*lrm) { while (*lrm) {
rawmaterial *rm = *lrm; rawmaterial *rm = *lrm;
@ -880,7 +882,7 @@ terraform_region(region * r, const terrain_type * terrain)
r->terrain = terrain; r->terrain = terrain;
if (!fval(terrain, LAND_REGION)) { if (!fval(terrain, LAND_REGION)) {
if (r->land) { if (r->land!=NULL) {
freeland(r->land); freeland(r->land);
r->land = NULL; r->land = NULL;
} }
@ -969,38 +971,39 @@ terraform_region(region * r, const terrain_type * terrain)
else { else {
rsetherbtype(r, NULL); rsetherbtype(r, NULL);
} }
if (!fval(oldterrain, LAND_REGION)) {
if (rand() % 100 < 3) fset(r, RF_MALLORN);
else freset(r, RF_MALLORN);
if (rand() % 100 < ENCCHANCE) {
fset(r, RF_ENCOUNTER);
}
}
} }
if (rand() % 100 < ENCCHANCE) { if (terrain->size!=oldterrain->size) {
fset(r, RF_ENCOUNTER); if (terrain==newterrain(T_PLAIN)) {
} rsethorses(r, rand() % (terrain->size / 50));
if (rand() % 100 < 3) if(rand()%100 < 40) {
fset(r, RF_MALLORN); rsettrees(r, 2, terrain->size * (30+rand()%40)/1000);
else rsettrees(r, 1, rtrees(r, 2)/4);
freset(r, RF_MALLORN); rsettrees(r, 0, rtrees(r, 2)/2);
}
if (oldterrain(terrain)==T_PLAIN) { } else if (chance(0.2)) {
rsethorses(r, rand() % (terrain->size / 50)); rsettrees(r, 2, terrain->size * (30 + rand() % 40) / 1000);
if(rand()%100 < 40) {
rsettrees(r, 2, terrain->size * (30+rand()%40)/1000);
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);
} }
} else if (chance(0.2)) {
rsettrees(r, 2, terrain->size * (30 + rand() % 40) / 1000);
rsettrees(r, 1, rtrees(r, 2)/4);
rsettrees(r, 0, rtrees(r, 2)/2);
}
if (terrain->size>0 && !fval(r, RF_CHAOTIC)) { if (!fval(r, RF_CHAOTIC)) {
int peasants; int peasants;
#if REDUCED_PEASANTGROWTH == 1 #if REDUCED_PEASANTGROWTH == 1
peasants = (maxworkingpeasants(r) * (20+dice_rand("6d10")))/100; peasants = (maxworkingpeasants(r) * (20+dice_rand("6d10")))/100;
#else #else
peasants = MAXPEASANTS_PER_AREA * (rand() % (terrain->size / MAXPEASANTS_PER_AREA / 2)); peasants = MAXPEASANTS_PER_AREA * (rand() % (terrain->size / MAXPEASANTS_PER_AREA / 2));
#endif #endif
rsetpeasants(r, max(100, peasants)); rsetpeasants(r, max(100, peasants));
rsetmoney(r, rpeasants(r) * ((wage(r, NULL, false)+1) + rand() % 5)); rsetmoney(r, rpeasants(r) * ((wage(r, NULL, false)+1) + rand() % 5));
}
} }
} }