Corporation spread on City founding

techathon

Member
Joined
Jul 6, 2009
Messages
313
Location
Fighting the Power
Hello, I am currently reworking the MesoAmerica mod that came with a patch a while back and I was looking for a way to make Spain have a Corp that spreads to each city it founds. It would be called 'Caballos y Hierro' (Horses and Iron) and will provide Horses and Iron to that city. I don't want Spain to have to found this corp at all, though. Is this possible?
 
To let this corp be placed in every city on founding, this python code should help (in CvEventManager):
PHP:
	def onCityBuilt(self, argsList):
                print 'onCityBuilt'
		'City Built'
		city = argsList[0]
###new code
		icurplayer = city.getOwner ()
		curplayer = gc.getPlayer(icurplayer)
		myName = curplayer.getCivilizationType ()
                spain = gc.getInfoTypeForString("CIVILIZATION_SPAIN")
                if myName == spain:
                        city.setHasCorporation(gc.getInfoTypeForString("CORPORATION_XY_WHATEVER"),True,False,False)

Edit: Indentation may look strange, but should be right.
 
Top Bottom