Skip to content

Commit

Permalink
Changes to GetDiplomatScore() for 6-36c
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Nov 9, 2023
1 parent 5b58123 commit 935b47c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 7 additions & 1 deletion CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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())
{
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 935b47c

Please sign in to comment.