From dcb74bcbbe2622750806ad35d7cb7f815cd5dbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sun, 21 Apr 2024 10:17:51 +0500 Subject: [PATCH 01/10] chatter.cfg: remove chatter phrases from Radio_NeedBackup event Change phrases for Chatter_DefendingBombsite event --- cfg/addons/yapb/conf/chatter.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index 78d695b..33ec11e 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -25,7 +25,7 @@ Event Radio_ReportTeam = report_in_team, anyone_see_them, anyone_see_anything, w Event Radio_Affirmative = affirmative, roger_that, me_too, ill_come_with_you, ill_go_with_you, ill_go_too, i_got_your_back, i_got_your_back2, im_with_you, im_with_you, sounds_like_a_plan, good_idea Event Radio_EnemySpotted = one_guy, two_of_them, three, three_of_them, a_bunch_of_them, theyre_all_over_the_place2, theyre_everywhere2, theres_too_many_of_them, theres_too_many, too_many2, the_actions_hot_here, its_a_party -Event Radio_NeedBackup = taking_fire_need_assistance2, i_could_use_some_help, i_could_use_some_help_over_here, help, need_help, need_help2, im_in_trouble +// Event Radio_NeedBackup = Event Radio_SectorClear = clear, clear2, clear3, clear4, area_clear, all_clear_here, nothing_moving_over_here, all_quiet, nothing_happening_over_here, i_got_nothing, nothing, nothing_here, theres_nobody_home Event Radio_InPosition = lets_wait_here, lets_hold_up_here_for_a_minute, im_gonna_hang_back, im_going_to_wait_here, im_waiting_here Event Radio_ReportingIn = reporting_in @@ -69,7 +69,7 @@ Event Chatter_ThreeEnemiesLeft = three_left, three_to_go, three_to_go2 Event Chatter_NoEnemiesLeft = that_was_the_last_one, that_was_it, that_was_the_last_guy Event Chatter_FoundBombPlace = theres_the_bomb, theres_the_bomb2 Event Chatter_WhereIsTheBomb = wheres_the_bomb, wheres_the_bomb2, wheres_the_bomb3, where_is_it -Event Chatter_DefendingBombSite = bombsite, bombsite2 +Event Chatter_DefendingBombSite = bombsite_secured, bombsite_under_control Event Chatter_BarelyDefused = i_wasnt_worried_for_a_minute, that_was_a_close_one, well_done, whew_that_was_close Event Chatter_NiceshotCommander = good_one_sir, good_one_sir2, nice_shot_sir, nice_one_sir Event Chatter_NiceshotPall = good_one, good_one2, nice_shot, nice_shot2, good_shot, good_shot2, nice, nice2, very_nice From 9f927f687ea18013c4c35025e171d6f70c750bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sun, 21 Apr 2024 05:43:14 +0000 Subject: [PATCH 02/10] fix: use correct define for Chatter_HeardEnemy chatter event --- src/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index 7c1377f..1c08fec 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -293,7 +293,7 @@ void BotConfig::loadChatterConfig () { { "Chatter_DefusingC4", Chatter::DefusingBomb, 3.0f }, { "Chatter_FoundC4", Chatter::FoundC4, 5.5f }, { "Chatter_ScaredEmotion", Chatter::ScaredEmotion, 6.1f }, - { "Chatter_HeardEnemy", Chatter::ScaredEmotion, 12.8f }, + { "Chatter_HeardEnemy", Chatter::HeardTheEnemy, 12.8f }, { "Chatter_SniperWarning", Chatter::SniperWarning, 14.3f }, { "Chatter_SniperKilled", Chatter::SniperKilled, 12.1f }, { "Chatter_OneEnemyLeft", Chatter::OneEnemyLeft, 12.5f }, From 35def2ab0570cd6a69ff91a0f19504c23543f854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:23:56 +0000 Subject: [PATCH 03/10] add: new chatter events --- cfg/addons/yapb/conf/chatter.cfg | 3 +++ inc/constant.h | 3 +++ inc/message.h | 6 ++++-- inc/yapb.h | 2 ++ src/botlib.cpp | 11 +++++++++++ src/config.cpp | 3 +++ src/message.cpp | 8 ++++++++ src/tasks.cpp | 1 - 8 files changed, 34 insertions(+), 3 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index 33ec11e..1bb2639 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -61,7 +61,10 @@ Event Chatter_HeardEnemy = i_hear_them, hang_on_i_heard_something, i_hear_someth Event Chatter_SniperWarning = sniper, sniper2, watch_it_theres_a_sniper Event Chatter_SniperKilled = got_the_sniper, got_the_sniper2, sniper_down, took_out_the_sniper, the_sniper_is_dead Event Chatter_VIPSpotted = i_see_our_target, target_spotted, target_acquired +Event Chatter_GuardingEscapeZone = watching_the_escape_zone, watching_the_escape_route, they_will_not_escape, im_at_the_escape_zone, guarding_the_escape_zone, guarding_the_escape_zone2 Event Chatter_GuardingVipSafety = watching_the_escape_route, im_at_the_escape_zone, watching_the_escape_zone, guarding_the_escape_zone, guarding_the_escape_zone2 +Event Chatter_GoingToGuardEscapeZone = im_going_to_keep_an_eye_on_the_escape, im_going_to_watch_the_escape_zone, im_going_to_cover_the_escape_zone +Event Chatter_GoingToGuardRescueZone = im_going_to_watch_the_rescue_zone, im_going_to_keep_an_eye_on_the_rescue Event Chatter_GoingToGuardVIPSafety = im_going_to_cover_the_escape_zone, im_going_to_watch_the_escape_zone, im_going_to_keep_an_eye_on_the_escape, heading_to_the_escape_zone Event Chatter_OneEnemyLeft = one_guy_left, theres_one_left Event Chatter_TwoEnemiesLeft = two_enemies_left, two_to_go diff --git a/inc/constant.h b/inc/constant.h index 01bc953..c768929 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -199,7 +199,10 @@ CR_DECLARE_SCOPED_ENUM (Chatter, SniperWarning, SniperKilled, VIPSpotted, + GuardingEscapeZone, GuardingVIPSafety, + GoingToGuardEscapeZone, + GoingToGuardRescueZone, GoingToGuardVIPSafety, QuickWonRound, OneEnemyLeft, diff --git a/inc/message.h b/inc/message.h index f830581..5eef43a 100644 --- a/inc/message.h +++ b/inc/message.h @@ -58,8 +58,10 @@ CR_DECLARE_SCOPED_ENUM (TextMsgCache, CR_DECLARE_SCOPED_ENUM (StatusIconCache, NeedHandle = cr::bit (0), BuyZone = cr::bit (1), - VipSafety = cr::bit (2), - C4 = cr::bit (3) + Escape = cr::bit (2), + Rescue = cr::bit (3), + VipSafety = cr::bit (4), + C4 = cr::bit (5) ) class MessageDispatcher final : public Singleton { diff --git a/inc/yapb.h b/inc/yapb.h index 0f24ec6..7ba132a 100644 --- a/inc/yapb.h +++ b/inc/yapb.h @@ -646,6 +646,8 @@ public: bool m_ignoreBuyDelay {}; // when reaching buyzone in the middle of the round don't do pauses bool m_inBombZone {}; // bot in the bomb zone or not bool m_inBuyZone {}; // bot currently in buy zone + bool m_inEscapeZone {}; // bot currently in escape zone + bool m_inRescueZone {}; // bot currently in rescue zone bool m_inVIPZone {}; // bot in the vip safety zone bool m_buyingFinished {}; // done with buying bool m_buyPending {}; // bot buy is pending diff --git a/src/botlib.cpp b/src/botlib.cpp index e9dc0f5..d9ced25 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2185,6 +2185,14 @@ void Bot::startTask (Task id, float desire, int data, float time, bool resume) { } } + if (rg.chance (75) && tid == Task::Camp && m_team == Team::CT && m_inEscapeZone) { + pushChatterMessage (Chatter::GoingToGuardEscapeZone); + } + + if (rg.chance (75) && tid == Task::Camp && m_team == Team::Terrorist && m_inRescueZone) { + pushChatterMessage (Chatter::GoingToGuardRescueZone); + } + if (rg.chance (75) && tid == Task::Camp && m_team == Team::Terrorist && m_inVIPZone) { pushChatterMessage (Chatter::GoingToGuardVIPSafety); } @@ -2655,6 +2663,9 @@ void Bot::checkRadioQueue () { if (bots.isBombPlanted () && m_team == Team::Terrorist) { pushChatterMessage (Chatter::GuardingDroppedC4); } + else if (m_inEscapeZone && m_team == Team::CT) { + pushChatterMessage (Chatter::GuardingEscapeZone); + } else if (m_inVIPZone && m_team == Team::Terrorist) { pushChatterMessage (Chatter::GuardingVIPSafety); } diff --git a/src/config.cpp b/src/config.cpp index 1c08fec..2d7c7db 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -266,9 +266,12 @@ void BotConfig::loadChatterConfig () { { "Radio_EnemyDown", Radio::EnemyDown, 10.0f }, { "Chatter_DiePain", Chatter::DiePain, kMaxChatterRepeatInterval }, { "Chatter_GoingToPlantBomb", Chatter::GoingToPlantBomb, 5.0f }, + { "Chatter_GoingToGuardEscapeZone", Chatter::GoingToGuardEscapeZone, kMaxChatterRepeatInterval }, + { "Chatter_GoingToGuardRescueZone", Chatter::GoingToGuardRescueZone, kMaxChatterRepeatInterval }, { "Chatter_GoingToGuardVIPSafety", Chatter::GoingToGuardVIPSafety, kMaxChatterRepeatInterval }, { "Chatter_RescuingHostages", Chatter::RescuingHostages, kMaxChatterRepeatInterval }, { "Chatter_TeamKill", Chatter::TeamKill, kMaxChatterRepeatInterval }, + { "Chatter_GuardingEscapeZone", Chatter::GuardingEscapeZone, kMaxChatterRepeatInterval }, { "Chatter_GuardingVipSafety", Chatter::GuardingVIPSafety, kMaxChatterRepeatInterval }, { "Chatter_PlantingC4", Chatter::PlantingBomb, 10.0f }, { "Chatter_InCombat", Chatter::InCombat, kMaxChatterRepeatInterval }, diff --git a/src/message.cpp b/src/message.cpp index 275aa8d..acb67c8 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -255,6 +255,12 @@ void MessageDispatcher::netMsgStatusIcon () { // try to equip in buyzone m_bot->enteredBuyZone (BuyState::PrimaryWeapon); } + else if (cached & StatusIconCache::Escape) { + m_bot->m_inEscapeZone = (m_args[enabled].long_ != 0); + } + else if (cached & StatusIconCache::Rescue) { + m_bot->m_inRescueZone = (m_args[enabled].long_ != 0); + } else if (cached & StatusIconCache::VipSafety) { m_bot->m_inVIPZone = (m_args[enabled].long_ != 0); } @@ -491,6 +497,8 @@ MessageDispatcher::MessageDispatcher () { // register status icon cache m_statusIconCache["buyzone"] = StatusIconCache::NeedHandle | StatusIconCache::BuyZone; + m_statusIconCache["escape"] = StatusIconCache::NeedHandle | StatusIconCache::Escape; + m_statusIconCache["rescue"] = StatusIconCache::NeedHandle | StatusIconCache::Rescue; m_statusIconCache["vipsafety"] = StatusIconCache::NeedHandle | StatusIconCache::VipSafety; m_statusIconCache["c4"] = StatusIconCache::NeedHandle | StatusIconCache::C4; diff --git a/src/tasks.cpp b/src/tasks.cpp index 4e67e63..d25ac0b 100644 --- a/src/tasks.cpp +++ b/src/tasks.cpp @@ -190,7 +190,6 @@ void Bot::normal_ () { // decide to duck or not to duck selectCampButtons (index); - pushChatterMessage (Chatter::GoingToGuardVIPSafety); // play info about that } } From ffb92ca962b0e628e76b695980bbb81aad95dd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Fri, 26 Apr 2024 18:23:20 +0000 Subject: [PATCH 04/10] fix: report about hostage rescuing when the bot is leading them --- src/botlib.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index 72f30d3..0610c7b 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2326,7 +2326,7 @@ void Bot::checkRadioQueue () { // don't allow bot listen you if bot is busy - if (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4) { + if (m_radioOrder != Radio::ReportInTeam && (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4)) { m_radioOrder = 0; return; } @@ -2630,14 +2630,14 @@ void Bot::checkRadioQueue () { const Path &path = graph[getTask ()->data]; if (path.flags & NodeFlag::Goal) { - if (game.mapIs (MapFlags::Demolition) && m_team == Team::Terrorist && m_hasC4) { + if (m_hasC4) { pushChatterMessage (Chatter::GoingToPlantBomb); } else { pushChatterMessage (Chatter::Nothing); } } - else if (path.flags & NodeFlag::Rescue) { + else if (m_hasHostage) { pushChatterMessage (Chatter::RescuingHostages); } else if ((path.flags & NodeFlag::Camp) && rg.chance (75)) { From 89ea866dcb9bdf98a78a78de850acf03b60eddb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:49:24 +0000 Subject: [PATCH 05/10] fix: corrected phrases about guarding the planted bomb --- cfg/addons/yapb/conf/chatter.cfg | 4 ++-- inc/constant.h | 2 +- src/botlib.cpp | 4 ++-- src/config.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index 1bb2639..f4cf6e5 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -44,7 +44,7 @@ Event Chatter_GoingToCamp = im_going_to_camp Event Chatter_HearSomething = hang_on_i_heard_something, i_hear_something, i_hear_them, i_heard_them, i_heard_something_over_there Event Chatter_TeamKill = what_happened, noo, oh_my_god, oh_man, oh_no_sad, what_have_you_done Event Chatter_ReportingIn = reporting_in -Event Chatter_GuardDroppedC4 = bombsite, bombsite2 +Event Chatter_GuardingPlantedC4 = bombsite_secure, bombsite_under_control Event Chatter_Camp = im_waiting_here Event Chatter_PlantingC4 = planting_the_bomb, planting Event Chatter_DefusingC4 = defusing, defusing_bomb, defusing_bomb_now @@ -77,7 +77,7 @@ Event Chatter_BarelyDefused = i_wasnt_worried_for_a_minute, that_was_a_close_one Event Chatter_NiceshotCommander = good_one_sir, good_one_sir2, nice_shot_sir, nice_one_sir Event Chatter_NiceshotPall = good_one, good_one2, nice_shot, nice_shot2, good_shot, good_shot2, nice, nice2, very_nice Event Chatter_GoingToGuardHostages = camping_hostages, im_going_to_camp_the_hostages, im_going_to_guard_the_hostages, im_going_to_guard_the_hostages2 -Event Chatter_GoingToGuardDoppedBomb = im_going_to_guard_the_bomb, im_going_to_guard_the_bomb2, im_going_to_keep_an_eye_on_the_bomb, im_going_to_watch_the_bomb +Event Chatter_GoingToGuardDroppedBomb = im_going_to_guard_the_bomb, im_going_to_guard_the_bomb2, im_going_to_keep_an_eye_on_the_bomb, im_going_to_watch_the_bomb Event Chatter_OnMyWay = on_my_way, on_my_way2, im_coming, hang_on_im_coming, be_right_there Event Chatter_LeadOnSir = lead_on_sir, lead_the_way_sir, lead_the_way, ok_sir_lets_go, lead_on_commander, lead_the_way_commander, ok_cmdr_lets_go Event Chatter_Pinned_Down = they_got_me_pinned_down_here, im_pinned_down diff --git a/inc/constant.h b/inc/constant.h index c768929..8953aa9 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -183,7 +183,7 @@ CR_DECLARE_SCOPED_ENUM (Chatter, TeamAttack, TeamKill, ReportingIn, - GuardingDroppedC4, + GuardingPlantedC4, Camping, PlantingBomb, DefusingBomb, diff --git a/src/botlib.cpp b/src/botlib.cpp index 0610c7b..7f4e94c 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2178,7 +2178,7 @@ void Bot::startTask (Task id, float desire, int data, float time, bool resume) { if (rg.chance (25) && tid == Task::Camp) { if (game.mapIs (MapFlags::Demolition) && bots.isBombPlanted ()) { - pushChatterMessage (Chatter::GuardingDroppedC4); + pushChatterMessage (Chatter::GuardingPlantedC4); } else { pushChatterMessage (Chatter::GoingToCamp); @@ -2661,7 +2661,7 @@ void Bot::checkRadioQueue () { case Task::Camp: if (rg.chance (40)) { if (bots.isBombPlanted () && m_team == Team::Terrorist) { - pushChatterMessage (Chatter::GuardingDroppedC4); + pushChatterMessage (Chatter::GuardingPlantedC4); } else if (m_inEscapeZone && m_team == Team::CT) { pushChatterMessage (Chatter::GuardingEscapeZone); diff --git a/src/config.cpp b/src/config.cpp index c102351..a5ba0a8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -292,7 +292,7 @@ void BotConfig::loadChatterConfig () { { "Chatter_VIPSpotted", Chatter::VIPSpotted, 5.3f }, { "Chatter_FriendlyFire", Chatter::FriendlyFire, 2.1f }, { "Chatter_GotBlinded", Chatter::Blind, 12.0f }, - { "Chatter_GuardDroppedC4", Chatter::GuardingDroppedC4, 3.0f }, + { "Chatter_GuardingPlantedC4", Chatter::GuardingPlantedC4, 3.0f }, { "Chatter_DefusingC4", Chatter::DefusingBomb, 3.0f }, { "Chatter_FoundC4", Chatter::FoundC4, 5.5f }, { "Chatter_ScaredEmotion", Chatter::ScaredEmotion, 6.1f }, @@ -304,7 +304,7 @@ void BotConfig::loadChatterConfig () { { "Chatter_ThreeEnemiesLeft", Chatter::ThreeEnemiesLeft, 12.5f }, { "Chatter_NiceshotPall", Chatter::NiceShotPall, 2.0f }, { "Chatter_GoingToGuardHostages", Chatter::GoingToGuardHostages, 3.0f }, - { "Chatter_GoingToGuardDoppedBomb", Chatter::GoingToGuardDroppedC4, 6.0f }, + { "Chatter_GoingToGuardDroppedBomb", Chatter::GoingToGuardDroppedC4, 6.0f }, { "Chatter_OnMyWay", Chatter::OnMyWay, 1.5f }, { "Chatter_LeadOnSir", Chatter::LeadOnSir, 5.0f }, { "Chatter_Pinned_Down", Chatter::PinnedDown, 5.0f }, From b0e98d0e3ff3ba93d184b4a2bd0552a8124435ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Tue, 30 Apr 2024 16:19:10 +0000 Subject: [PATCH 06/10] fix: report that a bot has heard an enemy --- cfg/addons/yapb/conf/chatter.cfg | 1 - inc/constant.h | 1 - src/botlib.cpp | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index f4cf6e5..0c976a2 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -41,7 +41,6 @@ Event Chatter_GotBlinded = ive_been_blinded, my_eyes, i_cant_see, im_blind Event Chatter_GoingToPlantBomb = im_gonna_go_plant, im_gonna_go_plant_the_bomb Event Chatter_RescuingHostages = the_hostages_are_with_me, taking_the_hostages_to_safety, ive_got_the_hostages, i_have_the_hostages Event Chatter_GoingToCamp = im_going_to_camp -Event Chatter_HearSomething = hang_on_i_heard_something, i_hear_something, i_hear_them, i_heard_them, i_heard_something_over_there Event Chatter_TeamKill = what_happened, noo, oh_my_god, oh_man, oh_no_sad, what_have_you_done Event Chatter_ReportingIn = reporting_in Event Chatter_GuardingPlantedC4 = bombsite_secure, bombsite_under_control diff --git a/inc/constant.h b/inc/constant.h index 8953aa9..57df4e7 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -179,7 +179,6 @@ CR_DECLARE_SCOPED_ENUM (Chatter, GoingToPlantBomb, RescuingHostages, GoingToCamp, - HeardNoise, TeamAttack, TeamKill, ReportingIn, diff --git a/src/botlib.cpp b/src/botlib.cpp index 7f4e94c..96f31b0 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2643,8 +2643,8 @@ void Bot::checkRadioQueue () { else if ((path.flags & NodeFlag::Camp) && rg.chance (75)) { pushChatterMessage (Chatter::GoingToCamp); } - else { - pushChatterMessage (Chatter::HeardNoise); + else if (m_states & Sense::HearingEnemy) { + pushChatterMessage (Chatter::HeardTheEnemy); } } else if (rg.chance (30)) { From 18b0640227edb728b760a665308f511b1f017c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Thu, 2 May 2024 17:32:11 +0000 Subject: [PATCH 07/10] fix: remove inappropriate chatter phrases for radio events --- cfg/addons/yapb/conf/chatter.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index 0c976a2..c2c7c0e 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -13,7 +13,7 @@ Event Radio_CoverMe = cover_me, cover_me2 // Event Radio_YouTakePoint = // Event Radio_HoldPosition = // Event Radio_RegroupTeam = -Event Radio_FollowMe = lead_on_sir, lead_the_way_sir, lead_the_way, ok_sir_lets_go, lead_on_commander, lead_the_way_commander, ok_cmdr_lets_go +// Event Radio_FollowMe = Event Radio_TakingFire = taking_fire_need_assistance2, i_could_use_some_help, i_could_use_some_help_over_here, help, need_help, need_help2, im_in_trouble // Event Radio_GoGoGo = @@ -24,7 +24,7 @@ Event Radio_TakingFire = taking_fire_need_assistance2, i_could_use_some_help, i_ Event Radio_ReportTeam = report_in_team, anyone_see_them, anyone_see_anything, where_are_they, where_could_they_be Event Radio_Affirmative = affirmative, roger_that, me_too, ill_come_with_you, ill_go_with_you, ill_go_too, i_got_your_back, i_got_your_back2, im_with_you, im_with_you, sounds_like_a_plan, good_idea -Event Radio_EnemySpotted = one_guy, two_of_them, three, three_of_them, a_bunch_of_them, theyre_all_over_the_place2, theyre_everywhere2, theres_too_many_of_them, theres_too_many, too_many2, the_actions_hot_here, its_a_party +// Event Radio_EnemySpotted = // Event Radio_NeedBackup = Event Radio_SectorClear = clear, clear2, clear3, clear4, area_clear, all_clear_here, nothing_moving_over_here, all_quiet, nothing_happening_over_here, i_got_nothing, nothing, nothing_here, theres_nobody_home Event Radio_InPosition = lets_wait_here, lets_hold_up_here_for_a_minute, im_gonna_hang_back, im_going_to_wait_here, im_waiting_here From 7ad54c55be1381f9d1caa7168d8ec9b6bee84aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Fri, 3 May 2024 17:23:36 +0000 Subject: [PATCH 08/10] add: report of the enemies' count --- cfg/addons/yapb/conf/chatter.cfg | 4 ++++ inc/constant.h | 4 ++++ src/botlib.cpp | 29 ++++++++++++++++++++++++++++- src/combat.cpp | 20 +++++++++++++++++++- src/config.cpp | 4 ++++ 5 files changed, 59 insertions(+), 2 deletions(-) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index c2c7c0e..d77fe72 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -57,6 +57,10 @@ Event Chatter_WonTheRound = good_job_team, nice_work_team, way_to_be_team, well_ Event Chatter_QuicklyWonTheRound = i_am_dangerous, do_not_mess_with_me, we_owned_them, they_never_knew_what_hit_them, thats_the_way_this_is_done, and_thats_how_its_done, owned, yesss, yesss2, yea_baby, whoo, whoo2, oh_yea, oh_yea2 Event Chatter_ScaredEmotion = whoa, uh_oh, oh_no, yikes, oh, oh_boy, oh_boy2, aah Event Chatter_HeardEnemy = i_hear_them, hang_on_i_heard_something, i_hear_something, i_heard_them, i_heard_something_over_there +Event Chatter_SpottedOneEnemy = one_guy +Event Chatter_SpottedTwoEnemies = two_of_them +Event Chatter_SpottedThreeEnemies = three, three_of_them +Event Chatter_TooManyEnemies = a_bunch_of_them, theyre_all_over_the_place2, theyre_everywhere2, theres_too_many_of_them, theres_too_many, too_many2, the_actions_hot_here, its_a_party Event Chatter_SniperWarning = sniper, sniper2, watch_it_theres_a_sniper Event Chatter_SniperKilled = got_the_sniper, got_the_sniper2, sniper_down, took_out_the_sniper, the_sniper_is_dead Event Chatter_VIPSpotted = i_see_our_target, target_spotted, target_acquired diff --git a/inc/constant.h b/inc/constant.h index 57df4e7..753b3cf 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -195,6 +195,10 @@ CR_DECLARE_SCOPED_ENUM (Chatter, WonTheRound, ScaredEmotion, HeardTheEnemy, + SpottedOneEnemy, + SpottedTwoEnemies, + SpottedThreeEnemies, + TooManyEnemies, SniperWarning, SniperKilled, VIPSpotted, diff --git a/src/botlib.cpp b/src/botlib.cpp index 18ad290..016021c 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2446,6 +2446,10 @@ void Bot::checkRadioQueue () { case Radio::EnemySpotted: case Radio::NeedBackup: + case Chatter::SpottedOneEnemy: + case Chatter::SpottedTwoEnemies: + case Chatter::SpottedThreeEnemies: + case Chatter::TooManyEnemies: case Chatter::ScaredEmotion: case Chatter::PinnedDown: if (((game.isNullEntity (m_enemy) && seesEntity (m_radioEntity->v.origin)) || distanceSq < cr::sqrf (2048.0f) || !m_moveToC4) @@ -2686,7 +2690,30 @@ void Bot::checkRadioQueue () { break; case Task::Attack: - pushChatterMessage (Chatter::InCombat); + if (rg.chance (50)) { + pushChatterMessage (Chatter::InCombat); + } + else { + if (cv_radio_mode.as () == 2) { + switch (numEnemiesNear (pev->origin, 384.0f)) { + case 1: + pushChatterMessage (Chatter::SpottedOneEnemy); + break; + case 2: + pushChatterMessage (Chatter::SpottedTwoEnemies); + break; + case 3: + pushChatterMessage (Chatter::SpottedThreeEnemies); + break; + default: + pushChatterMessage (Chatter::TooManyEnemies); + break; + } + } + else if (cv_radio_mode.as () == 1) { + pushRadioMessage (Radio::EnemySpotted); + } + } break; case Task::Hide: diff --git a/src/combat.cpp b/src/combat.cpp index d6d8d90..189b93c 100644 --- a/src/combat.cpp +++ b/src/combat.cpp @@ -399,7 +399,25 @@ bool Bot::lookupEnemies () { } else { if (m_seeEnemyTime + 3.0f < game.time () && (m_hasC4 || m_hasHostage || !game.isNullEntity (m_targetEntity))) { - pushRadioMessage (Radio::EnemySpotted); + if (cv_radio_mode.as () == 2) { + switch (numEnemiesNear (pev->origin, 384.0f)) { + case 1: + pushChatterMessage (Chatter::SpottedOneEnemy); + break; + case 2: + pushChatterMessage (Chatter::SpottedTwoEnemies); + break; + case 3: + pushChatterMessage (Chatter::SpottedThreeEnemies); + break; + default: + pushChatterMessage (Chatter::TooManyEnemies); + break; + } + } + else if (cv_radio_mode.as () == 1) { + pushRadioMessage (Radio::EnemySpotted); + } } m_targetEntity = nullptr; // stop following when we see an enemy... diff --git a/src/config.cpp b/src/config.cpp index a5ba0a8..5b7e986 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -297,6 +297,10 @@ void BotConfig::loadChatterConfig () { { "Chatter_FoundC4", Chatter::FoundC4, 5.5f }, { "Chatter_ScaredEmotion", Chatter::ScaredEmotion, 6.1f }, { "Chatter_HeardEnemy", Chatter::HeardTheEnemy, 12.8f }, + { "Chatter_SpottedOneEnemy", Chatter::SpottedOneEnemy, 4.0f }, + { "Chatter_SpottedTwoEnemies", Chatter::SpottedTwoEnemies, 4.0f }, + { "Chatter_SpottedThreeEnemies", Chatter::SpottedThreeEnemies, 4.0f }, + { "Chatter_TooManyEnemies", Chatter::TooManyEnemies, 4.0f }, { "Chatter_SniperWarning", Chatter::SniperWarning, 14.3f }, { "Chatter_SniperKilled", Chatter::SniperKilled, 12.1f }, { "Chatter_OneEnemyLeft", Chatter::OneEnemyLeft, 12.5f }, From 9d7b037e05f6484685f309e61623c9f010963b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Mon, 20 May 2024 19:58:59 +0000 Subject: [PATCH 09/10] add: OnARoll chatter event with phrases that bots will say when completing a kill streak in a short amount of time --- cfg/addons/yapb/conf/chatter.cfg | 1 + inc/constant.h | 1 + inc/yapb.h | 3 +++ src/botlib.cpp | 15 +++++++++++++++ src/config.cpp | 1 + 5 files changed, 21 insertions(+) diff --git a/cfg/addons/yapb/conf/chatter.cfg b/cfg/addons/yapb/conf/chatter.cfg index d77fe72..cb37a45 100644 --- a/cfg/addons/yapb/conf/chatter.cfg +++ b/cfg/addons/yapb/conf/chatter.cfg @@ -88,3 +88,4 @@ Event Chatter_GottaFindTheBomb = theres_the_bomb, theres_the_bomb2 Event Chatter_Lost_The_Commander = weve_lost_the_commander, the_commander_is_down, the_commander_is_down_repeat Event Chatter_CoverMe = cover_me, cover_me2 Event Chatter_BombSiteSecured = i_wasnt_worried_for_a_minute, that_was_a_close_one, well_done, whew_that_was_close +Event Chatter_OnARoll = i_got_more_where_that_came_from, who_wants_some_more, i_am_on_fire, look_out_brag, thats_right, whos_the_man diff --git a/inc/constant.h b/inc/constant.h index cdc2eb6..75c6b26 100644 --- a/inc/constant.h +++ b/inc/constant.h @@ -230,6 +230,7 @@ CR_DECLARE_SCOPED_ENUM (Chatter, CoverMe, BehindSmoke, BombsiteSecured, + OnARoll, Count ) diff --git a/inc/yapb.h b/inc/yapb.h index b2e2bdc..ecc0a7e 100644 --- a/inc/yapb.h +++ b/inc/yapb.h @@ -226,6 +226,7 @@ private: int m_tryOpenDoor {}; // attempt's to open the door int m_liftState {}; // state of lift handling int m_radioSelect {}; // radio entry + int m_killsCount {}; // the kills count of a bot int m_lastPredictIndex { kInvalidNodeIndex }; // last predicted path index int m_lastPredictLength {}; // last predicted path length @@ -286,6 +287,8 @@ private: float m_breakableTime {}; // breakable acquired time float m_stuckTimestamp {}; // last time was stuck float m_timeDebugUpdateTime {}; // time to update last debug timestamp + float m_lastVictimTime {}; // time when bot killed an enemy + float m_killsInterval {}; // interval between kills bool m_moveToGoal {}; // bot currently moving to goal?? bool m_isStuck {}; // bot is stuck diff --git a/src/botlib.cpp b/src/botlib.cpp index 00d97db..b0ff656 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -1806,6 +1806,7 @@ void Bot::refreshEnemyPredict () { void Bot::setLastVictim (edict_t *ent) { m_lastVictim = ent; m_lastVictimOrigin = ent->v.origin; + m_lastVictimTime = game.time (); m_forgetLastVictimTimer.start (rg (1.0f, 2.0f)); } @@ -1870,6 +1871,20 @@ void Bot::setConditions () { } } } + else { + auto currentTime = game.time(); + + m_killsInterval = currentTime - m_lastVictimTime; + if (m_killsInterval <= 5) { + m_killsCount++; + if (m_killsCount > 2) { + pushChatterMessage(Chatter::OnARoll); + } + } + else { + m_killsCount = 0; + } + } // if no more enemies found AND bomb planted, switch to knife to get to bomb place faster if (m_team == Team::CT && !usesKnife () && m_numEnemiesLeft == 0 && bots.isBombPlanted ()) { diff --git a/src/config.cpp b/src/config.cpp index e1075da..cb1be2b 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -322,6 +322,7 @@ void BotConfig::loadChatterConfig () { { "Chatter_BombSiteSecured", Chatter::BombsiteSecured, 3.5f }, { "Chatter_GoingToCamp", Chatter::GoingToCamp, 30.0f }, { "Chatter_Camp", Chatter::Camping, 10.0f }, + { "Chatter_OnARoll", Chatter::OnARoll, kMaxChatterRepeatInterval}, }; while (file.getLine (line)) { From 279b1e50d36978a35c37b352ac8fef021536631e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=BE=D0=B2?= <22411953+Vladislav4KZ@users.noreply.github.com> Date: Sun, 26 May 2024 06:34:57 +0000 Subject: [PATCH 10/10] fix: radio order checking condition after merging master branch --- src/botlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/botlib.cpp b/src/botlib.cpp index b1477c0..b83bf79 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -2345,7 +2345,7 @@ void Bot::checkRadioQueue () { // don't allow bot listen you if bot is busy - if (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4 || m_isCreature) { + if (m_radioOrder != Radio::ReportInTeam && (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4 || m_isCreature)) { m_radioOrder = 0; return; }