本文整理汇总了Python中CvAdvisorUtils类的典型用法代码示例。如果您正苦于以下问题:Python CvAdvisorUtils类的具体用法?Python CvAdvisorUtils怎么用?Python CvAdvisorUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CvAdvisorUtils类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onGameStart
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: onBuildingBuilt
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: onUnitBuilt
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: onUnitMove
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: onEndPlayerTurn
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: onBuildingBuilt
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: onUnitBuilt
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: onCityDoTurn
def onCityDoTurn(self, argsList):
'City Production'
pCity = argsList[0]
iPlayer = argsList[1]
CvAdvisorUtils.cityAdvise(pCity, iPlayer)
示例9: onMissionaryConvertedUnit
def onMissionaryConvertedUnit(self, argsList):
pUnit = argsList[0]
CvAdvisorUtils.addUnitToNagList(pUnit)
示例10: onUnitSelected
def onUnitSelected(self, argsList):
pUnit = argsList[0]
CvAdvisorUtils.unitSelectedFeats(pUnit)
示例11: onEndPlayerTurn
def onEndPlayerTurn(self, argsList):
'Called at the end of a players turn'
iGameTurn, iPlayer = argsList
CvAdvisorUtils.endTurnNags(iPlayer)
CvAdvisorUtils.endTurnFeats(iPlayer)
示例12: onCityScreenOpen
def onCityScreenOpen(self, argsList):
'Called when the game window activates or deactivates'
iPlayer = argsList[0]
iCityId = argsList[1]
CvAdvisorUtils.cityScreenFeats(iPlayer, iCityId)
示例13: onLoadGame
def onLoadGame(self, argsList):
CvAdvisorUtils.resetNoLiberateCities()
return 0