bots_loadout_rank bots_loadout_codpoints

This commit is contained in:
INeedBots 2020-12-20 20:49:58 -06:00
parent 8701417d9a
commit 54c2925599
2 changed files with 80 additions and 50 deletions

View File

@ -985,6 +985,9 @@ bot_get_cod_points()
return;
}
cp_dvar = getDvarInt("bots_loadout_codpoints");
if (cp_dvar == -1)
{
players = get_players();
total_points = [];
@ -1009,11 +1012,25 @@ bot_get_cod_points()
point_average = array_average( total_points );
self.pers["bot"][ "cod_points" ] = Int( point_average * RandomFloatRange( 0.6, 0.8 ) );
}
else if(cp_dvar == 0)
{
self.pers["bot"][ "cod_points" ] = Round( random_normal_distribution( 50000, 15000, 0, 100000 ) );
}
else
{
self.pers["bot"][ "cod_points" ] = Round( random_normal_distribution( cp_dvar, 1500, 0, 100000 ) );
}
}
/*
Get the bots rank
*/
bot_get_rank()
{
rank = 1;
rank_dvar = getDvarInt("bots_loadout_rank");
if (rank_dvar == -1)
{
players = get_players();
@ -1058,7 +1075,16 @@ bot_get_rank()
avg = array_average( ranks );
s = array_std_deviation( ranks, avg );
rank = Int( random_normal_distribution( avg, s, 0, level.maxRank ) );
rank = Round( random_normal_distribution( avg, s, 0, level.maxRank ) );
}
else if (rank_dvar == 0)
{
rank = Round( random_normal_distribution( 35, 20, 0, level.maxRank ) );
}
else
{
rank = Round( random_normal_distribution( rank_dvar, 5, 0, level.maxRank ) );
}
self.pers["bot"]["rankxp"] = maps\mp\gametypes\_rank::getRankInfoMinXP( rank );
}

View File

@ -47,6 +47,10 @@ init()
setDvar("bots_loadout_reasonable", false);
if(getDvar("bots_loadout_allow_op") == "")//allows jug, marty and laststand
setDvar("bots_loadout_allow_op", true);
if(getDvar("bots_loadout_rank") == "")// what rank the bots should be around, -1 is around the players, 0 is all random
setDvar("bots_loadout_rank", -1);
if(getDvar("bots_loadout_codpoints") == "")// how much cod points a bot should have, -1 is around the players, 0 is all random
setDvar("bots_loadout_codpoints", -1);
level.bots = [];
level.bot_decoys = [];