当前位置: 首页>>代码示例>>Python>>正文


Python CvAdvisorUtils.unitBuiltFeats方法代码示例

本文整理汇总了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()))
开发者ID:DarkLunaPhantom,项目名称:Civ4-K-Mod,代码行数:12,代码来源:CvEventManager.py

示例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)
开发者ID:Alrik2002,项目名称:Civ4-MMod,代码行数:40,代码来源:Fem+CEO+Mod.py


注:本文中的CvAdvisorUtils.unitBuiltFeats方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。