本文整理汇总了Python中CvAdvisorUtils.unitBuiltFeats方法的典型用法代码示例。如果您正苦于以下问题:Python CvAdvisorUtils.unitBuiltFeats方法的具体用法?Python CvAdvisorUtils.unitBuiltFeats怎么用?Python CvAdvisorUtils.unitBuiltFeats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvAdvisorUtils
的用法示例。
在下文中一共展示了CvAdvisorUtils.unitBuiltFeats方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onUnitBuilt
# 需要导入模块: import CvAdvisorUtils [as 别名]
# 或者: from CvAdvisorUtils import unitBuiltFeats [as 别名]
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()))
示例2: onUnitBuilt
# 需要导入模块: import CvAdvisorUtils [as 别名]
# 或者: from CvAdvisorUtils import unitBuiltFeats [as 别名]
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)