mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-23 06:15:43 +00:00
Added dvars
This commit is contained in:
parent
d2e563cf65
commit
5e7f456a42
@ -83,6 +83,8 @@ init()
|
||||
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();
|
||||
|
@ -463,6 +463,9 @@ grenade_danager()
|
||||
if(self isDefusing() || self isPlanting())
|
||||
continue;
|
||||
|
||||
if (!getDvarInt("bots_play_nade"))
|
||||
continue;
|
||||
|
||||
myEye = self getEye();
|
||||
for (i = level.bots_fragList.count-1; i >= 0; i--)
|
||||
{
|
||||
@ -971,6 +974,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)
|
||||
@ -1060,7 +1066,7 @@ aim()
|
||||
self thread bot_lookat(aimpos, aimspeed);
|
||||
self thread pressAds();
|
||||
|
||||
if (curweap == "javelin_mp")
|
||||
if (curweap == "javelin_mp" && getDvarInt("bots_play_fire"))
|
||||
self botFire(curweap);
|
||||
continue;
|
||||
}
|
||||
@ -1108,7 +1114,7 @@ aim()
|
||||
if(isplay)
|
||||
{
|
||||
//better room to nade? cook time function with dist?
|
||||
if(!self.bot.isfraggingafter && !self.bot.issmokingafter)
|
||||
if(!self.bot.isfraggingafter && !self.bot.issmokingafter && getDvarInt("bots_play_nade"))
|
||||
{
|
||||
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)
|
||||
@ -1174,7 +1180,7 @@ aim()
|
||||
knifeDist = level.bots_maxKnifeDistance;
|
||||
if (self _hasPerk("specialty_extendedmelee"))
|
||||
knifeDist *= 1.4;
|
||||
if((isplay || target.classname == "misc_turret") && !self.bot.isknifingafter && conedot > 0.9 && dist < knifeDist && trace_time > reaction_time && !usingRemote)
|
||||
if((isplay || target.classname == "misc_turret") && !self.bot.isknifingafter && conedot > 0.9 && dist < knifeDist && trace_time > reaction_time && !usingRemote && getDvarInt("bots_play_knife"))
|
||||
{
|
||||
self clear_bot_after_target();
|
||||
self thread knife();
|
||||
@ -1193,7 +1199,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(curweap);
|
||||
|
||||
if (isplay)
|
||||
@ -1230,7 +1236,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(curweap);
|
||||
|
||||
continue;
|
||||
@ -1388,6 +1394,9 @@ walk()
|
||||
wait 0.05;
|
||||
|
||||
self botMoveTo(self.origin);
|
||||
|
||||
if (!getDVarINt("bots_play_move"))
|
||||
continue;
|
||||
|
||||
if(level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.isfrozen || self.bot.stop_move)
|
||||
continue;
|
||||
|
@ -1286,7 +1286,8 @@ onSpawned()
|
||||
self.bot_was_follow_script_update = undefined;
|
||||
self.bot_stuck_on_carepackage = undefined;
|
||||
|
||||
self thread bot_dom_cap_think();
|
||||
if (getDvarInt("bots_play_obj"))
|
||||
self thread bot_dom_cap_think();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1688,45 +1689,69 @@ start_bot_threads()
|
||||
|
||||
gameFlagWait("prematch_done");
|
||||
|
||||
self thread bot_killstreak_think();
|
||||
// inventory usage
|
||||
if (getDvarInt("bots_play_killstreak"))
|
||||
self thread bot_killstreak_think();
|
||||
|
||||
self thread bot_weapon_think();
|
||||
self thread bot_perk_think();
|
||||
|
||||
self thread bot_target_vehicle();
|
||||
self thread bot_equipment_kill_think();
|
||||
self thread bot_turret_think();
|
||||
// script targeting
|
||||
if (getDvarInt("bots_play_target_other"))
|
||||
{
|
||||
self thread bot_target_vehicle();
|
||||
self thread bot_equipment_kill_think();
|
||||
self thread bot_turret_think();
|
||||
}
|
||||
|
||||
self thread bot_watch_stuck_on_crate();
|
||||
self thread bot_crate_think();
|
||||
// airdrop
|
||||
if (getDvarInt("bots_play_take_carepackages"))
|
||||
{
|
||||
self thread bot_watch_stuck_on_crate();
|
||||
self thread bot_crate_think();
|
||||
}
|
||||
|
||||
// awareness
|
||||
self thread bot_revenge_think();
|
||||
|
||||
self thread bot_uav_think();
|
||||
self thread bot_listen_to_steps();
|
||||
self thread follow_target();
|
||||
|
||||
self thread bot_think_follow();
|
||||
self thread bot_think_camp();
|
||||
self thread bot_jav_loc_think();
|
||||
self thread bot_use_grenade_think();
|
||||
self thread bot_use_tube_think();
|
||||
self thread bot_use_equipment_think();
|
||||
// camp and follow
|
||||
if (getDvarInt("bots_play_camp"))
|
||||
{
|
||||
self thread bot_think_follow();
|
||||
self thread bot_think_camp();
|
||||
}
|
||||
|
||||
self thread bot_watch_riot_weapons();
|
||||
// nades
|
||||
if (getDvarInt("bots_play_nade"))
|
||||
{
|
||||
self thread bot_jav_loc_think();
|
||||
self thread bot_use_tube_think();
|
||||
self thread bot_use_grenade_think();
|
||||
self thread bot_use_equipment_think();
|
||||
self thread bot_watch_riot_weapons();
|
||||
}
|
||||
|
||||
self thread bot_dom_def_think();
|
||||
self thread bot_dom_spawn_kill_think();
|
||||
// obj
|
||||
if (getDvarInt("bots_play_obj"))
|
||||
{
|
||||
self thread bot_dom_def_think();
|
||||
self thread bot_dom_spawn_kill_think();
|
||||
|
||||
self thread bot_hq();
|
||||
self thread bot_hq();
|
||||
|
||||
self thread bot_cap();
|
||||
self thread bot_cap();
|
||||
|
||||
self thread bot_sab();
|
||||
self thread bot_sab();
|
||||
|
||||
self thread bot_sd_defenders();
|
||||
self thread bot_sd_attackers();
|
||||
self thread bot_sd_defenders();
|
||||
self thread bot_sd_attackers();
|
||||
|
||||
self thread bot_dem_attackers();
|
||||
self thread bot_dem_defenders();
|
||||
self thread bot_dem_attackers();
|
||||
self thread bot_dem_defenders();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user