from what I can tell...
Code:
function float GetAIRating()
{
//airating (whether the bot uses/continues to use the weapon?)
//depending on whether bot sees an enemy/how far away it is, whether there is a combo pending
}
function SetComboTarget(UTProj_ShockBall S)
{
//if any of the three conditions are true, start the monitor function in the shockball class which was passed to this function, and turn on bwaitforcombo here, also.
}
function float RangedAttackTime()
{
//times the shockball shot if there is an enemy.
}
simulated function StartFire(byte FireModeNum) //this is when I fire either mode
{
if ( bWaitForCombo && (UTBot(Instigator.Controller) != None) ) //if I, weapon, am waiting to finish a combo, and the bot still is firing me...
{
if ( (ComboTarget == None) || ComboTarget.bDeleteMe ) //and I dont abort for losing the targeted shockball
bWaitForCombo = false; //and lose interest in the idea of doing so until another opportunity comes along
else
return; //get outta here
}
Super.StartFire(FireModeNum); //call the startfire function in the parent class and pass the same firemode which was passed to startfire in this class
}
function DoCombo() //really gonna shombo now
{
if ( bWaitForCombo ) //last check, in case change my mind from something
{
bWaitForCombo = false; //I am only going to do this once.
if ( (Instigator != None) && (Instigator.Weapon == self) ) //as long as me and my gun are still here...
{
StartFire(0); //fire firemodenum 0, the beam ewft instant hit
}
}
}
/* BestMode()
choose between regular or alt-fire //here is were you are likely to do much 0/1 swapping
*/
function byte BestMode()
{
local float EnemyDist;
local UTBot B;
local UTPawn EnemyPawn;
bWaitForCombo = false; //reset every time.
B = UTBot(Instigator.Controller);
if ( (B == None) || (B.Enemy == None) )
return 0; //set beam as best
if (B.IsShootingObjective())
return 0; //setting beam again
if ( !B.LineOfSightTo(B.Enemy) ) //maybe the enemy is around a corner or something?
{
if ( (ComboTarget != None) && !ComboTarget.bDeleteMe && B.CanCombo() ) //so if I already have a ball out
{
bWaitForCombo = true; //going to set this true for the other functions
return 0; //and get ready to beam
}
ComboTarget = None; //or maybe I am not ready to shoot at any specific ball with a beam.
if ( B.CanCombo() && B.ProficientWithWeapon() ) //but, ok, as long as I my bot is apt and fortunate enough to try and shombo
{
bRegisterTarget = true;
return 1; //I'll say to shoot a ball
}
return 0; //barring none of those other conditions, ready the beam
}
if ( UTSlowVolume(B.Enemy.PhysicsVolume) != None ) //not sure why on this one(maybe just better immersion, but..
{
return 1; //gonna shoot ball
}
EnemyPawn = UTPawn(B.Enemy);
if ( (EnemyPawn != None) && EnemyPawn.bHasSlowField ) //anyone running around with this slow field is invulnerable to instant hit stuff, afaik
{
return 1; //bot better use the projectile
}
EnemyDist = VSize(B.Enemy.Location - Instigator.Location);
if ( (EnemyDist > 4*class'UTProj_ShockBall'.default.Speed) || (EnemyDist < 150) )
{
ComboTarget = None;
return 0; //ready to shoot beam because the enemy will just dodge balls
}
if ( (ComboTarget != None) && !ComboTarget.bDeleteMe && B.CanCombo() )
{
bWaitForCombo = true;
return 0; //okay no balls flying around, which are targeted, but there is a ball, and I can combo, so ready the beam
}
ComboTarget = None; //okay none of the previous conditions were met, or I would have returned outta here. dont need combo target for the rest of the decisions
if ( (EnemyDist > 2500) && (FRand() < 0.5) ) //enemy is like, across Deck, flip a coin.
return 0; //okay for beams
if ( B.CanCombo() && B.ProficientWithWeapon() ) //know how to shombo, and also have good chance...
{
bRegisterTarget = true; //got you now, buddy
return 1; //gonna shoot the first part, the ball
}
// consider using altfire to block incoming enemy fire
if (EnemyDist < 1000.0 && B.Enemy.Weapon != None && B.Enemy.Weapon.Class != Class && B.ProficientWithWeapon())
{
return (FRand() < 0.3) ? 0 : 1; //I forgot how these statements work, but you'll probably want to switch the zeros and ones for your stuff
}
else
{
return (FRand() < 0.7) ? 0 : 1;
}
}
simulated function rotator GetAdjustedAim( vector StartFireLoc ) //bot should turn and aim. if they are an easy bot, it looks so very creepy and slow. checks that the bot is trying to shoot a beam at the ball, again with firemode 0/1
Bookmarks