latest pluto, bots can now dropshot and jumpshot

This commit is contained in:
ineed bots
2023-06-19 15:55:58 -06:00
parent 4d4a636e25
commit 9c1a445198
2 changed files with 88 additions and 12 deletions

View File

@ -12,6 +12,15 @@
#include maps\mp\_utility;
#include common_scripts\utility;
/*
Replace func stuff
*/
main()
{
// fix bot grenade launcher usage
replaceFunc( maps\mp\bots\_bot_combat::bot_should_hip_fire, ::bot_should_hip_fire_replaced );
}
/*
Entry point to the bots
*/
@ -92,6 +101,65 @@ init()
thread handleBots();
}
/*
Fixes gl usage
*/
bot_should_hip_fire_replaced()
{
enemy = self.bot.threat.entity;
weapon = self getcurrentweapon();
if ( weapon == "none" )
return 0;
if ( weaponisdualwield( weapon ) )
return 1;
class = weaponclass( weapon );
if ( isplayer( enemy ) && class == "spread" )
return 1;
if ( class == "grenade" ) // added
return 1;
distsq = distancesquared( self.origin, enemy.origin );
distcheck = 0;
switch ( class )
{
case "mg":
distcheck = 250;
break;
case "smg":
distcheck = 350;
break;
case "spread":
distcheck = 400;
break;
case "pistol":
distcheck = 200;
break;
case "rocketlauncher":
distcheck = 0;
break;
case "rifle":
default:
distcheck = 300;
break;
}
if ( isweaponscopeoverlay( weapon ) )
distcheck = 500;
return distsq < distcheck * distcheck;
}
/*
Adds sd to bot logic
*/
@ -681,11 +749,7 @@ getConeDot( to, from, dir )
return vectordot( dirToTarget, forward );
}
botMovementOverride( a, b ) {}
botClearMovementOverride() {}
botClearButtonOverride( a ) {}
botButtonOverride( a, b ) {}
botClearOverrides( a ) {}
/*
custom movement stuff