CvDiplomacyAI::GetHasAdoptedMyReligionScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 23477
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetHasAdoptedMyReligionScore
Hooks
static bool BeforeCvDiplomacyAI_GetHasAdoptedMyReligionScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetHasAdoptedMyReligionScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetHasAdoptedMyReligionScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetHasAdoptedMyReligionScore>(host, &BeforeCvDiplomacyAI_GetHasAdoptedMyReligionScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetHasAdoptedMyReligionScore>(host, &AfterCvDiplomacyAI_GetHasAdoptedMyReligionScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetHasAdoptedMyReligionScore>(host, &ReplaceCvDiplomacyAI_GetHasAdoptedMyReligionScore);
Code
23477int CvDiplomacyAI::GetHasAdoptedMyReligionScore(PlayerTypes ePlayer)23478{23479 int iOpinionWeight = 0;23480 if(m_pPlayer->GetReligions()->HasOthersReligionInMostCities(ePlayer))23481 {23482 // this is commented out because the score should be zero if you have more religions in his city23483 //iOpinionWeight += /*-5*/ GC.getOPINION_WEIGHT_ADOPTING_HIS_RELIGION() * GC.getEraInfo(GC.getGame().getCurrentEra())->getDiploEmphasisReligion();23484 }23485 else if(GET_PLAYER(ePlayer).GetReligions()->HasOthersReligionInMostCities(m_pPlayer->GetID()))23486 {23487 iOpinionWeight += /*-3*/ GC.getOPINION_WEIGHT_ADOPTING_MY_RELIGION() * GC.getEraInfo(GC.getGame().getCurrentEra())->getDiploEmphasisReligion();23488 }23489 return iOpinionWeight;23490}
Calls
- CvEraInfo::getDiploEmphasisReligion() const
- CvGame::getCurrentEra() const
- CvGlobals::getEraInfo(EraTypes)
- CvGlobals::getGame()
- CvGlobals::getOPINION_WEIGHT_ADOPTING_MY_RELIGION()
- CvPlayer::GetID() const
- CvPlayer::GetReligions() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvPlayerReligions::HasOthersReligionInMostCities(PlayerTypes) const