mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 05:25:44 +00:00
added weapon class dist mutiplier
This commit is contained in:
parent
c417ddba39
commit
43f88e9fb1
@ -129,6 +129,7 @@ resetBotVars()
|
|||||||
self.bot.jump_time = undefined;
|
self.bot.jump_time = undefined;
|
||||||
|
|
||||||
self.bot.is_cur_full_auto = false;
|
self.bot.is_cur_full_auto = false;
|
||||||
|
self.bot.cur_weap_dist_multi = 1;
|
||||||
|
|
||||||
self.bot.rand = randomInt(100);
|
self.bot.rand = randomInt(100);
|
||||||
|
|
||||||
@ -159,6 +160,27 @@ onPlayerSpawned()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Sets the factor of distance for a weapon
|
||||||
|
*/
|
||||||
|
SetWeaponDistMulti(weap)
|
||||||
|
{
|
||||||
|
if (weap == "none")
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
switch(weaponClass(weap))
|
||||||
|
{
|
||||||
|
case "rifle":
|
||||||
|
return 0.9;
|
||||||
|
case "smg":
|
||||||
|
return 0.7;
|
||||||
|
case "pistol":
|
||||||
|
return 0.5;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
When the bot changes weapon.
|
When the bot changes weapon.
|
||||||
*/
|
*/
|
||||||
@ -169,6 +191,8 @@ onWeaponChange()
|
|||||||
|
|
||||||
weap = self GetCurrentWeapon();
|
weap = self GetCurrentWeapon();
|
||||||
self.bot.is_cur_full_auto = WeaponIsFullAuto(weap);
|
self.bot.is_cur_full_auto = WeaponIsFullAuto(weap);
|
||||||
|
self.bot.cur_weap_dist_multi = SetWeaponDistMulti(weap);
|
||||||
|
|
||||||
if (weap != "none")
|
if (weap != "none")
|
||||||
self changeToWeap(weap);
|
self changeToWeap(weap);
|
||||||
|
|
||||||
@ -177,6 +201,7 @@ onWeaponChange()
|
|||||||
self waittill( "weapon_change", newWeapon );
|
self waittill( "weapon_change", newWeapon );
|
||||||
|
|
||||||
self.bot.is_cur_full_auto = WeaponIsFullAuto(newWeapon);
|
self.bot.is_cur_full_auto = WeaponIsFullAuto(newWeapon);
|
||||||
|
self.bot.cur_weap_dist_multi = SetWeaponDistMulti(weap);
|
||||||
|
|
||||||
if (newWeapon == "none")
|
if (newWeapon == "none")
|
||||||
continue;
|
continue;
|
||||||
@ -450,7 +475,7 @@ watchHoldBreath()
|
|||||||
if(self.bot.isfrozen)
|
if(self.bot.isfrozen)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
self holdbreath((self playerADS() && weaponClass(self getCurrentWEapon()) == "rifle"));
|
self holdbreath(self playerADS() >= 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,9 +722,11 @@ updateAimOffset(obj, theTime)
|
|||||||
targetObjUpdateTraced(obj, daDist, ent, theTime, isScriptObj, usingRemote)
|
targetObjUpdateTraced(obj, daDist, ent, theTime, isScriptObj, usingRemote)
|
||||||
{
|
{
|
||||||
distClose = self.pers["bots"]["skill"]["dist_start"];
|
distClose = self.pers["bots"]["skill"]["dist_start"];
|
||||||
|
distClose *= self.bot.cur_weap_dist_multi;
|
||||||
distClose *= distClose;
|
distClose *= distClose;
|
||||||
|
|
||||||
distMax = self.pers["bots"]["skill"]["dist_max"];
|
distMax = self.pers["bots"]["skill"]["dist_max"];
|
||||||
|
distMax *= self.bot.cur_weap_dist_multi;
|
||||||
distMax *= distMax;
|
distMax *= distMax;
|
||||||
|
|
||||||
timeMulti = 1;
|
timeMulti = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user