The Capo
godless Heathen
I hate to triple post here, but I think it is better to keep a bunch of different code in different posts just to avoid confusion. Anyway, I'm an idiot because I missed two other sections of code. So I'm going to put them in, but I wanted to see what needs to be removed to fit with my other code (i.e. so there is no vassal requirement). So here is the first section I missed:
Okay, the second part is a bit confusing because I have a section similar in my code already. Here is the Topkapi code:
And here is what I have in mine, which has the same "def" part, but a different return:
So yeah, a little help here; how do I "merge" these last two codes. Hopefully this should make it all work... right?
Code:
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
## Topkapi Palace Start ##
pPlayer = gc.getPlayer(iPlayer)
iTeam = pPlayer.getTeam()
pTeam = gc.getTeam(iTeam)
b_Flavian = gc.getInfoTypeForString("BUILDING_FLAVIAN")
obsoleteTech = gc.getBuildingInfo(b_Topkapi).getObsoleteTech()
if ( gc.getTeam(pPlayer.getTeam()).isHasTech(obsoleteTech) == false or obsoleteTech == -1 ):
for iCity in range(pPlayer.getNumCities()):
ppCity = pPlayer.getCity(iCity)
if ppCity.getNumActiveBuilding(b_Flavian) == true:
for iPlayer in range(gc.getMAX_PLAYERS()):
ppPlayer = gc.getPlayer(iPlayer)
if ( (ppPlayer.isAlive()==true) and (ppPlayer.isBarbarian()==false) ):
if ( gc.getTeam(ppPlayer.getTeam()).isVassal(iTeam) == true ):
iGold = ppPlayer.getGold( )
if ppPlayer.getGold( ) >= 5000:
ppPlayer.changeGold( 50 )
if ppPlayer.getGold( ) < 5000:
if ppPlayer.getGold( ) >= 100:
ppPlayer.changeGold( iGold//50 )
else:
ppPlayer.changeGold( 2 )
ppPlayer.changeCombatExperience( +1 )
## Topkapi Palace End ##
Okay, the second part is a bit confusing because I have a section similar in my code already. Here is the Topkapi code:
Code:
## Topkapi Palace Start ##
def getRandomNumber(self, int):
return CyGame().getSorenRandNum(int, "Gods")
## Topkapi Palace End ##
And here is what I have in mine, which has the same "def" part, but a different return:
Code:
def getRandomNumber(self, int):
return gc.getGame().getSorenRandNum(int, "Next War")
So yeah, a little help here; how do I "merge" these last two codes. Hopefully this should make it all work... right?