Bazaar developer reference

CvDiplomacyAI::DoExpansionBrokenPromiseStatement(PlayerTypes, DiploStatementTypes &)

Defined in
CvDiplomacyAI.cpp, line 13996
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoExpansionBrokenPromiseStatement

Hooks

static bool BeforeCvDiplomacyAI_DoExpansionBrokenPromiseStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void AfterCvDiplomacyAI_DoExpansionBrokenPromiseStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void ReplaceCvDiplomacyAI_DoExpansionBrokenPromiseStatement(void (*original)(CvDiplomacyAI*, PlayerTypes, DiploStatementTypes&), CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoExpansionBrokenPromiseStatement>(host, &BeforeCvDiplomacyAI_DoExpansionBrokenPromiseStatement);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoExpansionBrokenPromiseStatement>(host, &AfterCvDiplomacyAI_DoExpansionBrokenPromiseStatement);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoExpansionBrokenPromiseStatement>(host, &ReplaceCvDiplomacyAI_DoExpansionBrokenPromiseStatement);

Code

13995/// Possible Contact Statement13996void CvDiplomacyAI::DoExpansionBrokenPromiseStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement)13997{13998	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");13999	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");1400014001	// Tell the player he broke a promise14002	if(eStatement == NO_DIPLO_STATEMENT_TYPE)14003	{14004		if(IsPlayerBrokenExpansionPromise(ePlayer))14005		{14006			DiploStatementTypes eTempStatement = DIPLO_STATEMENT_EXPANSION_BROKEN_PROMISE;14007			int iTurnsBetweenStatements = MAX_TURNS_SAFE_ESTIMATE;1400814009			if(GetNumTurnsSinceStatementSent(ePlayer, eTempStatement) >= iTurnsBetweenStatements)14010				eStatement = eTempStatement;14011		}14012	}14013}

Calls

Called by