ok update to date with cod4

This commit is contained in:
INeedBots 2020-11-25 16:37:46 -06:00
parent 465c917248
commit cef1ee2a66
2 changed files with 84 additions and 2 deletions

View File

@ -8,7 +8,7 @@
*/
init()
{
level.bw_VERSION = "1.0.0";
level.bw_VERSION = "2.0.0";
if(getDvar("bots_main") == "")
setDvar("bots_main", true);
@ -59,6 +59,25 @@ init()
if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand
setDvar("bots_loadout_allow_op", true);
if(getDvar("bots_play_move") == "")//bots move
setDvar("bots_play_move", true);
if(getDvar("bots_play_knife") == "")//bots knife
setDvar("bots_play_knife", true);
if(getDvar("bots_play_fire") == "")//bots fire
setDvar("bots_play_fire", true);
if(getDvar("bots_play_nade") == "")//bots grenade
setDvar("bots_play_nade", true);
if(getDvar("bots_play_obj") == "")//bots play the obj
setDvar("bots_play_obj", true);
if(getDvar("bots_play_camp") == "")//bots camp and follow
setDvar("bots_play_camp", true);
if(getDvar("bots_play_jumpdrop") == "")//bots jump and dropshot
setDvar("bots_play_jumpdrop", true);
if(getDvar("bots_play_target_other") == "")//bot target non play ents (vehicles)
setDvar("bots_play_target_other", true);
if(getDvar("bots_play_killstreak") == "")//bot use killstreaks
setDvar("bots_play_killstreak", true);
level.defuseObject = undefined;
level.bots_smokeList = List();
level.tbl_PerkData[0]["reference_full"] = true;

View File

@ -338,6 +338,22 @@ isArtShocked()
return (isDefined(self.beingArtilleryShellshocked) && self.beingArtilleryShellshocked);
}
/*
If the player is carrying a bomb
*/
isBombCarrier()
{
return (isDefined(self.isBombCarrier) && self.isBombCarrier);
}
/*
If the site is in use
*/
isInUse()
{
return (isDefined(self.inUse) && self.inUse);
}
/*
Returns a valid grenade launcher weapon
*/
@ -414,6 +430,53 @@ GetEyePos()
return self getTagOrigin("tag_eye");
}
/*
Taken from iw4 script
*/
waittill_any_timeout( timeOut, string1, string2, string3, string4, string5 )
{
if ( ( !isdefined( string1 ) || string1 != "death" ) &&
( !isdefined( string2 ) || string2 != "death" ) &&
( !isdefined( string3 ) || string3 != "death" ) &&
( !isdefined( string4 ) || string4 != "death" ) &&
( !isdefined( string5 ) || string5 != "death" ) )
self endon( "death" );
ent = spawnstruct();
if ( isdefined( string1 ) )
self thread waittill_string( string1, ent );
if ( isdefined( string2 ) )
self thread waittill_string( string2, ent );
if ( isdefined( string3 ) )
self thread waittill_string( string3, ent );
if ( isdefined( string4 ) )
self thread waittill_string( string4, ent );
if ( isdefined( string5 ) )
self thread waittill_string( string5, ent );
ent thread _timeout( timeOut );
ent waittill( "returned", msg );
ent notify( "die" );
return msg;
}
/*
Used for waittill_any_timeout
*/
_timeout( delay )
{
self endon( "die" );
wait( delay );
self notify( "returned", "timeout" );
}
/*
Returns if we have the create a class object unlocked.
*/
@ -1544,7 +1607,7 @@ AStarSearch(start, goal, team, greedy_path)
// have certain types of nodes more expensive
if (childtype == "climb" || childtype == "prone")
penalty++;
penalty += 4;
//calc the total path we have took
newg = bestNode.g + DistanceSquared(nodeorg, childorg)*penalty;//bots on same team's path are more expensive