|
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_Boss2Pogo is an action that is used as part of the Egg Slimer's pinch phase thinker, when the boss is pogoing towards the target player. This action does not handle the pogoing action itself, but merely the additional behavior that must be done continuously during the pogoing – the pogoing itself is assumed to be handled by either A_Boss2PogoSFX
or A_Boss2PogoTarget
so that the full pogoing behavior can work properly.
When the actor is moving downwards and is 8 fracunits or lower above the ground, the actor will switch to its RaiseState
if not already using it – for the Egg Slimer this would be the state that starts the next jump of the pogoing phase (using either of the pogoing actions already mentioned). Otherwise, if the actor is moving downwards and hasn't already sprayed anything during the jump, the actor will spray Objects of a type determined by PainChance
around itself, playing AttackSound
when it does.
Object property |
Use
|
RaiseState |
Pogoing state
|
AttackSound |
Goop spraying sound
|
PainChance |
Object type of goop to spawn
|
Code – A_Boss2Pogo
|
|
// Function: A_Boss2Pogo
//
// Description: Pogo part of Boss 2 AI.
//
// var1 = unused
// var2 = unused
//
void A_Boss2Pogo(mobj_t *actor)
{
#ifdef HAVE_BLUA
if (LUA_CallAction("A_Boss2Pogo", actor))
return;
#endif
if (actor->z <= actor->floorz + FixedMul(8*FRACUNIT, actor->scale) && actor->momz <= 0)
{
if (actor->state != &states[actor->info->raisestate])
P_SetMobjState(actor, actor->info->raisestate);
// Pogo Mode
}
else if (actor->momz < 0 && actor->reactiontime)
{
const fixed_t ns = FixedMul(3 * FRACUNIT, actor->scale);
mobj_t *goop;
fixed_t fz = actor->z+actor->height+FixedMul(24*FRACUNIT, actor->scale);
angle_t fa;
INT32 i;
// spray in all 8 directions!
for (i = 0; i < 8; i++)
{
actor->movedir++;
actor->movedir %= NUMDIRS;
fa = (actor->movedir*FINEANGLES/8) & FINEMASK;
goop = P_SpawnMobj(actor->x, actor->y, fz, actor->info->painchance);
goop->momx = FixedMul(FINECOSINE(fa),ns);
goop->momy = FixedMul(FINESINE(fa),ns);
goop->momz = FixedMul(4*FRACUNIT, actor->scale);
goop->fuse = 10*TICRATE;
}
actor->reactiontime = 0; // we already shot goop, so don't do it again!
if (actor->info->attacksound)
S_StartAttackSound(actor, actor->info->attacksound);
actor->flags2 |= MF2_JUSTATTACKED;
}
}
|
|