In CvTeamAI::AI_permanentAllianceTrade:
How could I change this code to make it so that the average (total power divided by number of members) power of the resulting team has to be greater than the power of the potential new member?
For example: team 1 has players 1, 2, and 3. their average power is 500, player 4 has a power of 450, so he may potentially join team 1, however player 5 has a power of 550 so there is no chance of him joining until team 1 has an average power higher than 550.
thanks,
cotdamn
Code:
if ((getPower(true) + GET_TEAM(eTeam).getPower(true)) > (GC.getGameINLINE().countTotalCivPower() / 2))
{
if (getPower(true) > GET_TEAM(eTeam).getPower(true))
{
return DENIAL_POWER_US;
}
else
{
return DENIAL_POWER_YOU;
}
}
How could I change this code to make it so that the average (total power divided by number of members) power of the resulting team has to be greater than the power of the potential new member?
For example: team 1 has players 1, 2, and 3. their average power is 500, player 4 has a power of 450, so he may potentially join team 1, however player 5 has a power of 550 so there is no chance of him joining until team 1 has an average power higher than 550.
thanks,
cotdamn