Bazaar developer reference

CvDiplomacyAI::GetOtherPlayerWarmongerScore(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 10316
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetOtherPlayerWarmongerScore

Hooks

static bool BeforeCvDiplomacyAI_GetOtherPlayerWarmongerScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetOtherPlayerWarmongerScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetOtherPlayerWarmongerScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetOtherPlayerWarmongerScore>(host, &BeforeCvDiplomacyAI_GetOtherPlayerWarmongerScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetOtherPlayerWarmongerScore>(host, &AfterCvDiplomacyAI_GetOtherPlayerWarmongerScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetOtherPlayerWarmongerScore>(host, &ReplaceCvDiplomacyAI_GetOtherPlayerWarmongerScore);

Code

10315// The value of the warmonger amount adjusted by how much this player hates warmongers10316int CvDiplomacyAI::GetOtherPlayerWarmongerScore(PlayerTypes ePlayer)10317{10318	int iReturnValue = GetOtherPlayerWarmongerAmount(ePlayer);1031910320	// Value at this point is from 250 (DOW) to upwards of 2000 (after capturing several cities)10321	// Want final value to be about 1/20th that (Jon wanted max Opinion hit to be 100)10322	// Average WarmongerHate is 5, so divide by 100 to get to 1/20th.10323	iReturnValue *= GetWarmongerHate();10324	iReturnValue /= 100;10325	return iReturnValue;10326}

Calls

Called by