Time for action – I like you, I kill you last
First, let's start by writing the boss's version of the Seeking
state. This will be a bit different than the minions, as the boss won't move into a separate Attacking
state.
First, the state declaration:
auto state Seeking { }
Now the
Tick
function. We're altering this slightly from the minions; the boss won't stop while attacking and we're adding a line to make him strafe around the player a bit:function Tick(float DeltaTime) { local vector NewLocation; if(Enemy == none) GetEnemy(); if(Enemy != none) { NewLocation = Location; NewLocation += normal(Enemy.Location - Location) * MovementSpeed * DeltaTime; NewLocation += normal((Enemy.Location - Location) cross vect(0, 0, 1)) * MovementSpeed * DeltaTime; SetLocation(NewLocation); } }
Now let's add a timer in the
BeginState
function to make him attack every four seconds:function BeginState(Name PreviousStateName) { SetTimer(4.0, true, 'Attack'); }
For the boss' attack...