def FFHAddImprovements(self):
iBarrow = gc.getInfoTypeForString('IMPROVEMENT_BARROW')
iBarrowChance = gc.getDefineINT('BARROW_CHANCE')
iRuins = gc.getInfoTypeForString('IMPROVEMENT_RUINS')
iRuinsChance = gc.getDefineINT('RUINS_CHANCE')
iTower = gc.getInfoTypeForString('IMPROVEMENT_TOWER')
iTowerChance = gc.getDefineINT('TOWER_CHANCE')
iGoodyHut = gc.getInfoTypeForString('IMPROVEMENT_GOODY_HUT')
iGoodyHutChance = gc.getDefineINT('GOODY_HUT_CHANCE')
for i in range (CyMap().numPlots()):
if CyGame().getSorenRandNum(10000, "Add Barrows") <= iBarrowChance:
pPlot = CyMap().plotByIndex(i)
if (pPlot.canHaveImprovement(iBarrow,-1,True) and pPlot.getImprovementType() == -1 and pPlot.isCity() == False and pPlot.getFeatureType() == -1):
pPlot.setImprovementType(iBarrow)
if CyGame().getSorenRandNum(10000, "Add Ruins") <= iRuinsChance:
pPlot = CyMap().plotByIndex(i)
if (pPlot.canHaveImprovement(iRuins,-1,True) and pPlot.getImprovementType() == -1 and pPlot.isCity() == False):
pPlot.setImprovementType(iRuins)
if CyGame().getSorenRandNum(10000, "Add Tower") <= iTowerChance:
pPlot = CyMap().plotByIndex(i)
if (pPlot.canHaveImprovement(iTower,-1,True) and pPlot.getImprovementType() == -1 and pPlot.isCity() == False):
pPlot.setImprovementType(iTower)
if CyGame().getSorenRandNum(100, "Place Goody Hut") <= iGoodyHutChance:
pPlot = CyMap().plotByIndex(i)
if (pPlot.canHaveImprovement(iGoodyHut,-1,True) and pPlot.getImprovementType() == -1 and pPlot.isCity() == False):
pPlot.setImprovementType(iGoodyHut)