garIdx = 0
if( hasLiberalism ) :
garIdx = -int( 2*pow(pCity.plot().getNumDefenders(iPlayer)/2, .5) - .5 )
else :
if( pCity.getBuildingDefense() > 75 ) :
garIdx = -int( 3*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) + .5 )
elif( pCity.getBuildingDefense() > 25 ) :
garIdx = -int( 2.5*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) )
else :
garIdx = -int( 2*pow(pCity.plot().getNumDefenders(iPlayer)/2, .6) - .5 )
garIdx = int(math.floor( self.garrisonModifier*garIdx + .5 ))
if( natIdx > 0 ) :
garIdx = max([garIdx,-5])
else :
garIdx = max([garIdx,-8])