Code
15053void CvCity::doMeltdown()15054{15055 VALIDATE_OBJECT15056 AI_PERF_FORMAT("City-AI-perf.csv", ("CvCity::doMeltdown, Turn %03d, %s, %s", GC.getGame().getElapsedGameTurns(), GetPlayer()->getCivilizationShortDescription(), getName().c_str()) );1505715058 int iNumBuildingInfos = GC.getNumBuildingInfos();15059 for(int iI = 0; iI < iNumBuildingInfos; iI++)15060 {15061 const BuildingTypes eBuilding = static_cast<BuildingTypes>(iI);15062 CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(eBuilding);15063 if(NULL != pkBuildingInfo && m_pCityBuildings->GetNumBuilding((BuildingTypes)iI) > 0)15064 {15065 if(pkBuildingInfo->GetNukeExplosionRand() != 0)15066 {15067 if(GC.getGame().getJonRandNum(pkBuildingInfo->GetNukeExplosionRand(), "Meltdown!!!") == 0)15068 {15069 if(m_pCityBuildings->GetNumRealBuilding((BuildingTypes)iI) > 0)15070 {15071 m_pCityBuildings->SetNumRealBuilding(((BuildingTypes)iI), 0);15072 }1507315074 CvUnitCombat::ApplyNuclearExplosionDamage(plot(), 1);1507515076 if(getOwner() == GC.getGame().getActivePlayer())15077 {15078 Localization::String localizedText = Localization::Lookup("TXT_KEY_MISC_MELTDOWN_CITY");15079 localizedText << getNameKey();1508015081 DLLUI->AddCityMessage(0, GetIDInfo(), getOwner(), false, GC.getEVENT_MESSAGE_TIME(), localizedText.toUTF8()/*, "AS2D_MELTDOWN", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX(), getY(), true, true*/);15082 }1508315084 break;15085 }15086 }15087 }15088 }15089}