This commit is contained in:
Your Name 2020-08-18 15:03:40 -06:00
parent 0106fab764
commit a130a9ecb0
4 changed files with 39 additions and 31 deletions

View File

@ -140,6 +140,9 @@ handleBots()
level thread diffBots();
level addBots();
while(!level.intermission)
wait 0.05;
setDvar("bots_manage_add", getBotArray().size);
}

View File

@ -1078,7 +1078,7 @@ grenade_danager()
curWeap = self GetCurrentWeapon();
if (!isWeaponDroppable(curWeap))
if (!isWeaponPrimary(curWeap))
continue;
myEye = self getEye();
@ -2138,7 +2138,7 @@ knife(ent, knifeDist)
curWeap = self GetCurrentWeapon();
if (!isWeaponDroppable(curWeap))
if (!isWeaponPrimary(curWeap))
return;
if (self.bot.knifing || self.bot.isfraggingafter)
@ -2316,7 +2316,7 @@ botThrowGrenade(grenName)
curWeap = self GetCurrentWeapon();
if (!isWeaponDroppable(curWeap))
if (!isWeaponPrimary(curWeap))
return "cur weap is not droppable";
if (self.bot.knifingafter)

View File

@ -258,7 +258,7 @@ getKillstreaks()
{
streak_name = tableLookupByRow( "mp/killstreakTable.csv", i, 1 );
if(streak_name == "")
if(streak_name == "" || streak_name == "none")
continue;
if(streak_name == "b1")
@ -1052,7 +1052,7 @@ bot_weapon_think()
}
}
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "stinger_mp" && curWeap != "javelin_mp")
if(curWeap != "none" && self getAmmoCount(curWeap) && curWeap != "stinger_mp" && curWeap != "javelin_mp" && curWeap != "onemanarmy_mp")
{
if(randomInt(100) > self.pers["bots"]["behavior"]["switch"])
continue;
@ -1071,10 +1071,10 @@ bot_weapon_think()
if(!self getAmmoCount(weapon))
continue;
if (!isWeaponDroppable(weapon))
if (!isWeaponPrimary(weapon))
continue;
if(curWeap == weapon || weapon == "none" || weapon == "")
if(curWeap == weapon || weapon == "none" || weapon == "" || weapon == "javelin_mp" || weapon == "stinger_mp" || weapon == "onemanarmy_mp")
continue;
weap = weapon;
@ -1253,7 +1253,7 @@ bot_killstreak_think()
continue;
curWeap = self GetCurrentWeapon();
if (!isWeaponDroppable(curWeap))
if (!isWeaponPrimary(curWeap))
continue;
if (self isEMPed())

View File

@ -13,11 +13,6 @@ is_bot()
return ((isDefined(self.pers["isBot"]) && self.pers["isBot"]) || (isDefined(self.pers["isBotWarfare"]) && self.pers["isBotWarfare"]) || isSubStr( self.guid, "bot" ));
}
entIsVehicle(ent)
{
return (ent.classname == "script_vehicle" || ent.model == "vehicle_uav_static_mp" || ent.model == "vehicle_ac130_coop");
}
/*
Returns how much the bot is ads'ing all the way.
*/
@ -167,19 +162,6 @@ GetThreat()
return self.bot.target.entity;
}
/*
Returns if the given weapon is full auto.
*/
WeaponIsFullAuto(weap)
{
weaptoks = strtok(weap, "_");
assert(isDefined(weaptoks[0]));
assert(isString(weaptoks[0]));
return !isDefined(level.bots_nonfullautoguns[weaptoks[0]]);
}
/*
Returns if the bot has a script enemy.
*/
@ -201,6 +183,34 @@ IsBotKnifing()
return self.bot.knifing;
}
getBotVelocity()
{
return self.bot.velocity;
}
isWeaponPrimary(weap)
{
return (maps\mp\gametypes\_weapons::isPrimaryWeapon(weap) || maps\mp\gametypes\_weapons::isAltModeWeapon(weap));
}
entIsVehicle(ent)
{
return (ent.classname == "script_vehicle" || ent.model == "vehicle_uav_static_mp" || ent.model == "vehicle_ac130_coop");
}
/*
Returns if the given weapon is full auto.
*/
WeaponIsFullAuto(weap)
{
weaptoks = strtok(weap, "_");
assert(isDefined(weaptoks[0]));
assert(isString(weaptoks[0]));
return !isDefined(level.bots_nonfullautoguns[weaptoks[0]]);
}
IsDefusing()
{
return (isDefined(self.isDefusing) && self.isDefusing);
@ -234,11 +244,6 @@ IsStunned()
return (isdefined(self.concussionEndTime) && self.concussionEndTime > gettime());
}
getBotVelocity()
{
return self.bot.velocity;
}
/*
Returns if we are beingArtilleryShellshocked
*/