CvDiplomacyAI::GetAngryAboutProtectedMinorAttackedScore(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 23829
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore
Hooks
static bool BeforeCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static void AfterCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore(CvDiplomacyAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore(int (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore>(host, &BeforeCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore);CivRegisterAfter<CivHooks::CvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore>(host, &AfterCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore);CivRegisterReplace<CivHooks::CvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore>(host, &ReplaceCvDiplomacyAI_GetAngryAboutProtectedMinorAttackedScore);
Code
23829int CvDiplomacyAI::GetAngryAboutProtectedMinorAttackedScore(PlayerTypes ePlayer)23830{23831 int iOpinionWeight = 0;23832 if (IsAngryAboutProtectedMinorAttacked(ePlayer))23833 {23834 if (GetTurnsSincePlayerAttackedProtectedMinor(ePlayer) < /*50*/ GC.getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_RECENTLY_NUM_TURNS()) //antonjs: consider: scale by game speed23835 iOpinionWeight += /*20*/ GC.getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_RECENTLY();23836 else23837 iOpinionWeight += /*15*/ GC.getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_WHILE_AGO();2383823839 if (GetOtherPlayerNumProtectedMinorsAttacked(ePlayer) > 1)23840 iOpinionWeight += /*15*/ GC.getOPINION_WEIGHT_ATTACKED_MANY_PROTECTED_MINORS();23841 }23842 return iOpinionWeight;23843}
Calls
- CvDiplomacyAI::GetOtherPlayerNumProtectedMinorsAttacked(PlayerTypes) const
- CvDiplomacyAI::GetTurnsSincePlayerAttackedProtectedMinor(PlayerTypes) const
- CvDiplomacyAI::IsAngryAboutProtectedMinorAttacked(PlayerTypes)
- CvGlobals::getOPINION_WEIGHT_ATTACKED_MANY_PROTECTED_MINORS()
- CvGlobals::getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_RECENTLY()
- CvGlobals::getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_RECENTLY_NUM_TURNS()
- CvGlobals::getOPINION_WEIGHT_ATTACKED_PROTECTED_MINOR_WHILE_AGO()