Fimbulvetr
Emperor
Well I have reason to believe that m_aBuildingHappyChange is stored, so even if there is a chance that the building might not get the bonus of its own effect the same turn it is built, it would definitely get it the next turn.
for Market and Library to Library. In my game I added a Market to two cities. Then I added a Library to one of them. All this is through WorldBuilder.
as expected in the building list and the
hover.
as expected in the building list (for for each building) and the
hover.
. When I added the building, the
indicator on the map did not disappear until I exited WB.
effect immediately. So it must be recalculated between adding the building and beginning my next turn.
(getNumBuilding(eLoopBuilding) [B]+ (eBuilding == eLoopBuilding ? 1 : 0)[/B])

I thought this was handled in the big chunk that starts with // War Weariness Modifier but I can't see the global variant now that I actually read it. if (((iFocusFlags & BUILDINGFOCUS_HAPPY) || (iPass > 0)) && !isNoUnhappiness())
{
int iBestHappy = 0;
for (iI = 0; iI < GC.getNumHurryInfos(); iI++)
{
if (canHurryBuilding((HurryTypes)iI, eBuilding, true))
{
int iHappyFromHurry = AI_getHappyFromHurry((HurryTypes)iI, eBuilding, true);
if (iHappyFromHurry > iBestHappy)
{
iBestHappy = iHappyFromHurry;
}
}
}
iValue += iBestHappy * 10;
[B] if (kBuilding.isNoUnhappiness())
{
iValue += ((iAngryPopulation * 10) + getPopulation());
}[/B]
[COLOR="Green"]/************************************************************************************************/
/* BETTER_BTS_AI_MOD 02/24/10 jdog5000 */
/* */
/* City AI */
/************************************************************************************************/[/COLOR]
int iGood, iBad = 0;
int iBuildingActualHappiness = getAdditionalHappinessByBuilding(eBuilding,iGood,iBad);
if( iBuildingActualHappiness < 0 )
{
[COLOR="Green"]// Building causes net decrease in city happiness[/COLOR]
iValue -= (-iBuildingActualHappiness + iAngryPopulation) * 6
+ (-iBuildingActualHappiness) * iHappyModifier;
[COLOR="Green"]// BBAI TODO: Check for potential shrink in populatio[/COLOR]n
}
else if( iBuildingActualHappiness > 0 )
{
[COLOR="Green"]// Building causes net increase in city happiness[/COLOR]
iValue += (std::min(iBuildingActualHappiness, iAngryPopulation) * 10)
+ (std::max(0, iBuildingActualHappiness - iAngryPopulation) * iHappyModifier);
}
iValue += (-kBuilding.getHurryAngerModifier() * getHurryPercentAnger()) / 100;
for (iI = 0; iI < NUM_COMMERCE_TYPES; iI++)
{
iValue += (kBuilding.getCommerceHappiness(iI) * iHappyModifier) / 4;
}
int iWarWearinessModifer = kBuilding.getWarWearinessModifier();
if (iWarWearinessModifer != 0)
{
iValue += (-iWarWearinessModifer * iHappyModifier) / 16;
}
iValue += (kBuilding.getAreaHappiness() * (iNumCitiesInArea - 1) * 8);
iValue += (kBuilding.getGlobalHappiness() * iNumCities * 8);
int iWarWearinessPercentAnger = kOwner.getWarWearinessPercentAnger();
[B] int iGlobalWarWearinessModifer = kBuilding.getGlobalWarWearinessModifier();
if (iGlobalWarWearinessModifer != 0)
{
iValue += (-(((iGlobalWarWearinessModifer * iWarWearinessPercentAnger / 100) / GC.getPERCENT_ANGER_DIVISOR())) * iNumCities);[/B]
iValue += (-iGlobalWarWearinessModifer * iHappyModifier) / 16;
[B]}[/B]
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
if (kBuilding.getBuildingHappinessChanges(iI) != 0)
{
iValue += (kBuilding.getBuildingHappinessChanges(iI) * kOwner.getBuildingClassCount((BuildingClassTypes)iI) * 8);
}
}
[COLOR="Green"]/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/[/COLOR]
}
if (((iFocusFlags & BUILDINGFOCUS_HEALTHY) || (iPass > 0)) && !isNoUnhealthyPopulation())
{
[COLOR="Green"]/************************************************************************************************/
/* BETTER_BTS_AI_MOD 02/24/10 jdog5000 & Fuyu */
/* */
/* City AI */
/************************************************************************************************/[/COLOR]
int iGood, iBad = 0;
int iBuildingActualHealth = getAdditionalHealthByBuilding(eBuilding,iGood,iBad);
if( iBuildingActualHealth < 0 )
{
[COLOR="Green"]// Building causes net decrease in city health[/COLOR]
iValue -= (-iBuildingActualHealth + iBadHealth) * 6
+ (-iBuildingActualHealth) * iHealthModifier;
/[COLOR="Green"]/ BBAI TODO: Check for potential shrink in population[/COLOR]
}
else if( iBuildingActualHealth > 0 )
{
[COLOR="Green"]// Building causes net increase in city health[/COLOR]
iValue += (std::min(iBuildingActualHealth, iBadHealth) * 10)
+ (std::max(0, iBuildingActualHealth - iBadHealth) * iHealthModifier);
}
iValue += (kBuilding.getAreaHealth() * (iNumCitiesInArea-1) * 4);
iValue += (kBuilding.getGlobalHealth() * iNumCities * 4);
[COLOR="Green"]/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/[/COLOR]
}
and
) and Spoiled Food (caused by
and
). This is important because adding
or
doesn't always buy you an immediate benefit, and when it does it's good to know.
and 6
leaving you with 1
citizen who won't work. A Market with Ivory and Silk will show +2
and -1
.

int CvCity::getAdditionalHealthByBuilding(BuildingTypes eBuilding) const
{
int iGood = 0; int iBad = 0; int iSpoiledFood = 0;
return getAdditionalHealthByBuilding(eBuilding, iGood, iBad, iSpoiledFood);
}
int CvCity::getAdditionalHappinessByBuilding(BuildingTypes eBuilding) const
{
int iGood = 0; int iBad = 0; int iAngryPop = 0;
return getAdditionalHappinessByBuilding(eBuilding, iGood, iBad, iAngryPop);
}

>
. I am honestly tempted to change both to the bad food char, but then the equation on the left will not sync up exactly (four values won't fit there). I don't think the bad food icon is actually used anywhere in the vanilla game--only in the CDA. If so, I'm game to use it instead.
I am proposing +1 <eaten/bad-food> for
things and -1 <same icon> for
things.
in a city with unhealthiness.
buildings should say -X bad/eaten food and
buildings should say +X bad/eaten. Are we agreed on that?
, -1 eaten food)