Code:
def onCityBuilt(self, argsList):
'City Built'
self.parent.onCityBuilt(self, argsList)
city = argsList[0]
###new argslist argument vvvvvvvvvvvv
bOrbital = argsList[1]
###neu orbitalcheck REMOVE!
##CyInterface().addImmediateMessage(str(bOrbital), "")
pPlot = city.plot()
player = PyPlayer(city.getOwner())
pPlayer = gc.getPlayer(city.getOwner())
pTeam = gc.getTeam(pPlayer.getTeam())
pCapitalCity = pPlayer.getCapitalCity()
pStartEra = gc.getGame().getStartEra()
iRockyPolar = gc.getInfoTypeForString('TERRAIN_ROCKY_POLAR')
iRockyArid = gc.getInfoTypeForString('TERRAIN_ROCKY_ARID')
iRockyMoist = gc.getInfoTypeForString('TERRAIN_ROCKY_MOIST')
iRockyRainy = gc.getInfoTypeForString('TERRAIN_ROCKY_RAINY')
iFlatPolar = gc.getInfoTypeForString('TERRAIN_FLAT_POLAR')
iFlatArid = gc.getInfoTypeForString('TERRAIN_FLAT_ARID')
iFlatMoist = gc.getInfoTypeForString('TERRAIN_FLAT_MOIST')
iFlatRainy = gc.getInfoTypeForString('TERRAIN_FLAT_RAINY')
iHive = gc.getInfoTypeForString('CIVILIZATION_HIVE')
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_INSURGENT')
if pPlot.isWater() and bOrbital==false:
city.setNumRealBuilding(gc.getCivilizationInfo(pPlayer.getCivilizationType()).getCivilizationBuildings(gc.getInfoTypeForString("BUILDINGCLASS_SEA_BASE")),1)
if pPlayer.isHuman() == False:
pPlayer.initUnit(gc.getInfoTypeForString('UNIT_SCOUT_PATROL'), city.getX(), city.getY(), UnitAITypes.UNITAI_CITY_DEFENSE, DirectionTypes.NO_DIRECTION)
elif pPlayer.getCivilizationType() != iHive:
if pPlot.getTerrainType() == iRockyMoist:
pPlot.setTerrainType(iFlatMoist,True,True)
elif pPlot.getTerrainType() == iRockyRainy:
pPlot.setTerrainType(iFlatRainy,True,True)
elif pPlot.getTerrainType() == iRockyArid:
pPlot.setTerrainType(iFlatArid,True,True)
elif pPlot.getTerrainType() == iRockyPolar:
pPlot.setTerrainType(iFlatPolar,True,True)
if bOrbital==true:
city.setNumRealBuilding(gc.getInfoTypeForString("BUILDING_ORBITAL_BASE"), 1)
if pTeam.isHasTech(gc.getInfoTypeForString('TECH_MAGNETIC_PROPULSION')):
if (gc.getInfoTypeForString("BUILDING_ORBITAL_BASE") > 0):
if city.getNumRealBuilding(gc.getInfoTypeForString("BUILDING_ORBITAL_BASE")) == 1:
pPlot.setRouteType(gc.getInfoTypeForString('ROUTE_ROAD'))
if pPlayer.getNumCities() == 1 and pCapitalCity != -1:
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_PIRATES'):
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_BUNKER'), pCapitalCity.getX(), pCapitalCity.getY(), UnitAITypes.UNITAI_IMMOBILE, DirectionTypes.DIRECTION_NORTH)
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_NAVAL_FORTRESS'), True)
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_AQUATORIANS'):
newUnit = pPlayer.initUnit(gc.getInfoTypeForString('UNIT_BUNKER'), pCapitalCity.getX(), pCapitalCity.getY(), UnitAITypes.UNITAI_IMMOBILE, DirectionTypes.DIRECTION_NORTH)
newUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_NAVAL_FORTRESS'), True)
if pStartEra == gc.getInfoTypeForString('ERA_ARRIVAL'):
bStillAlive = False
for iPlayer in range(gc.getMAX_PLAYERS()):
pHumanPlayer = gc.getPlayer(iPlayer)
if pHumanPlayer.isHuman():
iHumanPlayer = iPlayer
bStillAlive = True
break
break # assuming human player is slot 0. If not, player probably has already switched once
if pPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_ANGELS'):
pPlayer.initUnit(gc.getInfoTypeForString('UNIT_BUNKER'), pCapitalCity.getX(), pCapitalCity.getY(), UnitAITypes.UNITAI_IMMOBILE, DirectionTypes.DIRECTION_NORTH)
pPlot.setRouteType(gc.getInfoTypeForString('ROUTE_ROAD'))
pPlayer.initUnit(gc.getInfoTypeForString('UNIT_DATAJACK'), pCapitalCity.getX(), pCapitalCity.getY(), UnitAITypes.UNITAI_MERCHANT, DirectionTypes.DIRECTION_NORTH)
pCapitalCity.setNumRealBuilding(gc.getInfoTypeForString('BUILDING_NETWORK_NODE'), 1)
if pPlot.getBonusType(-1) == -1:
iMod = CyGame().getSorenRandNum(2, "Maniac")
if iMod != 0:
pPlot.setBonusType(gc.getInfoTypeForString('BONUS_MINERAL'))
else:
pPlot.setBonusType(gc.getInfoTypeForString('BONUS_NUTRIENT'))
if bStillAlive: # if (pHumanPlayer != NO_PLAYER) in python??
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON)
popupInfo.setText(CyTranslator().getText("TXT_KEY_POPUP_CONTROL_ANGELS",()))
popupInfo.setData1(iHumanPlayer)
popupInfo.setData2(city.getOwner())
popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_YES", ()), "")
popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_NO", ()), "")
popupInfo.setOnClickedPythonCallback("reassignPlayer")
popupInfo.addPopup(iHumanPlayer)