def newNameByCivics( self, iPlayer, bVerbose = False ) :
# Assigns a new name to a player based on their civics choices
pPlayer = gc.getPlayer(iPlayer)
capital = pPlayer.getCapitalCity()
playerEra = pPlayer.getCurrentEra()
curDesc = pPlayer.getCivilizationDescription(0)
curShort = pPlayer.getCivilizationShortDescription(0)
curAdj = pPlayer.getCivilizationAdjective(0)
civInfo = gc.getCivilizationInfo(pPlayer.getCivilizationType())
origDesc = civInfo.getDescription()
origShort = civInfo.getShortDescription(0)
origAdj = civInfo.getAdjective(0)
if( game.getGameTurn() == 0 ) :
# Not clear if all game data is properly loaded yet
if( playerEra < 3 ) :
newName = curDesc
else :
newName = curDesc
return [newName,curShort,curAdj]
newName = origDesc
if( SDTK.sdObjectExists( "Revolution", pPlayer ) ) :
revTurn = SDTK.sdObjectGetVal( "Revolution", pPlayer, 'RevolutionTurn' )
else :
revTurn = None
if( SDTK.sdObjectExists( "BarbarianCiv", pPlayer ) ) :
barbTurn = SDTK.sdObjectGetVal( "BarbarianCiv", pPlayer, 'SpawnTurn' )
else :
barbTurn = None
if( not pPlayer.isAlive() ) :
newName = curAdj + ' Refugees'
return [newName, curShort, curAdj]
if( not revTurn == None and game.getGameTurn() - revTurn < 20 and pPlayer.getNumCities() < 3 ) :
# Maintain name of rebels from Revolution Mod
newName = curDesc
return [newName, curShort, curAdj]
elif( not barbTurn == None and game.getGameTurn() - barbTurn < 20 and pPlayer.getNumCities() < 4 ) :
# Maintain name of BarbarianCiv created player
newName = curDesc
return [newName, curShort, curAdj]
# Main naming conditions
if( pPlayer.getNumCities() == 0 ) :
if( 'Tribes' in curDesc or 'Peoples' in curDesc ) :
if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
newName = curDesc
elif( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
newName = curAdj + ' Tribes'
else :
newName = carAdj + ' Peoples'
elif( pPlayer.getNumCities() == 1 ) :
if( 'Free' in curdesc ) :
if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
newName = curDesc
elif( 50 > game.getSorenRandNum(100,'Rev: Naming') ) :
newName = "Free City of " + CvUtil.convertToStr(capital.getName())
else :
newName = "Free State of " + CvUtil.convertToStr(capital.getName())
else :
if( 'Kingdom' in curdesc ) :
if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("Names - keeping prior name")
newName = curDesc
elif( 30 < game.getSorenRandNum(100,'Rev: Naming') ) :
newName = curAdj + " Kingdom"
else :
newName = "Kingdom of " + curShort
return [newName, curShort, curAdj]