mirror of
https://github.com/ineedbots/t6_bot_warfare.git
synced 2025-04-20 17:25:42 +00:00
Bots use altmode
This commit is contained in:
parent
d91b4805a0
commit
0eec406277
@ -6,9 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include maps\mp\gametypes\_globallogic_utils;
|
#include maps\mp\gametypes\_globallogic_utils;
|
||||||
#include maps\mp\bots\_bot_combat;
|
|
||||||
#include maps\mp\bots\_bot;
|
|
||||||
#include maps\mp\gametypes\_gameobjects;
|
|
||||||
#include maps\mp\_utility;
|
#include maps\mp\_utility;
|
||||||
#include common_scripts\utility;
|
#include common_scripts\utility;
|
||||||
|
|
||||||
@ -703,9 +700,12 @@ onBotSpawned()
|
|||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
self waittill( "spawned_player" );
|
self waittill( "spawned_player" );
|
||||||
|
self BotBuiltinClearOverrides( true );
|
||||||
|
self BotBuiltinWeaponOverride( self getCurrentWeapon() );
|
||||||
|
|
||||||
self thread watch_for_override_stuff();
|
self thread watch_for_override_stuff();
|
||||||
self thread watch_for_melee_override();
|
self thread watch_for_melee_override();
|
||||||
|
self thread bot_watch_think_mw2();
|
||||||
self BotNotifyBotEvent( "debug", "we spawned!" );
|
self BotNotifyBotEvent( "debug", "we spawned!" );
|
||||||
|
|
||||||
waittillframeend;
|
waittillframeend;
|
||||||
@ -717,6 +717,70 @@ onBotSpawned()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Gets a GL
|
||||||
|
*/
|
||||||
|
getValidTube()
|
||||||
|
{
|
||||||
|
weaps = self getweaponslist( true );
|
||||||
|
|
||||||
|
for ( i = 0; i < weaps.size; i++ )
|
||||||
|
{
|
||||||
|
weap = weaps[i];
|
||||||
|
|
||||||
|
if ( !self GetAmmoCount( weap ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( !isstrstart( weap, "gl_" ) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return weap;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bots play mw2
|
||||||
|
*/
|
||||||
|
bot_watch_think_mw2()
|
||||||
|
{
|
||||||
|
self endon( "disconnect" );
|
||||||
|
self endon( "death" );
|
||||||
|
level endon( "game_ended" );
|
||||||
|
|
||||||
|
for ( ;; )
|
||||||
|
{
|
||||||
|
wait randomIntRange( 1, 4 );
|
||||||
|
|
||||||
|
if ( self IsRemoteControlling() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ( self maps\mp\bots\_bot_combat::bot_has_enemy() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
tube = self getValidTube();
|
||||||
|
|
||||||
|
if ( !isDefined( tube ) )
|
||||||
|
{
|
||||||
|
if ( self GetAmmoCount( "usrpg_mp" ) )
|
||||||
|
tube = "usrpg_mp";
|
||||||
|
else if ( self GetAmmoCount( "smaw_mp" ) )
|
||||||
|
tube = "smaw_mp";
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( self GetCurrentWeapon() == tube )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ( randomInt( 100 ) > 35 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
self switchtoweapon( tube );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
custom movement stuff
|
custom movement stuff
|
||||||
*/
|
*/
|
||||||
@ -725,8 +789,6 @@ watch_for_melee_override()
|
|||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
self endon( "death" );
|
self endon( "death" );
|
||||||
|
|
||||||
self BotBuiltinClearMeleeParams();
|
|
||||||
|
|
||||||
for ( ;; )
|
for ( ;; )
|
||||||
{
|
{
|
||||||
while ( ( !self maps\mp\bots\_bot_combat::threat_is_player() && !self maps\mp\bots\_bot_combat::threat_is_dog() ) || self IsRemoteControlling() || !self HasWeapon( "knife_mp" ) || !getDvarInt( "aim_automelee_enabled" ) )
|
while ( ( !self maps\mp\bots\_bot_combat::threat_is_player() && !self maps\mp\bots\_bot_combat::threat_is_dog() ) || self IsRemoteControlling() || !self HasWeapon( "knife_mp" ) || !getDvarInt( "aim_automelee_enabled" ) )
|
||||||
@ -782,8 +844,6 @@ watch_for_override_stuff()
|
|||||||
self endon( "disconnect" );
|
self endon( "disconnect" );
|
||||||
self endon( "death" );
|
self endon( "death" );
|
||||||
|
|
||||||
self BotBuiltinClearOverrides( true );
|
|
||||||
|
|
||||||
NEAR_DIST = 80;
|
NEAR_DIST = 80;
|
||||||
LONG_DIST = 1000;
|
LONG_DIST = 1000;
|
||||||
SPAM_JUMP_TIME = 5000;
|
SPAM_JUMP_TIME = 5000;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user