Bazaar developer reference

CvDiplomacyAI::DoFirstContactInitRelationship(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 10478
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoFirstContactInitRelationship

Hooks

static bool BeforeCvDiplomacyAI_DoFirstContactInitRelationship(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_DoFirstContactInitRelationship(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_DoFirstContactInitRelationship(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoFirstContactInitRelationship>(host, &BeforeCvDiplomacyAI_DoFirstContactInitRelationship);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoFirstContactInitRelationship>(host, &AfterCvDiplomacyAI_DoFirstContactInitRelationship);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoFirstContactInitRelationship>(host, &ReplaceCvDiplomacyAI_DoFirstContactInitRelationship);

Code

10478void CvDiplomacyAI::DoFirstContactInitRelationship(PlayerTypes ePlayer)10479{10480	DoUpdateOnePlayerMilitaryStrength(ePlayer);10481	DoUpdateOnePlayerEconomicStrength(ePlayer);1048210483	DoUpdateOnePlayerMilitaryAggressivePosture(ePlayer);10484	DoUpdateOnePlayerExpansionAggressivePosture(ePlayer);1048510486	DoUpdateOnePlayerTargetValue(ePlayer);1048710488	// Major Civ10489	if(!GET_PLAYER(ePlayer).isMinorCiv())10490	{10491		DoUpdateOnePlayerOpinion(ePlayer);1049210493		/////////////////10494		// APPROACH10495		/////////////////1049610497		int iHighestWeight;10498		WarFaceTypes eWarFace;1049910500		// See which Approach is best10501		MajorCivApproachTypes eApproach = GetBestApproachTowardsMajorCiv(ePlayer, /*Passed by Ref, but we won't use it*/ iHighestWeight, /*bLookAtOtherPlayers*/ true, /*bLog*/ true, /*Passed by Ref, used below*/ eWarFace);1050210503		// If we're going to war and we haven't picked a War Face yet choose one10504		if(eApproach == MAJOR_CIV_APPROACH_WAR && GetWarFaceWithPlayer(ePlayer) == NO_WAR_FACE_TYPE)10505			SetWarFaceWithPlayer(ePlayer, eWarFace);1050610507		CvAssertMsg(eApproach >= 0, "DIPLOMACY_AI: Invalid MajorCivApproachType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");1050810509		// Actually assign the (possibly) new Approach10510		SetMajorCivApproach(ePlayer, eApproach);10511	}1051210513	// Minor civ10514	else10515	{10516		SetMinorCivApproach(ePlayer, MINOR_CIV_APPROACH_IGNORE);10517	}10518}

Calls

Called by