platyping
Sleeping Dragon
Removed all getSorenRandNum functions to fix OOS.
This includes the codes in CvGameUtils for Pillaging in BTS codes.
This includes the codes in CvGameUtils for Pillaging in BTS codes.
Removed all getSorenRandNum functions to fix OOS.
This includes the codes in CvGameUtils for Pillaging in BTS codes.
what did you replace the getSorenRandNum function with?
Just use python own random function...
def placeWonderBuilding(self, pCity):
for i in xrange(21):
pPlot = pCity.getCityIndexPlot(i)
iFeature = pPlot.getFeatureType()
if iFeature == -1: continue
sType = gc.getFeatureInfo(iFeature).getType()
if sType.find("FEATURE_PLATY_") == -1: continue
sNature = sType[sType.find("_PLATY_") + 7:]
sBuildingType = "BUILDING_" + sNature
iBuilding = gc.getInfoTypeForString(sBuildingType)
if iBuilding == -1: continue
if self.checkWonderBuilt(iBuilding): continue
pCity.setNumRealBuilding(iBuilding, 1)
return
def checkWonderBuilt(self, iBuilding):
iBuildingClass = gc.getBuildingInfo(iBuilding).getBuildingClassType()
for iTeamX in xrange(gc.getMAX_TEAMS()):
pTeamX = gc.getTeam(iTeamX)
if pTeamX.getBuildingClassCount(iBuildingClass) > 0: return True
return False
<iGlobalHurryModifier>25</iGlobalHurryModifier>
iNaturalWonder = 5013 # make sure the id is not used for anything else
iPlayer = city.getOwner()
iCity = city.getID()
CyMessageControl( ).sendModNetMessage( iNaturalWonder, iPlayer , iCity, -1, -1 )
if iData1 == 5013:
pPlayer = gc.getPlayer(iData2)
for i in xrange(21):
pPlot = pPlayer.getCity(iData3).getCityIndexPlot(i)
iFeature = pPlot.getFeatureType()
if iFeature == -1: continue
sType = gc.getFeatureInfo(iFeature).getType()
if sType.find("FEATURE_PLATY_") == -1: continue
sNature = sType[sType.find("_PLATY_") + 7:]
sBuildingType = "BUILDING_" + sNature
iBuilding = gc.getInfoTypeForString(sBuildingType)
if iBuilding == -1: continue
bBuilt = NaturalWonders.NaturalWonders().checkWonderBuilt(pPlot, pPlayer.getCity(iData3))
if sType in NaturalWonders.NaturalWonders().lBigWonder and not bBuilt:
bFound = False
iX = pPlot.getX()
iY = pPlot.getY()
for x in xrange(iX - 1, iX + 2):
for y in xrange(iY - 1, iY + 2):
pAdjacentPlot = CyMap().plot(x, y)
if x == iX and y == iY: continue
if pAdjacentPlot.getFeatureType() == iFeature:
bFound = True
break
if bFound: break
bBuilt = NaturalWonders.NaturalWonders().checkWonderBuilt(pAdjacentPlot, pPlayer.getCity(iData3))
if bBuilt: continue
pPlayer.getCity(iData3).setNumRealBuilding(iBuilding, 1)
To fix the out of sync
Firstly CyGame().getSorenRandNum must be used and not the python random number