CvDiplomacyAI::IsAngryAboutProtectedMinorKilled(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 8078
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorKilled
Hooks
static bool BeforeCvDiplomacyAI_IsAngryAboutProtectedMinorKilled(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsAngryAboutProtectedMinorKilled(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsAngryAboutProtectedMinorKilled(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorKilled>(host, &BeforeCvDiplomacyAI_IsAngryAboutProtectedMinorKilled);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorKilled>(host, &AfterCvDiplomacyAI_IsAngryAboutProtectedMinorKilled);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorKilled>(host, &ReplaceCvDiplomacyAI_IsAngryAboutProtectedMinorKilled);
Code
8078bool CvDiplomacyAI::IsAngryAboutProtectedMinorKilled(PlayerTypes ePlayer)8079{8080 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version.");8081 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version.");8082 if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;80838084 int iNumProtectedMinorsKilled = GetOtherPlayerNumProtectedMinorsKilled(ePlayer);8085 if (iNumProtectedMinorsKilled > 0)8086 {8087 int iTurnsSinceMinorKilled = GetTurnsSincePlayerKilledProtectedMinor(ePlayer);8088 if (iTurnsSinceMinorKilled > -1 && iTurnsSinceMinorKilled < /*125*/ GC.getOPINION_WEIGHT_KILLED_PROTECTED_MINOR_NUM_TURNS_UNTIL_FORGIVEN()) //antonjs: consider: scale by game speed8089 {8090 return true;8091 }8092 }8093 return false;8094}