• 📚 Admin Project Update: I've added a major feature to PictureBooks.io called Avatar Studio! You can now upload photos to instantly turn your kids (and pets! 🐶) into illustrated characters that star in their own stories. Give it a try and let me know what you think!

"Your friends found reasons to denounce you"

MLGaming

Chieftain
Joined
Oct 5, 2020
Messages
14
So, Shoshone backstabbed me and now i had this negative diplo modifier with all the other civs. WTH is this and how cooked am i diplomatically. Please dont tell me I get negative relations for being backstabbed.
 
Intended mechanic (from BNW, although we fixed it). Otherwise there's no benefit to denouncing a friend versus just ending the DoF.

Code:
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());
}
 

Attachments

  • civ_polycule.png
    civ_polycule.png
    496.4 KB · Views: 87
Gonna have to add that one to the log. Power of Love might cause diplomacy to fail! It's the damnedest thing, somehow that never came up in beta testing.
 
Back
Top Bottom