Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/w/o/worldofciv-HEAD/Assets/Python/Revolution/Gameready/Revolution.py   World of Civilization ( WoC )(Download)
 
            # Happiness
            numUnhappy = RevUtils.getModNumUnhappy( pCity, self.warWearinessMod )
            happyIdx = 0
            if( numUnhappy > 0 ) :
            localRevIdx = pCity.getLocalRevIndex()
 
            numUnhappy = RevUtils.getModNumUnhappy( pCity, self.warWearinessMod )
            if( numUnhappy > 0 ) :
                cityThreshold = max([int( self.revInstigatorThreshold - 2.5*self.revInstigatorThreshold*numUnhappy/pCity.getPopulation() ),int(self.revInstigatorThreshold/6.0)])
        else :
            if( bPeaceful ) :
                modNumUnhappy = RevUtils.getModNumUnhappy( instigator, self.warWearinessMod )
                if( int(200*modNumUnhappy/instigator.getPopulation()) > game.getSorenRandNum( 100, 'Rev' ) ) :
                    if( self.LOG_DEBUG ) : CvUtil.pyPrint("  Revolt - Violent due to Unhappiness")