CvMinorCivAI::IsGoodTimeForNaturalWonderQuest(PlayerTypes)
- Defined in
- CvMinorCivAI.cpp, line 5995
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_IsGoodTimeForNaturalWonderQuest
Hooks
static bool BeforeCvMinorCivAI_IsGoodTimeForNaturalWonderQuest(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvMinorCivAI_IsGoodTimeForNaturalWonderQuest(CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvMinorCivAI_IsGoodTimeForNaturalWonderQuest(bool (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_IsGoodTimeForNaturalWonderQuest>(host, &BeforeCvMinorCivAI_IsGoodTimeForNaturalWonderQuest);CivRegisterAfter<CivHooks::CvMinorCivAI_IsGoodTimeForNaturalWonderQuest>(host, &AfterCvMinorCivAI_IsGoodTimeForNaturalWonderQuest);CivRegisterReplace<CivHooks::CvMinorCivAI_IsGoodTimeForNaturalWonderQuest>(host, &ReplaceCvMinorCivAI_IsGoodTimeForNaturalWonderQuest);
Code
5994/// Natural Wonder available to find that's not TOO easy to find?5995bool CvMinorCivAI::IsGoodTimeForNaturalWonderQuest(PlayerTypes ePlayer)5996{5997 CvPlayer* pPlayer = &GET_PLAYER(ePlayer);5998 CvTeam* pTeam = &GET_TEAM(pPlayer->getTeam());59996000 // No starting plot?6001 if(pPlayer->getStartingPlot() == NULL)6002 {6003 return false;6004 }60056006 // Player's already found them all6007 if(pTeam->GetNumNaturalWondersDiscovered() == GC.getMap().GetNumNaturalWonders())6008 {6009 return false;6010 }60116012 // Player hasn't yet found all the NWs in his area6013 int iNumNaturalWondersInStartingArea = GC.getMap().getArea(pPlayer->getStartingPlot()->getArea())->GetNumNaturalWonders();6014 if(pPlayer->GetNumNaturalWondersDiscoveredInArea() < iNumNaturalWondersInStartingArea)6015 {6016 return false;6017 }60186019 return true;6020}
Calls
- CvArea::GetNumNaturalWonders() const
- CvGlobals::getMap()
- CvMap::getArea(int)
- CvMap::GetNumNaturalWonders() const
- CvPlayer::GetNumNaturalWondersDiscoveredInArea() const
- CvPlayer::getStartingPlot() const
- CvPlayer::getTeam() const
- CvPlayerAI::getPlayer(PlayerTypes)
- CvPlot::getArea() const
- CvTeam::GetNumNaturalWondersDiscovered() const
- CvTeam::getTeam(TeamTypes)