javlock on

This commit is contained in:
Your Name 2020-08-25 19:42:48 -06:00
parent d4b2a72025
commit 7b866c16fe
3 changed files with 141 additions and 10 deletions

View File

@ -225,10 +225,63 @@ jav_loc_watch()
if (!self GetCurrentWeaponClipAmmo())
continue;
self WeaponLockFinalize( self.bot.jav_loc, (0,0,0), true );
if (self isEMPed())
continue;
self watchJavLock();
}
}
watchJavLock()
{
self endon("bot_kill_lockon_jav");
self thread watchJavLockEvents();
self thread watchJavLockHas();
self thread maps\mp\_javelin::LoopLocalSeekSound( "javelin_clu_aquiring_lock", 0.6 );
wait 2;
self notify( "stop_lockon_sound" );
self PlayLocalSound( "javelin_clu_lock" );
wait 1;
while (isDefined(self.bot.jav_loc))
{
self WeaponLockFinalize( self.bot.jav_loc, (0,0,0), true );
wait 0.05;
}
self notify("bot_kill_lockon_jav");
}
watchJavLockHas()
{
self endon("bot_kill_lockon_jav");
self endon("disconnect");
self endon("death");
while (isDefined(self.bot.jav_loc))
{
wait 0.05;
}
self notify( "stop_lockon_sound" );
self notify("bot_kill_lockon_jav");
}
watchJavLockEvents()
{
self endon("bot_kill_lockon_jav");
self endon("disconnect");
self endon("death");
self waittill_any("flash_rumble_loop", "weapon_change", "missile_fire");
self notify( "stop_lockon_sound" );
self notify("bot_kill_lockon_jav");
}
lockon_watch()
{
self endon("disconnect");
@ -254,6 +307,9 @@ lockon_watch()
if (!self GetCurrentWeaponClipAmmo())
continue;
if (weap == "javelin_mp" && self isEMPed())
continue;
self.bot.lockingon = true;
self doLockon();
self.bot.lockingon = false;
@ -1113,9 +1169,12 @@ grenade_danager()
if(self.bot.isfraggingafter || self.bot.climbing || self.bot.knifingafter || self IsUsingRemote())
continue;
if(self isDefusing() || self isPlanting())
continue;
curWeap = self GetCurrentWeapon();
if (!isWeaponPrimary(curWeap))
if (!isWeaponPrimary(curWeap) || self.disabledWeapon)
continue;
myEye = self getEye();
@ -2185,7 +2244,10 @@ knife(ent, knifeDist)
curWeap = self GetCurrentWeapon();
if (!isWeaponPrimary(curWeap))
if (!isWeaponPrimary(curWeap) || self.disabledWeapon)
return;
if(self isDefusing() || self isPlanting())
return;
if (self.bot.knifing || self.bot.isfraggingafter)
@ -2361,9 +2423,12 @@ botThrowGrenade(grenName)
if (level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.isfrozen || self.bot.climbing || self IsUsingRemote())
return "can't move";
if(self isDefusing() || self isPlanting())
return "bomb";
curWeap = self GetCurrentWeapon();
if (!isWeaponPrimary(curWeap))
if (!isWeaponPrimary(curWeap) || self.disabledWeapon)
return "cur weap is not droppable";
if (self.bot.knifingafter)

View File

@ -1090,6 +1090,19 @@ onBotSpawned()
self thread bot_listen_to_steps();
self thread bot_equipment_kill_think();
self thread bot_jav_loc_think();
self thread bot_perk_think();
}
}
bot_perk_think()
{
self endon("disconnect");
self endon("death");
level endon("game_ended");
for (;;)
{
wait 0.05;
}
}
@ -1097,14 +1110,58 @@ bot_jav_loc_think()
{
self endon("disconnect");
self endon("death");
level endon("game_ended");
self GiveWeapon("javelin_mp");
for (;;)
{
wait 0.05;
wait randomintRange(2, 4);
self SetWeaponAmmoClip("javelin_mp", 1);
self SetBotJavelinLocation((randomIntRange(-10000, 10000),randomIntRange(-10000, 10000),1000));
if (randomInt(100) < 50)
continue;
if (!self GetAmmoCount("javelin_mp"))
continue;
if (self HasThreat() || self HasBotJavelinLocation())
continue;
if(self BotIsFrozen())
continue;
if(self IsBotReloading() || self IsBotFragging() || self IsBotKnifing())
continue;
if(self isDefusing() || self isPlanting())
continue;
curWeap = self GetCurrentWeapon();
if (!isWeaponPrimary(curWeap) || self.disabledWeapon)
continue;
if (self botIsClimbing())
continue;
if (self IsUsingRemote())
continue;
traceForward = self maps\mp\_javelin::EyeTraceForward();
if (!isDefined(traceForward))
continue;
loc = traceForward[0];
if (self maps\mp\_javelin::TargetPointTooClose(loc))
continue;
if (!bulletTracePassed(self.origin + (0, 0, 5), self.origin + (0, 0, 2048), false, self))
continue;
if (!bulletTracePassed(loc + (0, 0, 5), loc + (0, 0, 2048), false, self))
continue;
self setSpawnWeapon("javelin_mp");
self SetBotJavelinLocation(loc);
self waittill_any("missile_fire", "weapon_change");
self ClearBotJavelinLocation(loc);
}
}
@ -1590,6 +1647,12 @@ bot_crate_think()
if ( RandomInt( 100 ) < 20 )
continue;
if(self isDefusing() || self isPlanting())
continue;
if(self IsUsingRemote() || self BotIsFrozen())
continue;
if ( self HasScriptGoal() || self.bot_lock_goal )
{
@ -1664,6 +1727,8 @@ bot_crate_think()
self _EnableWeapon();
self BotFreezeControls(false);
self notify("bot_force_check_switch");
if (!isDefined(crate))
continue;
@ -1684,7 +1749,7 @@ bot_weapon_think()
if(self IsBotReloading() || self IsBotFragging() || self botIsClimbing() || self IsBotKnifing())
continue;
if(self BotIsFrozen())
if(self BotIsFrozen() || self.disabledWeapon)
continue;
if(self isDefusing() || self isPlanting())
@ -1920,7 +1985,7 @@ bot_killstreak_think()
continue;
curWeap = self GetCurrentWeapon();
if (!isWeaponPrimary(curWeap))
if (!isWeaponPrimary(curWeap) || self.disabledWeapon)
continue;
if (self isEMPed())

View File

@ -142,6 +142,7 @@ HasBotJavelinLocation()
SetBotJavelinLocation(loc)
{
self.bot.jav_loc = loc;
self notify("new_enemy");
}
ClearBotJavelinLocation()