From 935b47ccf7efdcdd024e40f46bcdacd2c59b6362 Mon Sep 17 00:00:00 2001 From: RecursiveVision <66801010+RecursiveVision@users.noreply.github.com> Date: Tue, 7 Nov 2023 22:14:21 -0500 Subject: [PATCH] Changes to GetDiplomatScore() for 6-36c https://forums.civfanatics.com/threads/6-cp-tweaked-version-of-azum4rolls-espionage-overhaul.686239/ --- .../Core Files/Core Values/DiploOpinionWeights.sql | 4 ++-- CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp | 8 +++++++- CvGameCoreDLL_Expansion2/CvGlobals.cpp | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/(1) Community Patch/Core Files/Core Values/DiploOpinionWeights.sql b/(1) Community Patch/Core Files/Core Values/DiploOpinionWeights.sql index a69bbe456c..300e31ce4e 100644 --- a/(1) Community Patch/Core Files/Core Values/DiploOpinionWeights.sql +++ b/(1) Community Patch/Core Files/Core Values/DiploOpinionWeights.sql @@ -193,8 +193,8 @@ INSERT INTO Defines (Name, Value) SELECT 'OPINION_WEIGHT_EMBASSY_MUTUAL', -3; UPDATE Defines SET Value = -2 WHERE Name = 'OPINION_WEIGHT_EMBASSY'; INSERT INTO Defines (Name, Value) SELECT 'OPINION_WEIGHT_EMBASSY_THEM', -1; --- We have a Diplomat in their capital. (no bonus for capitulated vassals unless Content, no bonus for voluntary vassals unless Content, Disagreeing or Resurrected) -INSERT INTO Defines (Name, Value) SELECT 'OPINION_WEIGHT_DIPLOMAT', -15; +-- We have a Diplomat in their capital. (no bonus for capitulated vassals unless Content, no bonus for voluntary vassals unless Content, Disagreeing or Resurrected, no bonus if there are recent spying penalties) +INSERT INTO Defines (Name, Value) SELECT 'OPINION_WEIGHT_DIPLOMAT', -20; INSERT INTO Defines (Name, Value) SELECT 'OPINION_WEIGHT_DIPLOMAT_MOD', -10; -- bonus for Scientist AIs -- You forgave them for spying. diff --git a/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp b/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp index 1f9c9ce132..f501844104 100644 --- a/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp +++ b/CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp @@ -46962,6 +46962,8 @@ int CvDiplomacyAI::GetEmbassyScore(PlayerTypes ePlayer) int CvDiplomacyAI::GetDiplomatScore(PlayerTypes ePlayer) { + // Masters gets a free Diplomat in their vassals' capitals + // Therefore this bonus doesn't apply for a vassal unless the vassal is being treated kindly if (IsVassal(ePlayer) && !WasResurrectedBy(ePlayer)) { if (IsVoluntaryVassalage(ePlayer)) @@ -46976,12 +46978,16 @@ int CvDiplomacyAI::GetDiplomatScore(PlayerTypes ePlayer) } } + // No bonus if the player has recent spying penalties + if (GetNumTimesRobbedBy(ePlayer) > 0 || IsPlayerBrokenSpyPromise(ePlayer) || IsPlayerIgnoredSpyPromise(ePlayer)) + return 0; + int iOpinionWeight = 0; // They have a Spy as a Diplomat in our Capital if (GetPlayer()->GetEspionage()->IsOtherDiplomatVisitingMe(ePlayer)) { - iOpinionWeight = /*-15*/ GD_INT_GET(OPINION_WEIGHT_DIPLOMAT); + iOpinionWeight = /*-20*/ GD_INT_GET(OPINION_WEIGHT_DIPLOMAT); if (IsScientist() || GetPlayer()->GetPlayerTraits()->IsNerd()) { diff --git a/CvGameCoreDLL_Expansion2/CvGlobals.cpp b/CvGameCoreDLL_Expansion2/CvGlobals.cpp index 74569ef48f..3968cd1d90 100644 --- a/CvGameCoreDLL_Expansion2/CvGlobals.cpp +++ b/CvGameCoreDLL_Expansion2/CvGlobals.cpp @@ -847,7 +847,7 @@ CvGlobals::CvGlobals() : GD_INT_INIT(OPINION_WEIGHT_EMBASSY, -2), GD_INT_INIT(OPINION_WEIGHT_EMBASSY_THEM, -1), GD_INT_INIT(OPINION_WEIGHT_EMBASSY_MUTUAL, -3), - GD_INT_INIT(OPINION_WEIGHT_DIPLOMAT, -15), + GD_INT_INIT(OPINION_WEIGHT_DIPLOMAT, -20), GD_INT_INIT(OPINION_WEIGHT_DIPLOMAT_MOD, -10), GD_INT_INIT(OPINION_WEIGHT_CULTURE_BOMBED, 10), GD_INT_INIT(RELIGION_DIPLO_HIT_INITIAL_CONVERT_FRIENDLY_CITY, 1),