mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-20 00:42:53 +00:00
added mw2 playstyle
This commit is contained in:
parent
48261be3d2
commit
a3b2e2e655
@ -334,7 +334,10 @@ bot_spawn()
|
|||||||
self thread bot_radiation_think();
|
self thread bot_radiation_think();
|
||||||
|
|
||||||
if (getDvarInt("bots_play_nade"))
|
if (getDvarInt("bots_play_nade"))
|
||||||
|
{
|
||||||
self thread bot_use_equipment_think();
|
self thread bot_use_equipment_think();
|
||||||
|
self thread bot_watch_think_mw2();
|
||||||
|
}
|
||||||
|
|
||||||
if (getDvarInt("bots_play_target_other"))
|
if (getDvarInt("bots_play_target_other"))
|
||||||
{
|
{
|
||||||
@ -2531,6 +2534,52 @@ follow_target()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Bots play mw2
|
||||||
|
*/
|
||||||
|
bot_watch_think_mw2()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("death");
|
||||||
|
level endon("game_ended");
|
||||||
|
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
wait randomIntRange(1, 4);
|
||||||
|
|
||||||
|
if(self isDefusing() || self isPlanting())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (self IsRemoteControlling())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (self InLastStand())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (isDefined(self GetThreat()))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
tube = self getValidTube();
|
||||||
|
if (!isDefined(tube))
|
||||||
|
{
|
||||||
|
if (self GetAmmoCount("m72_law_mp"))
|
||||||
|
tube = "m72_law_mp";
|
||||||
|
else if (self GetAmmoCount("rpg_mp"))
|
||||||
|
tube = "rpg_mp";
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self GetCurrentWeapon() == tube)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (randomInt(100) > 35)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
self ChangeToWeapon(tube);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
|
Fast swaps or reload cancels don't work cause t5 bots wait for the anim to complete
|
||||||
Bots will think to switch weapons
|
Bots will think to switch weapons
|
||||||
|
@ -156,6 +156,27 @@ isWeaponAltmode(weap)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Returns a valid grenade launcher weapon
|
||||||
|
*/
|
||||||
|
getValidTube()
|
||||||
|
{
|
||||||
|
weaps = self getweaponslist();
|
||||||
|
|
||||||
|
for (i = 0; i < weaps.size; i++)
|
||||||
|
{
|
||||||
|
weap = weaps[i];
|
||||||
|
|
||||||
|
if(!self getAmmoCount(weap))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((isSubStr(weap, "gl_") && !isSubStr(weap, "_gl_")) || weap == "china_lake_mp")
|
||||||
|
return weap;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Taken from iw4 script
|
Taken from iw4 script
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user