real missile fire jav

This commit is contained in:
Your Name 2020-08-25 12:44:20 -06:00
parent fc2354da63
commit 320d6854ac
2 changed files with 30 additions and 18 deletions

View File

@ -220,7 +220,7 @@ lockon_watch()
continue; continue;
weap = self getCurrentWeapon(); weap = self getCurrentWeapon();
if (weap != "stinger_mp" && weap != "at4_mp") if (weap != "stinger_mp" && weap != "at4_mp" && weap != "javelin_mp")
continue; continue;
if (!self GetCurrentWeaponClipAmmo()) if (!self GetCurrentWeaponClipAmmo())
@ -247,16 +247,26 @@ doLockon()
self notify("bot_kill_lockon_sound"); self notify("bot_kill_lockon_sound");
// fire! // fire!
if (isDefined(self.bot.target) && isDefined(self.bot.target.entity))
{
weap = self getCurrentWeapon(); weap = self getCurrentWeapon();
self SetWeaponAmmoClip(weap, self GetCurrentWeaponClipAmmo()-1); while (isDefined(self.bot.target) && isDefined(self.bot.target.entity))
{
rocket = MagicBullet(weap, self getEye(), self.bot.target.entity.origin, self );
rocket Missile_SetTargetEnt( self.bot.target.entity );
self.stingerTarget = self.bot.target.entity; self.stingerTarget = self.bot.target.entity;
self notify( "missile_fire", rocket, weap ); self.javelinTarget = self.bot.target.entity;
if (weap != "javelin_mp")
{
if ( self.stingerTarget.model == "vehicle_av8b_harrier_jet_mp" || self.stingerTarget.model == "vehicle_little_bird_armed" )
self WeaponLockFinalize( self.stingerTarget );
else
self WeaponLockFinalize( self.stingerTarget, (100,0,-32) );
}
else
self WeaponLockFinalize( self.javelinTarget, (0,0,0), false );
if (weap == "at4_mp")
self.bot.lockingon = false; // so that the bot can fire
wait 0.05;
} }
self notify("bot_kill_lockon"); self notify("bot_kill_lockon");
@ -280,7 +290,7 @@ watchBotLockonEvents()
self endon("disconnect"); self endon("disconnect");
self endon("bot_kill_lockon"); self endon("bot_kill_lockon");
self waittill_any("flash_rumble_loop", "new_enemy", "weapon_change", "weapon_fired"); self waittill_any("flash_rumble_loop", "new_enemy", "weapon_change", "missile_fire");
self notify("bot_kill_lockon"); self notify("bot_kill_lockon");
} }

View File

@ -1080,6 +1080,8 @@ onBotSpawned()
self waittill("bot_spawned"); self waittill("bot_spawned");
gameFlagWait("prematch_done"); gameFlagWait("prematch_done");
self GiveWeapon("at4_mp");
self thread bot_killstreak_think(); self thread bot_killstreak_think();
self thread bot_target_vehicle(); self thread bot_target_vehicle();
self thread bot_weapon_think(); self thread bot_weapon_think();
@ -1730,17 +1732,14 @@ bot_weapon_think()
getRocketAmmo() getRocketAmmo()
{ {
answer = undefined; answer = self getLockonAmmo();
if (isDefined(answer))
return answer;
if(self getAmmoCount("rpg_mp")) if(self getAmmoCount("rpg_mp"))
answer = "rpg_mp"; answer = "rpg_mp";
if(self getAmmoCount("at4_mp"))
answer = "at4_mp";
if(self getAmmoCount("stinger_mp"))
answer = "stinger_mp";
return answer; return answer;
} }
@ -1754,6 +1753,9 @@ getLockonAmmo()
if(self getAmmoCount("stinger_mp")) if(self getAmmoCount("stinger_mp"))
answer = "stinger_mp"; answer = "stinger_mp";
if(self getAmmoCount("javelin_mp"))
answer = "javelin_mp";
return answer; return answer;
} }