Somebody please analyze the routine that is called for America in riseandfall.py. It looks like Christianity (and Judaism) is favored but it's possible for a surrounding culture (most likely British)'s state religion to be Islam.
def addMissionary(self, iCiv, tTopLeft, tBottomRight, tPlot, iNumber):
lReligions = [0, 0, 0, 0, 0, 0, 0]
for x in range(tTopLeft[0], tBottomRight[0]+1):
for y in range(tTopLeft[1], tBottomRight[1]+1):
pCurrent = gc.getMap().plot( x, y )
if (pCurrent.isCity()):
city = pCurrent.getPlotCity()
iOwner = city.getOwner()
if (iOwner != iCiv):
iStateReligion = gc.getPlayer(iOwner).getStateReligion()
if (iStateReligion >= 0 and iStateReligion < con.iNumReligions):
lReligions[iStateReligion] += 1
iMax = 0
iWinnerReligion = -1
for i in range(1, len(lReligions)+1): #so that Christianity comes first
iLoopReligion = i % con.iNumReligions
if (lReligions[iLoopReligion] > iMax):
iMax = lReligions[iLoopReligion]
iWinnerReligion = iLoopReligion
if (iWinnerReligion == -1):
for iLoopCiv in range(iNumMajorPlayers):
if (iLoopCiv != iCiv):
if (gc.getMap().plot(tPlot[0], tPlot[1]).isRevealed(iLoopCiv, False)):
iStateReligion = gc.getPlayer(iLoopCiv).getStateReligion()
if (iStateReligion >= 0 and iStateReligion < con.iNumReligions):
lReligions[iStateReligion] += 1
for iLoopReligion in range(1, len(lReligions)+1): #so that Christianity comes first
iLoopReligion = i % con.iNumReligions
if (lReligions[iLoopReligion] > iMax):
iMax = lReligions[iLoopReligion]
iWinnerReligion = iLoopReligion
if (iWinnerReligion != -1):
utils.makeUnit(con.iJewishMissionary + iWinnerReligion, iCiv, tPlot, iNumber)