mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-19 21:12:52 +00:00
comment spacing format
This commit is contained in:
parent
26c982e3db
commit
10e0d2eb7d
@ -37,77 +37,77 @@ init()
|
||||
|
||||
if ( getDvar( "bots_main_GUIDs" ) == "" )
|
||||
{
|
||||
setDvar( "bots_main_GUIDs", "" ); //guids of players who will be given host powers, comma seperated
|
||||
setDvar( "bots_main_GUIDs", "" ); // guids of players who will be given host powers, comma seperated
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_main_firstIsHost" ) == "" )
|
||||
{
|
||||
setDvar( "bots_main_firstIsHost", false ); //first play to connect is a host
|
||||
setDvar( "bots_main_firstIsHost", false ); // first play to connect is a host
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_main_waitForHostTime" ) == "" )
|
||||
{
|
||||
setDvar( "bots_main_waitForHostTime", 10.0 ); //how long to wait to wait for the host player
|
||||
setDvar( "bots_main_waitForHostTime", 10.0 ); // how long to wait to wait for the host player
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_main_kickBotsAtEnd" ) == "" )
|
||||
{
|
||||
setDvar( "bots_main_kickBotsAtEnd", false ); //kicks the bots at game end
|
||||
setDvar( "bots_main_kickBotsAtEnd", false ); // kicks the bots at game end
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_manage_add" ) == "" )
|
||||
{
|
||||
setDvar( "bots_manage_add", 0 ); //amount of bots to add to the game
|
||||
setDvar( "bots_manage_add", 0 ); // amount of bots to add to the game
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_manage_fill" ) == "" )
|
||||
{
|
||||
setDvar( "bots_manage_fill", 0 ); //amount of bots to maintain
|
||||
setDvar( "bots_manage_fill", 0 ); // amount of bots to maintain
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_manage_fill_spec" ) == "" )
|
||||
{
|
||||
setDvar( "bots_manage_fill_spec", true ); //to count for fill if player is on spec team
|
||||
setDvar( "bots_manage_fill_spec", true ); // to count for fill if player is on spec team
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_manage_fill_mode" ) == "" )
|
||||
{
|
||||
setDvar( "bots_manage_fill_mode", 0 ); //fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
|
||||
setDvar( "bots_manage_fill_mode", 0 ); // fill mode, 0 adds everyone, 1 just bots, 2 maintains at maps, 3 is 2 with 1
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_manage_fill_kick" ) == "" )
|
||||
{
|
||||
setDvar( "bots_manage_fill_kick", false ); //kick bots if too many
|
||||
setDvar( "bots_manage_fill_kick", false ); // kick bots if too many
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_team" ) == "" )
|
||||
{
|
||||
setDvar( "bots_team", "autoassign" ); //which team for bots to join
|
||||
setDvar( "bots_team", "autoassign" ); // which team for bots to join
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_team_amount" ) == "" )
|
||||
{
|
||||
setDvar( "bots_team_amount", 0 ); //amount of bots on axis team
|
||||
setDvar( "bots_team_amount", 0 ); // amount of bots on axis team
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_team_force" ) == "" )
|
||||
{
|
||||
setDvar( "bots_team_force", false ); //force bots on team
|
||||
setDvar( "bots_team_force", false ); // force bots on team
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_team_mode" ) == "" )
|
||||
{
|
||||
setDvar( "bots_team_mode", 0 ); //counts just bots when 1
|
||||
setDvar( "bots_team_mode", 0 ); // counts just bots when 1
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_skill" ) == "" )
|
||||
{
|
||||
setDvar( "bots_skill", 0 ); //0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
|
||||
setDvar( "bots_skill", 0 ); // 0 is random, 1 is easy 7 is hard, 8 is custom, 9 is completely random
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_skill_axis_hard" ) == "" )
|
||||
{
|
||||
setDvar( "bots_skill_axis_hard", 0 ); //amount of hard bots on axis team
|
||||
setDvar( "bots_skill_axis_hard", 0 ); // amount of hard bots on axis team
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_skill_axis_med" ) == "" )
|
||||
@ -135,12 +135,12 @@ init()
|
||||
setDvar( "bots_skill_max", 7 );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_loadout_reasonable" ) == "" ) //filter out the bad 'guns' and perks
|
||||
if ( getDvar( "bots_loadout_reasonable" ) == "" ) // filter out the bad 'guns' and perks
|
||||
{
|
||||
setDvar( "bots_loadout_reasonable", false );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_loadout_allow_op" ) == "" ) //allows jug, marty and laststand
|
||||
if ( getDvar( "bots_loadout_allow_op" ) == "" ) // allows jug, marty and laststand
|
||||
{
|
||||
setDvar( "bots_loadout_allow_op", true );
|
||||
}
|
||||
@ -155,57 +155,57 @@ init()
|
||||
setDvar( "bots_loadout_prestige", -1 );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_move" ) == "" ) //bots move
|
||||
if ( getDvar( "bots_play_move" ) == "" ) // bots move
|
||||
{
|
||||
setDvar( "bots_play_move", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_knife" ) == "" ) //bots knife
|
||||
if ( getDvar( "bots_play_knife" ) == "" ) // bots knife
|
||||
{
|
||||
setDvar( "bots_play_knife", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_fire" ) == "" ) //bots fire
|
||||
if ( getDvar( "bots_play_fire" ) == "" ) // bots fire
|
||||
{
|
||||
setDvar( "bots_play_fire", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_nade" ) == "" ) //bots grenade
|
||||
if ( getDvar( "bots_play_nade" ) == "" ) // bots grenade
|
||||
{
|
||||
setDvar( "bots_play_nade", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_take_carepackages" ) == "" ) //bots take carepackages
|
||||
if ( getDvar( "bots_play_take_carepackages" ) == "" ) // bots take carepackages
|
||||
{
|
||||
setDvar( "bots_play_take_carepackages", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_obj" ) == "" ) //bots play the obj
|
||||
if ( getDvar( "bots_play_obj" ) == "" ) // bots play the obj
|
||||
{
|
||||
setDvar( "bots_play_obj", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_camp" ) == "" ) //bots camp and follow
|
||||
if ( getDvar( "bots_play_camp" ) == "" ) // bots camp and follow
|
||||
{
|
||||
setDvar( "bots_play_camp", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_jumpdrop" ) == "" ) //bots jump and dropshot
|
||||
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)
|
||||
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
|
||||
if ( getDvar( "bots_play_killstreak" ) == "" ) // bot use killstreaks
|
||||
{
|
||||
setDvar( "bots_play_killstreak", true );
|
||||
}
|
||||
|
||||
if ( getDvar( "bots_play_ads" ) == "" ) //bot ads
|
||||
if ( getDvar( "bots_play_ads" ) == "" ) // bot ads
|
||||
{
|
||||
setDvar( "bots_play_ads", true );
|
||||
}
|
||||
|
@ -1656,7 +1656,7 @@ aim_loop()
|
||||
{
|
||||
if ( isplay )
|
||||
{
|
||||
//better room to nade? cook time function with dist?
|
||||
// better room to nade? cook time function with dist?
|
||||
if ( !self.bot.isfraggingafter && !self.bot.issmokingafter && getDvarInt( "bots_play_nade" ) )
|
||||
{
|
||||
nade = self getValidGrenade();
|
||||
@ -2419,7 +2419,7 @@ doWalk( goal, dist, isScriptGoal )
|
||||
{
|
||||
level endon ( "game_ended" );
|
||||
self endon( "kill_goal" );
|
||||
self endon( "goal_internal" ); //so that the watchOnGoal notify can happen same frame, not a frame later
|
||||
self endon( "goal_internal" ); // so that the watchOnGoal notify can happen same frame, not a frame later
|
||||
|
||||
dist *= dist;
|
||||
|
||||
@ -2616,7 +2616,7 @@ doMantle()
|
||||
*/
|
||||
getRandomLargestStafe( dist )
|
||||
{
|
||||
//find a better algo?
|
||||
// find a better algo?
|
||||
traces = NewHeap( ::HeapTraceFraction );
|
||||
myOrg = self.origin + ( 0, 0, 16 );
|
||||
|
||||
|
@ -4171,7 +4171,7 @@ bot_turret_attack( enemy )
|
||||
return;
|
||||
}
|
||||
|
||||
//if ( !BulletTracePassed( self getEye(), enemy.origin + ( 0, 0, 15 ), false, enemy ) )
|
||||
// if ( !BulletTracePassed( self getEye(), enemy.origin + ( 0, 0, 15 ), false, enemy ) )
|
||||
// return;
|
||||
}
|
||||
}
|
||||
@ -5967,7 +5967,7 @@ bot_dom_cap_think_loop()
|
||||
|
||||
if ( flag.useObj.curProgress == cur )
|
||||
{
|
||||
break;//some enemy is near us, kill him
|
||||
break; // some enemy is near us, kill him
|
||||
}
|
||||
|
||||
self thread bot_do_random_action_for_objective( flag );
|
||||
@ -6064,10 +6064,10 @@ bot_hq_loop()
|
||||
gameobj = radio.gameobject;
|
||||
origin = ( radio.origin[ 0 ], radio.origin[ 1 ], radio.origin[ 2 ] + 5 );
|
||||
|
||||
//if neut or enemy
|
||||
// if neut or enemy
|
||||
if ( gameobj.ownerTeam != myTeam )
|
||||
{
|
||||
if ( gameobj.interactTeam == "none" ) //wait for it to become active
|
||||
if ( gameobj.interactTeam == "none" ) // wait for it to become active
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
{
|
||||
@ -6089,7 +6089,7 @@ bot_hq_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//capture it
|
||||
// capture it
|
||||
|
||||
self BotNotifyBotEvent( "hq", "go", "cap" );
|
||||
|
||||
@ -6127,7 +6127,7 @@ bot_hq_loop()
|
||||
|
||||
if ( cur == gameobj.curProgress )
|
||||
{
|
||||
break;//no prog made, enemy must be capping
|
||||
break; // no prog made, enemy must be capping
|
||||
}
|
||||
|
||||
self thread bot_do_random_action_for_objective( gameobj.trigger );
|
||||
@ -6138,9 +6138,9 @@ bot_hq_loop()
|
||||
|
||||
self BotNotifyBotEvent( "hq", "stop", "cap" );
|
||||
}
|
||||
else//we own it
|
||||
else // we own it
|
||||
{
|
||||
if ( gameobj.objPoints[ myteam ].isFlashing ) //underattack
|
||||
if ( gameobj.objPoints[ myteam ].isFlashing ) // underattack
|
||||
{
|
||||
self BotNotifyBotEvent( "hq", "start", "defend" );
|
||||
|
||||
@ -6314,7 +6314,7 @@ bot_sab_loop()
|
||||
if ( level.bombPlanted )
|
||||
{
|
||||
// kill defuser
|
||||
if ( site isInUse() ) //somebody is defusing our bomb we planted
|
||||
if ( site isInUse() ) // somebody is defusing our bomb we planted
|
||||
{
|
||||
self BotNotifyBotEvent( "sab", "start", "defuser" );
|
||||
|
||||
@ -6334,7 +6334,7 @@ bot_sab_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
return;
|
||||
@ -6433,7 +6433,7 @@ bot_sab_loop()
|
||||
// protect our site from planters
|
||||
if ( !level.bombPlanted )
|
||||
{
|
||||
//kill bomb carrier
|
||||
// kill bomb carrier
|
||||
if ( site.bots > 2 || randomInt( 100 ) < 45 )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -6459,12 +6459,12 @@ bot_sab_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//protect bomb site
|
||||
// protect bomb site
|
||||
origin = ( site.curorigin[ 0 ] + 50, site.curorigin[ 1 ] + 50, site.curorigin[ 2 ] + 5 );
|
||||
|
||||
self thread bot_inc_bots( site );
|
||||
|
||||
if ( site isInUse() ) //somebody is planting
|
||||
if ( site isInUse() ) // somebody is planting
|
||||
{
|
||||
self BotNotifyBotEvent( "sab", "start", "planter" );
|
||||
|
||||
@ -6485,7 +6485,7 @@ bot_sab_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
wait 4;
|
||||
@ -6664,7 +6664,7 @@ bot_sd_defenders_loop( data )
|
||||
{
|
||||
origin = ( bomb.curorigin[ 0 ], bomb.curorigin[ 1 ], bomb.curorigin[ 2 ] + 5 );
|
||||
|
||||
//hang around the bomb
|
||||
// hang around the bomb
|
||||
if ( self HasScriptGoal() )
|
||||
{
|
||||
return;
|
||||
@ -6722,7 +6722,7 @@ bot_sd_defenders_loop( data )
|
||||
|
||||
origin = ( site.curorigin[ 0 ] + 50, site.curorigin[ 1 ] + 50, site.curorigin[ 2 ] + 5 );
|
||||
|
||||
if ( site isInUse() ) //somebody is planting
|
||||
if ( site isInUse() ) // somebody is planting
|
||||
{
|
||||
self BotNotifyBotEvent( "sd", "start", "planter", site );
|
||||
|
||||
@ -6742,7 +6742,7 @@ bot_sd_defenders_loop( data )
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
return;
|
||||
@ -6898,7 +6898,7 @@ bot_sd_attackers_loop( data )
|
||||
myTeam = self.pers[ "team" ];
|
||||
otherTeam = getOtherTeam( myTeam );
|
||||
|
||||
//bomb planted
|
||||
// bomb planted
|
||||
if ( level.bombPlanted )
|
||||
{
|
||||
if ( !isDefined( level.defuseObject ) )
|
||||
@ -6910,7 +6910,7 @@ bot_sd_attackers_loop( data )
|
||||
|
||||
origin = ( site.curorigin[ 0 ], site.curorigin[ 1 ], site.curorigin[ 2 ] + 5 );
|
||||
|
||||
if ( site IsInUse() ) //somebody is defusing
|
||||
if ( site IsInUse() ) // somebody is defusing
|
||||
{
|
||||
self BotNotifyBotEvent( "sd", "start", "defuser" );
|
||||
|
||||
@ -6931,7 +6931,7 @@ bot_sd_attackers_loop( data )
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
return;
|
||||
@ -6952,7 +6952,7 @@ bot_sd_attackers_loop( data )
|
||||
timeleft = maps\mp\gametypes\_gamelogic::getTimeRemaining() / 1000;
|
||||
timepassed = getTimePassed() / 1000;
|
||||
|
||||
//dont have a bomb
|
||||
// dont have a bomb
|
||||
if ( !self IsBombCarrier() && !level.multiBomb )
|
||||
{
|
||||
if ( !isDefined( level.sdBomb ) )
|
||||
@ -6963,10 +6963,10 @@ bot_sd_attackers_loop( data )
|
||||
bomb = level.sdBomb;
|
||||
carrier = level.sdBomb.carrier;
|
||||
|
||||
//bomb is picked up
|
||||
// bomb is picked up
|
||||
if ( isDefined( carrier ) )
|
||||
{
|
||||
//escort the bomb carrier
|
||||
// escort the bomb carrier
|
||||
if ( self HasScriptGoal() )
|
||||
{
|
||||
return;
|
||||
@ -6997,7 +6997,7 @@ bot_sd_attackers_loop( data )
|
||||
|
||||
origin = ( bomb.curorigin[ 0 ], bomb.curorigin[ 1 ], bomb.curorigin[ 2 ] + 5 );
|
||||
|
||||
//hang around the bomb if other is going to go get it
|
||||
// hang around the bomb if other is going to go get it
|
||||
if ( bomb.bots > 1 )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -7162,9 +7162,9 @@ bot_cap_loop()
|
||||
{
|
||||
carrier = myflag.carrier;
|
||||
|
||||
if ( !isDefined( carrier ) ) //someone doesnt has our flag
|
||||
if ( !isDefined( carrier ) ) // someone doesnt has our flag
|
||||
{
|
||||
if ( !isDefined( theirflag.carrier ) && DistanceSquared( self.origin, theirflag.curorigin ) < DistanceSquared( self.origin, myflag.curorigin ) ) //no one has their flag and its closer
|
||||
if ( !isDefined( theirflag.carrier ) && DistanceSquared( self.origin, theirflag.curorigin ) < DistanceSquared( self.origin, myflag.curorigin ) ) // no one has their flag and its closer
|
||||
{
|
||||
self BotNotifyBotEvent( "cap", "start", "their_flag", theirflag );
|
||||
|
||||
@ -7172,7 +7172,7 @@ bot_cap_loop()
|
||||
|
||||
self BotNotifyBotEvent( "cap", "stop", "their_flag", theirflag );
|
||||
}
|
||||
else//go get it
|
||||
else // go get it
|
||||
{
|
||||
self BotNotifyBotEvent( "cap", "start", "my_flag", myflag );
|
||||
|
||||
@ -7187,7 +7187,7 @@ bot_cap_loop()
|
||||
{
|
||||
if ( theirflag maps\mp\gametypes\_gameobjects::isHome() && randomint( 100 ) < 50 )
|
||||
{
|
||||
//take their flag
|
||||
// take their flag
|
||||
self BotNotifyBotEvent( "cap", "start", "their_flag", theirflag );
|
||||
|
||||
self bot_cap_get_flag( theirflag );
|
||||
@ -7210,7 +7210,7 @@ bot_cap_loop()
|
||||
|
||||
if ( theirzone.bots > 2 || randomInt( 100 ) < 45 )
|
||||
{
|
||||
//kill carrier
|
||||
// kill carrier
|
||||
if ( carrier _hasPerk( "specialty_coldblooded" ) )
|
||||
{
|
||||
return;
|
||||
@ -7231,7 +7231,7 @@ bot_cap_loop()
|
||||
|
||||
self thread bot_inc_bots( theirzone );
|
||||
|
||||
//camp their zone
|
||||
// camp their zone
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
wait 4;
|
||||
@ -7251,11 +7251,11 @@ bot_cap_loop()
|
||||
}
|
||||
}
|
||||
}
|
||||
else//our flag is ok
|
||||
else // our flag is ok
|
||||
{
|
||||
if ( self isFlagCarrier() ) //if have flag
|
||||
if ( self isFlagCarrier() ) // if have flag
|
||||
{
|
||||
//go cap
|
||||
// go cap
|
||||
origin = myzone.curorigin;
|
||||
|
||||
self BotNotifyBotEvent( "cap", "start", "cap" );
|
||||
@ -7281,7 +7281,7 @@ bot_cap_loop()
|
||||
|
||||
carrier = theirflag.carrier;
|
||||
|
||||
if ( !isDefined( carrier ) ) //if no one has enemy flag
|
||||
if ( !isDefined( carrier ) ) // if no one has enemy flag
|
||||
{
|
||||
self BotNotifyBotEvent( "cap", "start", "their_flag", theirflag );
|
||||
|
||||
@ -7291,7 +7291,7 @@ bot_cap_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//escort them
|
||||
// escort them
|
||||
|
||||
if ( self HasScriptGoal() )
|
||||
{
|
||||
@ -7374,7 +7374,7 @@ bot_cap_get_flag( flag )
|
||||
{
|
||||
origin = flag.curorigin;
|
||||
|
||||
//go get it
|
||||
// go get it
|
||||
|
||||
self.bot_lock_goal = true;
|
||||
self SetScriptGoal( origin, 32 );
|
||||
@ -7404,7 +7404,7 @@ bot_cap_get_flag( flag )
|
||||
|
||||
if ( flag.curProgress == cur )
|
||||
{
|
||||
break;//some enemy is near us, kill him
|
||||
break; // some enemy is near us, kill him
|
||||
}
|
||||
}
|
||||
|
||||
@ -7486,9 +7486,9 @@ bot_dem_attackers_loop()
|
||||
myTeam = self.pers[ "team" ];
|
||||
otherTeam = getOtherTeam( myTeam );
|
||||
|
||||
bombs = [];//sites with bombs
|
||||
sites = [];//sites to bomb at
|
||||
bombed = 0;//exploded sites
|
||||
bombs = []; // sites with bombs
|
||||
sites = []; // sites to bomb at
|
||||
bombed = 0; // exploded sites
|
||||
|
||||
for ( i = 0; i < level.bombZones.size; i++ )
|
||||
{
|
||||
@ -7533,9 +7533,9 @@ bot_dem_attackers_loop()
|
||||
|
||||
shouldLet = ( game[ "teamScores" ][ myteam ] > game[ "teamScores" ][ otherTeam ] && timeleft < 90 && bombed == 1 );
|
||||
|
||||
//spawnkill conditions
|
||||
//if we have bombed one site or 1 bomb is planted with lots of time left, spawn kill
|
||||
//if we want the other team to win for overtime and they do not need to defuse, spawn kill
|
||||
// spawnkill conditions
|
||||
// if we have bombed one site or 1 bomb is planted with lots of time left, spawn kill
|
||||
// if we want the other team to win for overtime and they do not need to defuse, spawn kill
|
||||
if ( ( ( bombed + bombs.size == 1 && timeleft >= 90 ) || ( shouldLet && !bombs.size ) ) && randomInt( 100 ) < 95 )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -7569,9 +7569,9 @@ bot_dem_attackers_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//let defuse conditions
|
||||
//if enemy is going to lose and lots of time left, let them defuse to play longer
|
||||
//or if want to go into overtime near end of the extended game
|
||||
// let defuse conditions
|
||||
// if enemy is going to lose and lots of time left, let them defuse to play longer
|
||||
// or if want to go into overtime near end of the extended game
|
||||
if ( ( ( bombs.size + bombed == 2 && timeleft >= 90 ) || ( shouldLet && bombs.size ) ) && randomInt( 100 ) < 95 )
|
||||
{
|
||||
spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_dd_spawn_attacker_start" );
|
||||
@ -7600,14 +7600,14 @@ bot_dem_attackers_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//defend bomb conditions
|
||||
//if time is running out and we have a bomb planted
|
||||
// defend bomb conditions
|
||||
// if time is running out and we have a bomb planted
|
||||
if ( bombs.size && timeleft < 90 && ( !sites.size || randomInt( 100 ) < 95 ) )
|
||||
{
|
||||
site = self bot_array_nearest_curorigin( bombs );
|
||||
origin = ( site.curorigin[ 0 ] + 50, site.curorigin[ 1 ] + 50, site.curorigin[ 2 ] + 5 );
|
||||
|
||||
if ( site IsInUse() ) //somebody is defusing
|
||||
if ( site IsInUse() ) // somebody is defusing
|
||||
{
|
||||
self BotNotifyBotEvent( "dem", "start", "defuser", site );
|
||||
|
||||
@ -7627,7 +7627,7 @@ bot_dem_attackers_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
return;
|
||||
@ -7645,7 +7645,7 @@ bot_dem_attackers_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else go plant
|
||||
// else go plant
|
||||
if ( !sites.size )
|
||||
{
|
||||
return;
|
||||
@ -7665,7 +7665,7 @@ bot_dem_attackers_loop()
|
||||
|
||||
origin = ( plant.curorigin[ 0 ] + 50, plant.curorigin[ 1 ] + 50, plant.curorigin[ 2 ] + 5 );
|
||||
|
||||
//hang around the site if lots of time left
|
||||
// hang around the site if lots of time left
|
||||
if ( plant.bots > 1 && timeleft >= 60 )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -7772,9 +7772,9 @@ bot_dem_defenders_loop()
|
||||
myTeam = self.pers[ "team" ];
|
||||
otherTeam = getOtherTeam( myTeam );
|
||||
|
||||
bombs = [];//sites with bombs
|
||||
sites = [];//sites to bomb at
|
||||
bombed = 0;//exploded sites
|
||||
bombs = []; // sites with bombs
|
||||
sites = []; // sites to bomb at
|
||||
bombed = 0; // exploded sites
|
||||
|
||||
for ( i = 0; i < level.bombZones.size; i++ )
|
||||
{
|
||||
@ -7819,9 +7819,9 @@ bot_dem_defenders_loop()
|
||||
|
||||
shouldLet = ( timeleft < 60 && ( ( bombed == 0 && bombs.size != 2 ) || ( game[ "teamScores" ][ myteam ] > game[ "teamScores" ][ otherTeam ] && bombed == 1 ) ) && randomInt( 100 ) < 98 );
|
||||
|
||||
//spawnkill conditions
|
||||
//if nothing to defuse with a lot of time left, spawn kill
|
||||
//or letting a bomb site to explode but a bomb is planted, so spawnkill
|
||||
// spawnkill conditions
|
||||
// if nothing to defuse with a lot of time left, spawn kill
|
||||
// or letting a bomb site to explode but a bomb is planted, so spawnkill
|
||||
if ( ( !bombs.size && timeleft >= 60 && randomInt( 100 ) < 95 ) || ( shouldLet && bombs.size == 1 ) )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -7855,9 +7855,9 @@ bot_dem_defenders_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//let blow up conditions
|
||||
//let enemy blow up at least one to extend play time
|
||||
//or if want to go into overtime after extended game
|
||||
// let blow up conditions
|
||||
// let enemy blow up at least one to extend play time
|
||||
// or if want to go into overtime after extended game
|
||||
if ( shouldLet )
|
||||
{
|
||||
spawnPoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( "mp_dd_spawn_defender_start" );
|
||||
@ -7886,14 +7886,14 @@ bot_dem_defenders_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//defend conditions
|
||||
//if no bombs planted with little time left
|
||||
// defend conditions
|
||||
// if no bombs planted with little time left
|
||||
if ( !bombs.size && timeleft < 60 && randomInt( 100 ) < 95 && sites.size )
|
||||
{
|
||||
site = self bot_array_nearest_curorigin( sites );
|
||||
origin = ( site.curorigin[ 0 ] + 50, site.curorigin[ 1 ] + 50, site.curorigin[ 2 ] + 5 );
|
||||
|
||||
if ( site IsInUse() ) //somebody is planting
|
||||
if ( site IsInUse() ) // somebody is planting
|
||||
{
|
||||
self BotNotifyBotEvent( "dem", "start", "planter", site );
|
||||
|
||||
@ -7913,7 +7913,7 @@ bot_dem_defenders_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
@ -7932,7 +7932,7 @@ bot_dem_defenders_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else go defuse
|
||||
// else go defuse
|
||||
|
||||
if ( !bombs.size )
|
||||
{
|
||||
@ -7953,7 +7953,7 @@ bot_dem_defenders_loop()
|
||||
|
||||
origin = ( defuse.curorigin[ 0 ] + 50, defuse.curorigin[ 1 ] + 50, defuse.curorigin[ 2 ] + 5 );
|
||||
|
||||
//hang around the site if not in danger of losing
|
||||
// hang around the site if not in danger of losing
|
||||
if ( defuse.bots > 1 && bombed + bombs.size != 2 )
|
||||
{
|
||||
if ( self HasScriptGoal() )
|
||||
@ -8272,7 +8272,7 @@ bot_gtnw_loop()
|
||||
|
||||
if ( cur == level.nukeSite.curProgress )
|
||||
{
|
||||
break;//no prog made, enemy must be capping
|
||||
break; // no prog made, enemy must be capping
|
||||
}
|
||||
|
||||
self thread bot_do_random_action_for_objective( trigger );
|
||||
@ -8302,7 +8302,7 @@ bot_gtnw_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//else hang around the site
|
||||
// else hang around the site
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
return;
|
||||
@ -8366,7 +8366,7 @@ bot_oneflag_loop()
|
||||
|
||||
if ( self isFlagCarrier() )
|
||||
{
|
||||
//go cap
|
||||
// go cap
|
||||
origin = myzone.curorigin;
|
||||
|
||||
self BotNotifyBotEvent( "oneflag", "start", "cap" );
|
||||
@ -8391,7 +8391,7 @@ bot_oneflag_loop()
|
||||
|
||||
carrier = theirflag.carrier;
|
||||
|
||||
if ( !isDefined( carrier ) ) //if no one has enemy flag
|
||||
if ( !isDefined( carrier ) ) // if no one has enemy flag
|
||||
{
|
||||
self BotNotifyBotEvent( "oneflag", "start", "their_flag" );
|
||||
self bot_cap_get_flag( theirflag );
|
||||
@ -8399,7 +8399,7 @@ bot_oneflag_loop()
|
||||
return;
|
||||
}
|
||||
|
||||
//escort them
|
||||
// escort them
|
||||
|
||||
if ( self HasScriptGoal() )
|
||||
{
|
||||
@ -8430,7 +8430,7 @@ bot_oneflag_loop()
|
||||
{
|
||||
carrier = myflag.carrier;
|
||||
|
||||
if ( !isDefined( carrier ) ) //someone doesnt has our flag
|
||||
if ( !isDefined( carrier ) ) // someone doesnt has our flag
|
||||
{
|
||||
self BotNotifyBotEvent( "oneflag", "start", "my_flag" );
|
||||
self bot_cap_get_flag( myflag );
|
||||
@ -8452,7 +8452,7 @@ bot_oneflag_loop()
|
||||
|
||||
if ( theirzone.bots > 2 || randomInt( 100 ) < 45 )
|
||||
{
|
||||
//kill carrier
|
||||
// kill carrier
|
||||
if ( carrier _hasPerk( "specialty_coldblooded" ) )
|
||||
{
|
||||
return;
|
||||
@ -8473,7 +8473,7 @@ bot_oneflag_loop()
|
||||
|
||||
self thread bot_inc_bots( theirzone );
|
||||
|
||||
//camp their zone
|
||||
// camp their zone
|
||||
if ( DistanceSquared( origin, self.origin ) <= 1024 * 1024 )
|
||||
{
|
||||
wait 4;
|
||||
@ -8586,7 +8586,7 @@ bot_arena_loop()
|
||||
|
||||
if ( cur == flag.curProgress )
|
||||
{
|
||||
break;//no prog made, enemy must be capping
|
||||
break; // no prog made, enemy must be capping
|
||||
}
|
||||
|
||||
self thread bot_do_random_action_for_objective( flag.trigger );
|
||||
|
@ -1023,11 +1023,11 @@ RaySphereIntersect( start, end, spherePos, radius )
|
||||
}
|
||||
|
||||
mu1 = ( 0 - b + sqrt( bb4ac ) ) / ( 2 * a );
|
||||
//mu2 = (0-b - sqrt(bb4ac)) / (2 * a);
|
||||
// mu2 = (0-b - sqrt(bb4ac)) / (2 * a);
|
||||
|
||||
// intersection points of the sphere
|
||||
ip1 = start + mu1 * dp;
|
||||
//ip2 = start + mu2 * dp;
|
||||
// ip2 = start + mu2 * dp;
|
||||
|
||||
myDist = DistanceSquared( start, end );
|
||||
|
||||
@ -1992,7 +1992,7 @@ _WaypointsToKDTree( waypoints, dem )
|
||||
heap HeapRemove();
|
||||
}
|
||||
|
||||
median = int( sorted.size / 2 ); //use divide and conq
|
||||
median = int( sorted.size / 2 ); // use divide and conq
|
||||
|
||||
left = [];
|
||||
right = [];
|
||||
@ -2089,7 +2089,7 @@ KDTree()
|
||||
/*
|
||||
Called on a KDTree. Will insert the object into the KDTree.
|
||||
*/
|
||||
KDTreeInsert( data ) //as long as what you insert has a .origin attru, it will work.
|
||||
KDTreeInsert( data ) // as long as what you insert has a .origin attru, it will work.
|
||||
{
|
||||
self.root = self _KDTreeInsert( self.root, data, 0, -2147483647, -2147483647, -2147483647, 2147483647, 2147483647, 2147483647 );
|
||||
}
|
||||
@ -2503,9 +2503,9 @@ GetNearestWaypoint( pos )
|
||||
*/
|
||||
AStarSearch( start, goal, team, greedy_path )
|
||||
{
|
||||
open = NewHeap( ::ReverseHeapAStar ); //heap
|
||||
openset = [];//set for quick lookup
|
||||
closed = [];//set for quick lookup
|
||||
open = NewHeap( ::ReverseHeapAStar ); // heap
|
||||
openset = []; // set for quick lookup
|
||||
closed = []; // set for quick lookup
|
||||
|
||||
|
||||
startWp = getNearestWaypoint( start );
|
||||
@ -2549,26 +2549,26 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
|
||||
|
||||
node = spawnStruct();
|
||||
node.g = 0; //path dist so far
|
||||
node.h = DistanceSquared( level.waypoints[ startWp ].origin, level.waypoints[ goalWp ].origin ); //herustic, distance to goal for path finding
|
||||
node.g = 0; // path dist so far
|
||||
node.h = DistanceSquared( level.waypoints[ startWp ].origin, level.waypoints[ goalWp ].origin ); // herustic, distance to goal for path finding
|
||||
node.f = node.h + node.g; // combine path dist and heru, use reverse heap to sort the priority queue by this attru
|
||||
node.index = startWp;
|
||||
node.parent = undefined; //we are start, so we have no parent
|
||||
node.parent = undefined; // we are start, so we have no parent
|
||||
|
||||
//push node onto queue
|
||||
// push node onto queue
|
||||
openset[ node.index + "" ] = node;
|
||||
open HeapInsert( node );
|
||||
|
||||
//while the queue is not empty
|
||||
// while the queue is not empty
|
||||
while ( open.data.size )
|
||||
{
|
||||
//pop bestnode from queue
|
||||
// pop bestnode from queue
|
||||
bestNode = open.data[ 0 ];
|
||||
open HeapRemove();
|
||||
openset[ bestNode.index + "" ] = undefined;
|
||||
wp = level.waypoints[ bestNode.index ];
|
||||
|
||||
//check if we made it to the goal
|
||||
// check if we made it to the goal
|
||||
if ( bestNode.index == goalWp )
|
||||
{
|
||||
path = [];
|
||||
@ -2585,7 +2585,7 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
level.waypointUsage[ team ][ bestNode.index + "" ]++;
|
||||
}
|
||||
|
||||
//construct path
|
||||
// construct path
|
||||
path[ path.size ] = bestNode.index;
|
||||
|
||||
bestNode = bestNode.parent;
|
||||
@ -2594,7 +2594,7 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
return path;
|
||||
}
|
||||
|
||||
//for each child of bestnode
|
||||
// for each child of bestnode
|
||||
for ( i = wp.children.size - 1; i >= 0; i-- )
|
||||
{
|
||||
child = wp.children[ i ];
|
||||
@ -2608,7 +2608,7 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
|
||||
if ( isDefined( level.waypointUsage[ team ][ child + "" ] ) )
|
||||
{
|
||||
temppen = level.waypointUsage[ team ][ child + "" ]; //consider how many bots are taking this path
|
||||
temppen = level.waypointUsage[ team ][ child + "" ]; // consider how many bots are taking this path
|
||||
}
|
||||
|
||||
if ( temppen > 1 )
|
||||
@ -2623,10 +2623,10 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
penalty += 4;
|
||||
}
|
||||
|
||||
//calc the total path we have took
|
||||
newg = bestNode.g + DistanceSquared( wp.origin, childWp.origin ) * penalty; //bots on same team's path are more expensive
|
||||
// calc the total path we have took
|
||||
newg = bestNode.g + DistanceSquared( wp.origin, childWp.origin ) * penalty; // bots on same team's path are more expensive
|
||||
|
||||
//check if this child is in open or close with a g value less than newg
|
||||
// check if this child is in open or close with a g value less than newg
|
||||
inopen = isDefined( openset[ child + "" ] );
|
||||
|
||||
if ( inopen && openset[ child + "" ].g <= newg )
|
||||
@ -2662,13 +2662,13 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
node.f = node.g + node.h;
|
||||
node.index = child;
|
||||
|
||||
//check if in closed, remove it
|
||||
// check if in closed, remove it
|
||||
if ( inclosed )
|
||||
{
|
||||
closed[ child + "" ] = undefined;
|
||||
}
|
||||
|
||||
//check if not in open, add it
|
||||
// check if not in open, add it
|
||||
if ( !inopen )
|
||||
{
|
||||
open HeapInsert( node );
|
||||
@ -2676,7 +2676,7 @@ AStarSearch( start, goal, team, greedy_path )
|
||||
}
|
||||
}
|
||||
|
||||
//done with children, push onto closed
|
||||
// done with children, push onto closed
|
||||
closed[ bestNode.index + "" ] = bestNode;
|
||||
}
|
||||
|
||||
@ -2768,7 +2768,7 @@ onUsePlantObjectFix( player )
|
||||
if ( !self maps\mp\gametypes\_gameobjects::isFriendlyTeam( player.pers[ "team" ] ) )
|
||||
{
|
||||
level thread bombPlantedFix( self, player );
|
||||
//player logString( "bomb planted: " + self.label );
|
||||
// player logString( "bomb planted: " + self.label );
|
||||
|
||||
// disable all bomb zones except this one
|
||||
for ( index = 0; index < level.bombZones.size; index++ )
|
||||
@ -2784,7 +2784,7 @@ onUsePlantObjectFix( player )
|
||||
player playSound( "mp_bomb_plant" );
|
||||
player notify ( "bomb_planted" );
|
||||
|
||||
//if ( !level.hardcoreMode )
|
||||
// if ( !level.hardcoreMode )
|
||||
// iPrintLn( &"MP_EXPLOSIVES_PLANTED_BY", player );
|
||||
|
||||
leaderDialog( "bomb_planted" );
|
||||
@ -3029,7 +3029,7 @@ botGiveLoadout( team, class, allowCopycat )
|
||||
loadoutSecondary = maps\mp\gametypes\_class::table_getWeapon( level.classTableName, 10, 1 );
|
||||
}
|
||||
|
||||
//loadoutSecondaryCamo = "none";
|
||||
// loadoutSecondaryCamo = "none";
|
||||
|
||||
// stop default class op'ness
|
||||
allowOp = ( getDvarInt( "bots_loadout_allow_op" ) >= 1 );
|
||||
@ -3098,7 +3098,7 @@ botGiveLoadout( team, class, allowCopycat )
|
||||
self SetOffhandPrimaryClass( "other" );
|
||||
|
||||
// Action Slots
|
||||
//self _SetActionSlot( 1, "" );
|
||||
// self _SetActionSlot( 1, "" );
|
||||
self _SetActionSlot( 1, "nightvision" );
|
||||
self _SetActionSlot( 3, "altMode" );
|
||||
self _SetActionSlot( 4, "" );
|
||||
|
@ -503,7 +503,7 @@ ShowOptionOn( variable )
|
||||
if ( isDefined( self.Curs[ self.SubMenu ][ variable ] ) && isDefined( self.MenuText ) && isDefined( self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ] ) )
|
||||
{
|
||||
self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].fontscale = 2.0;
|
||||
//self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
// self.MenuText[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
@ -530,7 +530,7 @@ ShowOptionOn( variable )
|
||||
if ( isDefined( self.Curs[ self.SubMenu ][ variable ] ) && isDefined( self.MenuTextY ) && isDefined( self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ] ) )
|
||||
{
|
||||
self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].fontscale = 2.0;
|
||||
//self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
// self.MenuTextY[ self.Curs[ self.SubMenu ][ variable ] ].color = (randomInt(256)/255, randomInt(256)/255, randomInt(256)/255);
|
||||
color = ( 6 / 255, 69 / 255, 173 + randomIntRange( -5, 5 ) / 255 );
|
||||
|
||||
if ( int( time * 4 ) % 2 )
|
||||
|
@ -89,8 +89,8 @@ StartDev()
|
||||
self.nearest = -1;
|
||||
|
||||
self takeAllWeapons();
|
||||
self giveWeapon( "m16_gl_mp" ); //to knife windows
|
||||
self giveWeapon( "javelin_mp" ); //to mark jav spots
|
||||
self giveWeapon( "m16_gl_mp" ); // to knife windows
|
||||
self giveWeapon( "javelin_mp" ); // to mark jav spots
|
||||
self SetOffhandPrimaryClass( "other" );
|
||||
self giveWeapon( "semtex_mp" );
|
||||
self _clearperks();
|
||||
|
Loading…
x
Reference in New Issue
Block a user