Advertisement
Guest User

Untitled

a guest
May 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. def doPlanarGateChance(self, iPlayer, pCity):
  2.     gc          = CyGlobalContext()
  3.     game        = CyGame()
  4.     iX           = pCity.getX()
  5.     iY           = pCity.getY()
  6.     getPlot = CyMap().plot
  7.    
  8.     if iPlayer == -1:
  9.         pPlayer = gc.getPlayer(game.getActivePlayer())
  10.     else:
  11.         pPlayer = gc.getPlayer(iPlayer)
  12.        
  13.     iMult = 1
  14.     iHell = 0
  15.     iAC = game.getGlobalCounter()
  16.    
  17.     if iAC >= 10:
  18.         iMult += 0.15
  19.     if iAC >= 20:
  20.         iMult += 0.15
  21.     if iAC >= 30:
  22.         iMult += 0.15
  23.     if iAC >= 40:
  24.         iMult += 0.15
  25.     if iAC >= 50:
  26.         iMult += 0.15
  27.     if iAC >= 60:
  28.         iMult += 0.15
  29.     if iAC >= 70:
  30.         iMult += 0.15
  31.     if iAC >= 80:
  32.         iMult += 0.15
  33.     if iAC >= 90:
  34.         iMult += 0.15
  35.     if iAC == 100:
  36.         iMult += 0.15
  37.    
  38.     for iiX,iiY in BFC:
  39.         pLoopPlot = getPlot(iX+iiX,iY+iiY)
  40.         if not pLoopPlot.isNone():
  41.             iTerrain = pLoopPlot.getTerrainType()
  42.             if iTerrain.isHell():
  43.                 iHell += 1
  44.  
  45.     if iHell != 0:
  46.         iMult += iHell * 0.05
  47.    
  48.     iPlanarGateChance = (self.Defines["Planar Gate"] * iMult)
  49.     iPlanarGateChance = scaleInverse(iPlanarGateChance)
  50.    
  51.     pCity.setCityCounter(iPlanarGateChance)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement