Give ability to bot to use shock ball

This commit is contained in:
cclecle
2022-12-04 11:57:00 +00:00
parent 39d90d8c70
commit dfb8b41154
3 changed files with 66 additions and 0 deletions

Binary file not shown.

View File

@@ -26,6 +26,72 @@ simulated event PreBeginPlay()
}
}
/* BestMode()
=> re apply base method from shockrifle to allow bot use combo
*/
function byte BestMode()
{
local float EnemyDist, MaxDist;
local bot B;
bWaitForCombo = false;
B = Bot(Instigator.Controller);
if ( (B == None) || (B.Enemy == None) )
return 0;
if (B.IsShootingObjective())
return 0;
if ( !B.EnemyVisible() )
{
if ( (ComboTarget != None) && !ComboTarget.bDeleteMe && B.CanCombo() )
{
bWaitForCombo = true;
return 0;
}
ComboTarget = None;
if ( B.CanCombo() && B.ProficientWithWeapon() )
{
bRegisterTarget = true;
return 1;
}
return 0;
}
EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
if ( B.Skill > 5 )
MaxDist = 4 * class'ShockProjectile'.default.Speed;
else
MaxDist = 3 * class'ShockProjectile'.default.Speed;
if ( (EnemyDist > MaxDist) || (EnemyDist < 150) )
{
ComboTarget = None;
return 0;
}
if ( (ComboTarget != None) && !ComboTarget.bDeleteMe && B.CanCombo() )
{
bWaitForCombo = true;
return 0;
}
ComboTarget = None;
if ( (EnemyDist > 2500) && (FRand() < 0.5) )
return 0;
if ( B.CanCombo() && B.ProficientWithWeapon() )
{
bRegisterTarget = true;
return 1;
}
if ( FRand() < 0.7 )
return 0;
return 1;
}
defaultproperties
{
FireModeClass(0)=Class'XWeapons.SuperShockBeamFire'

Binary file not shown.