diff --git a/dlls/bot/cs_bot.cpp b/dlls/bot/cs_bot.cpp index 0a9ea0ab..7537dee5 100644 --- a/dlls/bot/cs_bot.cpp +++ b/dlls/bot/cs_bot.cpp @@ -221,10 +221,11 @@ void CCSBot::BotTouch(CBaseEntity *other) // TODO: Need to account for reaction time, etc. if (other->IsPlayer()) { +#if 0 // if we are defusing a bomb, don't move if (IsDefusingBomb()) return; - +#endif CBasePlayer *player = static_cast(other); // get priority of other player @@ -292,10 +293,12 @@ void CCSBot::BotTouch(CBaseEntity *other) bool CCSBot::IsBusy() const { if (IsAttacking() || +#if 0 IsBuying() || IsDefusingBomb() || GetTask() == PLANT_BOMB || GetTask() == RESCUE_HOSTAGES || +#endif IsSniping()) { return true; @@ -462,6 +465,7 @@ bool CCSBot::IsDoingScenario() const // Return true if we noticed the bomb on the ground or on the radar (for T's only) +#if 0 bool CCSBot::NoticeLooseBomb() const { CCSBotManager *ctrl = TheCSBots(); @@ -519,7 +523,7 @@ bool CCSBot::CanSeePlantedBomb() const return false; } - +#endif // Return last enemy that hurt us CBasePlayer *CCSBot::GetAttacker() const @@ -593,13 +597,13 @@ void CCSBot::SetHidingSpotCheckTimestamp(HidingSpot *spot) m_checkedHidingSpot[ leastRecent ].timestamp = gpGlobals->time; } } - +#if 0 // Periodic check of hostage count in case we lost some void CCSBot::UpdateHostageEscortCount() { } - +#endif // Return true if we are outnumbered by enemies bool CCSBot::IsOutnumbered() const @@ -860,8 +864,9 @@ const Vector *FindNearbyRetreatSpot(CCSBot *me, float maxRange) // Return euclidean distance to farthest escorted hostage. // Return -1 if no hostage is following us. - +#if 0 float CCSBot::GetRangeToFarthestEscortedHostage() const { return 0; } +#endif diff --git a/dlls/bot/cs_bot.h b/dlls/bot/cs_bot.h index 1309850e..2f7ddac1 100644 --- a/dlls/bot/cs_bot.h +++ b/dlls/bot/cs_bot.h @@ -378,7 +378,7 @@ public: void MoveTo(const Vector *pos, RouteType route = SAFEST_ROUTE); // move to potentially distant position bool IsMovingTo() const; // return true if we are in the MoveTo state - +#if 0 void PlantBomb(); void FetchBomb(); // bomb has been dropped - go get it @@ -394,10 +394,11 @@ public: bool IsEscapingFromBomb() const; // return true if we are escaping from the bomb void RescueHostages(); - void UseEntity(CBaseEntity *entity); // use the entity + // use the entity bool IsBuying() const; - +#endif + void UseEntity(CBaseEntity *entity); void Panic(CBasePlayer *enemy); // look around in panic void Follow(CBasePlayer *player); // begin following given Player void ContinueFollowing(); // continue following our leader after finishing what we were doing @@ -434,22 +435,22 @@ public: enum TaskType { SEEK_AND_DESTROY, - PLANT_BOMB, - FIND_TICKING_BOMB, - DEFUSE_BOMB, - GUARD_TICKING_BOMB, - GUARD_BOMB_DEFUSER, - GUARD_LOOSE_BOMB, - GUARD_BOMB_ZONE, - ESCAPE_FROM_BOMB, + //PLANT_BOMB, + //FIND_TICKING_BOMB, + //DEFUSE_BOMB, + //GUARD_TICKING_BOMB, + //GUARD_BOMB_DEFUSER, + //GUARD_LOOSE_BOMB, + //GUARD_BOMB_ZONE, + //ESCAPE_FROM_BOMB, HOLD_POSITION, FOLLOW, - VIP_ESCAPE, - GUARD_VIP_ESCAPE_ZONE, - COLLECT_HOSTAGES, - RESCUE_HOSTAGES, - GUARD_HOSTAGES, - GUARD_HOSTAGE_RESCUE_ZONE, + //VIP_ESCAPE, + //GUARD_VIP_ESCAPE_ZONE, + //COLLECT_HOSTAGES, + //RESCUE_HOSTAGES, + //GUARD_HOSTAGES, + //GUARD_HOSTAGE_RESCUE_ZONE, MOVE_TO_LAST_KNOWN_ENEMY_POSITION, MOVE_TO_SNIPER_SPOT, SNIPING, @@ -662,10 +663,11 @@ public: bool IsPrimaryWeaponEmpty() const; // return true if primary weapon doesn't exist or is totally out of ammo bool IsPistolEmpty() const; // return true if secondary weapon doesn't exist or is totally out of ammo - +#if 0 int GetHostageEscortCount() const; void IncreaseHostageEscortCount(); float GetRangeToFarthestEscortedHostage() const; +#endif void ResetWaitForHostagePatience(); void ResetValues(); // reset internal data to initial state void BotDeathThink(); @@ -808,7 +810,7 @@ private: // game scenario mechanisms CSGameState m_gameState; - +#if 0 // hostages mechanism byte m_hostageEscortCount; void UpdateHostageEscortCount(); @@ -816,7 +818,7 @@ private: bool m_isWaitingForHostage; CountdownTimer m_inhibitWaitingForHostageTimer; CountdownTimer m_waitForHostageTimer; - +#endif // listening mechanism Vector m_noisePosition; // position we last heard non-friendly noise float m_noiseTimestamp; // when we heard it (can get zeroed) @@ -1035,11 +1037,12 @@ inline float CCSBot::GetSafeTime() const { return m_safeTime; } - +#if 0 inline bool CCSBot::IsCarryingBomb() const { return false; } +#endif inline bool CCSBot::IsFollowing() const { @@ -1373,7 +1376,7 @@ inline CCSBot::ZoomType CCSBot::GetZoomLevel() const return HIGH_ZOOM; } - +#if 0 inline int CCSBot::GetHostageEscortCount() const { return m_hostageEscortCount; @@ -1389,7 +1392,7 @@ inline void CCSBot::ResetWaitForHostagePatience() m_isWaitingForHostage = false; m_inhibitWaitingForHostageTimer.Invalidate(); } - +#endif inline float CCSBot::GetFeetZ() const { if (IsCrouching()) @@ -1642,13 +1645,13 @@ public: { // these areas are very slow to move through float crouchPenalty = (m_route == FASTEST_ROUTE) ? 20.0f : 5.0f; - +#if 0 /// TODO: useful in coop modes // avoid crouch areas if we are rescuing hostages if (m_bot->GetHostageEscortCount()) { crouchPenalty *= 3.0f; } - +#endif cost += crouchPenalty * dist; } diff --git a/dlls/bot/cs_bot_chatter.cpp b/dlls/bot/cs_bot_chatter.cpp index de228d3a..1a71c7de 100644 --- a/dlls/bot/cs_bot_chatter.cpp +++ b/dlls/bot/cs_bot_chatter.cpp @@ -84,7 +84,7 @@ void BotHelpMeme::Interpret(CCSBot *sender, CCSBot *receiver) const } // A teammate reported information about a bombsite - +#if 0 void BotBombsiteStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const { // remember this bombsite's status @@ -134,7 +134,7 @@ void BotBombStatusMeme::Interpret(CCSBot *sender, CCSBot *receiver) const } } } - +#endif // A teammate has asked that we follow him void BotFollowMeme::Interpret(CCSBot *sender, CCSBot *receiver) const @@ -195,7 +195,7 @@ void BotDefendHereMeme::Interpret(CCSBot *sender, CCSBot *receiver) const } // A teammate has asked where the bomb is planted - +#if 0 void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const { int zone = receiver->GetGameState()->GetPlantedBombsite(); @@ -203,14 +203,14 @@ void BotWhereBombMeme::Interpret(CCSBot *sender, CCSBot *receiver) const if (zone != CSGameState::UNKNOWN) receiver->GetChatter()->FoundPlantedBomb(zone); } - +#endif // A teammate has asked us to report in void BotRequestReportMeme::Interpret(CCSBot *sender, CCSBot *receiver) const { receiver->GetChatter()->ReportingIn(); } - +#if 0 // A teammate told us all the hostages are gone void BotAllHostagesGoneMeme::Interpret(CCSBot *sender, CCSBot *receiver) const @@ -236,6 +236,7 @@ void BotHostageBeingTakenMeme::Interpret(CCSBot *sender, CCSBot *receiver) const // acknowledge receiver->GetChatter()->Say("Affirmative"); } +#endif BotSpeakable::BotSpeakable() { @@ -1694,7 +1695,7 @@ void BotChatterInterface::ReportingIn() // where are we Place place = m_me->GetPlace(); SayWhere(say, place); - +#if 0 // what are we doing switch (m_me->GetTask()) { @@ -1741,7 +1742,7 @@ void BotChatterInterface::ReportingIn() break; } } - +#endif // what do we see if (m_me->IsAttacking()) { @@ -1896,7 +1897,7 @@ void BotChatterInterface::Negative() say->AppendPhrase(TheBotPhrases->GetPhrase("Negative")); AddStatement(say); } - +#if 0 void BotChatterInterface::GoingToPlantTheBomb(Place place) { if (TheCSBots()->IsRoundOver()) @@ -2078,7 +2079,7 @@ void BotChatterInterface::FoundPlantedBomb(int zoneIndex) say->AttachMeme(new BotBombsiteStatusMeme(zoneIndex, BotBombsiteStatusMeme::PLANTED)); AddStatement(say); } - +#endif void BotChatterInterface::Scared() { const float minInterval = 10.0f; @@ -2141,7 +2142,7 @@ void BotChatterInterface::AnnouncePlan(const char *phraseName, Place place) say->SetStartTime(ctrl->GetRoundStartTime() + RANDOM_FLOAT(2.0, 3.0f)); AddStatement(say); } - +#if 0 void BotChatterInterface::GuardingHostages(Place place, bool isPlan) { if (TheCSBots()->IsRoundOver()) @@ -2256,3 +2257,4 @@ void BotChatterInterface::FriendlyFire() say->SetStartTime(gpGlobals->time + RANDOM_FLOAT(0.3f, 0.5f)); AddStatement(say); } +#endif diff --git a/dlls/bot/cs_bot_chatter.h b/dlls/bot/cs_bot_chatter.h index 298bd163..30ba12e9 100644 --- a/dlls/bot/cs_bot_chatter.h +++ b/dlls/bot/cs_bot_chatter.h @@ -54,7 +54,7 @@ public: void Transmit(CCSBot *sender) const; // transmit meme to other bots virtual void Interpret(CCSBot *sender, CCSBot *receiver) const = 0; // cause the given bot to act on this meme }; - +#if 0 class BotAllHostagesGoneMeme: public BotMeme { public: @@ -66,7 +66,7 @@ class BotHostageBeingTakenMeme: public BotMeme public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme }; - +#endif class BotHelpMeme: public BotMeme { public: @@ -79,7 +79,7 @@ public: private: Place m_place; }; - +#if 0 class BotBombsiteStatusMeme: public BotMeme { public: @@ -113,7 +113,7 @@ private: CSGameState::BombState m_state; Vector m_pos; }; - +#endif class BotFollowMeme: public BotMeme { public: @@ -133,11 +133,13 @@ private: Vector m_pos; }; +#if 0 class BotWhereBombMeme: public BotMeme { public: virtual void Interpret(CCSBot *sender, CCSBot *receiver) const; // cause the given bot to act on this meme }; +#endif class BotRequestReportMeme: public BotMeme { @@ -499,7 +501,7 @@ public: void PinnedDown(); void Scared(); void HeardNoise(const Vector *pos); - +#if 0 void TheyPickedUpTheBomb(); void GoingToPlantTheBomb(Place place); void BombsiteClear(int zoneIndex); @@ -518,7 +520,7 @@ public: void TalkingToHostages(); void EscortingHostages(); NOXREF void HostageDown(); - +#endif void CelebrateWin(); void Encourage(const char *phraseName, float repeatInterval = 10.0f, float lifetime = 3.0f); // "encourage" the player to do the scenario diff --git a/dlls/bot/cs_bot_init.cpp b/dlls/bot/cs_bot_init.cpp index 0dbb9354..0a0001a6 100644 --- a/dlls/bot/cs_bot_init.cpp +++ b/dlls/bot/cs_bot_init.cpp @@ -221,10 +221,10 @@ void CCSBot::ResetValues() m_lastRadioSentTimestamp = 0.0f; m_radioSubject = NULL; m_voiceFeedbackEndTimestamp = 0.0f; - +#if 0 m_hostageEscortCount = 0; m_hostageEscortCountTimestamp = 0.0f; - +#endif m_noisePosition = Vector(0, 0, 0); m_noiseTimestamp = 0.0f; m_noiseCheckTimestamp = 0.0f; diff --git a/dlls/bot/cs_bot_statemachine.cpp b/dlls/bot/cs_bot_statemachine.cpp index c2e59976..ef31af0c 100644 --- a/dlls/bot/cs_bot_statemachine.cpp +++ b/dlls/bot/cs_bot_statemachine.cpp @@ -24,13 +24,13 @@ void CCSBot::Idle() SetTask(SEEK_AND_DESTROY); SetState(&m_idleState); } - +#if 0 void CCSBot::EscapeFromBomb() { // SetTask(ESCAPE_FROM_BOMB); // SetState(&m_escapeFromBombState); } - +#endif void CCSBot::Follow(CBasePlayer *player) { if (player == NULL) @@ -67,12 +67,12 @@ void CCSBot::StopFollowing() } // Begin process of rescuing hostages - +#if 0 void CCSBot::RescueHostages() { SetTask(RESCUE_HOSTAGES); } - +#endif // Use the entity void CCSBot::UseEntity(CBaseEntity *entity) @@ -336,7 +336,7 @@ bool CCSBot::IsAttacking() const } // Return true if we are escaping from the bomb - +#if 0 bool CCSBot::IsEscapingFromBomb() const { // if (m_state == static_cast(&m_escapeFromBombState)) @@ -354,7 +354,7 @@ bool CCSBot::IsDefusingBomb() const return false; } - +#endif // Return true if we are hiding bool CCSBot::IsHiding() const @@ -396,7 +396,7 @@ bool CCSBot::IsMovingTo() const } // Return true if we are buying - +#if 0 bool CCSBot::IsBuying() const { // if (m_state == static_cast(&m_buyState)) @@ -404,6 +404,7 @@ bool CCSBot::IsBuying() const return false; } +#endif // Move to potentially distant position @@ -414,6 +415,7 @@ void CCSBot::MoveTo(const Vector *pos, RouteType route) SetState(&m_moveToState); } +#if 0 void CCSBot::PlantBomb() { // SetState(&m_plantBombState); @@ -430,6 +432,7 @@ void CCSBot::DefuseBomb() { // SetState(&m_defuseBombState); } +#endif // Investigate recent enemy noise diff --git a/dlls/bot/cs_bot_update.cpp b/dlls/bot/cs_bot_update.cpp index ef1ab17a..133a8b81 100644 --- a/dlls/bot/cs_bot_update.cpp +++ b/dlls/bot/cs_bot_update.cpp @@ -476,7 +476,7 @@ void CCSBot::Update() } // TODO: This doesn't work if we are restricted to just knives and sniper rifles because we cant use the rifle at close range - if (!IsSafe() && !IsUsingGrenade() && IsUsingKnife() && !IsEscapingFromBomb()) + if (!IsSafe() && !IsUsingGrenade() && IsUsingKnife()) { EquipBestWeapon(); } @@ -534,7 +534,7 @@ void CCSBot::Update() // check encounter spots UpdatePeripheralVision(); - +#if 0 // Update gamestate if (m_bomber != NULL) GetChatter()->SpottedBomber(GetBomber()); @@ -594,7 +594,7 @@ void CCSBot::Update() #endif } } - +#endif // Follow nearby humans if our co-op is high and we have nothing else to do // If we were just following someone, don't auto-follow again for a short while to // give us a chance to do something else. @@ -715,7 +715,7 @@ void CCSBot::Update() ClearMovement(); } #endif - +#if 0 // if we get too far ahead of the hostages we are escorting, wait for them if (!IsAttacking() && m_inhibitWaitingForHostageTimer.IsElapsed()) { @@ -746,7 +746,7 @@ void CCSBot::Update() } } } - +#endif // remember our prior safe time status m_wasSafe = IsSafe(); } diff --git a/dlls/bot/cs_bot_weapon.cpp b/dlls/bot/cs_bot_weapon.cpp index 63f49725..570a0e38 100644 --- a/dlls/bot/cs_bot_weapon.cpp +++ b/dlls/bot/cs_bot_weapon.cpp @@ -702,10 +702,13 @@ void CCSBot::ReloadCheck() // don't bother to reload if there are no enemies left if (GetEnemiesRemaining() == 0) return; - +#if 0 if (IsDefusingBomb() || IsActiveWeaponReloading()) return; - +#else + if (IsActiveWeaponReloading()) + return; +#endif if (IsActiveWeaponClipEmpty()) { #if 0 @@ -774,7 +777,7 @@ void CCSBot::SilencerCheck() // longer than reload check because reloading should take precedence const float safeSilencerWaitTime = 3.5f; - if (IsDefusingBomb() || IsActiveWeaponReloading() || IsAttacking()) + if (IsActiveWeaponReloading() || IsAttacking()) return; // M4A1 and USP are the only weapons with removable silencers diff --git a/dlls/bot/states/cs_bot_attack.cpp b/dlls/bot/states/cs_bot_attack.cpp index 58c50fcc..bde73e13 100644 --- a/dlls/bot/states/cs_bot_attack.cpp +++ b/dlls/bot/states/cs_bot_attack.cpp @@ -30,10 +30,11 @@ void AttackState::OnEnter(CCSBot *me) m_shieldToggleTimestamp = gpGlobals->time + RANDOM_FLOAT(2.0f, 10.0f); m_shieldForceOpen = false; +#if 0 // if we encountered someone while escaping, grab our weapon and fight! if (me->IsEscapingFromBomb()) me->EquipBestWeapon(); - +#endif if (me->IsUsingKnife()) { // can't crouch and hold with a knife diff --git a/dlls/bot/states/cs_bot_follow.cpp b/dlls/bot/states/cs_bot_follow.cpp index a54e5926..d32129e4 100644 --- a/dlls/bot/states/cs_bot_follow.cpp +++ b/dlls/bot/states/cs_bot_follow.cpp @@ -83,7 +83,7 @@ void FollowState::OnUpdate(CCSBot *me) me->Idle(); return; } - +#if 0 // if we are carrying the bomb and at a bombsite, plant if (me->IsCarryingBomb() && me->IsAtBombsite()) { @@ -95,7 +95,7 @@ void FollowState::OnUpdate(CCSBot *me) me->GetChatter()->PlantingTheBomb(me->GetPlace()); return; } - +#endif // look around me->UpdateLookAround(); diff --git a/dlls/bot/states/cs_bot_hide.cpp b/dlls/bot/states/cs_bot_hide.cpp index f43f2242..12406ac4 100644 --- a/dlls/bot/states/cs_bot_hide.cpp +++ b/dlls/bot/states/cs_bot_hide.cpp @@ -49,8 +49,10 @@ void HideState::OnUpdate(CCSBot *me) // wait until finished reloading to leave hide state if (!me->IsActiveWeaponReloading()) { + if (gpGlobals->time - me->GetStateTimestamp() > m_duration) { +#if 0 if (me->GetTask() == CCSBot::GUARD_LOOSE_BOMB) { // if we're guarding the loose bomb, continue to guard it but pick a new spot @@ -83,7 +85,7 @@ void HideState::OnUpdate(CCSBot *me) return; } } - +#endif me->Idle(); return; } @@ -220,6 +222,7 @@ void HideState::OnUpdate(CCSBot *me) } #endif + bool isSettledInSniper = (me->IsSniper() && m_isAtSpot) ? true : false; // only investigate noises if we are initiating attacks, and we aren't a "settled in" sniper diff --git a/dlls/bot/states/cs_bot_idle.cpp b/dlls/bot/states/cs_bot_idle.cpp index 955e5dad..883e1e77 100644 --- a/dlls/bot/states/cs_bot_idle.cpp +++ b/dlls/bot/states/cs_bot_idle.cpp @@ -53,6 +53,7 @@ void IdleState::OnUpdate(CCSBot *me) // if round is over, hunt if (me->GetGameState()->IsRoundOver()) { +#if 0 // if we are escorting hostages, try to get to the rescue zone if (me->GetHostageEscortCount()) { @@ -64,7 +65,7 @@ void IdleState::OnUpdate(CCSBot *me) me->PrintIfWatched("Trying to rescue hostages at the end of the round\n"); return; } - +#endif me->Hunt(); return; } diff --git a/dlls/bot/states/cs_bot_move_to.cpp b/dlls/bot/states/cs_bot_move_to.cpp index f8a9e58c..cc3d2753 100644 --- a/dlls/bot/states/cs_bot_move_to.cpp +++ b/dlls/bot/states/cs_bot_move_to.cpp @@ -17,9 +17,12 @@ void MoveToState::OnEnter(CCSBot *me) RouteType route; switch (me->GetTask()) { + // maybe also fastest way to healthkits?? +#if 0 case CCSBot::FIND_TICKING_BOMB: case CCSBot::DEFUSE_BOMB: - case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION: +#endif + case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION: route = FASTEST_ROUTE; break; @@ -243,6 +246,7 @@ void MoveToState::OnUpdate(CCSBot *me) // reached destination switch (me->GetTask()) { +#if 0 case CCSBot::PLANT_BOMB: { // if we are at bombsite with the bomb, plant it @@ -273,6 +277,7 @@ void MoveToState::OnUpdate(CCSBot *me) } break; } +#endif case CCSBot::MOVE_TO_LAST_KNOWN_ENEMY_POSITION: { CBasePlayer *victim = static_cast(me->GetTaskEntity());