[COLOR="Lime"][B]def onGreatPersonBorn(self, argsList):[/B][/COLOR]
'Unit Promoted'
pUnit, iPlayer, pCity = argsList
player = PyPlayer(iPlayer)
if pUnit.isNone() or pCity.isNone():
return
[COLOR="Red"]# Female Great People - saibotlieh - start[/COLOR]
UnitName = pUnit.getName()
iUnitType = pUnit.getUnitType()
UnitInfo = gc.getUnitInfo(iUnitType)
sUnitType = UnitInfo.getType()
sFemaleUnitType = 'UNIT_FEMALE'+sUnitType[4:]
iFemaleUnitType = gc.getInfoTypeForString(sFemaleUnitType)
if iFemaleUnitType > -1:
Owner = gc.getPlayer(iPlayer)
if Owner.isCivic(gc.getInfoTypeForString("CIVIC_EMANCIPATION")):
iFemaleChance = 50
else:
iFemaleChance = 15
if gc.getInfoTypeForString('BONUS_AMAZONS') > 0:
iNumAmazonBonuses = pCity.getNumBonuses(gc.getInfoTypeForString('BONUS_AMAZONS'))
iFemaleChance += iNumAmazonBonuses*15
if iFemaleChance > 50:
iFemaleChance = 50
iRnd = CyGame().getSorenRandNum(100, "Female unit")
if iRnd < iFemaleChance:
pFemaleUnit = Owner.initUnit(iFemaleUnitType,pUnit.getX(),pUnit.getY(),UnitAITypes.NO_UNITAI,DirectionTypes.DIRECTION_SOUTH)
pUnit.kill(false,iPlayer)
UnitName = pFemaleUnit.getName()
[COLOR="Red"]# Female Great People - saibotlieh - end[/COLOR]
if (not self.__LOG_GREATPERSON):
return
CvUtil.pyPrint('A %s was born for %s in %s' %(UnitName, player.getCivilizationName(), pCity.getName()))
[COLOR="Lime"][B]def onUnitBuilt(self, argsList):[/B][/COLOR]
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
iplayer = gc.getPlayer(city.getOwner())
[COLOR="Red"]# Female Missionaries - saibotlieh - start[/COLOR]
iUnitType = unit.getUnitType()
UnitInfo = gc.getUnitInfo(iUnitType)
if UnitInfo.getDefaultUnitAIType() == gc.getInfoTypeForString('UNITAI_MISSIONARY'):
sUnitType = UnitInfo.getType()
sFemaleUnitType = 'UNIT_FEMALE'+sUnitType[4:]
iFemaleUnitType = gc.getInfoTypeForString(sFemaleUnitType)
if iFemaleUnitType > -1:
if iplayer.isCivic(gc.getInfoTypeForString('CIVIC_EMANCIPATION')):
iFemaleChance = 50
else:
iFemaleChance = 15
iRnd = CyGame().getSorenRandNum(100, "Female unit")
if iRnd < iFemaleChance:
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())
[COLOR="Red"]# Female Missionaries - saibotlieh - end[/COLOR]
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()))