////////////////////////////// //// 5. Wonder Code //// //////////////////////////// // Description: // This code takes those buildings out of the build lists of both AI and // human players that are no longer necessary because a Wonder was built by // this player that gives a free building of this type in every city. This // prevents the AI from building expensive buildings that it doesn't need // anyway and makes the build list more readable and less confusing for the // human. When wonders are lost or go obsolete, the buildings reappear in the // build lists. // make buildings unbuildable for civs with a wonder that grants those buildings int_f mod_CanCityBuildBuilding(city_t theCity, int_t theBuilding) { city_t tmpCity; int_t tmpBuilding; tmpBuilding = theBuilding; tmpCity = theCity; // if (!IsHumanPlayer(tmpCity.owner)) { // NO LONGER USED: humans can still build everything if (tmpBuilding == BuildingDB(IMPROVE_AQUEDUCT)) { // if building is Aqueduct if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_HANGING_GARDENS))) { // and player has Hanging Gardens return 0; // this cannot be built } else { return 1; // if player doesn't have Hanging Gardens, it can be built// } } elseif (tmpBuilding == BuildingDB(IMPROVE_ZIGGURAT)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_ANGOR_WAT))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_FORGE)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_GENIUS_OF_ARCHIEMEDES))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_AQUEDUCT)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_HANGING_GARDENS))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_POWER_STATION_WAW)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_HOOVER_DAM))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_RETAIL_PARK)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_WORLD_BANK))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_COMPUTER_CENTER)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_INTERNET))) { return 0; } else { return 1; } } elseif (tmpBuilding == BuildingDB(IMPROVE_MATTER_DECOMPILER)) { if (PlayerHasWonder(tmpCity.owner, WonderDB(WONDER_CENTRAL_MATTER_DECOMPILER))) { return 0; } else { return 1; } } else { return 1; // all other buildings can always be built } // } else { // NO LONGER USED: humans can still build everything // return 1; // NO LONGER USED // } // NO LONGER USED }