I'd have to time it to be able to give an answer, but the unitBuilt call-up isn't near as severe as something like the canMove call-back, because the former would probably be called a couple of times a turn, while the latter would be called hundreds of times! That is why the first one is always enabled in the game, while the second one is disabled by default.Baldyr, isn't it too heavy for the game? Wouldn't it be slowing the game to have that check everytime a unit is built?
Before I do this; just a quick pointer: Shouldn't the Civ specific Herminage buildings be BuildingTypes belonging to BUILDINGCLASS_HERMITAGE? Because that is - as far as I understand it - what BuildingClassTypes are for. Namely being able to diversify Civ specific building, also known as Unique Buildings, of the same class.In case, here are the tags:
Give PROMOTION_ARCTIC_SURVIVALIST to UNITCLASS_WORKER if there is a building BUILDINGCLASS_HERMITAGE_RUSSIA or BUILDINGCLASS_HERMITAGE_VIKING.
It can be scripted either way, but I thought we should clarify this in beforehand.
edit: It turns out that it would be a bad idea to check BuildingClassTypes, so it should be BuildingTypes, as I proposed. Try this in CvEventManager:
Code:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
[COLOR="Red"] if unit.getUnitClassType() == gc.getInfoTypeForString("UNITCLASS_WORKER"):
if ( city.isHasBuilding(gc.getInfoTypeForString("BUILDING_HERMITAGE_RUSSIA"))
or city.isHasBuilding(gc.getInfoTypeForString("BUILDING_HERMITAGE_VIKING")) ):
unit.setHasPromotion(gc.getInfoTypeForString("PROMOTION_ARCTIC_SURVIVALIST"), True)[/COLOR]