Bazaar developer reference

CvDiplomacyAI::GetLandmarksBuiltForMeScore(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 23364
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_GetLandmarksBuiltForMeScore

Hooks

static bool BeforeCvDiplomacyAI_GetLandmarksBuiltForMeScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetLandmarksBuiltForMeScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetLandmarksBuiltForMeScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetLandmarksBuiltForMeScore>(host, &BeforeCvDiplomacyAI_GetLandmarksBuiltForMeScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetLandmarksBuiltForMeScore>(host, &AfterCvDiplomacyAI_GetLandmarksBuiltForMeScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetLandmarksBuiltForMeScore>(host, &ReplaceCvDiplomacyAI_GetLandmarksBuiltForMeScore);

Code

23364int CvDiplomacyAI::GetLandmarksBuiltForMeScore(PlayerTypes ePlayer)23365{23366	int iOpinionWeight = 0;23367	int iNumLandmarks = GetNumLandmarksBuiltForMe(ePlayer);23368	if (iNumLandmarks> 0)23369	{23370		// Full credit for first one23371		iOpinionWeight += /*-20*/ GC.getOPINION_WEIGHT_BUILT_LANDMARK();2337223373		// Partial credit for any after first23374		if (iNumLandmarks > 1)23375		{23376			iOpinionWeight += ((GC.getOPINION_WEIGHT_BUILT_LANDMARK() / 3) * (iNumLandmarks - 1));23377		}23378	}23379	return iOpinionWeight;23380}

Calls

Called by