dacubz145
Deity
I'm assuming that is suppose to show up every game turn, so even the message does not show up
if CyGame().getSorenRandNum(1, "Wonder Building") == 0:
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_GLOBAL_JAM",()), None)
if CyGame().getSorenRandNum(1, "Wonder Building") == 0:
if 1 < 2:
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_GLOBAL_JAM",()), None)
iGameTurn = argsList[0]
def onEndGameTurn(self, argsList):
'Called at the end 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)
[COLOR="Red"]CyInterface().addImmediateMessage(CyTranslator().getText("TXT_NUM_ANCIENTS",(len(AncientWonder)),), None)[/COLOR]
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 ##
## 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)
WhichWonder = CyGame().getSorenRandNum(len(AncientWonder), "which wonder")
Wonderinfo = gc.getBuildingInfo(AncientWonder[WhichWonder])
if len(AncientWonder) > 0:
WonderPlayer = []
for iPlayerX in range(gc.getMAX_CIV_PLAYERS()):
pPlayerX = gc.getPlayer(iPlayerX)
if pPlayerX.isAlive():
if Wonderinfo.isWater():
if pPlayerX.countNumCoastalCities() > 0:
WonderPlayer.append(pPlayerX)
else:
WonderPlayer.append(pPlayerX)
pPlayer = WonderPlayer[CyGame().getSorenRandNum(len(WonderPlayer), "which player")]
WonderCity = []
(loopCity, iter) = pPlayer.firstCity(false)
while(loopCity):
if Wonderinfo.isWater():
if loopCity.isCoastal(10):
WonderCity.append(loopCity)
else:
WonderCity.append(loopCity)
if len(WonderCity) > 0:
pCity = WonderCity[CyGame().getSorenRandNum(len(WonderCity), "which city")]
pCity.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(pCity.getID())
popupInfo.setData3(0)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pPlayer.getID())
CyInterface().addImmediateMessage(CyTranslator().getText("TXT_ANCIENT_START",(gc.getBuildingInfo(AncientWonder[WhichWonder]).getDescription(),pCity.getName(),pPlayer.getCivilizationDescriptionKey(),)), None)
## Ancient Wonders End ##