Bazaar developer reference

CvDiplomacyAI::GetSupportedMyProposalScore(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 24127
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetSupportedMyProposalScore

Hooks

static bool BeforeCvDiplomacyAI_GetSupportedMyProposalScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetSupportedMyProposalScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetSupportedMyProposalScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetSupportedMyProposalScore>(host, &BeforeCvDiplomacyAI_GetSupportedMyProposalScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetSupportedMyProposalScore>(host, &AfterCvDiplomacyAI_GetSupportedMyProposalScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetSupportedMyProposalScore>(host, &ReplaceCvDiplomacyAI_GetSupportedMyProposalScore);

Code

24127int CvDiplomacyAI::GetSupportedMyProposalScore(PlayerTypes ePlayer)24128{24129	int iOpinionWeight = 0;24130	int iTurnsSince = GetTurnsSinceTheySupportedOurProposal(ePlayer);24131	if (iTurnsSince > -1 && iTurnsSince < GC.getOPINION_WEIGHT_THEY_SUPPORTED_OUR_PROPOSAL_NUM_TURNS())24132	{24133		int iOpposingTurnsSince = GetTurnsSinceTheyFoiledOurProposal(ePlayer);24134		if (iOpposingTurnsSince == -1 || iTurnsSince < iOpposingTurnsSince)24135		{24136			iOpinionWeight += GC.getOPINION_WEIGHT_THEY_SUPPORTED_OUR_PROPOSAL();24137		}24138	}24139	return iOpinionWeight;24140}

Calls

Called by