mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-21 21:45:43 +00:00
climb and remote
This commit is contained in:
parent
240a9cd6c8
commit
f9aa349ba3
@ -378,15 +378,19 @@ moveHack()
|
|||||||
curWeap = self GetCurrentWeapon();
|
curWeap = self GetCurrentWeapon();
|
||||||
weapClass = weaponClass(curWeap);
|
weapClass = weaponClass(curWeap);
|
||||||
inLastStand = isDefined(self.lastStand);
|
inLastStand = isDefined(self.lastStand);
|
||||||
|
usingRemote = self isUsingRemote();
|
||||||
|
|
||||||
// a number between 0 and 1, 1 being totally flat, same level. 0 being totally above or below. about 0.7 is a 45 degree angle
|
// a number between 0 and 1, 1 being totally flat, same level. 0 being totally above or below. about 0.7 is a 45 degree angle
|
||||||
verticleDegree = getConeDot(self.bot.moveTo + (1, 1, 0), self.origin + (-1, -1, 0), VectorToAngles((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2]) - self.origin));
|
verticleDegree = getConeDot(self.bot.moveTo + (1, 1, 0), self.origin + (-1, -1, 0), VectorToAngles((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2]) - self.origin));
|
||||||
self.bot.climbing = (self.bot.next_wp != -1 && level.waypoints[self.bot.next_wp].type == "climb") ||
|
self.bot.climbing = (self.bot.next_wp != -1 && level.waypoints[self.bot.next_wp].type == "climb") ||
|
||||||
(abs(self.bot.moveTo[2] - self.origin[2]) > 50 && verticleDegree < 0.64);
|
(abs(self.bot.moveTo[2] - self.origin[2]) > 50 && verticleDegree < 0.64);
|
||||||
|
|
||||||
if (isLastStand)
|
if (inLastStand || usingRemote)
|
||||||
self.bot.climbing = false;
|
self.bot.climbing = false;
|
||||||
|
|
||||||
|
if (usingRemote)
|
||||||
|
continue;
|
||||||
|
|
||||||
moveSpeed = 10;
|
moveSpeed = 10;
|
||||||
if (self.bot.running)
|
if (self.bot.running)
|
||||||
moveSpeed *= 1.5;
|
moveSpeed *= 1.5;
|
||||||
@ -447,12 +451,13 @@ moveHack()
|
|||||||
self SetOrigin(self.bot.moveTo);
|
self SetOrigin(self.bot.moveTo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// push out of players
|
||||||
|
|
||||||
if (completedMove)
|
if (completedMove)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!self.bot.climbing)
|
if (!self.bot.climbing || inLastStand)
|
||||||
{
|
{
|
||||||
// step towards the goal
|
|
||||||
self SetOrigin(self.origin + (VectorNormalize((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2])-self.origin) * moveSpeed));
|
self SetOrigin(self.origin + (VectorNormalize((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2])-self.origin) * moveSpeed));
|
||||||
|
|
||||||
// clamp to ground
|
// clamp to ground
|
||||||
@ -461,6 +466,11 @@ moveHack()
|
|||||||
{
|
{
|
||||||
self SetOrigin(trace);
|
self SetOrigin(trace);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
self SetOrigin(self.origin - (0,0,5));
|
||||||
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,16 +493,16 @@ fireHack()
|
|||||||
|
|
||||||
shouldFire = self.bot.fire_pressed;
|
shouldFire = self.bot.fire_pressed;
|
||||||
|
|
||||||
if (self.bot.isswitching || self.bot.run_in_delay || self.bot.running || self.bot.climbing)
|
if (self.bot.isswitching || self.bot.run_in_delay || self.bot.running)
|
||||||
shouldFire = false;
|
shouldFire = false;
|
||||||
|
|
||||||
if (self.bot.isfragging || self.bot.issmoking || (!self GetCurrentWeaponClipAmmo() && !self IsUsingRemote()))
|
if (self.bot.isfragging || self.bot.issmoking || (self.bot.isreloading && !self IsUsingRemote()))
|
||||||
shouldFire = true;
|
shouldFire = true;
|
||||||
|
|
||||||
if (level.gameEnded || !gameFlag( "prematch_done" ))
|
if (level.gameEnded || !gameFlag( "prematch_done" ))
|
||||||
shouldFire = false;
|
shouldFire = false;
|
||||||
|
|
||||||
if (self.bot.isfrozen)
|
if (self.bot.isfrozen || self.bot.climbing)
|
||||||
shouldFire = false;
|
shouldFire = false;
|
||||||
|
|
||||||
self FreezeControls(!shouldFire);
|
self FreezeControls(!shouldFire);
|
||||||
@ -823,7 +833,7 @@ reload_thread()
|
|||||||
|
|
||||||
wait 2.5;
|
wait 2.5;
|
||||||
|
|
||||||
if(isDefined(self.bot.target) || self.bot.isreloading || self.bot.isfraggingafter || self.bot.issmokingafter || self.bot.isfrozen || level.gameEnded || !gameFlag( "prematch_done" ))
|
if(isDefined(self.bot.target) || self.bot.isreloading || self.bot.isfraggingafter || self.bot.issmokingafter || self.bot.isfrozen || level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.climbing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cur = self getCurrentWEapon();
|
cur = self getCurrentWEapon();
|
||||||
@ -853,7 +863,7 @@ target()
|
|||||||
if (!isAlive(self))
|
if (!isAlive(self))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(self maps\mp\_flashgrenades::isFlashbanged())
|
if(self maps\mp\_flashgrenades::isFlashbanged() || self.bot.climbing)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
myEye = self GetEye();
|
myEye = self GetEye();
|
||||||
@ -1561,9 +1571,8 @@ walk()
|
|||||||
*/
|
*/
|
||||||
strafe(target)
|
strafe(target)
|
||||||
{
|
{
|
||||||
self endon("new_enemy");
|
|
||||||
self endon("flash_rumble_loop");
|
|
||||||
self endon("kill_goal");
|
self endon("kill_goal");
|
||||||
|
self thread killWalkOnEvents();
|
||||||
|
|
||||||
angles = VectorToAngles(vectorNormalize(target.origin - self.origin));
|
angles = VectorToAngles(vectorNormalize(target.origin - self.origin));
|
||||||
anglesLeft = (0, angles[1]+90, 0);
|
anglesLeft = (0, angles[1]+90, 0);
|
||||||
@ -1582,6 +1591,7 @@ strafe(target)
|
|||||||
|
|
||||||
self botMoveTo(strafe);
|
self botMoveTo(strafe);
|
||||||
wait 2;
|
wait 2;
|
||||||
|
self notify("kill_goal");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user