ripple01
Emperor
I am borrowing some code from tsentom1 that is attached to a wonder that provides a 2% interest on all your gold reserves. I am attempting to attach this to a trait. My python is below, it doesn't throw any errors but it just doesn't seem to work. Any help would be appreciated.
Cheers,
ripple01
Cheers,
ripple01
Code:
def onBeginPlayerTurn(self, argsList):
'Called at the beginning of a players turn'
iGameTurn, iPlayer = argsList
## Financial Trait Start ##
pPlayer = gc.getPlayer(iPlayer)
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_FINANCIAL')
if (pPlayer.hasTrait(iTrait)):
iGold = pPlayer.getGold( )
if pPlayer.getGold( ) >= 2500:
pPlayer.changeGold( 50 )
if pPlayer.getGold( ) < 2500:
if pPlayer.getGold( ) >= 50:
pPlayer.changeGold( iGold//50 )
else:
pPlayer.changeGold( 1 )
## Financial Trait End ##