Assigned Super Specialist

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
I'm slaving over the development of more python functions again. This time I am in need of determining if a great specialist has been assigned to a city as a Super specialist. For example: I have a city plot that has two great specialists (GS), one GS that has joined the city (as a Super Specialist) and one GS that has not joined the city. I want to determine/isolate which GS has joined the city. I have written a nifty function to determine if a unit type is a GS, but it falls short of excluding specialists that have joined a city. I appreciate any ideas that could help.

Code:
def isGreatSpecialist(iUnitType):
	# Orion's Standard Functions
	# Returns True if the unit is a Great Specialist
	# Returns False if the unit is not a Great Specialist		
	bIsGreatSpecialist = False
	
	for iSpecialist in range(gc.getNumSpecialistInfos()):
		if iSpecialist != SpecialistTypes.NO_SPECIALIST:
			if (gc.getUnitInfo(iUnitType).getGreatPeoples(iSpecialist)):
				bIsGreatSpecialist = True
				break

	return bIsGreatSpecialist
 
Both GS will be free specialists in the code. So, you have to check for the buildings in city that may grant free specialists and work out a simple formula starting from there. Checking the code in the :getAddedFreeSpecialistCount function may help you.
Btw, no need to check if iSpecialist != -1... Keep it simple and efficient.
 
Back
Top Bottom