Bazaar developer reference

CvDiplomacyAI::DoPlotBuyingBrokenPromiseStatement(PlayerTypes, DiploStatementTypes &)

Defined in
CvDiplomacyAI.cpp, line 14048
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement

Hooks

static bool BeforeCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void AfterCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void ReplaceCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement(void (*original)(CvDiplomacyAI*, PlayerTypes, DiploStatementTypes&), CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement>(host, &BeforeCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement>(host, &AfterCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement>(host, &ReplaceCvDiplomacyAI_DoPlotBuyingBrokenPromiseStatement);

Code

14047/// Possible Contact Statement14048void CvDiplomacyAI::DoPlotBuyingBrokenPromiseStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement)14049{14050	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");14051	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.");1405214053	// Tell the player he broke a promise14054	if(eStatement == NO_DIPLO_STATEMENT_TYPE)14055	{14056		if(IsPlayerBrokenBorderPromise(ePlayer))14057		{14058			DiploStatementTypes eTempStatement = DIPLO_STATEMENT_PLOT_BUYING_BROKEN_PROMISE;14059			int iTurnsBetweenStatements = MAX_TURNS_SAFE_ESTIMATE;1406014061			if(GetNumTurnsSinceStatementSent(ePlayer, eTempStatement) >= iTurnsBetweenStatements)14062				eStatement = eTempStatement;14063		}14064	}14065}

Calls

Called by