The problem is, the values of the bonuses for Health & Happy from Techs is calculated in CvTeam::processTech using a value that is fed to it from CvTeam::setHasTech, and that fed-in value is the number of techs that the team has with the qualifying modifier. Remember, it's not just "normal" techs, but the Future Techs too, which just keep counting up & up. I can't just say:
because that would only return each tech from the tree that you've learned that had an ExtraHealth value for it. But the tree is not where the number of Future Techs you have is counted. The above would return 1 for Future Tech 1, and continue to return 1 for FT 2, 3, etc.
So, what I'm thinking is, change this line in CvTeam::setHasTech thus:
and add this further down to calculate and then return the value of
/
The above is just a pair of duplicates of CvTeam::processTech, with everthing non-
/
-related removed.
I can then call CvTeam::getTechHealth() & ::getTechHappy in CGTM for the hovers...
I think...
EDIT: Nope, that didn't work. Apparently, "GET_PLAYER((PlayerTypes)iI).changeExtraHealth(GC.getTechInfo(eTech).getHealth() * iChange) has type 'void' ". Which means I can't dictate to have it equal a variable, like iTechHealthValue. Don't know how to work around this...
Code:
for each tech iI
if player has tech iI
So, what I'm thinking is, change this line in CvTeam::setHasTech thus:
Code:
processTech(eIndex, ((bNewValue) ? 1 : -1));
[COLOR="Red"]updateTechHappy(eIndex, ((bNewValue) ? 1 : -1));
updateTechHealth(eIndex, ((bNewValue) ? 1 : -1));[/COLOR]
and add this further down to calculate and then return the value of
/
PHP:
void CvTeam::updateTechHappy(TechTypes eTech, int iChange)
{
PROFILE_FUNC();
int iI;
int iTechHappyValue = 0;
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
{
iTechHappyValue = GET_PLAYER((PlayerTypes)iI).changeExtraHappiness(GC.getTechInfo(eTech).getHappiness() * iChange);
}
}
m_iTechHappy = iTechHappyValue;
}
int CvTeam::getTechHappy()
{
return m_iTechHappy;
}
void CvTeam::updateTechHealth(TechTypes eTech, int iChange)
{
PROFILE_FUNC();
int iI;
int iTechHealthValue = 0;
for (iI = 0; iI < MAX_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).getTeam() == getID())
{
iTechHealthValue = GET_PLAYER((PlayerTypes)iI).changeExtraHealth(GC.getTechInfo(eTech).getHealth() * iChange);
}
}
m_iTechHealth = iTechHealthValue;
}
int CvTeam::getTechHealth()
{
return m_iTechHealth;
}
_______________________________________________________________________________
I'm trying something new here with the |PHP| tags instead of
the |CODE| tags. I think it might be easier to read...
The above is just a pair of duplicates of CvTeam::processTech, with everthing non-
/
-related removed.I can then call CvTeam::getTechHealth() & ::getTechHappy in CGTM for the hovers...
I think...

EDIT: Nope, that didn't work. Apparently, "GET_PLAYER((PlayerTypes)iI).changeExtraHealth(GC.getTechInfo(eTech).getHealth() * iChange) has type 'void' ". Which means I can't dictate to have it equal a variable, like iTechHealthValue. Don't know how to work around this...

/
rocessTech() and there are already calls to CvPlayer::changeExtraHappiness() for the tech's happiness. What are you trying to do? It's too difficult to keep multiple threads straight when people do multiple things in the same thread. Can you please restate exactly what you're doing at this point? I don't want to reread the whole thread.
/
/
to them also. At your, and xienwolf's, suggestion, the Tech Yields tags are simply available to all techs, and not attached solely to FT.
