This commit is contained in:
INeedBots 2021-03-12 13:55:56 -06:00
parent 2f4323fb66
commit 43701bd314
2 changed files with 41 additions and 4 deletions

View File

@ -45,6 +45,8 @@ added()
self.pers["bots"]["behavior"]["switch"] = 1; // percentage of how often the bot will switch weapons self.pers["bots"]["behavior"]["switch"] = 1; // percentage of how often the bot will switch weapons
self.pers["bots"]["behavior"]["class"] = 1; // percentage of how often the bot will change classes self.pers["bots"]["behavior"]["class"] = 1; // percentage of how often the bot will change classes
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
} }
/* /*
@ -972,6 +974,9 @@ watchToLook()
if(!self isInRange(self.bot.target.dist, curweap)) if(!self isInRange(self.bot.target.dist, curweap))
continue; continue;
if (weaponClass(curweap) == "sniper")
continue;
if(randomInt(100) > self.pers["bots"]["behavior"]["jump"]) if(randomInt(100) > self.pers["bots"]["behavior"]["jump"])
continue; continue;
@ -1126,7 +1131,10 @@ aim()
else else
{ {
if (self canAds(dist, curweap)) if (self canAds(dist, curweap))
self thread pressADS(); {
if (weaponClass(curweap) != "sniper" || !self.pers["bots"]["behavior"]["quickscope"])
self thread pressAds();
}
} }
self botLookAt(last_pos + (0, 0, self getEyeHeight() + nadeAimOffset), aimspeed); self botLookAt(last_pos + (0, 0, self getEyeHeight() + nadeAimOffset), aimspeed);
@ -1182,7 +1190,19 @@ aim()
canADS = (self canAds(dist, curweap) && conedot > 0.75); canADS = (self canAds(dist, curweap) && conedot > 0.75);
if (canADS) if (canADS)
self thread pressADS(); {
stopAdsOverride = false;
if (weaponClass(curweap) == "sniper")
{
if (self.pers["bots"]["behavior"]["quickscope"] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000)
stopAdsOverride = true;
else
self notify("kill_goal");
}
if (!stopAdsOverride)
self thread pressAds();
}
if (trace_time > reaction_time) if (trace_time > reaction_time)
{ {
@ -1219,7 +1239,19 @@ aim()
canADS = (self canAds(dist, curweap) && conedot > 0.75); canADS = (self canAds(dist, curweap) && conedot > 0.75);
if (canADS) if (canADS)
self thread pressADS(); {
stopAdsOverride = false;
if (weaponClass(curweap) == "sniper")
{
if (self.pers["bots"]["behavior"]["quickscope"] && self.bot.last_fire_time != -1 && getTime() - self.bot.last_fire_time < 1000)
stopAdsOverride = true;
else
self notify("kill_goal");
}
if (!stopAdsOverride)
self thread pressAds();
}
if((!canADS || adsAmount >= 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire")) if((!canADS || adsAmount >= 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire"))
self botFire(); self botFire();
@ -1391,7 +1423,7 @@ walk()
if(self.bot.target.isplay && self.bot.target.trace_time && self canFire(curweap) && self isInRange(self.bot.target.dist, curweap)) if(self.bot.target.isplay && self.bot.target.trace_time && self canFire(curweap) && self isInRange(self.bot.target.dist, curweap))
{ {
if (self InLastStand() || self GetStance() == "prone") if (self InLastStand() || self GetStance() == "prone" || (weaponClass(curweap) == "sniper" && self PlayerADS() > 0))
continue; continue;
if(self.bot.target.rand <= self.pers["bots"]["behavior"]["strafe"]) if(self.bot.target.rand <= self.pers["bots"]["behavior"]["strafe"])

View File

@ -562,6 +562,11 @@ set_class(rankxp)
rank = self maps\mp\gametypes\_rank::getRankForXp( rankxp ) + 1; rank = self maps\mp\gametypes\_rank::getRankForXp( rankxp ) + 1;
if (RandomFloatRange(0, 1) < ((rank / level.maxRank) + 0.1))
{
self.pers["bots"]["behavior"]["quickscope"] = true;
}
for(i=0; i < 5; i++) for(i=0; i < 5; i++)
{ {
primary = get_random_weapon(primaryGroups, rank); primary = get_random_weapon(primaryGroups, rank);