Psychic_Llamas
Wizard in the Making
im not too sure, i cant see anything of that sort... here is a bigger section of code:
thats the whole of the onunitbuild python in cvEventManager
Code:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
pPlayer = gc.getPlayer(unit.getOwner())
iFreeProm = unit.getFreePromotionPick()
# if unit.getUnitType() == gc.getInfoTypeForString('UNIT_BLOODTHIRSTER'):
# iPop = city.getPopulation() - 4
# if iPop <= 1:
# iPop = 1
# city.setPopulation(iPop)
# city.setOccupationTimer(4)
# if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_CHANCEL_OF_GUARDIANS')) > 0:
# if CyGame().getSorenRandNum(100, "Bob") <= 20:
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_DEFENSIVE'), True)
# if (city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_CAVE_OF_ANCESTORS')) > 0 and unit.getUnitCombatType() == (gc.getInfoTypeForString('UNITCOMBAT_ADEPT'))):
# i = 0
# for iBonus in range(gc.getNumBonusInfos()):
# if gc.getBonusInfo(iBonus).getBonusClassType() == gc.getInfoTypeForString('BONUSCLASS_MANA'):
# if city.hasBonus(iBonus):
# i = i + 1
# if i >= 1:
# unit.changeExperience(i, -1, False, False, False)
# if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_GOLEM')):
# if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_BLASTING_WORKSHOP')) > 0:
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_FIRE2'), True)
# if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_GRIDLINES')) > 0:
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CITY_GARRISON1'), True)
# if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_ASYLUM')) > 0:
# if unit.isAlive():
# if isWorldUnitClass(unit.getUnitClassType()) == False:
# if CyGame().getSorenRandNum(100, "Bob") <= 10:
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CRAZED'), True)
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ENRAGED'), True)
# if unit.getUnitType() == gc.getInfoTypeForString('UNIT_ACHERON'):
# city.setNumRealBuilding(gc.getInfoTypeForString('BUILDING_THE_DRAGONS_HORDE'), 1)
# iX = city.getX()
# iY = city.getY()
# for iiX in range(iX-1, iX+2, 1):
# for iiY in range(iY-1, iY+2, 1):
# pPlot = CyMap().plot(iiX,iiY)
# if (pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_FOREST') or pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_JUNGLE')):
# pPlot.setFeatureType(gc.getInfoTypeForString('FEATURE_FLAMES'), 0)
# cf.addPopup(CyTranslator().getText("TXT_KEY_POPUP_ACHERON_CREATION",()), str(gc.getUnitInfo(unit.getUnitType()).getImage()))
if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DWARF')):
if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_BREWERY')) > 0:
unit.changeExperience(2, -1, False, False, False)
# if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON')):
# if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_DEMONS_ALTAR')) > 0:
# unit.changeExperience(2, -1, False, False, False)
# if city.isHasCorporation(gc.getInfoTypeForString('CORPORATION_AERONS_BOUNTY')):
# if unit.getUnitClassType() == gc.getInfoTypeForString('UNITCLASS_ASSASSIN'):
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_AERONS_CHOSEN'), True)
# if city.isHasCorporation(gc.getInfoTypeForString('CORPORATION_CULT_OF_THE_DRAGON')):
# if unit.getReligion() == -1:
# if CyGame().getSorenRandNum(100, "Bob") <= 20:
# unit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_CULT_OF_THE_DRAGON'), True)
if unit.getFreePromotionPick() < iFreeProm:
unit.changeFreePromotionPick(iFreeProm - unit.getFreePromotionPick())
if city.getNumRealBuilding(gc.getInfoTypeForString('BUILDING_WARRENS')) > 0:
if isWorldUnitClass(unit.getUnitClassType()) == False:
if isNationalUnitClass(unit.getUnitClassType()) == False:
if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_SIEGE'):
if unit.getUnitCombatType() != gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
newUnit = pPlayer.initUnit(unit.getUnitType(), city.getX(), city.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
city.applyBuildEffects(newUnit)
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()))
thats the whole of the onunitbuild python in cvEventManager