|
This article or section is incomplete. It doesn't have all of the necessary core information on this topic. Please help the SRB2 Wiki by finishing this article.
|
A_BossZoom is an action that is a modification of A_SkullAttack
originally intended for use with the Egg Mobile, but was never used. The main difference from A_SkullAttack
is that instead of using a fixed flying speed, the actor's Speed
property determines the speed (Speed*5*FRACUNIT
). However, as Var1 and Var2 are not used, this action can only make the actor fly straight towards its target both vertically and horizontally.
Object property |
Use
|
AttackSound |
Attacking sound
|
Speed |
Speed (Speed*5*FRACUNIT)
|
Code – A_BossZoom
|
|
// Function: A_BossZoom
//
// Description: Like A_SkullAttack, but used by Boss 1.
//
// var1 = unused
// var2 = unused
//
void A_BossZoom(mobj_t *actor)
{
mobj_t *dest;
angle_t an;
INT32 dist;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_BossZoom", actor))
return;
#endif
if (!actor->target)
return;
dest = actor->target;
actor->flags2 |= MF2_SKULLFLY;
if (actor->info->attacksound)
S_StartAttackSound(actor, actor->info->attacksound);
A_FaceTarget(actor);
an = actor->angle >> ANGLETOFINESHIFT;
actor->momx = FixedMul(FixedMul(actor->info->speed*5*FRACUNIT, actor->scale), FINECOSINE(an));
actor->momy = FixedMul(FixedMul(actor->info->speed*5*FRACUNIT, actor->scale), FINESINE(an));
dist = P_AproxDistance(dest->x - actor->x, dest->y - actor->y);
dist = dist / FixedMul(actor->info->speed*5*FRACUNIT, actor->scale);
if (dist < 1)
dist = 1;
actor->momz = (dest->z + (dest->height>>1) - actor->z) / dist;
}
|
|