CvDiplomacyAI::GetEndDoFMessage(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 20170
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetEndDoFMessage
Hooks
static bool BeforeCvDiplomacyAI_GetEndDoFMessage(CvDiplomacyAI* self, PlayerTypes ePlayer, const char*& result);static void AfterCvDiplomacyAI_GetEndDoFMessage(CvDiplomacyAI* self, PlayerTypes ePlayer, const char*& result);static const char* ReplaceCvDiplomacyAI_GetEndDoFMessage(const char* (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetEndDoFMessage>(host, &BeforeCvDiplomacyAI_GetEndDoFMessage);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetEndDoFMessage>(host, &AfterCvDiplomacyAI_GetEndDoFMessage);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetEndDoFMessage>(host, &ReplaceCvDiplomacyAI_GetEndDoFMessage);
Code
20169/// The AI is breaking up with the human20170const char* CvDiplomacyAI::GetEndDoFMessage(PlayerTypes ePlayer)20171{20172 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20173 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.");2017420175 const char* strText = "OMG I HAVE NO DATA (DECLARING WAR) - Please send Jon this with your last 5 autosaves and what changelist # you're playing.";2017620177 // Guy is a warmonger20178 if(GetWarmongerThreat(ePlayer) >= THREAT_MAJOR)20179 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_WARMONGER");20180 // Guy is getting too friendly with our minors20181 else if(GetMinorCivDisputeLevel(ePlayer) >= DISPUTE_LEVEL_STRONG)20182 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_MINORS");20183 // Guy is setting near us and we don't like it20184 else if(GetLandDisputeLevel(ePlayer) >= DISPUTE_LEVEL_STRONG)20185 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_LAND");20186 // Guy built wonders we wanted20187 else if(GetWonderDisputeLevel(ePlayer) >= DISPUTE_LEVEL_STRONG)20188 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_WONDERS");20189 // Guy built wonders we wanted20190 else if(GetVictoryDisputeLevel(ePlayer) >= DISPUTE_LEVEL_STRONG)20191 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_VICTORY");20192 else20193 strText = GetDiploTextFromTag("RESPONSE_END_WORK_WITH_US_DEFAULT");2019420195 return strText;20196}
Calls
- CvDiplomacyAI::GetDiploTextFromTag(const char *)
- CvDiplomacyAI::GetLandDisputeLevel(PlayerTypes) const
- CvDiplomacyAI::GetMinorCivDisputeLevel(PlayerTypes) const
- CvDiplomacyAI::GetVictoryDisputeLevel(PlayerTypes) const
- CvDiplomacyAI::GetWarmongerThreat(PlayerTypes) const
- CvDiplomacyAI::GetWonderDisputeLevel(PlayerTypes) const