Aussie_Lurker
Deity
Hi to all you skilled with SDK. I really want to change the way in which population growth is determined. Essentially, HEALTH will be what determines if a city grows, shrinks or remains stagnant-and food surpluses or deficits modify health for the purpose of population growth.
Now, I have the following sections of the SDK for City Growth:
and this section on health
Can anyone point me in the right direction as to how I can modify this?
Thanks in advance.
Aussie_Lurker.
Now, I have the following sections of the SDK for City Growth:
Code:
int CvCity::getFoodTurnsLeft()
{
int iFoodLeft;
int iTurnsLeft;
iFoodLeft = (growthThreshold() - getFood());
if (foodDifference() <= 0)
{
return iFoodLeft;
}
iTurnsLeft = (iFoodLeft / foodDifference());
if ((iTurnsLeft * foodDifference()) < iFoodLeft)
{
iTurnsLeft++;
}
return max(1, iTurnsLeft);
}
bool CvCity::isProduction()
{
return (headOrderQueueNode() != NULL);
}
and this section on health
Code:
int CvCity::getBonusHealth(BonusTypes eBonus)
{
int iHealth;
int iI;
iHealth = GC.getBonusInfo(eBonus).getHealth();
for (iI = 0; iI < GC.getNumBuildingInfos(); iI++)
{
if (hasActiveBuilding((BuildingTypes)iI))
{
iHealth += GC.getBuildingInfo((BuildingTypes) iI).getBonusHealthChanges(eBonus);
}
}
return iHealth;
}
Can anyone point me in the right direction as to how I can modify this?
Thanks in advance.
Aussie_Lurker.