Reduced the effect of pre-existing progress in AI_chooseBuilding.

Previously any pre-existing progress on the chosen building would
effectively boost the probability up to 100%. Now, the probability is
increased by progress / total cost.

Also, cleared out some bbai comments and clarified what was actually
added by bbai in a couple of places.
Changed the odds formula for short-circuit 2&3 in AI_chooseProduction.

The new formula is more sensitive to iBuildUnitProb. My intention is
that this should put a bit more of the leader's flavour back into the
number of units built, and also it should slightly decrease the rate of
military cities getting side-tracked by other infrastructure.

Overall, short-circuit 2 will be slightly less common than before.

The threshold for short-circuit 3 has been raised, so that it will catch
fewer buildings.
Changed the format of the mouseover text for limited units.

The limits are now displayed on a new line rather than inline with the
unit name, and the limit text is displayed in the warning colour (ie.
red) if the limit has already been reached.
setUnitHelp now checks for exemptions to any building requirements.

The text stating that the unit requires a building will now only be
displayed if the player is not exempt to that requirement. (eg. the text
for missionaries won't say "requires monastary" if the civ is using
Organised Religion.)
CvPlayer::canTrain team/national limits are now skipped if bTestVisible

The global unit limits are enforced based on the number of units ever
built, but team limits and national limits are based on the number of
units currently active. So even though the units may be currently maxed
out, they won't necesearily be like that forever - and therefore they
should still be visible.
Rewrote sections in AI_techValue for map and defensive pact trading.

The new evaluations are based on the number of players that the tech
would enable us to trade with. It's similar to the recent update for
tech trading.
Added some basic diplomatic victory strategy to AI_civicValue.

When aiming for a diplomatic victory, the AI now give some additional
value to the favourite civics of their potential allies.

Also made a couple of minor tweaks some unused bits of AI_civicValue.
Research is now completely halted while in anarchy.

Previously, research would continue as normal while in anarchy. The
commerce rate would be zero, but the civ would still get the 'base
research' points (which is set to 1 in the default xml). Now, research
is completely halted during anarchy, including the free base research.

The primary reason for this change is not really a good one... the
reason is that the AI cannot evaluate techs accurate while in anarchy,
and so I don't want them to have to choose their research while in
anarchy.

I've also changed a couple of things related to the triggering of
choose-research popups.
Fixed a K-Mod bug in distance maintenance for civs with exactly 2 cities

CvCity::calculateMaintenanceDistance incorrectly calculated zero
distance when the only other city was the capital.
Made some adjustments to CvGameTextMgr::buildBuildingRequiresString

For buildings such as catherals which require a number of other
buildings nation-wide, the requirement count is now includes the number
of (catheral style) buildings currently under construction. This means
if a catheral cannot be added to the build queue of multiple cities due
to a lack of temples, the city screen will now accurately report the
number of temples required.

Also, in the civilopedia such requirement counts are now indepentent of
the what buildings the current player happens to have.

Cleaned up the style of some of the code to be more maintainable.
Removed some superfluous clearing of danger cache in CvPlot::setOwner.

The cache range was being used recursively by mistake.
Fixed the resetting of the UI pathfinder after a unit is promoted.

Previously it was resetting the wrong pathfinder, and thus had no
effect.
Rescaled collateral damage protection of Drill promotions.

Collateral proetection on Drill I, II, III, IV, has be changed from
0, 20, 20, 20 to 15, 15, 15, 15 respectively.
Fixed a crash in the Hall of Fame screen from the original BtS code.

Previously the game would randomly crash when switching between
different filters in the Hall of Fame if there were a lot of replays.
For example, if there were lots of single player replays, and lots of
multiplayer replays, the game would often crash when switching between
single player view and multiplayer view.
Tweaked the group size adjustment used in AI_stackVsStack.
Added a lot more nuance to the AI's evaluation of gifted units.

Gifts of great people will now always result in +1 for "you gave us
help".

Gifts of military units are now evaluated based on the usefulness of the
gifted unit, and the AI player's current military needs. (In general,
units won't be worth very much if the AI is not at war; and they'll be
worth a lot if the AI is losing a war.)
Corrected the latin in one of Julius Caeser's quotes. (hopefully)

"Senatus populusque Romani saluto vos" has been changed to "Senatus
Populusque Romanus te salutant", under the guidence of Fluffy_Rabbit and
Yudishtira.
Fixed a mistake in the new diplomatic evaluation in AI_civicValue.

The other-player favourite civic bonus should only apply if the other
player is actually using their favourite civic. (I had forgotten to
check for this.)
Tweaked AI_warCommitmentCost for overseas wars and for late-game wars.

Changed the "total war" naval unit comparison so overseas wars are not
significantly cheaper than land wars.

Strengthen the condition on the doubling of the commitment cost for
space4 & culture4 so that it is only used when considering war with
someone who is not expected to beat us. (roughly.)
Rescaled and adjusted AI_warDiplomacyCost.

The previous version had some strange scaling based on population, which
had some counter-intuitive effects. (I'm not sure why I'd used that
scaling, and I'd even commented in the code that it was strange.) The
new scaling is based on the default number of players for the map size.

I've also made some adjustments to the weight. In general, the effect of
the team's "peace weight" has been dramatically reduced. (I did some
rough calculations and decided that the effect of peace weight was...
huge.)

I'd like some case data to get a sense of how well this function is
working, but I don't really want to test it right now...