Where are the upgrade costs of units coded?

well there is the BASE_UNIT_UPGRADE_COST and UNIT_UPGRADE_COST_PER_PRODUCTION defines in the globaldefines.xml

thats a good place to start
 
You can override in the the GameUtils python file (def getUpgradePriceOverride(self, argsList)):

Code:
		iPrice = gc.getDefineINT("BASE_UNIT_UPGRADE_COST")
		iPrice += (max(0, (pPlayer.getUnitProductionNeeded(iUnitTypeUpgrade) - pPlayer.getUnitProductionNeeded(pUnit.getUnitType()))) * gc.getDefineINT("UNIT_UPGRADE_COST_PER_PRODUCTION"))

		if ((not pPlayer.isHuman()) and (not pPlayer.isBarbarian())):
			pHandicapInfo = gc.getHandicapInfo(gc.getGame().getHandicapType())
			iPrice = iPrice * pHandicapInfo.getAIUnitUpgradePercent() / 100
			iPrice = iPrice * max(0, ((pHandicapInfo.getAIPerEraModifier() * pPlayer.getCurrentEra()) + 100)) / 100

		iPrice = iPrice - ((iPrice * pUnit.getUpgradeDiscount()) / 100)

Would be the python equivalent of the SDK upgrade price code.
 
The above is how Tsentom made the Leonardo's Worksop World Wonder. Nice wonder by the way, thanks for making it available, it's made it's way into WolfRev :)
 
Thanks; I'll fiddle with it when I get the chance!
 
Back
Top Bottom