int CvDiplomacyAI::GetFriendDenouncementScore(PlayerTypes ePlayer)
{
int iTraitorOpinion = 0;
// How many of their friends have denounced them?
for (int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)
{
PlayerTypes eLoopPlayer = (PlayerTypes) iPlayerLoop;
if (GET_PLAYER(eLoopPlayer).isMajorCiv() && eLoopPlayer != GetID() && eLoopPlayer != ePlayer && IsHasMet(eLoopPlayer, true) && GET_PLAYER(ePlayer).GetDiplomacyAI()->IsFriendDenouncedUs(eLoopPlayer))
{
// If this guy is untrustworthy or we hate him, he doesn't count
if (!CvDiplomacyAIHelpers::IgnoresBackstabbing(GetID(), eLoopPlayer, true) && !IsAtWar(eLoopPlayer) && !IsDenouncedPlayer(eLoopPlayer) && !IsDenouncedByPlayer(eLoopPlayer))
{
// Do we like this player who denounced them more than the player we're evaluating?
if (GetCachedOpinionWeight(eLoopPlayer) < GetCachedOpinionWeight(ePlayer))
{
int iPenalty = /*20*/ GD_INT_GET(OPINION_WEIGHT_DENOUNCED_BY_FRIEND_EACH);
if (IsFriendOrAlly(eLoopPlayer))
{
iPenalty *= /*200*/ GD_INT_GET(OPINION_WEIGHT_BETRAYED_OUR_FRIEND_MULTIPLIER);
iPenalty /= 100;
}
iTraitorOpinion += iPenalty;
}
else
{
iTraitorOpinion += /*10*/ GD_INT_GET(OPINION_WEIGHT_DENOUNCED_BY_FRIEND_DONT_LIKE);
}
}
}
}
// Scale with WorkAgainstWillingness
return AdjustConditionalModifier(iTraitorOpinion, GetWorkAgainstWillingness());
}