Example #1
0
 def OnCityBuilt(self, argsList):
     CyCity = argsList[0]
     iOwner = CyCity.getOwner()
     iPlayer = GC.getGame().getActivePlayer()
     if self.getCheckForDomVictory():
         if iOwner == iPlayer:
             self.CheckForAlerts(iOwner, False)
     if self.options.isShowCityFoundedAlert():
         if iOwner != iPlayer:
             bRevealed = CyCity.isRevealed(GC.getActivePlayer().getTeam(),
                                           False)
             if bRevealed or PlayerUtil.canSeeCityList(iOwner):
                 CyPlayer = GC.getPlayer(iOwner)
                 iColor = GC.getInfoTypeForString("COLOR_MAGENTA")
                 if bRevealed:
                     msg = TRNSLTR.getText(
                         "TXT_KEY_MORECIV4LERTS_CITY_FOUNDED",
                         (CyPlayer.getName(), CyCity.getName()))
                     icon = "Art/Interface/Buttons/Actions/foundcity.dds"
                     CvUtil.sendMessage(msg, iPlayer,
                                        EVENT_MESSAGE_TIME_LONG, icon,
                                        ColorTypes(iColor), CyCity.getX(),
                                        CyCity.getY(), True, True)
                 else:
                     msg = TRNSLTR.getText(
                         "TXT_KEY_MORECIV4LERTS_CITY_FOUNDED_UNSEEN",
                         (CyPlayer.getName(), CyCity.getName()))
                     self._addMessageNoIcon(iPlayer, msg, iColor)
Example #2
0
 def OnCityBuilt(self, argsList):
     city = argsList[0]
     iPlayer = city.getOwner()
     iActivePlayer = gc.getGame().getActivePlayer()
     if (self.getCheckForDomVictory()):
         if (iPlayer == iActivePlayer):
             self.CheckForAlerts(iPlayer,
                                 PyPlayer(iPlayer).getTeam(), False)
     if (self.getCheckForForeignCities()):
         if (iPlayer != iActivePlayer):
             bRevealed = city.isRevealed(gc.getActivePlayer().getTeam(),
                                         False)
             if (bRevealed or PlayerUtil.canSeeCityList(iPlayer)):
                 player = gc.getPlayer(iPlayer)
                 #iColor = gc.getPlayerColorInfo(player.getPlayerColor()).getColorTypePrimary()
                 iColor = gc.getInfoTypeForString("COLOR_MAGENTA")
                 if (bRevealed):
                     message = localText.getText(
                         "TXT_KEY_MORECIV4LERTS_CITY_FOUNDED",
                         (player.getName(), city.getName()))
                     self._addMessageAtCity(
                         iActivePlayer, message,
                         "Art/Interface/Buttons/Actions/foundcity.dds",
                         city, iColor)
                 else:
                     message = localText.getText(
                         "TXT_KEY_MORECIV4LERTS_CITY_FOUNDED_UNSEEN",
                         (player.getName(), city.getName()))
                     self._addMessageNoIcon(iActivePlayer, message, iColor)
Example #3
0
	def OnCityBuilt(self, argsList):
		city = argsList[0]
		# <advc.127>
		if not gc.getPlayer(self.iOwner).isHuman():
			return # </advc.127>
		iPlayer = city.getOwner()
		# advc.135b: All uses replaced with self.iOwner
		#iActivePlayer = gc.getGame().getActivePlayer()
		if (self.getCheckForDomVictory()):
			if (iPlayer == self.iOwner):
				self.CheckForAlerts(iPlayer, PyPlayer(iPlayer).getTeam(), False)
		if (self.getCheckForForeignCities()):
			if (iPlayer != self.iOwner):
				owner = gc.getPlayer(self.iOwner)
				bRevealed = city.isRevealed(owner.getTeam(), False)
				# advc.135b: canSeeCityList checks if ActivePlayer
				# can see the list of iPlayer - should be self.iOwner
				# instead of ActivePlayer. Doesn't matter though b/c
				# K-Mod disables public city lists.
				# advc.210c (comment): The city-founded alert is now entirely disabled.
				if (bRevealed or PlayerUtil.canSeeCityList(iPlayer)):
					player = gc.getPlayer(iPlayer)
					#iColor = gc.getPlayerColorInfo(player.getPlayerColor()).getColorTypePrimary()
					iColor = gc.getInfoTypeForString("COLOR_MAGENTA")
					if (bRevealed):
						message = localText.getText("TXT_KEY_MORECIV4LERTS_CITY_FOUNDED", (player.getName(), city.getName()))
						self._addMessageAtCity(self.iOwner, message, "Art/Interface/Buttons/Actions/foundcity.dds", city, iColor)
					else:
						message = localText.getText("TXT_KEY_MORECIV4LERTS_CITY_FOUNDED_UNSEEN", (player.getName(), city.getName()))
						self._addMessageNoIcon(self.iOwner, message, iColor)
Example #4
0
	def OnCityBuilt(self, argsList):
		city = argsList[0]
		iPlayer = city.getOwner()
		iActivePlayer = gc.getGame().getActivePlayer()
		if (self.getCheckForDomVictory()):
			if (iPlayer == iActivePlayer):
				self.CheckForAlerts(iPlayer, PyPlayer(iPlayer).getTeam(), False)
		if (self.getCheckForForeignCities()):
			if (iPlayer != iActivePlayer):
				bRevealed = city.isRevealed(gc.getActivePlayer().getTeam(), False)
				if (bRevealed or PlayerUtil.canSeeCityList(iPlayer)):
					player = gc.getPlayer(iPlayer)
					#iColor = gc.getPlayerColorInfo(player.getPlayerColor()).getColorTypePrimary()
					iColor = gc.getInfoTypeForString("COLOR_MAGENTA")
					if (bRevealed):
						message = localText.getText("TXT_KEY_MORECIV4LERTS_CITY_FOUNDED", (player.getName(), city.getName()))
						self._addMessageAtCity(iActivePlayer, message, "Art/Interface/Buttons/Actions/foundcity.dds", city, iColor)
					else:
						message = localText.getText("TXT_KEY_MORECIV4LERTS_CITY_FOUNDED_UNSEEN", (player.getName(), city.getName()))
						self._addMessageNoIcon(iActivePlayer, message, iColor)