Ploeperpengel
academic precarity
The code below is written in onCityDoTurn. It automatically spreads a certain Religion and removes all other Religions from cities owned by one of the 4 listed civs as long the city isn't under occupation(at least I hope that part works too). The bolded part was supposed to remove the Religion from all cities not own by one of the listed civs. However it also removes them for the listed ones. I tried all kinds of changes and only got errors or the unwanted effect. Can anyone help me noob get out of this?
Code:
lDestCivs = ['CIVILIZATION_ORCS','CIVILIZATION_GOBLINS','CIVILIZATION_HOBGOB','CIVILIZATION_OGRELORDS']
for i in range( len( lDestCivs ) ):
if pPlayer.getCivilizationType() == CvUtil.findInfoTypeNum(gc.getCivilizationInfo, gc.getNumCivilizationInfos, lDestCivs[i]):
for iReligion in range(gc.getNumReligionInfos()):
if ( pCity.isHasReligion(iReligion) and iReligion != gc.getInfoTypeForString('RELIGION_DESTRUCTION') and not pCity.isOccupation()):
pCity.setHasReligion(iReligion, False, True, True)
if (pCity.isHasReligion(gc.getInfoTypeForString('RELIGION_DESTRUCTION')) == False and not pCity.isOccupation()):
pCity.setHasReligion(gc.getInfoTypeForString('RELIGION_DESTRUCTION'), True, True, True)
[B]for j in range(gc.getNumCivilizationInfos()):
if pPlayer.getCivilizationType() != CvUtil.findInfoTypeNum(gc.getCivilizationInfo, gc.getNumCivilizationInfos, lDestCivs[i]):
if (pCity.isHasReligion(gc.getInfoTypeForString('RELIGION_DESTRUCTION')) == True and not pCity.isOccupation()):
pCity.setHasReligion(gc.getInfoTypeForString('RELIGION_DESTRUCTION'), False, True, True)[/B]