CvMinorCivAI::GetEffectiveFriendshipWithMajorTimes100(PlayerTypes)
- Defined in
- CvMinorCivAI.cpp, line 6238
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100
Hooks
static bool BeforeCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100>(host, &BeforeCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100);CivRegisterAfter<CivHooks::CvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100>(host, &AfterCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100);CivRegisterReplace<CivHooks::CvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100>(host, &ReplaceCvMinorCivAI_GetEffectiveFriendshipWithMajorTimes100);
Code
6235// What is the level of Friendship between this Minor and the requested Major Civ?6236// Takes things like war status into account6237// NOTE: Not const because of need to check war status6238int CvMinorCivAI::GetEffectiveFriendshipWithMajorTimes100(PlayerTypes ePlayer)6239{6240 CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");6241 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");6242 if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return 0; // as defined during Reset()62436244 // Are we at war?6245 if(IsAtWarWithPlayersTeam(ePlayer))6246 return (100 * /*-60*/GC.getMINOR_FRIENDSHIP_AT_WAR());62476248 return GetBaseFriendshipWithMajorTimes100(ePlayer);6249}
Calls
Called by
- CvPlayerEspionage::AttemptCoup(uint)
- CvPlayerEspionage::GetCoupChanceOfSuccess(uint)
- CvMinorCivAI::AddQuestCopyForPlayer(PlayerTypes, CvMinorCivQuest *)
- CvMinorCivAI::AddQuestForPlayer(PlayerTypes, MinorCivQuestTypes, int)
- CvMinorCivAI::CalculateFriendshipFromQuests()
- CvMinorCivAI::DoCompletedQuestsForPlayer(PlayerTypes, MinorCivQuestTypes)
- CvMinorCivAI::DoElection()
- CvMinorCivAI::DoFriendship()
- CvMinorCivAI::DoMajorBullyGold(PlayerTypes, int)
- CvMinorCivAI::DoMajorBullyUnit(PlayerTypes, UnitTypes)
- CvMinorCivAI::DoObsoleteQuestsForPlayer(PlayerTypes, MinorCivQuestTypes)
- CvMinorCivAI::GetEffectiveFriendshipWithMajor(PlayerTypes)
- CvMinorCivAI::SetFriendshipWithMajorTimes100(PlayerTypes, int, bool)