Ist die Einrückung genauso wie vorher? Also auch Leerzeichen und keine Tabs? Meine Version der Methode:
Code:
def onReligionFounded(self, argsList): #pie
'Religion Founded'
iReligion, iFounder = argsList
player = PyPlayer(iFounder)
iCityId = gc.getGame().getHolyCity(iReligion).getID()
# PAE - capital gets Holy City for certain religions
lReligion = []
lReligion.append(gc.getInfoTypeForString("RELIGION_CELTIC"))
lReligion.append(gc.getInfoTypeForString("RELIGION_NORDIC"))
lReligion.append(gc.getInfoTypeForString("RELIGION_PHOEN"))
lReligion.append(gc.getInfoTypeForString("RELIGION_GREEK"))
lReligion.append(gc.getInfoTypeForString("RELIGION_ROME"))
lReligion.append(gc.getInfoTypeForString("RELIGION_JUDAISM"))
if iReligion in lReligion:
pCapitalCity = gc.getPlayer(iFounder).getCapitalCity()
if pCapitalCity:
if iCityId != pCapitalCity.getID():
gc.getGame().getHolyCity(iReligion).setHasReligion(iReligion,0,0,0)
gc.getGame().setHolyCity (iReligion, pCapitalCity, 0)
iCityId = pCapitalCity.getID()
# Christentum
elif iReligion == gc.getInfoTypeForString("RELIGION_CHRISTIANITY"):
iJudentum = gc.getInfoTypeForString("RELIGION_JUDAISM")
# In der heiligen j��chen Stadt, wenn der Gr��r der Besitzer ist
pHolyCityJudentum = gc.getGame().getHolyCity(iJudentum)
if pHolyCityJudentum.getOwner() == iFounder:
if iCityId != pHolyCityJudentum.getID():
gc.getGame().getHolyCity(iReligion).setHasReligion(iReligion,0,0,0)
gc.getGame().setHolyCity (iReligion, pHolyCityJudentum, 0)
iCityId = pHolyCityJudentum.getID()
# in der gr��n j��chen Stadt des Besitzers
else:
iNewCityPop = 0
pNewCity = None
pPlayer = gc.getPlayer(iFounder)
iNumCities = pPlayer.getNumCities()
for i in range (iNumCities):
pCity = pPlayer.getCity(i)
if pCity:
if pCity.isHasReligion(iJudentum):
iPop = pCity.getPopulation()
if iPop > iNewCityPop:
iNewCityPop = iPop
pNewCity = pCity
if pNewCity != None:
if iCityId != pNewCity.getID():
gc.getGame().getHolyCity(iReligion).setHasReligion(iReligion,0,0,0)
gc.getGame().setHolyCity (iReligion, pNewCity, 0)
iCityId = pNewCity.getID()
# BTS
if (gc.getGame().isFinalInitialized() and not gc.getGame().GetWorldBuilderMode()):
if gc.getPlayer(iFounder).isHuman():
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iReligion)
popupInfo.setData2(iCityId)
popupInfo.setData3(1)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(iFounder)
if (not self.__LOG_RELIGION):
return
CvUtil.pyPrint('Player %d Civilization %s has founded %s'
%(iFounder, player.getCivilizationName(), gc.getReligionInfo(iReligion).getDescription()))