Bazaar developer reference

CvMinorCivAI::DoTestProxyWarAnnouncementOnFirstContact(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 3441
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact

Hooks

static bool BeforeCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact(CvMinorCivAI* self, PlayerTypes eMajor);static void AfterCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact(CvMinorCivAI* self, PlayerTypes eMajor);static void ReplaceCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact(void (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes eMajor);CivRegisterBefore<CivHooks::CvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact>(host, &BeforeCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact);CivRegisterAfter<CivHooks::CvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact>(host, &AfterCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact);CivRegisterReplace<CivHooks::CvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact>(host, &ReplaceCvMinorCivAI_DoTestProxyWarAnnouncementOnFirstContact);

Code

3441void CvMinorCivAI::DoTestProxyWarAnnouncementOnFirstContact(PlayerTypes eMajor)3442{3443	for (int i = 0; i < MAX_MAJOR_CIVS; i++)3444	{3445		PlayerTypes eOtherMajor = (PlayerTypes) i;3446		if (IsProxyWarActiveForMajor(eMajor, eOtherMajor))3447		{3448			CvPlayer* pOtherMajor = &GET_PLAYER(eOtherMajor);3449			CvAssertMsg(pOtherMajor, "Error sending out proxy war notification from a city-state. Please send Anton your save file and version.");3450			if (pOtherMajor)3451			{3452				TeamTypes eEnemyTeam = pOtherMajor->getTeam();3453				PlayerTypes eEnemyTeamLeader = GET_TEAM(eEnemyTeam).getLeaderID();3454				CvPlayer* pEnemyTeamLeader = &GET_PLAYER(eEnemyTeamLeader);3455				CvAssert(pEnemyTeamLeader);3456				if (pEnemyTeamLeader)3457				{3458					Localization::String strMessage = Localization::Lookup("TXT_KEY_NOTIFICATION_MINOR_WAR_UNIT_HELP");3459					strMessage << GetPlayer()->getCivilizationShortDescriptionKey() << pEnemyTeamLeader->getCivilizationShortDescriptionKey();3460					Localization::String strSummary = Localization::Lookup("TXT_KEY_NOTIFICATION_SUMMARY_MINOR_WAR_UNIT_HELP");3461					strSummary << GetPlayer()->getCivilizationShortDescriptionKey();34623463					AddQuestNotification(strMessage.toUTF8(), strSummary.toUTF8(), eMajor);34643465					break;3466				}3467			}3468		}3469	}3470}

Calls

Called by