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

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

src/w/o/worldofciv-HEAD/Assets/Python/Revolution/Gameready/Revolution.py   World of Civilization ( WoC )(Download)
                        newCulVal = int( self.revCultureModifier*max([1.0*pCity.getCulture(pPlayer.getID()),pCity.countTotalCultureTimes100()/200]) )
                        newPlotVal = int( self.revCultureModifier*max([1.2*pCity.plot().getCulture(pPlayer.getID()),pCity.plot().countTotalCulture()/2]) )
                        RevUtils.giveCityCulture( pCity, pRevPlayer.getID(), newCulVal, newPlotVal, overwriteHigher = False )
 
                        ix = pCity.getX()
                newCulVal = int( self.revCultureModifier*max([pCity.getCulture(pPlayer.getID()),pCity.countTotalCultureTimes100()/200]) )
                newPlotVal = int( self.revCultureModifier*max([pCity.plot().getCulture(pPlayer.getID()),pCity.plot().countTotalCulture()/2]) )
                RevUtils.giveCityCulture( pCity, pRevPlayer.getID(), newCulVal, newPlotVal, overwriteHigher = False )
 
                newUnitList = list()

src/w/o/worldofciv-HEAD/Assets/Python/Revolution/RevEvents.py   World of Civilization ( WoC )(Download)
                    newCulVal = int( revCultureModifier*max([pCity.getCulture(oldOwnerID),pCity.countTotalCultureTimes100()/200]) )
                    newPlotVal = int( revCultureModifier*max([pCity.plot().getCulture(oldOwnerID),pCity.plot().countTotalCulture()/2]) )
                    RevUtils.giveCityCulture( pCity, newOwnerID, newCulVal, newPlotVal, overwriteHigher = False )
 
                    # Extra units
                    newCulVal = int( revCultureModifier*max([pCity.getCulture(oldOwnerID)/2,pCity.countTotalCultureTimes100()/400]) )
                    newPlotVal = int( revCultureModifier*max([pCity.plot().getCulture(oldOwnerID)/2,pCity.plot().countTotalCulture()/4]) )
                    RevUtils.giveCityCulture( pCity, newOwnerID, newCulVal, newPlotVal, overwriteHigher = False )
 
                    # Change city disorder timer to favor new player
                newCulVal = int( revCultureModifier*max([pCity.getCulture(oldOwnerID)/2,pCity.countTotalCultureTimes100()/400]) )
                newPlotVal = int( revCultureModifier*max([pCity.plot().getCulture(oldOwnerID)/2,pCity.plot().countTotalCulture()/4]) )
                RevUtils.giveCityCulture( pCity, newOwnerID, newCulVal, newPlotVal, overwriteHigher = False )
 
                iTurns = pCity.getOccupationTimer()
                cityCul = pCity.getCulture(iSmallPlayer)/2
                plotCul = pCity.plot().getCulture(iSmallPlayer)/2
                RevUtils.giveCityCulture( pCity, iBigPlayer, cityCul, plotCul, overwriteHigher = False )
 
        for sublist in unitList :

src/w/o/worldofciv-HEAD/Assets/Python/Revolution/Gameready/BarbarianCiv.py   World of Civilization ( WoC )(Download)
            iPlotCul = pCity.plot().getCulture( gc.getBARBARIAN_PLAYER() )
            iPlotCul += pCity.plot().getCulture(pCity.getOriginalOwner())
            RevUtils.giveCityCulture( pCity, newPlayer.getID(), iTotCul, iPlotCul, False, True )
 
            # Change nearby barb units
                iPlotCul = pCity.plot().getCulture( gc.getBARBARIAN_PLAYER() )
                iPlotCul += pCity.plot().getCulture(pCity.getOriginalOwner())
                RevUtils.giveCityCulture( pCity, newPlayer.getID(), iTotCul, iPlotCul, False, True )
                if( self.LOG_DEBUG and bVerbose ) : CvUtil.pyPrint("  BC - Culture of %s set to %d"%(city.getName(),city.getCulture()))