Assets\Python\Revolution\Gameready\BarbarianCiv.py // createMinorCiv()
Relevant function in DLL seems to be game.addPlayer().
I have seen a multiple city civ spawn from barbarians in C2C, actually. It was pretty surprising. One barb city was clearly about to turn into some civ so I figured it was time to go take the city. I was just sending off a small, but not too small, army to do it when suddenly they got organized into some civilization and took 2 other barb cities with them so I was not facing a 1 city civ, I was facing a 3 city civ without enough army to take all 3 cities. (So I took a different barb city that happened to be on the way there and then waited there for reinforcements before going after the new civ.)
But that was the only time I ever noticed it do that. On the other hand, having come across a few civs that must have spawned from barb cities that had more than 1 city it is possible that it has happened in some of my games out of my sight rather than them capturing another barb city or two, like it could also be.
iNumBarbDefenders = gc.getHandicapInfo( game.getHandicapType() ).getBarbarianInitialDefenders()
pyBarbPlayer = PyPlayer( gc.getBARBARIAN_PLAYER() )
barbCityList = pyBarbPlayer.getCityList()
for barbCity in barbCityList :
pBarbCity = barbCity.GetCy()
if( pBarbCity.area().getID() == capital.area().getID() ) :
if( pBarbCity.getPreviousOwner() == -1 ) :
iDist = plotDistance( capital.getX(), capital.getY(), pBarbCity.getX(), pBarbCity.getY())
iDist2 = gc.getMap().calculatePathDistance( capital.plot(), pBarbCity.plot() )
iBarbCityRand = game.getSorenRandNum(iDist*iDist, "Give barb city")
if( self.LOG_DEBUG ) : CvUtil.pyPrint(" BC - Distance to barb city %s is %d (path %d, rand %d"%(pBarbCity.getName(),iDist,iDist2,iBarbCityRand))
if( iDist < 10 ) :
if( 20 > iBarbCityRand ) :
pBarbCityPlot = pBarbCity.plot()
if( self.LOG_DEBUG ) : CvUtil.pyPrint(" BC - Adding extra barb city %s at %d, %d"%(pBarbCity.getName(),pBarbCity.getX(),pBarbCity.getY()))
pBarbCityPlot.setOwner( newPlayer.getID() )
self.setupFormerBarbCity(pBarbCityPlot.getPlotCity(), newPlayer.getID(), iBestDefender, int(iNumBarbDefenders*self.militaryStrength + 0.5))
iCityJoinFactor = (pBarbCity.getPopulation() * iBarbCityRand * 10) / iDist
if (iCityJoinFactor >= 4) :
pBarbCityPlot = pBarbCity.plot()
if( self.LOG_DEBUG ) : CvUtil.pyPrint(" BC - Adding extra barb city %s at %d, %d"%(pBarbCity.getName(),pBarbCity.getX(),pBarbCity.getY()))
pBarbCityPlot.setOwner( newPlayer.getID() )
self.setupFormerBarbCity(pBarbCityPlot.getPlotCity(), newPlayer.getID(), iBestDefender, int(iNumBarbDefenders*self.militaryStrength + 0.5))
It appears that the number returned by getMaxTurns will only be set in the DLL if the time victory condition is turned on. It looks like if that VC is not active it should return 0, but if it is active it should return the turn number of the turn when that VC happens.
The CyGame.getEstimateEndTurn function appears to return the actual turn number you get from adding up all the increments (as they are called in the DLL code) in the game speed info, where it specifies X turns at Y months per turn for each of the specified set of "increments" - this function returns is the sum of all those X values. This is independent of any victory conditions being active.