CvDiplomacyAI::IsAngryAboutProtectedMinorBullied(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 8118
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorBullied
Hooks
static bool BeforeCvDiplomacyAI_IsAngryAboutProtectedMinorBullied(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvDiplomacyAI_IsAngryAboutProtectedMinorBullied(CvDiplomacyAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsAngryAboutProtectedMinorBullied(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorBullied>(host, &BeforeCvDiplomacyAI_IsAngryAboutProtectedMinorBullied);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorBullied>(host, &AfterCvDiplomacyAI_IsAngryAboutProtectedMinorBullied);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsAngryAboutProtectedMinorBullied>(host, &ReplaceCvDiplomacyAI_IsAngryAboutProtectedMinorBullied);
Code
8118bool CvDiplomacyAI::IsAngryAboutProtectedMinorBullied(PlayerTypes ePlayer)8119{8120 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version.");8121 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index. Please send Anton your save file and version.");8122 if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;81238124 int iNumProtectedMinorsBullied = GetOtherPlayerNumProtectedMinorsBullied(ePlayer);8125 if (iNumProtectedMinorsBullied > 0)8126 {8127 int iTurnsSinceBully = GetTurnsSincePlayerBulliedProtectedMinor(ePlayer);8128 if (iTurnsSinceBully > -1 && iTurnsSinceBully < /*75*/ GC.getOPINION_WEIGHT_BULLIED_PROTECTED_MINOR_NUM_TURNS_UNTIL_FORGIVEN()) //antonjs: consider: scale by game speed8129 {8130 return true;8131 }8132 }8133 return false;8134}