Fast swap, swap on spawn

This commit is contained in:
INeedBots 2021-03-26 00:26:57 -06:00
parent 4059b373c2
commit ca71fbee4b
2 changed files with 28 additions and 7 deletions

View File

@ -47,6 +47,7 @@ added()
self.pers["bots"]["behavior"]["jump"] = 100; // percentage of how often the bot will jumpshot and dropshot self.pers["bots"]["behavior"]["jump"] = 100; // percentage of how often the bot will jumpshot and dropshot
self.pers["bots"]["behavior"]["quickscope"] = false; // is a quickscoper self.pers["bots"]["behavior"]["quickscope"] = false; // is a quickscoper
self.pers["bots"]["behavior"]["initswitch"] = 10; // percentage of how often the bot will switch weapons on spawn
} }
/* /*

View File

@ -2421,7 +2421,7 @@ doReloadCancel()
for (;;) for (;;)
{ {
self waittill("reload"); ret = self waittill_any_return("reload", "weapon_change");
if(self BotIsFrozen()) if(self BotIsFrozen())
continue; continue;
@ -2433,9 +2433,16 @@ doReloadCancel()
continue; continue;
curWeap = self GetCurrentWeapon(); curWeap = self GetCurrentWeapon();
if (!maps\mp\gametypes\_weapons::isSideArm( curWeap ) && !maps\mp\gametypes\_weapons::isPrimaryWeapon( curWeap ))
continue;
if (ret == "reload")
{
// check single reloads // check single reloads
if (self GetWeaponAmmoClip(curWeap) < WeaponClipSize(curWeap)) if (self GetWeaponAmmoClip(curWeap) < WeaponClipSize(curWeap))
continue; continue;
}
// check difficulty // check difficulty
if (self.pers["bots"]["skill"]["base"] <= 3) if (self.pers["bots"]["skill"]["base"] <= 3)
@ -2467,6 +2474,7 @@ doReloadCancel()
self BotChangeToWeapon(weap); self BotChangeToWeapon(weap);
wait 0.25; wait 0.25;
self BotChangeToWeapon(curWeap); self BotChangeToWeapon(curWeap);
wait 2;
} }
} }
@ -2479,6 +2487,8 @@ bot_weapon_think()
self endon("disconnect"); self endon("disconnect");
level endon("game_ended"); level endon("game_ended");
first = true;
for(;;) for(;;)
{ {
self waittill_any_timeout(randomIntRange(2, 4), "bot_force_check_switch"); self waittill_any_timeout(randomIntRange(2, 4), "bot_force_check_switch");
@ -2504,6 +2514,15 @@ bot_weapon_think()
} }
} }
if (first)
{
first = false;
if(randomInt(100) > self.pers["bots"]["behavior"]["initswitch"])
continue;
}
else
{
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "satchel_charge_mp" && curWeap != "squadcommand_mp") if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "satchel_charge_mp" && curWeap != "squadcommand_mp")
{ {
if(randomInt(100) > self.pers["bots"]["behavior"]["switch"]) if(randomInt(100) > self.pers["bots"]["behavior"]["switch"])
@ -2512,6 +2531,7 @@ bot_weapon_think()
if(hasTarget) if(hasTarget)
continue; continue;
} }
}
weaponslist = self getweaponslist(); weaponslist = self getweaponslist();
weap = ""; weap = "";