version 1.5 | | version 1.6 |
---|
| | |
/* | | /* |
* static char *rcsid_weather_c = | | * static char *rcsid_weather_c = |
* "$Id: weather.c,v 1.5 2002/10/28 04:50:39 garbled Exp $"; | | * "$Id: weather.c,v 1.6 2002/10/28 10:20:08 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
} | | } |
delete_map(m); | | delete_map(m); |
/* jesus thats confusing as all hell */ | | /* jesus thats confusing as all hell */ |
weathermap[x][y].humid = water/(spwtx*spwty); | | printf("water %d humid %d\n", water, water*100/(spwtx*spwty)); |
| | weathermap[x][y].humid = water*100/(spwtx*spwty); |
weathermap[x][y].avgelev = elev/(spwtx*spwty); | | weathermap[x][y].avgelev = elev/(spwtx*spwty); |
weathermap[x][y].water = weathermap[x][y].humid; | | weathermap[x][y].water = weathermap[x][y].humid; |
} | | } |
| | |
read_pressuremap(); | | read_pressuremap(); |
read_winddirmap(); | | read_winddirmap(); |
read_windspeedmap(); | | read_windspeedmap(); |
| | read_watermap(); |
read_humidmap(); | | read_humidmap(); |
read_elevmap(); /* elevation must allways follow humidity */ | | read_elevmap(); /* elevation must allways follow humidity */ |
read_temperaturemap(); | | read_temperaturemap(); |
| | |
| | |
for (x=0; x < WEATHERMAPTILESX; x++) | | for (x=0; x < WEATHERMAPTILESX; x++) |
for (y=0; y < WEATHERMAPTILESY; y++) | | for (y=0; y < WEATHERMAPTILESY; y++) |
humid_tile(x, y); | | weathermap[x][y].humid = humid_tile(x, y); |
} | | } |
| | |
/* calculate the humidity of this tile */ | | /* calculate the humidity of this tile */ |
| | |
if (x != WEATHERMAPTILESX) | | if (x != WEATHERMAPTILESX) |
ox = x + 1; | | ox = x + 1; |
} | | } |
humid = MIN(100, (weathermap[x][y].humid + weathermap[ox][oy].humid * 2 + | | |
weathermap[x][y].water + rndm(-2,2)) / 4); | | |
| | |
| | humid = MIN(100, ((weathermap[x][y].humid * 2 + |
| | weathermap[ox][oy].humid * weathermap[ox][oy].windspeed + |
| | weathermap[x][y].water + rndm(-2, 2)) / |
| | (weathermap[ox][oy].windspeed+3))); |
return humid; | | return humid; |
} | | } |
| | |