bool CCSBot::IsHurrying() const { if (!m_hurryTimer.IsElapsed()) return true; CCSBotManager *ctrl = TheCSBots(); // if the bomb has been planted, we are in a hurry, CT or T (they could be defusing it!) if (ctrl->GetScenario() == CCSBotManager::SCENARIO_DEFUSE_BOMB && ctrl->IsBombPlanted()) return true; // if we are a T and hostages are being rescued, we are in a hurry if (ctrl->GetScenario() == CCSBotManager::SCENARIO_RESCUE_HOSTAGES && m_iTeam == TERRORIST && GetGameState()->AreAllHostagesBeingRescued()) return true; return false; }
bool CCSBot::CanSeeLooseBomb() const { CCSBotManager *ctrl = TheCSBots(); if (ctrl->GetScenario() != CCSBotManager::SCENARIO_DEFUSE_BOMB) return false; CBaseEntity *bomb = ctrl->GetLooseBomb(); if (bomb != NULL) { if (IsVisible(&bomb->pev->origin, CHECK_FOV)) return true; } return false; }
bool CCSBot::CanSeePlantedBomb() const { CCSBotManager *ctrl = TheCSBots(); if (ctrl->GetScenario() != CCSBotManager::SCENARIO_DEFUSE_BOMB) return false; if (!GetGameState()->IsBombPlanted()) return false; const Vector *bombPos = GetGameState()->GetBombPosition(); if (bombPos != NULL && IsVisible(bombPos, CHECK_FOV)) return true; return false; }
bool CCSBot::NoticeLooseBomb() const { CCSBotManager *ctrl = TheCSBots(); if (ctrl->GetScenario() != CCSBotManager::SCENARIO_DEFUSE_BOMB) return false; CBaseEntity *bomb = ctrl->GetLooseBomb(); if (bomb != NULL) { // T's can always see bomb on their radar return true; } return false; }