A_Boss1Chase
Since this hidden (source code-only) SOC Action is behind SpawnState's behavior for custom bosses, should we add any information on it at all?
Relevant code and such, taken from here:
Object Property |
Use
|
MeleeState |
Attack State #1
|
MissileState |
Attack State #2
|
RaiseState |
Pinch Phase Attack
|
Damage |
When the boss' health points reaches this value, start pinch phase
|
Speed |
Chasing Speed
|
Code - A_Boss1Chase
|
|
// Function: A_Boss1Chase
//
// Description: Like A_Chase, but for Boss 1.
//
// var1 = unused
// var2 = unused
//
void A_Boss1Chase(mobj_t *actor)
{
INT32 delta;
if (actor->reactiontime)
actor->reactiontime--;
if (actor->z < actor->floorz+33*FRACUNIT)
actor->z = actor->floorz+33*FRACUNIT;
// turn towards movement direction if not there yet
if (actor->movedir < NUMDIRS)
{
actor->angle &= (7<<29);
delta = actor->angle - (actor->movedir << 29);
if (delta > 0)
actor->angle -= ANGLE_45;
else if (delta < 0)
actor->angle += ANGLE_45;
}
// do not attack twice in a row
if (actor->flags2 & MF2_JUSTATTACKED)
{
actor->flags2 &= ~MF2_JUSTATTACKED;
P_NewChaseDir(actor);
return;
}
if (actor->movecount)
goto nomissile;
if (!P_CheckMissileRange(actor))
goto nomissile;
if (actor->reactiontime <= 0)
{
if (actor->health > actor->info->damage)
{
if (P_Random() & 1)
P_SetMobjState(actor, actor->info->missilestate);
else
P_SetMobjState(actor, actor->info->meleestate);
}
else
P_SetMobjState(actor, actor->info->raisestate);
actor->flags2 |= MF2_JUSTATTACKED;
actor->reactiontime = 2*TICRATE;
return;
}
// ?
nomissile:
// possibly choose another target
if (multiplayer && P_Random() < 2)
{
if (P_LookForPlayers(actor, true, false, 0))
return; // got a new target
}
// chase towards player
if (--actor->movecount < 0 || !P_Move(actor, actor->info->speed))
P_NewChaseDir(actor);
}
|
|
Is it worth adding in then? Just wondering. :x --Monster Iestyn Talk 14:20, 22 May 2013 (CDT)
Well, it doesn't seem like it would add any useful information that's not already in the article, so I would say no. Correct me if I'm wrong. Oh, and one thing because I'm pedantic like that: If it's source-code only, it's not a SOC action. :P --SpiritCrusherTalk • Contribs 00:31, 23 May 2013 (CDT)