コード例 #1
0
	def onGameStart(self, argsList):
		'Called at the start of the game'
		#Rhye - dawn of map must appear in late starts too
		#if (gc.getGame().getGameTurnYear() == gc.getDefineINT("START_YEAR") and not gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
		if (gc.getGame().getStartEra() == gc.getDefineINT("STANDARD_ERA") or gc.getGame().isOption(GameOptionTypes.GAMEOPTION_ADVANCED_START)):
			for iPlayer in range(gc.getMAX_PLAYERS()):
				player = gc.getPlayer(iPlayer)
				if (player.isAlive() and player.isHuman()):
					popupInfo = CyPopupInfo()
					popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
					popupInfo.setText(u"showDawnOfMan")
					popupInfo.addPopup(iPlayer)
		else:
			CyInterface().setSoundSelectionReady(true)

		if gc.getGame().isPbem():
			for iPlayer in range(gc.getMAX_PLAYERS()):
				player = gc.getPlayer(iPlayer)
				if (player.isAlive() and player.isHuman()):
					popupInfo = CyPopupInfo()
					popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_DETAILS)
					popupInfo.setOption1(true)
					popupInfo.addPopup(iPlayer)

		CvAdvisorUtils.resetNoLiberateCities()
コード例 #2
0
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList

		CvAdvisorUtils.buildingBuiltFeats(pCity, iBuildingType)

		if (not self.__LOG_BUILDING):
			return
		CvUtil.pyPrint('%s was finished by Player %d Civilization %s'
			%(gc.getBuildingInfo(iBuildingType).getDescription(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDescription(0)))
コード例 #3
0
	def onUnitBuilt(self, argsList):
		'Unit Completed'
		city = argsList[0]
		unit = argsList[1]
		player = PyPlayer(city.getOwner())
		CvAdvisorUtils.unitBuiltFeats(city, unit)
		if (not self.__LOG_UNITBUILD):
			return
		CvUtil.pyPrint('%s was finished by Player %d Civilization %s' 
			%(PyInfo.UnitInfo(unit.getUnitType()).getDescription(), player.getID(), player.getCivilizationName()))
コード例 #4
0
	def onUnitMove(self, argsList):
		'unit move'
		pPlot,pUnit,pOldPlot = argsList
		player = gc.getPlayer(pUnit.getOwner())
		unitInfo = gc.getUnitInfo(pUnit.getUnitType())
		CvAdvisorUtils.unitMoveFeats(pUnit, pPlot, pOldPlot)
		if (not self.__LOG_MOVEMENT):
			return
		if player and unitInfo:
			CvUtil.pyPrint('Player %d Civilization %s unit %s is moving to %d, %d'
				%(player.getID(), player.getCivilizationDescription(0), unitInfo.getDescription(),
				pUnit.getX(), pUnit.getY()))
コード例 #5
0
	def onEndPlayerTurn(self, argsList):
		'Called at the end of a players turn'
		iGameTurn, iPlayer = argsList

		if (gc.getGame().getElapsedGameTurns() == 1):
			if (gc.getPlayer(iPlayer).isHuman()):
				if (gc.getPlayer(iPlayer).canRevolution(0)):
					popupInfo = CyPopupInfo()
					popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_CHANGECIVIC)
					popupInfo.addPopup(iPlayer)

		CvAdvisorUtils.resetAdvisorNags()
		CvAdvisorUtils.endTurnFeats(iPlayer)
コード例 #6
0
	def onBuildingBuilt(self, argsList):
		'Building Completed'
		pCity, iBuildingType = argsList
		game = gc.getGame()
		if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer()) and isWorldWonderClass(gc.getBuildingInfo(iBuildingType).getBuildingClassType())):
			# If this is a wonder...
			popupInfo = CyPopupInfo()
			popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
			popupInfo.setData1(iBuildingType)
			popupInfo.setData2(pCity.getID())
			popupInfo.setData3(0)
			popupInfo.setText(u"showWonderMovie")
			popupInfo.addPopup(pCity.getOwner())

		CvAdvisorUtils.buildingBuiltFeats(pCity, iBuildingType)

		if (not self.__LOG_BUILDING):
			return
		CvUtil.pyPrint('%s was finished by Player %d Civilization %s'
			%(PyInfo.BuildingInfo(iBuildingType).getDescription(), pCity.getOwner(), gc.getPlayer(pCity.getOwner()).getCivilizationDescription(0)))
コード例 #7
0
ファイル: Fem CEO Mod.py プロジェクト: Alrik2002/Civ4-MMod
def onUnitBuilt(argsList):
		'Unit Completed'
		city = argsList[0]
		unit = argsList[1]
		player = PyPlayer(city.getOwner())
		iplayer = gc.getPlayer(city.getOwner())
		
# Female CEO begin

		iUnitType = unit.getUnitType()
		UnitInfo = gc.getUnitInfo(iUnitType)
		sUnitType = UnitInfo.getType()
	
		if UnitInfo.getDefaultUnitAIType() == gc.getInfoTypeForString('UNITAI_MISSIONARY'):
			sUnitBuilt = gc.getInfoTypeForString(sUnitType[:20])
			
			if sUnitBuilt == "UNITCLASS_EXECUTIVE_":
				sCEOType = gc.getInfoTypeForString(sUnitType[20:])
				iFemaleUnitType = CvUtil.findInfoTypeNum(gc.getUnitInfo,gc.getNumUnitInfos(),sUnitBuilt+sCEOType+'_FEMALE')
				
			else:		
				sFemaleUnitType = 'UNIT_FEMALE'+sUnitType[4:]
				iFemaleUnitType = gc.getInfoTypeForString(sFemaleUnitType)
			
			iRnd = CyGame().getSorenRandNum(100, "female CEO")
			if iplayer.isCivic(gc.getInfoTypeForString("CIVIC_EMANCIPATION")):
				iRnd -= 35
			if iRnd <= 20:	## Changed from 15 to 20 - better chance of generating female unit without Emancipation
				oldunit = unit				
				pFemaleUnit = iplayer.initUnit(iFemaleUnitType,oldunit.getX(),oldunit.getY(),UnitAITypes.NO_UNITAI,DirectionTypes.DIRECTION_SOUTH)
				pFemaleUnit.convert(oldunit)
				if oldunit.getGroup().isAutomated():
					pFemaleUnit.getGroup().setAutomateType(AutomateTypes.AUTOMATE_RELIGION)
				oldunit.kill(false,oldunit.getOwner())
				
# End Female CEO code

		CvAdvisorUtils.unitBuiltFeats(city, unit)
コード例 #8
0
	def onCityDoTurn(self, argsList):
		'City Production'
		pCity = argsList[0]
		iPlayer = argsList[1]

		CvAdvisorUtils.cityAdvise(pCity, iPlayer)
コード例 #9
0
	def onMissionaryConvertedUnit(self, argsList):
		pUnit = argsList[0]
		CvAdvisorUtils.addUnitToNagList(pUnit)
コード例 #10
0
	def onUnitSelected(self, argsList):
		pUnit = argsList[0]
		CvAdvisorUtils.unitSelectedFeats(pUnit)
コード例 #11
0
	def onEndPlayerTurn(self, argsList):
		'Called at the end of a players turn'
		iGameTurn, iPlayer = argsList

		CvAdvisorUtils.endTurnNags(iPlayer)
		CvAdvisorUtils.endTurnFeats(iPlayer)
コード例 #12
0
	def onCityScreenOpen(self, argsList):
		'Called when the game window activates or deactivates'
		iPlayer = argsList[0]
		iCityId = argsList[1]
		CvAdvisorUtils.cityScreenFeats(iPlayer, iCityId)
コード例 #13
0
	def onLoadGame(self, argsList):
		CvAdvisorUtils.resetNoLiberateCities()
		return 0
コード例 #14
0
ファイル: CvEventManager.py プロジェクト: Charriu/PBStats
 def onLoadGame(self, argsList):
     CvAdvisorUtils.resetNoLiberateCities()
     return 0
コード例 #15
0
ファイル: CvEventManager.py プロジェクト: YggdrasiI/PBStats
    def onCityDoTurn(self, argsList):
        'City Production'
        pCity = argsList[0]
        iPlayer = argsList[1]

        CvAdvisorUtils.cityAdvise(pCity, iPlayer)