CvDiplomacyAI::IsAtWar(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 25314
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsAtWar
Hooks
static bool BeforeCvDiplomacyAI_IsAtWar(CvDiplomacyAI* self, PlayerTypes eOtherPlayer, bool& result);static void AfterCvDiplomacyAI_IsAtWar(CvDiplomacyAI* self, PlayerTypes eOtherPlayer, bool& result);static bool ReplaceCvDiplomacyAI_IsAtWar(bool (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes eOtherPlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsAtWar>(host, &BeforeCvDiplomacyAI_IsAtWar);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsAtWar>(host, &AfterCvDiplomacyAI_IsAtWar);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsAtWar>(host, &ReplaceCvDiplomacyAI_IsAtWar);
Code
25313/// Helper function to determine if we're at war with a player25314bool CvDiplomacyAI::IsAtWar(PlayerTypes eOtherPlayer)25315{25316 CvAssertMsg(eOtherPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");25317 CvAssertMsg(eOtherPlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");2531825319 return GET_TEAM(GetTeam()).isAtWar(GET_PLAYER(eOtherPlayer).getTeam());25320}
Calls
Called by
- CvDiplomacyAI::ChangeOtherPlayerNumMajorsAttacked(PlayerTypes, int, TeamTypes)
- CvDiplomacyAI::ChangeWarValueLost(PlayerTypes, int)
- CvDiplomacyAI::DoAggressiveMilitaryStatement(PlayerTypes, DiploStatementTypes &)
- CvDiplomacyAI::DoAngryBefriendedEnemy(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::DoAngryDenouncedFriend(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::DoBeginDiploWithHumanEspionageResult()
- CvDiplomacyAI::DoContactMinorCivs()
- CvDiplomacyAI::DoContactPlayer(PlayerTypes)
- CvDiplomacyAI::DoCoopWarTimeStatement(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::DoFirstContact(PlayerTypes)
- CvDiplomacyAI::DoHappyBefriendedFriend(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::DoHappyDenouncedEnemy(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::DoMakePeaceWithMinors()
- CvDiplomacyAI::DoMakeWarOnPlayer(PlayerTypes)
- CvDiplomacyAI::DoTestDemandReady()
- CvDiplomacyAI::DoUpdatePeaceTreatyWillingness()
- CvDiplomacyAI::DoUpdateWarStates()
- CvDiplomacyAI::DoWarDamageDecay()
- CvDiplomacyAI::DoWeAttackedYourMinorStatement(PlayerTypes, DiploStatementTypes &, int &)
- CvDiplomacyAI::GetBestApproachTowardsMinorCiv(PlayerTypes, int &, bool, bool)
- CvDiplomacyAI::GetDenounceWeight(PlayerTypes, bool)
- CvDiplomacyAI::GetGreetHumanMessage(LeaderheadAnimationTypes &)
- CvDiplomacyAI::GetNumOurEnemiesPlayerAtWarWith(PlayerTypes)
- CvDiplomacyAI::GetRequestFriendToDenounce(PlayerTypes, bool &)
- CvDiplomacyAI::IsActHostileTowardsHuman(PlayerTypes)
- CvDiplomacyAI::IsPlayerDemandAttractive(PlayerTypes)
- CvDiplomacyAI::LogWarGoal(CvString &, PlayerTypes)
- CvDiplomacyAI::LogWarState(CvString &, PlayerTypes)
- CvDiplomacyAI::LogWarStatus()