CvDiplomacyAI::GetFoiledMyProposalScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 24142
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetFoiledMyProposalScore
Hooks
static bool BeforeCvDiplomacyAI_GetFoiledMyProposalScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetFoiledMyProposalScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetFoiledMyProposalScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetFoiledMyProposalScore>(host, &BeforeCvDiplomacyAI_GetFoiledMyProposalScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetFoiledMyProposalScore>(host, &AfterCvDiplomacyAI_GetFoiledMyProposalScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetFoiledMyProposalScore>(host, &ReplaceCvDiplomacyAI_GetFoiledMyProposalScore);
Code
24142int CvDiplomacyAI::GetFoiledMyProposalScore(PlayerTypes ePlayer)24143{24144 int iOpinionWeight = 0;24145 int iTurnsSince = GetTurnsSinceTheyFoiledOurProposal(ePlayer);24146 if (iTurnsSince > -1 && iTurnsSince < GC.getOPINION_WEIGHT_THEY_FOILED_OUR_PROPOSAL_NUM_TURNS())24147 {24148 int iOpposingTurnsSince = GetTurnsSinceTheySupportedOurProposal(ePlayer);24149 if (iOpposingTurnsSince == -1 || iTurnsSince < iOpposingTurnsSince)24150 {24151 iOpinionWeight += GC.getOPINION_WEIGHT_THEY_FOILED_OUR_PROPOSAL();24152 }24153 }24154 return iOpinionWeight;24155}