improved mantling and knifing glass

This commit is contained in:
INeedBots 2021-02-27 14:25:32 -06:00
parent 49c98fe467
commit 527f63b771

View File

@ -399,6 +399,7 @@ doBotMovement()
move_To = self.bot.moveTo; move_To = self.bot.moveTo;
angles = self GetPlayerAngles(); angles = self GetPlayerAngles();
dir = (0, 0, 0); dir = (0, 0, 0);
eye = self getEye();
if (DistanceSquared(self.origin, move_To) >= 49) if (DistanceSquared(self.origin, move_To) >= 49)
{ {
@ -420,6 +421,13 @@ doBotMovement()
dir = (dir[0], 0-dir[1], 0); 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! // move!
self botMovement(int(dir[0]), int(dir[1])); self botMovement(int(dir[0]), int(dir[1]));
} }
@ -1739,7 +1747,7 @@ movetowards(goal)
{ {
self botMoveTo(goal); self botMoveTo(goal);
if(time > 3) if(time > 3.5)
{ {
time = 0; time = 0;
if(distanceSquared(self.origin, lastOri) < 128) if(distanceSquared(self.origin, lastOri) < 128)
@ -1748,8 +1756,6 @@ movetowards(goal)
randomDir = self getRandomLargestStafe(stucks); randomDir = self getRandomLargestStafe(stucks);
self knife(); // knife glass
wait 0.25;
self botMoveTo(randomDir); self botMoveTo(randomDir);
wait stucks; wait stucks;
} }
@ -1758,7 +1764,7 @@ movetowards(goal)
} }
else if(timeslow > 1.5) else if(timeslow > 1.5)
{ {
self thread jump(); self thread doMantle();
} }
else if(timeslow > 0.75) else if(timeslow > 0.75)
{ {
@ -1780,6 +1786,19 @@ movetowards(goal)
self notify("completed_move_to"); 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. Will return the pos of the largest trace from the bot.
*/ */