Do not spraypaint if just saw or suspecting enemy.
Add yb_stab_close_enemies, to allow or dissallow sneak enemies with knife if close enough.
This commit is contained in:
parent
e2dbd6d91e
commit
a41a656164
2 changed files with 4 additions and 4 deletions
|
|
@ -391,7 +391,7 @@ void Bot::checkBreakable (edict_t *touch) {
|
||||||
m_breakableEntity = lookupBreakable ();
|
m_breakableEntity = lookupBreakable ();
|
||||||
|
|
||||||
if (game.isNullEntity (m_breakableEntity)) {
|
if (game.isNullEntity (m_breakableEntity)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_campButtons = pev->button & IN_DUCK;
|
m_campButtons = pev->button & IN_DUCK;
|
||||||
startTask (Task::ShootBreakable, TaskPri::ShootBreakable, kInvalidNodeIndex, 0.0f, false);
|
startTask (Task::ShootBreakable, TaskPri::ShootBreakable, kInvalidNodeIndex, 0.0f, false);
|
||||||
|
|
@ -3038,7 +3038,7 @@ void Bot::normal_ () {
|
||||||
m_prevGoalIndex = kInvalidNodeIndex;
|
m_prevGoalIndex = kInvalidNodeIndex;
|
||||||
|
|
||||||
// spray logo sometimes if allowed to do so
|
// spray logo sometimes if allowed to do so
|
||||||
if (m_timeLogoSpray < game.time () && yb_spraypaints.bool_ () && rg.chance (60) && m_moveSpeed > getShiftSpeed () && game.isNullEntity (m_pickupItem)) {
|
if (!(m_states & (Sense::SeeingEnemy | Sense::SuspectEnemy)) && m_seeEnemyTime + 5.0f < game.time () && !m_reloadState && m_timeLogoSpray < game.time () && yb_spraypaints.bool_ () && rg.chance (50) && m_moveSpeed > getShiftSpeed () && game.isNullEntity (m_pickupItem)) {
|
||||||
if (!(game.mapIs (MapFlags::Demolition) && bots.isBombPlanted () && m_team == Team::CT)) {
|
if (!(game.mapIs (MapFlags::Demolition) && bots.isBombPlanted () && m_team == Team::CT)) {
|
||||||
startTask (Task::Spraypaint, TaskPri::Spraypaint, kInvalidNodeIndex, game.time () + 1.0f, false);
|
startTask (Task::Spraypaint, TaskPri::Spraypaint, kInvalidNodeIndex, game.time () + 1.0f, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
ConVar yb_shoots_thru_walls ("yb_shoots_thru_walls", "2", "Specifies whether bots able to fire at enemies behind the wall, if they hearing or suspecting them.", true, 0.0f, 3.0f);
|
ConVar yb_shoots_thru_walls ("yb_shoots_thru_walls", "2", "Specifies whether bots able to fire at enemies behind the wall, if they hearing or suspecting them.", true, 0.0f, 3.0f);
|
||||||
ConVar yb_ignore_enemies ("yb_ignore_enemies", "0", "Enables or disables searching world for enemies.");
|
ConVar yb_ignore_enemies ("yb_ignore_enemies", "0", "Enables or disables searching world for enemies.");
|
||||||
ConVar yb_check_enemy_rendering ("yb_check_enemy_rendering", "0", "Enables or disables checking enemy rendering flags. Useful for some mods.");
|
ConVar yb_check_enemy_rendering ("yb_check_enemy_rendering", "0", "Enables or disables checking enemy rendering flags. Useful for some mods.");
|
||||||
|
ConVar yb_stab_close_enemies ("yb_stab_close_enemies", "1", "Enables or disables bot ability to stab the enemy with knife if bot is in good condition.");
|
||||||
ConVar mp_friendlyfire ("mp_friendlyfire", nullptr, Var::NoRegister);
|
ConVar mp_friendlyfire ("mp_friendlyfire", nullptr, Var::NoRegister);
|
||||||
|
|
||||||
int Bot::numFriendsNear (const Vector &origin, float radius) {
|
int Bot::numFriendsNear (const Vector &origin, float radius) {
|
||||||
|
|
@ -883,7 +883,7 @@ void Bot::fireWeapons () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// use knife if near and good difficulty (l33t dude!)
|
// use knife if near and good difficulty (l33t dude!)
|
||||||
if (m_difficulty >= 3 && pev->health > 80.0f && !game.isNullEntity (enemy) && pev->health >= enemy->v.health && distance < 100.0f && !isOnLadder () && !isGroupOfEnemies (pev->origin)) {
|
if (yb_stab_close_enemies.bool_ () && m_difficulty >= 3 && pev->health > 80.0f && !game.isNullEntity (enemy) && pev->health >= enemy->v.health && distance < 100.0f && !isOnLadder () && !isGroupOfEnemies (pev->origin)) {
|
||||||
selectWeapons (distance, selectIndex, selectId, choosenWeapon);
|
selectWeapons (distance, selectIndex, selectId, choosenWeapon);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue