def spreadIslamIndonesia(self, iGameTurn):
        if not gc.getGame().isReligionFounded(iIslam): return
        if not pIndonesia.isAlive(): return
        if not (getTurnForYear(1300) <= iGameTurn <= getTurnForYear(1600)):
            return

        if iGameTurn % utils.getTurns(15) != utils.getTurns(4): return

        lIndonesianContacts = [
            iPlayer for iPlayer in range(iNumPlayers)
            if pIndonesia.canContact(iPlayer)
            and gc.getPlayer(iPlayer).getStateReligion() == iIslam
        ]
        if not lIndonesianContacts:
            return

        lIndonesianCities = utils.getRegionCities([rIndonesia])
        lPotentialCities = [
            city for city in lIndonesianCities
            if not city.isHasReligion(iIslam)
        ]

        iMaxCitiesMultiplier = 2
        if pIndonesia.getStateReligion() == iIslam: iMaxCitiesMultiplier = 5

        if len(lPotentialCities) * iMaxCitiesMultiplier >= len(
                lIndonesianCities):
            pSpreadCity = utils.getRandomEntry(lPotentialCities)
            if pSpreadCity:
                pSpreadCity.spreadReligion(iIslam)
Beispiel #2
0
	def spreadReligionToRegion(self, iReligion, lRegions, iGameTurn, iStartDate, iInterval, iOffset):
		if not gc.getGame().isReligionFounded(iReligion): return
		if iGameTurn < getTurnForYear(iStartDate): return
		
		if iGameTurn % utils.getTurns(iInterval) != iOffset: return
		
		lRegionCities = utils.getRegionCities(lRegions)
		lReligionCities = [city for city in lRegionCities if city.isHasReligion(iReligion)]
		
		if 2 * len(lReligionCities) < len(lRegionCities):
			pSpreadCity = utils.getRandomEntry(self.getTargetCities(lRegionCities, iReligion))
			if pSpreadCity:
				pSpreadCity.spreadReligion(iReligion)
	def spreadJudaismMiddleEast(self, iGameTurn):
		if not gc.getGame().isReligionFounded(iJudaism): return
		if iGameTurn < getTurnForYear(600): return
		
		if iGameTurn % utils.getTurns(20) != utils.getTurns(5): return
		
		lMiddleEastCities = utils.getRegionCities([rMesopotamia, rAnatolia, rEgypt])
		lJewishCities = [city for city in lMiddleEastCities if city.isHasReligion(iJudaism)]
		
		if 2 * len(lJewishCities) < len(lMiddleEastCities):
			pSpreadCity = utils.getRandomEntry(self.getTargetCities(lMiddleEastCities, iJudaism))
			if pSpreadCity:
				pSpreadCity.spreadReligion(iJudaism)
	def spreadJudaismEurope(self, iGameTurn):
		if not gc.getGame().isReligionFounded(iJudaism): return
		if iGameTurn < getTurnForYear(1000): return
		
		if iGameTurn % utils.getTurns(10) != 0: return
	
		lEuropeanCities = utils.getRegionCities([rIberia, rEurope, rItaly, rBritain, rRussia, rBalkans])
		lJewishCities = [city for city in lEuropeanCities if city.isHasReligion(iJudaism)]
		
		if 2 * len(lJewishCities) < len(lEuropeanCities):
			pSpreadCity = utils.getRandomEntry(self.getTargetCities(lEuropeanCities, iJudaism))
			if pSpreadCity:
				pSpreadCity.spreadReligion(iJudaism)
    def spreadJudaismMiddleEast(self, iGameTurn):
        if not gc.getGame().isReligionFounded(iJudaism): return
        if iGameTurn < getTurnForYear(600): return

        if iGameTurn % utils.getTurns(20) != utils.getTurns(5): return

        lMiddleEastCities = utils.getRegionCities(
            [rMesopotamia, rAnatolia, rEgypt])
        lJewishCities = [
            city for city in lMiddleEastCities if city.isHasReligion(iJudaism)
        ]

        if 2 * len(lJewishCities) < len(lMiddleEastCities):
            pSpreadCity = utils.getRandomEntry(
                self.getTargetCities(lMiddleEastCities, iJudaism))
            if pSpreadCity:
                pSpreadCity.spreadReligion(iJudaism)
    def spreadJudaismEurope(self, iGameTurn):
        if not gc.getGame().isReligionFounded(iJudaism): return
        if iGameTurn < getTurnForYear(1000): return

        if iGameTurn % utils.getTurns(10) != 0: return

        lEuropeanCities = utils.getRegionCities(
            [rIberia, rEurope, rItaly, rBritain, rRussia, rBalkans])
        lJewishCities = [
            city for city in lEuropeanCities if city.isHasReligion(iJudaism)
        ]

        if 2 * len(lJewishCities) < len(lEuropeanCities):
            pSpreadCity = utils.getRandomEntry(
                self.getTargetCities(lEuropeanCities, iJudaism))
            if pSpreadCity:
                pSpreadCity.spreadReligion(iJudaism)