mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 22:05:44 +00:00
improved mantling and knifing glass
This commit is contained in:
parent
49c98fe467
commit
527f63b771
@ -399,6 +399,7 @@ doBotMovement()
|
||||
move_To = self.bot.moveTo;
|
||||
angles = self GetPlayerAngles();
|
||||
dir = (0, 0, 0);
|
||||
eye = self getEye();
|
||||
|
||||
if (DistanceSquared(self.origin, move_To) >= 49)
|
||||
{
|
||||
@ -420,6 +421,13 @@ doBotMovement()
|
||||
dir = (dir[0], 0-dir[1], 0);
|
||||
}
|
||||
|
||||
if (self isMantling())
|
||||
self crouch();
|
||||
|
||||
bt = bulletTrace(eye, eye + anglesToForward(angles) * 25, false, self);
|
||||
if (bt["surfacetype"] == "glass")
|
||||
self thread knife();
|
||||
|
||||
// move!
|
||||
self botMovement(int(dir[0]), int(dir[1]));
|
||||
}
|
||||
@ -1739,7 +1747,7 @@ movetowards(goal)
|
||||
{
|
||||
self botMoveTo(goal);
|
||||
|
||||
if(time > 3)
|
||||
if(time > 3.5)
|
||||
{
|
||||
time = 0;
|
||||
if(distanceSquared(self.origin, lastOri) < 128)
|
||||
@ -1748,8 +1756,6 @@ movetowards(goal)
|
||||
|
||||
randomDir = self getRandomLargestStafe(stucks);
|
||||
|
||||
self knife(); // knife glass
|
||||
wait 0.25;
|
||||
self botMoveTo(randomDir);
|
||||
wait stucks;
|
||||
}
|
||||
@ -1758,7 +1764,7 @@ movetowards(goal)
|
||||
}
|
||||
else if(timeslow > 1.5)
|
||||
{
|
||||
self thread jump();
|
||||
self thread doMantle();
|
||||
}
|
||||
else if(timeslow > 0.75)
|
||||
{
|
||||
@ -1780,6 +1786,19 @@ movetowards(goal)
|
||||
self notify("completed_move_to");
|
||||
}
|
||||
|
||||
doMantle()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
self endon("kill_goal");
|
||||
|
||||
self jump();
|
||||
|
||||
wait 0.35;
|
||||
|
||||
self jump();
|
||||
}
|
||||
|
||||
/*
|
||||
Will return the pos of the largest trace from the bot.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user