def isCorePlot(argsList):
    x = argsList[0]
    y = argsList[1]
    iCiv = argsList[2]
    reborn = utils.getReborn(iCiv)
    if iCiv < iNumPlayers:
        if (x, y) in Areas.getCoreArea(iCiv):
            return 1
    return 0
Пример #2
0
	def startCongress(self):
		self.bPostWar = (len(self.lWinners) > 0)
		
		utils.debugTextPopup('Congress takes place')

		self.inviteToCongress()
		
		if self.bPostWar:
			iHostPlayer = [iWinner for iWinner in self.lWinners if gc.getPlayer(iWinner).isAlive()][0]
		else:
			iHostPlayer = utils.getRandomEntry([iInvitee for iInvitee in self.lInvites if gc.getPlayer(iInvitee).getNumCities() > 0])
			
		# normal congresses during war time may be too small because all civilisations are tied up in global wars
		if len(self.lInvites) < 3:
			data.iCongressTurns /= 2
			data.currentCongress = None
			return
			
		# establish contact between all participants
		for iThisPlayer in self.lInvites:
			for iThatPlayer in self.lInvites:
				if iThisPlayer != iThatPlayer:
					tThisPlayer = gc.getTeam(iThisPlayer)
					if not tThisPlayer.canContact(iThatPlayer): tThisPlayer.meet(iThatPlayer, False)

		self.sHostCityName = utils.getRandomEntry(utils.getOwnedCoreCities(iHostPlayer, utils.getReborn(iHostPlayer))).getName()
		
		# moved selection of claims after the introduction event so claims and their resolution take place at the same time
		if utils.getHumanID() in self.lInvites:
			self.startIntroductionEvent(True)
				
		# procedure continues from the makeClaimHuman event
		
		bHumanInGlobalWar = False
		if isGlobalWar():
			lAttackers, lDefenders = determineAlliances(data.iGlobalWarAttacker, data.iGlobalWarDefender)
			bHumanInGlobalWar = utils.getHumanID() in lAttackers + lDefenders
		
		# unless the player isn't involved, in that case resolve from here
		if utils.getHumanID() not in self.lInvites:
			# since Congresses now can occur during autoplay, don't display these congresses to the player
			if gc.getGame().getGameTurn() >= getTurnForYear(tBirth[utils.getHumanID()]):
				self.startIntroductionEvent(False, bHumanInGlobalWar)
			else:
				# select claims first, then move on to voting directly since the player isn't involved
				for iLoopPlayer in self.lInvites:
					if not self.canClaim(iLoopPlayer): continue
					self.dPossibleClaims[iLoopPlayer] = self.selectClaims(iLoopPlayer)
					
				for iLoopPlayer in self.lInvites:
					if iLoopPlayer not in self.dPossibleClaims: continue
					
					if utils.getHumanID() != iLoopPlayer:
						self.makeClaimAI(iLoopPlayer)
						
				self.voteOnClaims()
Пример #3
0
	def startCongress(self):
		self.bPostWar = (len(self.lWinners) > 0)
		
		utils.debugTextPopup('Congress takes place')

		self.inviteToCongress()
		
		if self.bPostWar:
			iHostPlayer = self.lWinners[0]
		else:
			iHostPlayer = utils.getRandomEntry(self.lInvites)
			
		# establish contact between all participants
		for iThisPlayer in self.lInvites:
			for iThatPlayer in self.lInvites:
				if iThisPlayer != iThatPlayer:
					tThisPlayer = gc.getTeam(iThisPlayer)
					if not tThisPlayer.canContact(iThatPlayer): tThisPlayer.meet(iThatPlayer, False)
			
		self.sHostCityName = utils.getRandomEntry(utils.getCoreCityList(iHostPlayer, utils.getReborn(iHostPlayer))).getName()
		
		# moved selection of claims after the introduction event so claims and their resolution take place at the same time
		if utils.getHumanID() in self.lInvites:
			self.startIntroductionEvent(True)
				
		# procedure continues from the makeClaimHuman event
		
		# unless the player isn't involved, in that case resolve from here
		if utils.getHumanID() not in self.lInvites:
			# since Congresses now can occur during autoplay, don't display these congresses to the player
			if gc.getGame().getGameTurn() >= getTurnForYear(tBirth[utils.getHumanID()]):
				self.startIntroductionEvent(False)
			else:
				# select claims first, then move on to voting directly since the player isn't involved
				for iLoopPlayer in self.lInvites:
					if not self.canClaim(iLoopPlayer): continue
					self.dPossibleClaims[iLoopPlayer] = self.selectClaims(iLoopPlayer)
					
				for iLoopPlayer in self.lInvites:
					if iLoopPlayer not in self.dPossibleClaims: continue
					
					if utils.getHumanID() != iLoopPlayer:
						self.makeClaimAI(iLoopPlayer)
						
				self.voteOnClaims()
	def startCongress(self):
		self.bPostWar = (len(self.lWinners) > 0)
		
		utils.debugTextPopup('Congress takes place')

		self.inviteToCongress()
		
		if self.bPostWar:
			iHostPlayer = self.lWinners[0]
		else:
			iHostPlayer = utils.getRandomEntry(self.lInvites)
			
		# establish contact between all participants
		for iThisPlayer in self.lInvites:
			for iThatPlayer in self.lInvites:
				if iThisPlayer != iThatPlayer:
					tThisPlayer = gc.getTeam(iThisPlayer)
					if not tThisPlayer.canContact(iThatPlayer): tThisPlayer.meet(iThatPlayer, False)
			
		self.sHostCityName = utils.getRandomEntry(utils.getCoreCityList(iHostPlayer, utils.getReborn(iHostPlayer))).getName()
		
		# moved selection of claims after the introduction event so claims and their resolution take place at the same time
		if utils.getHumanID() in self.lInvites:
			self.startIntroductionEvent(True)
				
		# procedure continues from the makeClaimHuman event
		
		# unless the player isn't involved, in that case resolve from here
		if utils.getHumanID() not in self.lInvites:
			# since Congresses now can occur during autoplay, don't display these congresses to the player
			if gc.getGame().getGameTurn() >= getTurnForYear(tBirth[utils.getHumanID()]):
				self.startIntroductionEvent(False)
			else:
				# select claims first, then move on to voting directly since the player isn't involved
				for iLoopPlayer in self.lInvites:
					if not self.canClaim(iLoopPlayer): continue
					self.dPossibleClaims[iLoopPlayer] = self.selectClaims(iLoopPlayer)
					
				for iLoopPlayer in self.lInvites:
					if iLoopPlayer not in self.dPossibleClaims: continue
					
					if utils.getHumanID() != iLoopPlayer:
						self.makeClaimAI(iLoopPlayer)
						
				self.voteOnClaims()