add: teamkill chatter event
This commit is contained in:
parent
2d2ca5fd22
commit
da574c11b3
4 changed files with 36 additions and 30 deletions
|
|
@ -190,6 +190,7 @@ CR_DECLARE_SCOPED_ENUM (Chatter,
|
||||||
GoingToCamp,
|
GoingToCamp,
|
||||||
HeardNoise,
|
HeardNoise,
|
||||||
TeamAttack,
|
TeamAttack,
|
||||||
|
TeamKill,
|
||||||
ReportingIn,
|
ReportingIn,
|
||||||
GuardingDroppedC4,
|
GuardingDroppedC4,
|
||||||
Camping,
|
Camping,
|
||||||
|
|
@ -449,7 +450,7 @@ constexpr float kInfiniteDistance = 9999999.0f;
|
||||||
constexpr float kGrenadeCheckTime = 2.15f;
|
constexpr float kGrenadeCheckTime = 2.15f;
|
||||||
constexpr float kSprayDistance = 260.0f;
|
constexpr float kSprayDistance = 260.0f;
|
||||||
constexpr float kDoubleSprayDistance = kSprayDistance * 2;
|
constexpr float kDoubleSprayDistance = kSprayDistance * 2;
|
||||||
constexpr float kMaxChatterRepeatInteval = 99.0f;
|
constexpr float kMaxChatterRepeatInterval = 99.0f;
|
||||||
|
|
||||||
constexpr int kInfiniteDistanceLong = static_cast <int> (kInfiniteDistance);
|
constexpr int kInfiniteDistanceLong = static_cast <int> (kInfiniteDistance);
|
||||||
constexpr int kMaxNodeLinks = 8;
|
constexpr int kMaxNodeLinks = 8;
|
||||||
|
|
|
||||||
|
|
@ -1029,8 +1029,8 @@ void Bot::pushChatterMessage (int message) {
|
||||||
auto messageRepeat = conf.getChatterMessageRepeatInterval (message);
|
auto messageRepeat = conf.getChatterMessageRepeatInterval (message);
|
||||||
auto &messageTimer = m_chatterTimes[message];
|
auto &messageTimer = m_chatterTimes[message];
|
||||||
|
|
||||||
if (messageTimer < game.time () || cr::fequal (messageTimer, kMaxChatterRepeatInteval)) {
|
if (messageTimer < game.time () || cr::fequal (messageTimer, kMaxChatterRepeatInterval)) {
|
||||||
if (!cr::fequal (messageRepeat, kMaxChatterRepeatInteval)) {
|
if (!cr::fequal (messageRepeat, kMaxChatterRepeatInterval)) {
|
||||||
messageTimer = game.time () + messageRepeat;
|
messageTimer = game.time () + messageRepeat;
|
||||||
}
|
}
|
||||||
sendMessage = true;
|
sendMessage = true;
|
||||||
|
|
|
||||||
|
|
@ -229,46 +229,46 @@ void BotConfig::loadChatterConfig () {
|
||||||
int code;
|
int code;
|
||||||
float repeat;
|
float repeat;
|
||||||
} chatterEventMap[] = {
|
} chatterEventMap[] = {
|
||||||
{ "Radio_CoverMe", Radio::CoverMe, kMaxChatterRepeatInteval },
|
{ "Radio_CoverMe", Radio::CoverMe, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_YouTakePoint", Radio::YouTakeThePoint, kMaxChatterRepeatInteval },
|
{ "Radio_YouTakePoint", Radio::YouTakeThePoint, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_HoldPosition", Radio::HoldThisPosition, 10.0f },
|
{ "Radio_HoldPosition", Radio::HoldThisPosition, 10.0f },
|
||||||
{ "Radio_RegroupTeam", Radio::RegroupTeam, 10.0f },
|
{ "Radio_RegroupTeam", Radio::RegroupTeam, 10.0f },
|
||||||
{ "Radio_FollowMe", Radio::FollowMe, 15.0f },
|
{ "Radio_FollowMe", Radio::FollowMe, 15.0f },
|
||||||
{ "Radio_TakingFire", Radio::TakingFireNeedAssistance, 5.0f },
|
{ "Radio_TakingFire", Radio::TakingFireNeedAssistance, 5.0f },
|
||||||
{ "Radio_GoGoGo", Radio::GoGoGo, kMaxChatterRepeatInteval },
|
{ "Radio_GoGoGo", Radio::GoGoGo, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_Fallback", Radio::TeamFallback, kMaxChatterRepeatInteval },
|
{ "Radio_Fallback", Radio::TeamFallback, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_StickTogether", Radio::StickTogetherTeam, kMaxChatterRepeatInteval },
|
{ "Radio_StickTogether", Radio::StickTogetherTeam, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_GetInPosition", Radio::GetInPositionAndWaitForGo, kMaxChatterRepeatInteval },
|
{ "Radio_GetInPosition", Radio::GetInPositionAndWaitForGo, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_StormTheFront", Radio::StormTheFront, kMaxChatterRepeatInteval },
|
{ "Radio_StormTheFront", Radio::StormTheFront, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_ReportTeam", Radio::ReportInTeam, kMaxChatterRepeatInteval },
|
{ "Radio_ReportTeam", Radio::ReportInTeam, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_Affirmative", Radio::RogerThat, kMaxChatterRepeatInteval },
|
{ "Radio_Affirmative", Radio::RogerThat, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_EnemySpotted", Radio::EnemySpotted, 4.0f },
|
{ "Radio_EnemySpotted", Radio::EnemySpotted, 4.0f },
|
||||||
{ "Radio_NeedBackup", Radio::NeedBackup, 5.0f },
|
{ "Radio_NeedBackup", Radio::NeedBackup, 5.0f },
|
||||||
{ "Radio_SectorClear", Radio::SectorClear, 10.0f },
|
{ "Radio_SectorClear", Radio::SectorClear, 10.0f },
|
||||||
{ "Radio_InPosition", Radio::ImInPosition, 10.0f },
|
{ "Radio_InPosition", Radio::ImInPosition, 10.0f },
|
||||||
{ "Radio_ReportingIn", Radio::ReportingIn, 3.0f },
|
{ "Radio_ReportingIn", Radio::ReportingIn, 3.0f },
|
||||||
{ "Radio_ShesGonnaBlow", Radio::ShesGonnaBlow, kMaxChatterRepeatInteval },
|
{ "Radio_ShesGonnaBlow", Radio::ShesGonnaBlow, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_Negative", Radio::Negative, kMaxChatterRepeatInteval },
|
{ "Radio_Negative", Radio::Negative, kMaxChatterRepeatInterval },
|
||||||
{ "Radio_EnemyDown", Radio::EnemyDown, 10.0f },
|
{ "Radio_EnemyDown", Radio::EnemyDown, 10.0f },
|
||||||
{ "Chatter_DiePain", Chatter::DiePain, kMaxChatterRepeatInteval },
|
{ "Chatter_DiePain", Chatter::DiePain, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_GoingToPlantBomb", Chatter::GoingToPlantBomb, 5.0f },
|
{ "Chatter_GoingToPlantBomb", Chatter::GoingToPlantBomb, 5.0f },
|
||||||
{ "Chatter_GoingToGuardVIPSafety", Chatter::GoingToGuardVIPSafety, kMaxChatterRepeatInteval },
|
{ "Chatter_GoingToGuardVIPSafety", Chatter::GoingToGuardVIPSafety, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_RescuingHostages", Chatter::RescuingHostages, kMaxChatterRepeatInteval },
|
{ "Chatter_RescuingHostages", Chatter::RescuingHostages, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_TeamKill", Chatter::FriendlyFire, kMaxChatterRepeatInteval },
|
{ "Chatter_TeamKill", Chatter::TeamKill, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_GuardingVipSafety", Chatter::GuardingVIPSafety, kMaxChatterRepeatInteval },
|
{ "Chatter_GuardingVipSafety", Chatter::GuardingVIPSafety, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_PlantingC4", Chatter::PlantingBomb, 10.0f },
|
{ "Chatter_PlantingC4", Chatter::PlantingBomb, 10.0f },
|
||||||
{ "Chatter_InCombat", Chatter::InCombat, kMaxChatterRepeatInteval },
|
{ "Chatter_InCombat", Chatter::InCombat, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_SeeksEnemy", Chatter::SeekingEnemies, kMaxChatterRepeatInteval },
|
{ "Chatter_SeeksEnemy", Chatter::SeekingEnemies, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_Nothing", Chatter::Nothing, kMaxChatterRepeatInteval },
|
{ "Chatter_Nothing", Chatter::Nothing, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_EnemyDown", Chatter::EnemyDown, 10.0f },
|
{ "Chatter_EnemyDown", Chatter::EnemyDown, 10.0f },
|
||||||
{ "Chatter_UseHostage", Chatter::UsingHostages, kMaxChatterRepeatInteval },
|
{ "Chatter_UseHostage", Chatter::UsingHostages, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_WonTheRound", Chatter::WonTheRound, kMaxChatterRepeatInteval },
|
{ "Chatter_WonTheRound", Chatter::WonTheRound, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_QuicklyWonTheRound", Chatter::QuickWonRound, kMaxChatterRepeatInteval },
|
{ "Chatter_QuicklyWonTheRound", Chatter::QuickWonRound, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_NoEnemiesLeft", Chatter::NoEnemiesLeft, kMaxChatterRepeatInteval },
|
{ "Chatter_NoEnemiesLeft", Chatter::NoEnemiesLeft, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_FoundBombPlace", Chatter::FoundC4Plant, 15.0f },
|
{ "Chatter_FoundBombPlace", Chatter::FoundC4Plant, 15.0f },
|
||||||
{ "Chatter_WhereIsTheBomb", Chatter::WhereIsTheC4, kMaxChatterRepeatInteval },
|
{ "Chatter_WhereIsTheBomb", Chatter::WhereIsTheC4, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_DefendingBombSite", Chatter::DefendingBombsite, kMaxChatterRepeatInteval },
|
{ "Chatter_DefendingBombSite", Chatter::DefendingBombsite, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_BarelyDefused", Chatter::BarelyDefused, kMaxChatterRepeatInteval },
|
{ "Chatter_BarelyDefused", Chatter::BarelyDefused, kMaxChatterRepeatInterval },
|
||||||
{ "Chatter_NiceshotCommander", Chatter::NiceShotCommander, 10.0f },
|
{ "Chatter_NiceshotCommander", Chatter::NiceShotCommander, 10.0f },
|
||||||
{ "Chatter_ReportingIn", Chatter::ReportingIn, 10.0f },
|
{ "Chatter_ReportingIn", Chatter::ReportingIn, 10.0f },
|
||||||
{ "Chatter_SpotTheBomber", Chatter::SpotTheBomber, 4.3f },
|
{ "Chatter_SpotTheBomber", Chatter::SpotTheBomber, 4.3f },
|
||||||
|
|
|
||||||
|
|
@ -1195,6 +1195,11 @@ void BotManager::handleDeath (edict_t *killer, edict_t *victim) {
|
||||||
if (victimBot != nullptr) {
|
if (victimBot != nullptr) {
|
||||||
if (killerTeam == victimBot->m_team) {
|
if (killerTeam == victimBot->m_team) {
|
||||||
victimBot->m_voteKickIndex = game.indexOfEntity (killer);
|
victimBot->m_voteKickIndex = game.indexOfEntity (killer);
|
||||||
|
for (const auto ¬ify : bots) {
|
||||||
|
if (notify->seesEntity (victim->v.origin)) {
|
||||||
|
notify->pushChatterMessage (Chatter::TeamKill);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
victimBot->m_notKilled = false;
|
victimBot->m_notKilled = false;
|
||||||
}
|
}
|
||||||
|
|
@ -1314,7 +1319,7 @@ void Bot::newRound () {
|
||||||
m_hostages.clear ();
|
m_hostages.clear ();
|
||||||
|
|
||||||
for (auto &timer : m_chatterTimes) {
|
for (auto &timer : m_chatterTimes) {
|
||||||
timer = kMaxChatterRepeatInteval;
|
timer = kMaxChatterRepeatInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isReloading = false;
|
m_isReloading = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue