ExCx
Chieftain
So, there is this feature called olympics (http://forums.civfanatics.com/downloads.php?do=file&id=18299) which is built into a random city every 25 years, to give its boosts for 5 years.
Also, there is this "Olympic Games" wonder in RoM. It gives free Arena (colosseum) in every city, provides happiness bonuses and stuff.
Now, I want to incorporate these two. So, Olympics should not start with a date, but instead it should initiate whenever the "Olympic games" wonder is built. And the games would also be held firstly in the city where the wonder is built. Lastly, the games should be held only in the cities with an arena (colosseum).
I don't really know any Python. I do know some other languages, so I can understand it a little bit. But it's not enough. Can you help me on this?
Current code for Olympics in CvEventManager is as follows:
Also, there is this "Olympic Games" wonder in RoM. It gives free Arena (colosseum) in every city, provides happiness bonuses and stuff.
Now, I want to incorporate these two. So, Olympics should not start with a date, but instead it should initiate whenever the "Olympic games" wonder is built. And the games would also be held firstly in the city where the wonder is built. Lastly, the games should be held only in the cities with an arena (colosseum).
I don't really know any Python. I do know some other languages, so I can understand it a little bit. But it's not enough. Can you help me on this?
Current code for Olympics in CvEventManager is as follows:
Code:
## Olympics Start ##
if CyGame().getStartEra() == gc.getInfoTypeForString("ERA_ANCIENT"):
olympicyear = -776
else:
olympicyear = 1896
if CyGame().getTurnYear(iGameTurn) >= olympicyear:
if iGameTurn % 25 == 0:
OlyPlayer = []
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.isAlive():
OlyPlayer.append(pPlayerX)
OlyChosenPlayer = OlyPlayer[CyGame().getSorenRandNum(len(OlyPlayer), "which player")]
citychance = CyGame().getSorenRandNum(OlyChosenPlayer.getNumCities(), "which city")
i = 0
(loopCity, iter) = OlyChosenPlayer.firstCity(false)
while(loopCity):
if i == citychance:
loopCity.setNumRealBuilding(gc.getInfoTypeForString("BUILDING_OLYMPICS"), 1)
loopCity.changeBaseYieldRate(2,1)
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_OLYMPICS_START",(loopCity.getName(),OlyChosenPlayer.getCivilizationDescriptionKey(),)), None)
break
i += 1
(loopCity, iter) = OlyChosenPlayer.nextCity(iter, false)
if iGameTurn % 25 == 5:
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.getBuildingClassCount(gc.getInfoTypeForString("BUILDINGCLASS_OLYMPICS")) == 1:
pPlayerX.removeBuildingClass(gc.getInfoTypeForString("BUILDINGCLASS_OLYMPICS"))
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_OLYMPICS_END", ()), None)
break