Bernhard
Forum-Team
    
Beiträge: 9.397
Registriert seit: Jan 2004
|
also wenn ich das auf die schnelle richtig gelesen habe hat sich nichts geändert, bis auf die Tatsache dass die Stadtwerte nicht mehr Bitcodiert sind sondern Word oder so.
hier der Code
Code:
static void UpdateTownGrowRate(Town *t)
{
int n;
Station *st;
byte m;
Player *p;
// Reset player ratings if they're low
FOR_ALL_PLAYERS(p) {
if (p->is_active && t->ratings[p->index] <= 200) {
t->ratings[p->index] += 5;
}
}
n = 0;
FOR_ALL_STATIONS(st) {
if (DistanceSquare(st->xy, t->xy) <= t->radius[0]) {
if (st->time_since_load <= 20 || st->time_since_unload <= 20) {
n++;
if (st->owner < MAX_PLAYERS && t->ratings[st->owner] <= 1000-12)
t->ratings[st->owner] += 12;
} else {
if (st->owner < MAX_PLAYERS && t->ratings[st->owner] >= -1000+15)
t->ratings[st->owner] -= 15;
}
}
}
t->flags12 &= ~1;
if (t->fund_buildings_months != 0) {
static const byte _grow_count_values[6] = {
60, 60, 60, 50, 40, 30
};
m = _grow_count_values[min(n, 5)];
t->fund_buildings_months--;
} else if (n == 0) {
m = 160;
if (!CHANCE16(1, 12))
return;
} else {
static const byte _grow_count_values[5] = {
210, 150, 110, 80, 50
};
m = _grow_count_values[min(n, 5) - 1];
}
if (_opt.landscape == LT_HILLY) {
if (TilePixelHeight(t->xy) >= _opt.snow_line && t->act_food == 0 && t->population > 90)
return;
} else if (_opt.landscape == LT_DESERT) {
if (GetMapExtraBits(t->xy) == 1 && (t->act_food==0 || t->act_water==0) && t->population > 60)
return;
}
t->growth_rate = m / (t->num_houses / 50 + 1);
if (m <= t->grow_counter)
t->grow_counter = m;
t->flags12 |= 1;
}
ziemlich mittig. st->time_since_load <= 20 || st->time_since_unload <= 20
also das alte Spiel.
Aber jetzt reicht auch entladen, es muss nicht geladen werden, und es können wesentlich mehr Städte berechnet werden
"Das Böse triumphiert alleine dadurch, daß gute Menschen nichts unternehmen!" Edward Burke, 1729-1797
"Wir leben alle unter dem gleichen Himmel, aber wir haben nicht alle den gleichen Horizont!" Konrad Adenauer, 1876-1967
|
|
| 08.03.2005 20:53 |
|