add: new chatter events

This commit is contained in:
Владислав Сухов 2024-04-22 14:23:56 +00:00
commit 35def2ab05
8 changed files with 34 additions and 3 deletions

View file

@ -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_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_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_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_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_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_OneEnemyLeft = one_guy_left, theres_one_left
Event Chatter_TwoEnemiesLeft = two_enemies_left, two_to_go Event Chatter_TwoEnemiesLeft = two_enemies_left, two_to_go

View file

@ -199,7 +199,10 @@ CR_DECLARE_SCOPED_ENUM (Chatter,
SniperWarning, SniperWarning,
SniperKilled, SniperKilled,
VIPSpotted, VIPSpotted,
GuardingEscapeZone,
GuardingVIPSafety, GuardingVIPSafety,
GoingToGuardEscapeZone,
GoingToGuardRescueZone,
GoingToGuardVIPSafety, GoingToGuardVIPSafety,
QuickWonRound, QuickWonRound,
OneEnemyLeft, OneEnemyLeft,

View file

@ -58,8 +58,10 @@ CR_DECLARE_SCOPED_ENUM (TextMsgCache,
CR_DECLARE_SCOPED_ENUM (StatusIconCache, CR_DECLARE_SCOPED_ENUM (StatusIconCache,
NeedHandle = cr::bit (0), NeedHandle = cr::bit (0),
BuyZone = cr::bit (1), BuyZone = cr::bit (1),
VipSafety = cr::bit (2), Escape = cr::bit (2),
C4 = cr::bit (3) Rescue = cr::bit (3),
VipSafety = cr::bit (4),
C4 = cr::bit (5)
) )
class MessageDispatcher final : public Singleton <MessageDispatcher> { class MessageDispatcher final : public Singleton <MessageDispatcher> {

View file

@ -646,6 +646,8 @@ public:
bool m_ignoreBuyDelay {}; // when reaching buyzone in the middle of the round don't do pauses 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_inBombZone {}; // bot in the bomb zone or not
bool m_inBuyZone {}; // bot currently in buy zone 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_inVIPZone {}; // bot in the vip safety zone
bool m_buyingFinished {}; // done with buying bool m_buyingFinished {}; // done with buying
bool m_buyPending {}; // bot buy is pending bool m_buyPending {}; // bot buy is pending

View file

@ -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) { if (rg.chance (75) && tid == Task::Camp && m_team == Team::Terrorist && m_inVIPZone) {
pushChatterMessage (Chatter::GoingToGuardVIPSafety); pushChatterMessage (Chatter::GoingToGuardVIPSafety);
} }
@ -2655,6 +2663,9 @@ void Bot::checkRadioQueue () {
if (bots.isBombPlanted () && m_team == Team::Terrorist) { if (bots.isBombPlanted () && m_team == Team::Terrorist) {
pushChatterMessage (Chatter::GuardingDroppedC4); pushChatterMessage (Chatter::GuardingDroppedC4);
} }
else if (m_inEscapeZone && m_team == Team::CT) {
pushChatterMessage (Chatter::GuardingEscapeZone);
}
else if (m_inVIPZone && m_team == Team::Terrorist) { else if (m_inVIPZone && m_team == Team::Terrorist) {
pushChatterMessage (Chatter::GuardingVIPSafety); pushChatterMessage (Chatter::GuardingVIPSafety);
} }

View file

@ -266,9 +266,12 @@ void BotConfig::loadChatterConfig () {
{ "Radio_EnemyDown", Radio::EnemyDown, 10.0f }, { "Radio_EnemyDown", Radio::EnemyDown, 10.0f },
{ "Chatter_DiePain", Chatter::DiePain, kMaxChatterRepeatInterval }, { "Chatter_DiePain", Chatter::DiePain, kMaxChatterRepeatInterval },
{ "Chatter_GoingToPlantBomb", Chatter::GoingToPlantBomb, 5.0f }, { "Chatter_GoingToPlantBomb", Chatter::GoingToPlantBomb, 5.0f },
{ "Chatter_GoingToGuardEscapeZone", Chatter::GoingToGuardEscapeZone, kMaxChatterRepeatInterval },
{ "Chatter_GoingToGuardRescueZone", Chatter::GoingToGuardRescueZone, kMaxChatterRepeatInterval },
{ "Chatter_GoingToGuardVIPSafety", Chatter::GoingToGuardVIPSafety, kMaxChatterRepeatInterval }, { "Chatter_GoingToGuardVIPSafety", Chatter::GoingToGuardVIPSafety, kMaxChatterRepeatInterval },
{ "Chatter_RescuingHostages", Chatter::RescuingHostages, kMaxChatterRepeatInterval }, { "Chatter_RescuingHostages", Chatter::RescuingHostages, kMaxChatterRepeatInterval },
{ "Chatter_TeamKill", Chatter::TeamKill, kMaxChatterRepeatInterval }, { "Chatter_TeamKill", Chatter::TeamKill, kMaxChatterRepeatInterval },
{ "Chatter_GuardingEscapeZone", Chatter::GuardingEscapeZone, kMaxChatterRepeatInterval },
{ "Chatter_GuardingVipSafety", Chatter::GuardingVIPSafety, kMaxChatterRepeatInterval }, { "Chatter_GuardingVipSafety", Chatter::GuardingVIPSafety, kMaxChatterRepeatInterval },
{ "Chatter_PlantingC4", Chatter::PlantingBomb, 10.0f }, { "Chatter_PlantingC4", Chatter::PlantingBomb, 10.0f },
{ "Chatter_InCombat", Chatter::InCombat, kMaxChatterRepeatInterval }, { "Chatter_InCombat", Chatter::InCombat, kMaxChatterRepeatInterval },

View file

@ -255,6 +255,12 @@ void MessageDispatcher::netMsgStatusIcon () {
// try to equip in buyzone // try to equip in buyzone
m_bot->enteredBuyZone (BuyState::PrimaryWeapon); 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) { else if (cached & StatusIconCache::VipSafety) {
m_bot->m_inVIPZone = (m_args[enabled].long_ != 0); m_bot->m_inVIPZone = (m_args[enabled].long_ != 0);
} }
@ -491,6 +497,8 @@ MessageDispatcher::MessageDispatcher () {
// register status icon cache // register status icon cache
m_statusIconCache["buyzone"] = StatusIconCache::NeedHandle | StatusIconCache::BuyZone; 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["vipsafety"] = StatusIconCache::NeedHandle | StatusIconCache::VipSafety;
m_statusIconCache["c4"] = StatusIconCache::NeedHandle | StatusIconCache::C4; m_statusIconCache["c4"] = StatusIconCache::NeedHandle | StatusIconCache::C4;

View file

@ -190,7 +190,6 @@ void Bot::normal_ () {
// decide to duck or not to duck // decide to duck or not to duck
selectCampButtons (index); selectCampButtons (index);
pushChatterMessage (Chatter::GoingToGuardVIPSafety); // play info about that
} }
} }