mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-20 16:45:43 +00:00
loadout
This commit is contained in:
parent
527c053a05
commit
8701417d9a
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,14 @@
|
||||
*/
|
||||
added()
|
||||
{
|
||||
self maps\mp\bots\_bot_loadout::bot_get_cod_points();
|
||||
self maps\mp\bots\_bot_loadout::bot_get_rank();
|
||||
|
||||
self maps\mp\bots\_bot_loadout::bot_setKillstreaks();
|
||||
|
||||
self.pers["bot"][ "cod_points_org" ] = self.pers["bot"][ "cod_points" ];//killstreaks cannot be set again
|
||||
|
||||
self maps\mp\bots\_bot_loadout::bot_set_class();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -24,6 +32,12 @@ connected()
|
||||
{
|
||||
self thread classWatch();
|
||||
self thread teamWatch();
|
||||
|
||||
self thread maps\mp\bots\_bot_loadout::bot_rank();
|
||||
self thread bot_skip_killcam();
|
||||
|
||||
self thread bot_on_spawn();
|
||||
self thread bot_on_death();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -33,6 +47,42 @@ bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHi
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
When the bot dies
|
||||
*/
|
||||
bot_on_death()
|
||||
{
|
||||
self endon("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill("death");
|
||||
|
||||
self.hasSpawned = false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Bots skip killcams
|
||||
*/
|
||||
bot_skip_killcam()
|
||||
{
|
||||
level endon("game_ended");
|
||||
self endon("disconnect");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
wait 1;
|
||||
|
||||
if(isDefined(self.killcam))
|
||||
{
|
||||
self notify("end_killcam");
|
||||
self clientNotify("fkce");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Selects a class for the bot.
|
||||
*/
|
||||
@ -44,13 +94,12 @@ classWatch()
|
||||
{
|
||||
while(!isdefined(self.pers["team"]) || level.oldschool)
|
||||
wait .05;
|
||||
|
||||
|
||||
wait 0.5;
|
||||
|
||||
self notify("menuresponse", game["menu_changeclass"], "smg_mp");
|
||||
self.bot_change_class = true;
|
||||
|
||||
while(isdefined(self.pers["team"]) && isdefined(self.pers["class"]) && isDefined(self.bot_change_class))
|
||||
while(isdefined(self.pers["team"]) && isdefined(self.pers["class"]))
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
@ -74,3 +123,17 @@ teamWatch()
|
||||
wait .05;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
When bot spawns
|
||||
*/
|
||||
bot_on_spawn()
|
||||
{
|
||||
self endon("disconnect");
|
||||
level endon("game_ended");
|
||||
|
||||
for(;;)
|
||||
{
|
||||
self waittill("spawned_player");
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,24 @@ getGoodMapAmount()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Rounds to the nearest whole number.
|
||||
*/
|
||||
Round(x)
|
||||
{
|
||||
y = int(x);
|
||||
|
||||
if(abs(x) - abs(y) > 0.5)
|
||||
{
|
||||
if(x < 0)
|
||||
return y - 1;
|
||||
else
|
||||
return y + 1;
|
||||
}
|
||||
else
|
||||
return y;
|
||||
}
|
||||
|
||||
/*
|
||||
Picks a random thing
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user