A_MayonakaArrow is an action exclusive to SRB2Kart. It is the animation handler for the MC Sign. If the Extra flag is checked then 3 frames are added to the actor. The delay before the actor changes frames is randomly determined. If the Special flag is checked then the actor's frame has 6 added to it and different animation behavior occurs. The actor will have FF_PAPERSPRITE applied to it while this action is called.
Code – A_MayonakaArrow
|
|
// A_MayonakaArrow
// Used for the arrow sprite animations in Mayonaka. It's only extra visual bullshit to make em more random.
void A_MayonakaArrow(mobj_t *actor)
{
INT32 flip = 0;
INT32 iswarning;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_MayonakaArrow", (actor)))
return;
#endif
iswarning = actor->spawnpoint->options & MTF_OBJECTSPECIAL; // is our object a warning sign?
// "animtimer" is replaced by "extravalue1" here.
actor->extravalue1 = ((actor->extravalue1) ? (actor->extravalue1+1) : (P_RandomRange(0, (iswarning) ? (TICRATE/2) : TICRATE*3)));
flip = ((actor->spawnpoint->options & 1) ? (3) : (0)); // flip adds 3 frames, which is the flipped version of the sign.
// special warning behavior:
if (iswarning)
flip = 6;
actor->frame = flip + actor->extravalue2*3;
if (actor->extravalue1 >= TICRATE*7/2)
{
actor->extravalue1 = 0; // reset to 0 and start a new cycle.
// special behavior for warning sign; swap from warning to sneaker & reverse
if (iswarning)
actor->extravalue2 = (actor->extravalue2) ? (0) : (1);
}
else if (actor->extravalue1 > TICRATE*7/2 -4)
actor->frame = flip+2;
else if (actor->extravalue1 > TICRATE*3 && leveltime%2 > 0)
actor->frame = flip+1;
actor->frame |= FF_PAPERSPRITE;
actor->momz = 0;
return;
}
|
|