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