platyping
Sleeping Dragon
By the way... Singapore is a country not a city state
def onBeginGameTurn(self, argsList):
'Called at the beginning of the end of each turn'
iGameTurn = argsList[0]
## Ancient Wonders Start ##
if CyGame().getSorenRandNum(1, "Wonder Building") == 0:
AncientWonder = []
for iWonder in range(gc.getNumBuildingInfos()):
Wonderinfo = gc.getBuildingInfo(iWonder)
WonderBuildingClass = Wonderinfo.getBuildingClassType()
WonderSpecialBuilding = Wonderinfo.getSpecialBuildingType()
if WonderSpecialBuilding == gc.getInfoTypeForString("SPECIALBUILDING_ANCIENT_WONDER") and CyGame().getBuildingClassCreatedCount(WonderBuildingClass) == 0:
AncientWonder.append(iWonder)
if len(AncientWonder) > 0:
OlyPlayer = []
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.isAlive()==true:
OlyPlayer.append(pPlayerX)
pPlayer = OlyPlayer[CyGame().getSorenRandNum(len(OlyPlayer), "which player")]
citychance = CyGame().getSorenRandNum(pPlayer.getNumCities(), "which city")
i = 0
(loopCity, iter) = pPlayer.firstCity(false)
while(loopCity):
if i == citychance:
WhichWonder = CyGame().getSorenRandNum(len(AncientWonder), "which wonder")
Wonderinfo = gc.getBuildingInfo(AncientWonder[WhichWonder])
if Wonderinfo.isWater():
if loopCity.isCoastal(10):
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
else:
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
if ((not gc.getGame().isNetworkMultiPlayer()) and (pPlayer.getID() == gc.getGame().getActivePlayer())):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(AncientWonder[WhichWonder])
popupInfo.setData2(loopCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pPlayer.getID())
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_ANCIENT_START",(gc.getBuildingInfo(AncientWonder[WhichWonder]).getDescription(),loopCity.getName(),pPlayer.getCivilizationDescriptionKey(),)), None)
i += 1
(loopCity, iter) = pPlayer.nextCity(iter, false)
## Ancient Wonders End ##
CvTopCivs.CvTopCivs().turnChecker(iGameTurn)
; Set to 1 for no python exception popups
HidePythonExceptions = 0
def onBeginGameTurn(self, argsList):
'Called at the beginning of the end of each turn'
iGameTurn = argsList[0]
## Ancient Wonders Start ##
if CyGame().getSorenRandNum(1, "Wonder Building") == 0:
AncientWonder = []
for iWonder in range(gc.getNumBuildingInfos()):
Wonderinfo = gc.getBuildingInfo(iWonder)
WonderBuildingClass = Wonderinfo.getBuildingClassType()
WonderSpecialBuilding = Wonderinfo.getSpecialBuildingType()
if WonderSpecialBuilding == gc.getInfoTypeForString("SPECIALBUILDING_ANCIENT_WONDER") and CyGame().getBuildingClassCreatedCount(WonderBuildingClass) == 0:
AncientWonder.append(iWonder)
if len(AncientWonder) > 0:
OlyPlayer = []
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.isAlive()==true:
OlyPlayer.append(pPlayerX)
pPlayer = OlyPlayer[CyGame().getSorenRandNum(len(OlyPlayer), "which player")]
citychance = CyGame().getSorenRandNum(pPlayer.getNumCities(), "which city")
i = 0
(loopCity, iter) = pPlayer.firstCity(false)
while(loopCity):
if i == citychance:
WhichWonder = CyGame().getSorenRandNum(len(AncientWonder), "which wonder")
Wonderinfo = gc.getBuildingInfo(AncientWonder[WhichWonder])
if Wonderinfo.isWater():
if loopCity.isCoastal(10):
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
else:
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
if ((not gc.getGame().isNetworkMultiPlayer()) and (pPlayer.getID() == gc.getGame().getActivePlayer())):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(AncientWonder[WhichWonder])
popupInfo.setData2(loopCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pPlayer.getID())
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_ANCIENT_START",(gc.getBuildingInfo(AncientWonder[WhichWonder]).getDescription(),loopCity.getName(),pPlayer.getCivilizationDescriptionKey(),)), None)
i += 1
(loopCity, iter) = pPlayer.nextCity(iter, false)
## Ancient Wonders End ##
## Ancient Wonders Start ##
if CyGame().getSorenRandNum(1, "Wonder Building") == 0:
AncientWonder = []
for iWonder in range(gc.getNumBuildingInfos()):
Wonderinfo = gc.getBuildingInfo(iWonder)
WonderBuildingClass = Wonderinfo.getBuildingClassType()
WonderSpecialBuilding = Wonderinfo.getSpecialBuildingType()
if WonderSpecialBuilding == gc.getInfoTypeForString("SPECIALBUILDING_CATHEDRAL") and CyGame().getBuildingClassCreatedCount(WonderBuildingClass) == 0:
AncientWonder.append(iWonder)
if len(AncientWonder) > 0:
OlyPlayer = []
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.isAlive()==true:
OlyPlayer.append(pPlayerX)
pPlayer = OlyPlayer[CyGame().getSorenRandNum(len(OlyPlayer), "which player")]
citychance = CyGame().getSorenRandNum(pPlayer.getNumCities(), "which city")
i = 0
b_WonderBuilt = false
(loopCity, iter) = pPlayer.firstCity(false)
while(loopCity):
if i == citychance:
WhichWonder = CyGame().getSorenRandNum(len(AncientWonder), "which wonder")
Wonderinfo = gc.getBuildingInfo(AncientWonder[WhichWonder])
if Wonderinfo.isWater():
if loopCity.isCoastal(10):
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
b_WonderBuilt = true
else:
loopCity.setNumRealBuilding(AncientWonder[WhichWonder], 1)
b_WonderBuilt = true
if b_WonderBuilt == true:
if ((not gc.getGame().isNetworkMultiPlayer()) and (pPlayer.getID() == gc.getGame().getActivePlayer())):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(AncientWonder[WhichWonder])
popupInfo.setData2(loopCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pPlayer.getID())
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_ANCIENT_START",(gc.getBuildingInfo(AncientWonder[WhichWonder]).getDescription(),loopCity.getName(),pPlayer.getCivilizationDescriptionKey(),)), None)
break
i += 1
(loopCity, iter) = pPlayer.nextCity(iter, false)
## Ancient Wonders End ##
if WonderSpecialBuilding == gc.getInfoTypeForString("SPECIALBUILDING_ANCIENT_WONDER") and CyGame().getBuildingClassCreatedCount(WonderBuildingClass) == 0: