## Nom Trait Start ##
pPlayer = gc.getPlayer( pUnit.getOwner( ) )
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_NOMADIC')
if (pPlayer.hasTrait(iTrait)):
iPillageGold = ( ( 0 ) * 2 )
iPillageGold = ( ( CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 1") ) * 2 )
iPillageGold += ( ( CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 2") ) * 2 )
iPillageGold += ( ( (pUnit.getPillageChange() * iPillageGold) / 100 ) * 2 )
else:
iPillageGold = 0
iPillageGold = CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 1")
iPillageGold += CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 2")
iPillageGold += (pUnit.getPillageChange() * iPillageGold) / 100
pPlayer2 = gc.getPlayer( pPlot.getOwner( ) )
if pPlot.getOwner( ) >= 0:
if (pPlayer2.hasTrait(iTrait)):
iPillageGold = 0
## Nom Trait End ##
## Nom Trait Start ##
pPlayer = gc.getPlayer( pUnit.getOwner( ) )
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_NOMADIC')
if (pPlayer.hasTrait(iTrait)):
iPillageGold = ( ( 0 ) * 2 )
iPillageGold = ( ( CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 1") ) * 2 )
iPillageGold += ( ( CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 2") ) * 2 )
iPillageGold += ( ( (pUnit.getPillageChange() * iPillageGold) / 100 ) * 2 )
else:
iPillageGold = 0
iPillageGold = CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 1")
iPillageGold += CyGame().getSorenRandNum(gc.getImprovementInfo(pPlot.getImprovementType()).getPillageGold(), "Pillage Gold 2")
iPillageGold += (pUnit.getPillageChange() * iPillageGold) / 100
## Nom Trait End ##
def doCityCaptureGold(self, argsList):
"controls the gold result of capturing a city"
pOldCity = argsList[0]
iCaptureGold = 0
iCaptureGold += gc.getDefineINT("BASE_CAPTURE_GOLD")
iCaptureGold += (pOldCity.getPopulation() * gc.getDefineINT("CAPTURE_GOLD_PER_POPULATION"))
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND1"), "Capture Gold 1")
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND2"), "Capture Gold 2")
if (gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS") > 0):
iCaptureGold *= cyIntRange((CyGame().getGameTurn() - pOldCity.getGameTurnAcquired()), 0, gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS"))
iCaptureGold /= gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS")
## Nom Trait Start ##
pPlayer = gc.getPlayer( pOldCity.getOwner( ) )
iTrait = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_PROTECTIVE')
if (pPlayer.hasTrait(iTrait)):
iCaptureGold = 0
else:
iCaptureGold = 0
iCaptureGold += gc.getDefineINT("BASE_CAPTURE_GOLD")
iCaptureGold += (pOldCity.getPopulation() * gc.getDefineINT("CAPTURE_GOLD_PER_POPULATION"))
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND1"), "Capture Gold 1")
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND2"), "Capture Gold 2")
if (gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS") > 0):
iCaptureGold *= cyIntRange((CyGame().getGameTurn() - pOldCity.getGameTurnAcquired()), 0, gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS"))
iCaptureGold /= gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS")
## Nom Trait End ##
return iCaptureGold
def doCityCaptureGold(self, argsList):
"controls the gold result of capturing a city"
pOldCity = argsList[0]
iCaptureGold = 0
iCaptureGold += gc.getDefineINT("BASE_CAPTURE_GOLD")
iCaptureGold += (pOldCity.getPopulation() * gc.getDefineINT("CAPTURE_GOLD_PER_POPULATION"))
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND1"), "Capture Gold 1")
iCaptureGold += CyGame().getSorenRandNum(gc.getDefineINT("CAPTURE_GOLD_RAND2"), "Capture Gold 2")
if (gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS") > 0):
iCaptureGold *= cyIntRange((CyGame().getGameTurn() - pOldCity.getGameTurnAcquired()), 0, gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS"))
iCaptureGold /= gc.getDefineINT("CAPTURE_GOLD_MAX_TURNS")
return iCaptureGold
def onCityBuilt(self, argsList):
'City Built'
city = argsList[0]
#FREE SPEC FROM TRAIT
player = PyPlayer(city.getOwner())
pPlayer = gc.getPlayer(city.getOwner())
iTrait2 = CvUtil.findInfoTypeNum(gc.getTraitInfo,gc.getNumTraitInfos(),'TRAIT_SCIENTIFIC')
iSpecialist = CvUtil.findInfoTypeNum(gc.getSpecialistInfo, gc.getNumSpecialistInfos(), 'SPECIALIST_SCIENTIST', )
if (pPlayer.hasTrait(iTrait2)):
city.changeFreeSpecialistCount(iSpecialist, 1)
#END SPEC FROM TRAIT #
That's odd. I had the following in a trait I created:Mercantile is actually all XML so the confusing wording of the trait (20% of Food is Trade) is all firaxis' fault.
The way it works currently every 5 commerce a trade route makes (as 20% of a 100 is 5) you will also get 1 hammer and 1 food. This applies to all trade routes. It's generally weak late game but gets strong once you have harbors and custom houses.
[B] <TradeYieldModifiers>
<iYield>100</iYield>
<iYield>0</iYield>
<iYield>0</iYield>
</TradeYieldModifiers>[/B]
Also, it won't show up as a +25% when hovering over your hammers in the city screen. Rather if you compare the actual hammer cost of the building or unit when selecting production it'll be lower.
Using SDK instead.