Ejemplo n.º 1
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()))
Ejemplo n.º 2
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
Ejemplo n.º 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()))
Ejemplo n.º 4
0
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)