Beim erzeugen neuer Inseln keine Eisberge und Vulkane mehr machen.

This commit is contained in:
Enno Rehling 2005-12-31 13:01:11 +00:00
parent 9ea1f9fdf5
commit c30cebd352
6 changed files with 23 additions and 16 deletions

View File

@ -38,9 +38,8 @@ extern "C" {
#define FLY_INTO (1<<7) /* man darf hierhin fliegen */ #define FLY_INTO (1<<7) /* man darf hierhin fliegen */
#define SWIM_INTO (1<<8) /* man darf hierhin schwimmen */ #define SWIM_INTO (1<<8) /* man darf hierhin schwimmen */
#define WALK_INTO (1<<9) /* man darf hierhin laufen */ #define WALK_INTO (1<<9) /* man darf hierhin laufen */
#define LARGE_SHIPS (1<<10) /* grosse Schiffe dürfen hinfahren */ #define LARGE_SHIPS (1<<10) /* grosse Schiffe dürfen hinfahren */
#define AUTO_TERRAIN (1<<11) /* used by autoseed */
#define NORMAL_TERRAIN (WALK_INTO|SAIL_INTO|FLY_INTO)
typedef struct production_rule { typedef struct production_rule {
char * name; char * name;

View File

@ -1539,6 +1539,7 @@ parse_terrains(xmlDocPtr doc)
if (xml_bvalue(node, "swim", false)) terrain->flags |= SWIM_INTO; if (xml_bvalue(node, "swim", false)) terrain->flags |= SWIM_INTO;
if (xml_bvalue(node, "shallow", true)) terrain->flags |= LARGE_SHIPS; if (xml_bvalue(node, "shallow", true)) terrain->flags |= LARGE_SHIPS;
if (xml_bvalue(node, "cavalry", false)) terrain->flags |= CAVALRY_REGION; if (xml_bvalue(node, "cavalry", false)) terrain->flags |= CAVALRY_REGION;
if (xml_bvalue(node, "seed", true)) terrain->flags |= AUTO_TERRAIN;
} }
if (xml_bvalue(node, "sea", false)) terrain->flags |= SEA_REGION; if (xml_bvalue(node, "sea", false)) terrain->flags |= SEA_REGION;
if (xml_bvalue(node, "arctic", false)) terrain->flags |= ARCTIC_REGION; if (xml_bvalue(node, "arctic", false)) terrain->flags |= ARCTIC_REGION;

View File

@ -645,7 +645,7 @@ autoseed(newfaction ** players, int nsize, boolean new_island)
--isize; --isize;
if (psize>=PLAYERS_PER_ISLAND) break; if (psize>=PLAYERS_PER_ISLAND) break;
} else { } else {
terraform_region(r, random_terrain(NORMAL_TERRAIN)); terraform_region(r, random_terrain(AUTO_TERRAIN));
--isize; --isize;
} }
} }
@ -681,7 +681,7 @@ autoseed(newfaction ** players, int nsize, boolean new_island)
const struct terrain_type * terrain = newterrain(T_OCEAN); const struct terrain_type * terrain = newterrain(T_OCEAN);
rn = new_region(r->x + delta_x[d], r->y + delta_y[d]); rn = new_region(r->x + delta_x[d], r->y + delta_y[d]);
if (rand() % SPECIALCHANCE < special) { if (rand() % SPECIALCHANCE < special) {
terrain = random_terrain(NORMAL_TERRAIN); terrain = random_terrain(AUTO_TERRAIN);
special = SPECIALCHANCE / 3; /* 33% chance auf noch eines */ special = SPECIALCHANCE / 3; /* 33% chance auf noch eines */
} else { } else {
special = 1; special = 1;

View File

@ -366,6 +366,13 @@
</FileConfiguration> </FileConfiguration>
</File> </File>
</Filter> </Filter>
<Filter
Name="XML files"
Filter="">
<File
RelativePath="..\res\terrains.xml">
</File>
</Filter>
<File <File
RelativePath=".\console.c"> RelativePath=".\console.c">
</File> </File>

View File

@ -1154,7 +1154,7 @@ movearound(short rx, short ry) {
if (r!=NULL) { if (r!=NULL) {
a = map_input(0,0,0,"Wieviele Regionen?",0,500,0); a = map_input(0,0,0,"Wieviele Regionen?",0,500,0);
if (a) { if (a) {
const terrain_type * terrain = random_terrain(NORMAL_TERRAIN); const terrain_type * terrain = random_terrain(AUTO_TERRAIN);
create_island(r, a, terrain); create_island(r, a, terrain);
modified=1; modified=1;
} }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml version="1.0" encoding="ISO-8859-1"?>
<terrains> <terrains>
<!-- defaults: walk="yes" sail="yes" fly="yes" shallow="yes" swim="no" forest="no" sea="no" land="yes" forbidden="no" arctic="no" cavalry="no" --> <!-- defaults: walk="yes" sail="yes" fly="yes" shallow="yes" swim="no" forest="no" sea="no" land="yes" forbidden="no" arctic="no" cavalry="no" -->
<terrain name="ocean" size="100" shallow="no" walk="no" swim="yes" land="no" sea="yes"/> <terrain name="ocean" size="100" shallow="no" walk="no" swim="yes" land="no" sea="yes" seed="no"/>
<terrain name="plain" size="10000" road="50" shallow="no" forest="yes" cavalry="yes"> <terrain name="plain" size="10000" road="50" shallow="no" forest="yes" cavalry="yes">
<herb name="h0"/> <herb name="h0"/>
@ -60,7 +60,7 @@
<resource name="laen" chance="0.05" level="1" base="4" div="100"/> <resource name="laen" chance="0.05" level="1" base="4" div="100"/>
</terrain> </terrain>
<terrain name="iceberg_sleep" size="100" road="250" arctic="yes"> <terrain name="iceberg_sleep" size="100" road="250" arctic="yes" seed="no">
<herb name="h15"/> <herb name="h15"/>
<herb name="h16"/> <herb name="h16"/>
<herb name="h17"/> <herb name="h17"/>
@ -69,7 +69,7 @@
<resource name="laen" chance="0.05" level="1" base="4" div="100"/> <resource name="laen" chance="0.05" level="1" base="4" div="100"/>
</terrain> </terrain>
<terrain name="iceberg" size="100" arctic="yes"> <terrain name="iceberg" size="100" arctic="yes" seed="no">
<herb name="h15"/> <herb name="h15"/>
<herb name="h16"/> <herb name="h16"/>
<herb name="h17"/> <herb name="h17"/>
@ -77,10 +77,10 @@
<resource name="stone" chance="0.9" level="1" base="2" div="100"/> <resource name="stone" chance="0.9" level="1" base="2" div="100"/>
</terrain> </terrain>
<terrain name="firewall" size="100" road="250" land="no" walk="no" sail="no" fly="no" forbidden="yes"/> <terrain name="firewall" size="100" road="250" land="no" walk="no" sail="no" fly="no" forbidden="yes" seed="no"/>
<terrain name="fog" sail="no" land="no" size="0"/> <terrain name="fog" sail="no" land="no" size="0" seed="no"/>
<terrain name="thickfog" forbidden="yes" sail="no" walk="no" fly="no" land="no" size="0"/> <terrain name="thickfog" forbidden="yes" sail="no" walk="no" fly="no" land="no" size="0" seed="no"/>
<terrain name="volcano" size="500" road="250"> <terrain name="volcano" size="500" road="250">
<resource name="iron" chance="0.5" level="1" base="50" div="50"/> <resource name="iron" chance="0.5" level="1" base="50" div="50"/>
@ -88,15 +88,15 @@
<resource name="laen" chance="0.075" level="1" base="4" div="100"/> <resource name="laen" chance="0.075" level="1" base="4" div="100"/>
</terrain> </terrain>
<terrain name="activevolcano" size="500" road="250"> <terrain name="activevolcano" size="500" road="250" seed="no">
<resource name="iron" chance="0.5" level="1" base="50" div="50"/> <resource name="iron" chance="0.5" level="1" base="50" div="50"/>
<resource name="stone" chance="0.5" level="1" base="100" div="100"/> <resource name="stone" chance="0.5" level="1" base="100" div="100"/>
<resource name="laen" chance="0.075" level="1" base="4" div="100"/> <resource name="laen" chance="0.075" level="1" base="4" div="100"/>
</terrain> </terrain>
<!-- used for the museum only --> <!-- used for the museum only -->
<terrain name="hall1" sail="no" fly="no" size="0"/> <terrain name="hall1" sail="no" fly="no" size="0" seed="no"/>
<terrain name="corridor1" sail="no" fly="no" size="0"/> <terrain name="corridor1" sail="no" fly="no" size="0" seed="no"/>
<terrain name="wall1" forbidden="yes" size="0"/> <terrain name="wall1" forbidden="yes" size="0" seed="no"/>
</terrains> </terrains>