CvDiplomacyAI::DoStartDemandProcess(PlayerTypes)
- Defined in
- CvDiplomacyAI.cpp, line 4694
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_DoStartDemandProcess
Hooks
static bool BeforeCvDiplomacyAI_DoStartDemandProcess(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_DoStartDemandProcess(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_DoStartDemandProcess(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoStartDemandProcess>(host, &BeforeCvDiplomacyAI_DoStartDemandProcess);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoStartDemandProcess>(host, &AfterCvDiplomacyAI_DoStartDemandProcess);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoStartDemandProcess>(host, &ReplaceCvDiplomacyAI_DoStartDemandProcess);
Code
4693/// AI has picked someone to make a demand of... what does this mean?4694void CvDiplomacyAI::DoStartDemandProcess(PlayerTypes ePlayer)4695{4696 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");4697 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.");46984699 SetDemandTargetPlayer(ePlayer);47004701 CvAIOperation* pOperation = GetPlayer()->GetMilitaryAI()->GetShowOfForceOperation((ePlayer));47024703 // Not yet readying an attack4704 if(pOperation == NULL && !IsMusteringForAttack(ePlayer)) // If we're "mustering" it means we had a Sneak Attack Operation that finished4705 {4706 if(!GET_TEAM(GetTeam()).isAtWar(GET_PLAYER(ePlayer).getTeam()))4707 {4708#if defined(MOD_EVENTS_WAR_AND_PEACE)4709 if(GET_TEAM(GetTeam()).canDeclareWar(GET_PLAYER(ePlayer).getTeam(), GetPlayer()->GetID()))4710#else4711 if(GET_TEAM(GetTeam()).canDeclareWar(GET_PLAYER(ePlayer).getTeam()))4712#endif4713 {4714 GetPlayer()->GetMilitaryAI()->RequestShowOfForce(ePlayer);4715 SetWarGoal(ePlayer, WAR_GOAL_DEMAND);4716 }4717 }4718 }4719}
Calls
- CvDiplomacyAI::GetPlayer()
- CvDiplomacyAI::GetTeam()
- CvDiplomacyAI::IsMusteringForAttack(PlayerTypes) const
- CvDiplomacyAI::SetDemandTargetPlayer(PlayerTypes)
- CvDiplomacyAI::SetWarGoal(PlayerTypes, WarGoalTypes)
- CvMilitaryAI::GetShowOfForceOperation(PlayerTypes)
- CvMilitaryAI::RequestShowOfForce(PlayerTypes)
- CvPlayer::GetID() const
- CvPlayer::GetMilitaryAI() const
- CvPlayer::getTeam() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvTeam::canDeclareWar(TeamTypes, PlayerTypes) const
- CvTeam::getTeam(TeamTypes)
- CvTeam::isAtWar(TeamTypes) const