//////////////////////////////////////////////////////////////////////////// // // SLIC for Civ series Settler to build tile improvements. // // By Dale // // Version 0.1 13-Sep-2002 // //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// // // PLEASE NOTE! // // I believe Civ 3 to be an inferior game to CTP2, but considering the // amount of requests for the Civ series settlers building tile improvements // I decided to shut those people up once and for all. // // NEVER ASK ME TO DO ANOTHER CRAPPY CIV SERIES CONCEPT TO REPLACE THE // FAR SUPERIOR CTP2 CONCEPTS! // //////////////////////////////////////////////////////////////////////////// HandleEvent(CreateImprovement) 'CivSettlerBuildTileImps' pre { int_t numUnits; int_t counter; int_t tmpPlayer; int_t settlerUnit; unit_t tmpUnit; location_t tmpLoc; settlerUnit = 0; tmpLoc = location[0]; tmpPlayer = g.player; if(IsHumanPlayer(tmpPlayer)) { // Only do it for Human as AI's wouldn't be able to handle it if(!(TerrainType(tmpLoc) == 10 || TerrainType(tmpLoc) == 11 || TerrainType(tmpLoc) == 12 || TerrainType(tmpLoc) == 13 || TerrainType(tmpLoc) == 14 || TerrainType(tmpLoc) == 15 || TerrainType(tmpLoc) == 16 || TerrainType(tmpLoc) == 22 || TerrainType(tmpLoc) == 23)) { // Don't need settler for water terrains numUnits = GetUnitsAtLocation(tmpLoc); if(numUnits > 0) { for(counter = 0; counter < numUnits; counter = counter + 1) { GetUnitFromCell(tmpLoc, counter, tmpUnit); if(tmpUnit.type == UnitDB(UNIT_SETTLER) || tmpUnit.type == UnitDB(UNIT_URBAN_PLANNER)) { // Look for a settler unit settlerUnit = 1; } } } if(settlerUnit == 0) { return STOP; // Don't build if no settler there } } } }