Allows configuring the width of the coast in tropic maps that generates as tropiczone_normal before the desert kicks in, it does this by creating two additional arrays which house the coordinates to create a filled circle of radius of 19 tiles, and 25 tiles. the default creates a radius of 13 tiles.

I'd eventually like to add an Extra Large setting but manually creating the array of coordinates is horrible.

I wedged this setting in beside the setting for tropic width around rivers despite it not fitting into the rivers/lakes category because it still feels the most relevant place for now.
This commit is contained in:
reldred
2022-03-05 16:25:50 +10:30
parent 1e1b48323a
commit 22305e8795
6 changed files with 869 additions and 11 deletions

View File

@@ -1011,13 +1011,37 @@ static void CreateDesertOrRainForest(uint desert_tropic_line)
if (!IsValidTile(tile)) continue;
for (data = _make_desert_or_rainforest_data;
if (_settings_game.game_creation.coast_tropics_width == 0) {
for (data = _make_desert_or_rainforest_data;
data != endof(_make_desert_or_rainforest_data); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && (TileHeight(t) >= desert_tropic_line || IsTileType(t, MP_WATER))) break;
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && (TileHeight(t) >= desert_tropic_line || IsTileType(t, MP_WATER))) break;
}
if (data == endof(_make_desert_or_rainforest_data)) {
SetTropicZone(tile, TROPICZONE_DESERT);
}
}
if (data == endof(_make_desert_or_rainforest_data)) {
SetTropicZone(tile, TROPICZONE_DESERT);
if (_settings_game.game_creation.coast_tropics_width == 1) {
for (data = _make_desert_or_rainforest_data_medium;
data != endof(_make_desert_or_rainforest_data_medium); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && (TileHeight(t) >= desert_tropic_line || IsTileType(t, MP_WATER))) break;
}
if (data == endof(_make_desert_or_rainforest_data_medium)) {
SetTropicZone(tile, TROPICZONE_DESERT);
}
}
if (_settings_game.game_creation.coast_tropics_width == 2) {
for (data = _make_desert_or_rainforest_data_large;
data != endof(_make_desert_or_rainforest_data_large); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && (TileHeight(t) >= desert_tropic_line || IsTileType(t, MP_WATER))) break;
}
if (data == endof(_make_desert_or_rainforest_data_large)) {
SetTropicZone(tile, TROPICZONE_DESERT);
}
}
}
@@ -1032,13 +1056,37 @@ static void CreateDesertOrRainForest(uint desert_tropic_line)
if (!IsValidTile(tile)) continue;
for (data = _make_desert_or_rainforest_data;
if (_settings_game.game_creation.coast_tropics_width == 0) {
for (data = _make_desert_or_rainforest_data;
data != endof(_make_desert_or_rainforest_data); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && IsTileType(t, MP_CLEAR) && IsClearGround(t, CLEAR_DESERT)) break;
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && IsTileType(t, MP_CLEAR) && IsClearGround(t, CLEAR_DESERT)) break;
}
if (data == endof(_make_desert_or_rainforest_data)) {
SetTropicZone(tile, TROPICZONE_RAINFOREST);
}
}
if (data == endof(_make_desert_or_rainforest_data)) {
SetTropicZone(tile, TROPICZONE_RAINFOREST);
if (_settings_game.game_creation.coast_tropics_width == 1) {
for (data = _make_desert_or_rainforest_data_medium;
data != endof(_make_desert_or_rainforest_data_medium); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && IsTileType(t, MP_CLEAR) && IsClearGround(t, CLEAR_DESERT)) break;
}
if (data == endof(_make_desert_or_rainforest_data_medium)) {
SetTropicZone(tile, TROPICZONE_RAINFOREST);
}
}
if (_settings_game.game_creation.coast_tropics_width == 2) {
for (data = _make_desert_or_rainforest_data_large;
data != endof(_make_desert_or_rainforest_data_large); ++data) {
TileIndex t = AddTileIndexDiffCWrap(tile, *data);
if (t != INVALID_TILE && IsTileType(t, MP_CLEAR) && IsClearGround(t, CLEAR_DESERT)) break;
}
if (data == endof(_make_desert_or_rainforest_data_large)) {
SetTropicZone(tile, TROPICZONE_RAINFOREST);
}
}
}
}