mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-19 16:32:53 +00:00
fixed rc and turret
This commit is contained in:
parent
513f71ed6b
commit
91c8bd30a5
@ -43,6 +43,8 @@ connected()
|
|||||||
|
|
||||||
self thread bot_on_spawn();
|
self thread bot_on_spawn();
|
||||||
self thread bot_on_death();
|
self thread bot_on_death();
|
||||||
|
|
||||||
|
self thread bot_watch_rcbomb();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -147,6 +149,9 @@ bot_on_spawn()
|
|||||||
*/
|
*/
|
||||||
bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHitLoc )
|
bot_damage_callback( eAttacker, iDamage, sMeansOfDeath, sWeapon, eInflictor, sHitLoc )
|
||||||
{
|
{
|
||||||
|
if (!self is_bot())
|
||||||
|
return;
|
||||||
|
|
||||||
self.killerLocation = undefined;
|
self.killerLocation = undefined;
|
||||||
if(!IsDefined( self ) || !isDefined(self.team))
|
if(!IsDefined( self ) || !isDefined(self.team))
|
||||||
return;
|
return;
|
||||||
@ -465,9 +470,6 @@ getKillstreakTargetLocation()
|
|||||||
*/
|
*/
|
||||||
bot_rccar_think(weapon)
|
bot_rccar_think(weapon)
|
||||||
{
|
{
|
||||||
self endon("weapon_object_destroyed");
|
|
||||||
self endon("rcbomb_done");
|
|
||||||
|
|
||||||
diff = self GetBotDiffNum();
|
diff = self GetBotDiffNum();
|
||||||
|
|
||||||
if (diff > 0)
|
if (diff > 0)
|
||||||
@ -488,6 +490,38 @@ bot_rccar_think(weapon)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wait 2;
|
wait 2;
|
||||||
|
|
||||||
|
while (isDefined(self.rcbomb))
|
||||||
|
wait 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Watches rcbomb
|
||||||
|
*/
|
||||||
|
bot_watch_rcbomb()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
wait 2;
|
||||||
|
|
||||||
|
if (!IsDefined( self.rcbomb ))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
self bot_watch_rccar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Watches while bot uses rccar
|
||||||
|
*/
|
||||||
|
bot_watch_rccar()
|
||||||
|
{
|
||||||
|
self endon("weapon_object_destroyed");
|
||||||
|
self endon("rcbomb_done");
|
||||||
|
|
||||||
|
diff = self GetBotDiffNum();
|
||||||
stuck_time = 0;
|
stuck_time = 0;
|
||||||
last_org = self.origin;
|
last_org = self.origin;
|
||||||
|
|
||||||
@ -498,7 +532,7 @@ bot_rccar_think(weapon)
|
|||||||
if (!IsDefined( self.rcbomb ))
|
if (!IsDefined( self.rcbomb ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DistanceSquared(self.rcbomb.origin, last_org) < 2 * 2)
|
if (DistanceSquared(self.rcbomb.origin, last_org) < 4 * 4)
|
||||||
stuck_time += 0.5;
|
stuck_time += 0.5;
|
||||||
else
|
else
|
||||||
stuck_time = 0;
|
stuck_time = 0;
|
||||||
@ -523,6 +557,9 @@ bot_rccar_think(weapon)
|
|||||||
if ( level.teamBased && player.team == self.team )
|
if ( level.teamBased && player.team == self.team )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!SightTracePassed( self.rcbomb.origin, player.origin, false, self.rcbomb ))
|
||||||
|
continue;
|
||||||
|
|
||||||
if ( diff == 0 )
|
if ( diff == 0 )
|
||||||
{
|
{
|
||||||
if ( DistanceSquared( self.rcbomb.origin, player.origin ) < 512 * 512 )
|
if ( DistanceSquared( self.rcbomb.origin, player.origin ) < 512 * 512 )
|
||||||
@ -713,6 +750,9 @@ bot_killstreak_think()
|
|||||||
{
|
{
|
||||||
wait( RandomIntRange( 1, 3 ) );
|
wait( RandomIntRange( 1, 3 ) );
|
||||||
|
|
||||||
|
if (isDefined(self.carryingTurret) && self.carryingTurret)
|
||||||
|
self PressAttackButton();
|
||||||
|
|
||||||
if (isDefined(self GetThreat()))
|
if (isDefined(self GetThreat()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user