mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
strafe slowness
This commit is contained in:
parent
93adda6465
commit
0c78d98f3f
@ -770,6 +770,27 @@ moveHack()
|
||||
moveSpeed *= 0.2;
|
||||
}
|
||||
|
||||
myOrg = self.origin;
|
||||
myOrg = (myOrg[0], myOrg[1], 0);
|
||||
myAngles = self GetPlayerAngles();
|
||||
myAngles = (0, myAngles[1], 0);
|
||||
myVelocity = self.bot.velocity;
|
||||
myVelocity = (myVelocity[0], myVelocity[1], 0);
|
||||
|
||||
// 1 is totally forward, 0 is left or right, -1 is backward
|
||||
botForwardMoveCone = GetConeDot(myOrg + myVelocity, myOrg, myAngles);
|
||||
|
||||
// apply strafe slowness
|
||||
if (botForwardMoveCone < 0.95)
|
||||
{
|
||||
strafeMultiplier = 0.667;
|
||||
|
||||
if (botForwardMoveCone < 0)
|
||||
moveSpeed *= strafeMultiplier;
|
||||
else
|
||||
moveSpeed *= (((1 - strafeMultiplier) * botForwardMoveCone) + strafeMultiplier);
|
||||
}
|
||||
|
||||
if (self.bot.climbing)
|
||||
{
|
||||
if (self _hasPerk("specialty_fastmantle"))
|
||||
@ -800,8 +821,6 @@ moveHack()
|
||||
if (self _hasPerk("specialty_lightweight"))
|
||||
moveSpeed *= 1.07;
|
||||
|
||||
// speed according to forward, left, right, back components?
|
||||
|
||||
moveSpeed *= (getdvarfloat("g_speed")/190.0);
|
||||
moveSpeed *= self.moveSpeedScaler;
|
||||
|
||||
|
46
userraw/scripts/bots_test.gsc
Normal file
46
userraw/scripts/bots_test.gsc
Normal file
@ -0,0 +1,46 @@
|
||||
#include maps\mp\_utility;
|
||||
#include maps\mp\gametypes\_hud_util;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\bots\_bot_utility;
|
||||
|
||||
init()
|
||||
{
|
||||
setDvarIfUninitialized( "bots_test", true );
|
||||
|
||||
if (!getDvarInt("bots_test"))
|
||||
return;
|
||||
|
||||
level thread onConnected();
|
||||
}
|
||||
|
||||
onConnected()
|
||||
{
|
||||
for (;;)
|
||||
{
|
||||
level waittill("connected", player);
|
||||
|
||||
player thread test();
|
||||
}
|
||||
}
|
||||
|
||||
test()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
wait 0.05;
|
||||
|
||||
if (self is_bot())
|
||||
continue;
|
||||
|
||||
myOrg = self.origin;
|
||||
myOrg = (myOrg[0], myOrg[1], 0);
|
||||
myAngles = self GetPlayerAngles();
|
||||
myAngles = (0, myAngles[1], 0);
|
||||
myVelocity = self GetVelocity();
|
||||
myVelocity = (myVelocity[0], myVelocity[1], 0);
|
||||
|
||||
self sayall(GetConeDot(myOrg + myVelocity, myOrg, myAngles));
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user