//BCM:Added 27.9.09
iValue += ((kBuilding.getCommerceModifier(COMMERCE_CULTURE) * getBaseCommerceRate(COMMERCE_CULTURE)) / 15);
for (iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
{
iValue += ((kBuilding.getBonusCommerceModifier(iJ,COMMERCE_CULTURE) * getBaseCommerceRate(COMMERCE_CULTURE)) / 15);
}
if (GC.getGameINLINE().isOption(GAMEOPTION_NO_ESPIONAGE))
{
iValue += ((kBuilding.getCommerceModifier(COMMERCE_ESPIONAGE) * getBaseCommerceRate(COMMERCE_ESPIONAGE)) / 15);
for (iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
{
iValue += ((kBuilding.getBonusCommerceModifier(iJ,COMMERCE_ESPIONAGE) * getBaseCommerceRate(COMMERCE_ESPIONAGE)) / 15);
}
}
}
if (iFocusFlags & BUILDINGFOCUS_BIGCULTURE)
{
iTempValue = (kBuilding.getCommerceModifier(COMMERCE_CULTURE) / 5);
for (iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
{
iTempValue += (kBuilding.getBonusCommerceModifier(iJ,COMMERCE_CULTURE) / 5);
}
if (iTempValue != 0)
{
if (MAX_INT == aiCommerceRank[COMMERCE_CULTURE])
{
aiCommerceRank[COMMERCE_CULTURE] = findCommerceRateRank(COMMERCE_CULTURE);
}
// if this is a limited wonder, and we are not one of the top 4 in this category,
// do not count the culture value
// we probably do not want to build this here (but we might)
if (bIsLimitedWonder && (aiCommerceRank[COMMERCE_CULTURE] > (3 + iLimitedWonderLimit)))
{
iTempValue = 0;
}
iValue += iTempValue;
}
}
if (iFocusFlags & BUILDINGFOCUS_ESPIONAGE || (GC.getGameINLINE().isOption(GAMEOPTION_NO_ESPIONAGE) && (iFocusFlags & BUILDINGFOCUS_CULTURE)))
{
iTempValue = ((kBuilding.getCommerceModifier(COMMERCE_ESPIONAGE) * getBaseCommerceRate(COMMERCE_ESPIONAGE)) / 60);
for (iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
{
iTempValue += ((kBuilding.getBonusCommerceModifier(iJ,COMMERCE_ESPIONAGE) * getBaseCommerceRate(COMMERCE_ESPIONAGE)) / 60);
}
if (iTempValue != 0)
{
if (MAX_INT == aiCommerceRank[COMMERCE_ESPIONAGE])
{
aiCommerceRank[COMMERCE_ESPIONAGE] = findCommerceRateRank(COMMERCE_ESPIONAGE);
}
// if this is a limited wonder, and we are not one of the top 4 in this category, subtract the value
// we do _not_ want to build this here (unless the value was small anyway)
if (bIsLimitedWonder && (aiCommerceRank[COMMERCE_ESPIONAGE] > (3 + iLimitedWonderLimit)))
{
iTempValue *= -1;
}
iValue += iTempValue;
}
iTempValue = (kBuilding.getCommerceChange(COMMERCE_ESPIONAGE) * 3);
iTempValue += (kBuilding.getObsoleteSafeCommerceChange(COMMERCE_ESPIONAGE) * 3);
iTempValue *= 100 + kBuilding.getCommerceModifier(COMMERCE_ESPIONAGE);
for (iJ = 0; iJ < GC.getNumBonusInfos(); iJ++)
{
iTempValue *= 100 + kBuilding.getBonusCommerceModifier(iJ,COMMERCE_ESPIONAGE);
}
iValue += iTempValue / 100;
}
}
//BCM:End