|
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_Boss1Spikeballs is an action that was formerly used by the Egg Mobile in version 2.1 to spawn one of its spikeballs (an Object of type MT_EGGMOBILE_BALL
) during its pinch phase. The spikeball's SeeSound
is played, and its spawn state's action will be called; for MT_EGGMOBILE_BALL
this means A_UnidusBall
is called, initialising the spikeball's position.
The angular offset of the spikeball around the actor depends on Var1 and Var2: Var2 determines how many spikeballs in total there are meant to be, and Var1 determines the number of the spikeball being spawned (starting from 0). These are intended to be used such that, when the action has been called for every spikeball, the spikeballs will evenly spaced around the actor. For example, for the Egg Mobile to spawn four spikeballs, it calls A_Boss1Spikeballs
four times, with Var1 values 0 to 3 used in succession while Var2's value is 4 all four times:
Var1 (Spikeball #)
|
Var2 (Total #)
|
Angular offset
|
0
|
4
|
0°
|
1
|
4
|
90°
|
2
|
4
|
180°
|
3
|
4
|
270°
|
Note that this action sets the spikeball's threshold value, which is used by A_UnidusBall
to determine the distance it will be placed from the actor when rotating; specifically the value spikeball's radius + actor's radius + spikeball's PainChance
.
Code – A_Boss1Spikeballs
|
|
// Function: A_Boss1Spikeballs
//
// Description: Boss 1 spikeball spawning loop.
//
// var1 = ball number
// var2 = total balls
//
void A_Boss1Spikeballs(mobj_t *actor)
{
INT32 locvar1 = var1;
INT32 locvar2 = var2;
mobj_t *ball;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_Boss1Spikeballs", actor))
return;
#endif
ball = P_SpawnMobj(actor->x, actor->y, actor->z, MT_EGGMOBILE_BALL);
P_SetTarget(&ball->target, actor);
ball->movedir = FixedAngle(FixedMul(FixedDiv(locvar1<<FRACBITS, locvar2<<FRACBITS), 360<<FRACBITS));
ball->threshold = ball->radius + actor->radius + ball->info->painchance;
S_StartSound(ball, ball->info->seesound);
var1 = ball->state->var1, var2 = ball->state->var2;
ball->state->action.acp1(ball);
}
|
|