Added play dvars

This commit is contained in:
INeedBots 2020-11-23 13:06:06 -06:00
parent a6c4e27ff0
commit 88e2c0ea82
3 changed files with 48 additions and 4 deletions

View File

@ -58,6 +58,25 @@ 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_play_move") == "")//bots move
setDvar("bots_play_move", true);
if(getDvar("bots_play_knife") == "")//bots knife
setDvar("bots_play_knife", true);
if(getDvar("bots_play_fire") == "")//bots fire
setDvar("bots_play_fire", true);
if(getDvar("bots_play_nade") == "")//bots grenade
setDvar("bots_play_nade", true);
if(getDvar("bots_play_obj") == "")//bots play the obj
setDvar("bots_play_obj", true);
if(getDvar("bots_play_camp") == "")//bots camp and follow
setDvar("bots_play_camp", true);
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)
setDvar("bots_play_target_other", true);
if(getDvar("bots_play_killstreak") == "")//bot use killstreaks
setDvar("bots_play_killstreak", true);
level.defuseObject = undefined;
level.bots_smokeList = List();

View File

@ -400,6 +400,9 @@ grenade_danger()
if(!isDefined(grenade))
continue;
if (!getDvarInt("bots_play_nade"))
continue;
if(weapname != "frag_grenade_mp")
continue;
@ -847,6 +850,9 @@ watchToLook()
if(randomInt(100) > self.pers["bots"]["behavior"]["jump"])
continue;
if (!getDvarInt("bots_play_jumpdrop"))
continue;
thetime = getTime();
if(isDefined(self.bot.jump_time) && thetime - self.bot.jump_time <= 5000)
@ -973,7 +979,7 @@ aim()
if(!self.bot.isfraggingafter && !self.bot.issmokingafter)
{
nade = self getValidGrenade();
if(isDefined(nade) && rand <= self.pers["bots"]["behavior"]["nade"] && bulletTracePassed(eyePos, eyePos + (0, 0, 75), false, self) && bulletTracePassed(last_pos, last_pos + (0, 0, 100), false, target) && dist > level.bots_minGrenadeDistance && dist < level.bots_maxGrenadeDistance)
if(isDefined(nade) && rand <= self.pers["bots"]["behavior"]["nade"] && bulletTracePassed(eyePos, eyePos + (0, 0, 75), false, self) && bulletTracePassed(last_pos, last_pos + (0, 0, 100), false, target) && dist > level.bots_minGrenadeDistance && dist < level.bots_maxGrenadeDistance && getDvarInt("bots_play_nade"))
{
if(nade == "frag_grenade_mp")
self thread frag(2.5);
@ -1023,7 +1029,7 @@ aim()
self botLookAt(aimpos, aimspeed);
}
if(isplay && !self.bot.isknifingafter && conedot > 0.9 && dist < level.bots_maxKnifeDistance && trace_time > reaction_time)
if(isplay && !self.bot.isknifingafter && conedot > 0.9 && dist < level.bots_maxKnifeDistance && trace_time > reaction_time && getDvarInt("bots_play_knife"))
{
self clear_bot_after_target();
self thread knife();
@ -1041,7 +1047,7 @@ aim()
if (trace_time > reaction_time)
{
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance))
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire"))
self botFire();
if (isplay)
@ -1076,7 +1082,7 @@ aim()
if (canADS)
self thread pressADS();
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance))
if((!canADS || self playerads() == 1.0 || self InLastStand() || self GetStance() == "prone") && (conedot > 0.95 || dist < level.bots_maxKnifeDistance) && getDvarInt("bots_play_fire"))
self botFire();
continue;
@ -1209,6 +1215,9 @@ walk()
wait 0.05;
self botMoveTo(self.origin);
if (!getDvarInt("bots_play_move"))
continue;
if(level.inPrematchPeriod || level.gameEnded || self.bot.isfrozen || self.bot.stop_move)
continue;

View File

@ -326,6 +326,22 @@ inLastStand()
return (isDefined(self.lastStand) && self.lastStand);
}
/*
If the player is carrying a bomb
*/
isBombCarrier()
{
return (isDefined(self.isBombCarrier) && self.isBombCarrier);
}
/*
If the site is in use
*/
isInUse()
{
return (isDefined(self.inUse) && self.inUse);
}
/*
Returns if we are stunned.
*/