Bazaar developer reference

CvDiplomacyAI::DoPlotBuyingWarningStatement(PlayerTypes, DiploStatementTypes &)

Defined in
CvDiplomacyAI.cpp, line 14016
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoPlotBuyingWarningStatement

Hooks

static bool BeforeCvDiplomacyAI_DoPlotBuyingWarningStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void AfterCvDiplomacyAI_DoPlotBuyingWarningStatement(CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);static void ReplaceCvDiplomacyAI_DoPlotBuyingWarningStatement(void (*original)(CvDiplomacyAI*, PlayerTypes, DiploStatementTypes&), CvDiplomacyAI* self, PlayerTypes ePlayer, DiploStatementTypes& eStatement);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoPlotBuyingWarningStatement>(host, &BeforeCvDiplomacyAI_DoPlotBuyingWarningStatement);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoPlotBuyingWarningStatement>(host, &AfterCvDiplomacyAI_DoPlotBuyingWarningStatement);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoPlotBuyingWarningStatement>(host, &ReplaceCvDiplomacyAI_DoPlotBuyingWarningStatement);

Code

14015/// Possible Contact Statement14016void CvDiplomacyAI::DoPlotBuyingWarningStatement(PlayerTypes ePlayer, DiploStatementTypes& eStatement)14017{14018	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");14019	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.");1402014021	// Comment on aggressive Plot Buying14022	if(eStatement == NO_DIPLO_STATEMENT_TYPE)14023	{14024		bool bSendStatement = false;14025		if (!EverMadeBorderPromise(ePlayer) && !IsPlayerMadeBorderPromise(ePlayer) && !IsPlayerBrokenBorderPromise(ePlayer) && !IsPlayerIgnoredBorderPromise(ePlayer))14026		{14027			if(GetLandDisputeLevel(ePlayer) >= DISPUTE_LEVEL_STRONG)14028			{14029				// We've spotten them buying up Plots14030				if(GetPlotBuyingAggressivePosture(ePlayer) >= AGGRESSIVE_POSTURE_LOW)14031					bSendStatement = true;14032			}14033		}1403414035		if(bSendStatement)14036		{14037			DiploStatementTypes eTempStatement = DIPLO_STATEMENT_PLOT_BUYING_WARNING;14038			int iTurnsBetweenStatements = (GC.getBORDER_PROMISE_TURNS_EFFECTIVE() * GC.getGame().getGameSpeedInfo().getOpinionDurationPercent()) / 100;1403914040			if(GetNumTurnsSinceStatementSent(ePlayer, eTempStatement) >= iTurnsBetweenStatements)14041				eStatement = eTempStatement;14042		}1404314044	}14045}

Calls

Called by