This commit is contained in:
INeedBots 2021-01-18 13:20:58 -06:00
parent 337c9bb587
commit 80bbdf5aac
2 changed files with 28 additions and 21 deletions

View File

@ -665,7 +665,7 @@ bot_use_supply_drop( weapon )
self thread changeToWeapon(self.lastNonKillstreakWeapon); self thread changeToWeapon(self.lastNonKillstreakWeapon);
if (ret == "grenade_fire" && randomInt(100) < 80) if (ret == "grenade_fire" && randomInt(100) < 80 && !self HasScriptGoal() && !self.bot_lock_goal)
self waittill_any_timeout( 15, "bot_crate_landed" ); self waittill_any_timeout( 15, "bot_crate_landed" );
} }
@ -1236,16 +1236,15 @@ bot_equipment_kill_think()
for ( ;; ) for ( ;; )
{ {
hasHacker = self HasPerk( "specialty_showenemyequipment" ); wait RandomIntRange( 1, 3 );
if ( hasHacker )
wait( RandomIntRange( 2, 5 ) );
else
wait( RandomIntRange( 5, 7 ) );
if(isDefined(self GetThreat()) || self IsRemoteControlling() || self UseButtonPressed()) if(isDefined(self GetThreat()) || self IsRemoteControlling() || self UseButtonPressed())
continue; continue;
grenades = GetEntArray( "grenade", "classname" ); grenades = GetEntArray( "grenade", "classname" );
hasHacker = self HasPerk( "specialty_showenemyequipment" );
myEye = self getEye();
myAngles = self getPlayerAngles();
target = undefined; target = undefined;
for ( i = 0; i < grenades.size; i++ ) for ( i = 0; i < grenades.size; i++ )
@ -1286,14 +1285,13 @@ bot_equipment_kill_think()
if(item.bots >= 2) if(item.bots >= 2)
continue; continue;
dist = DistanceSquared( item.origin, self.origin ); if (!hasHacker && !BulletTracePassed(myEye, item.origin, false, item))
if ( hasHacker && dist < 512 * 512 ) continue;
{
target = item;
break;
}
if ( dist < 256 * 256 ) if(getConeDot(item.origin, self.origin, myAngles) < 0.6)
continue;
if ( DistanceSquared( item.origin, self.origin ) < 512 * 512 )
{ {
target = item; target = item;
break; break;
@ -1327,15 +1325,14 @@ bot_equipment_kill_think()
if(player.tacticalInsertion.bots >= 2) if(player.tacticalInsertion.bots >= 2)
continue; continue;
dist = DistanceSquared( player.tacticalInsertion.origin, self.origin );
if ( hasHacker && dist < 512 * 512 )
{
target = player.tacticalInsertion;
break;
}
if ( dist < 256 * 256 ) if (!hasHacker && !BulletTracePassed(myEye, player.tacticalInsertion.origin, false, player.tacticalInsertion))
continue;
if(getConeDot(player.tacticalInsertion.origin, self.origin, myAngles) < 0.6)
continue;
if ( DistanceSquared( player.tacticalInsertion.origin, self.origin ) < 512 * 512 )
{ {
target = player.tacticalInsertion; target = player.tacticalInsertion;
break; break;

View File

@ -300,6 +300,16 @@ doExtraCheck()
maps\mp\bots\_bot_script::checkTheBots(); maps\mp\bots\_bot_script::checkTheBots();
} }
/*
Returns the cone dot (like fov, or distance from the center of our screen).
*/
getConeDot(to, from, dir)
{
dirToTarget = VectorNormalize(to-from);
forward = AnglesToForward(dir);
return vectordot(dirToTarget, forward);
}
/* /*
Fixes sd bomb planting Fixes sd bomb planting
*/ */