mirror of
https://github.com/ineedbots/t4_bot_warfare.git
synced 2025-04-22 16:05:44 +00:00
Improved mantle and knife glass
This commit is contained in:
parent
9d0bc09dee
commit
a9ccf1bcbd
@ -188,7 +188,6 @@ onPlayerSpawned()
|
|||||||
self thread onLastStand();
|
self thread onLastStand();
|
||||||
|
|
||||||
self thread reload_watch();
|
self thread reload_watch();
|
||||||
self thread doBotMovement();
|
|
||||||
self thread sprint_watch();
|
self thread sprint_watch();
|
||||||
|
|
||||||
self thread spawned();
|
self thread spawned();
|
||||||
@ -211,6 +210,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 getEyePos();
|
||||||
|
|
||||||
if (DistanceSquared(self.origin, move_To) >= 49)
|
if (DistanceSquared(self.origin, move_To) >= 49)
|
||||||
{
|
{
|
||||||
@ -232,9 +232,15 @@ 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]));
|
||||||
self setPing(randomIntRange(45, 55));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +254,7 @@ spawned()
|
|||||||
|
|
||||||
wait self.pers["bots"]["skill"]["spawn_time"];
|
wait self.pers["bots"]["skill"]["spawn_time"];
|
||||||
|
|
||||||
|
self thread doBotMovement();
|
||||||
self thread grenade_danger();
|
self thread grenade_danger();
|
||||||
self thread check_reload();
|
self thread check_reload();
|
||||||
self thread stance();
|
self thread stance();
|
||||||
@ -1614,7 +1621,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)
|
||||||
@ -1623,8 +1630,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;
|
||||||
}
|
}
|
||||||
@ -1633,7 +1638,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)
|
||||||
{
|
{
|
||||||
@ -1655,6 +1660,22 @@ movetowards(goal)
|
|||||||
self notify("completed_move_to");
|
self notify("completed_move_to");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bots do the mantle
|
||||||
|
*/
|
||||||
|
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.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user