// A_RandomShadowFrame
// Gives a random sprite for the Mayonaka static shadows. Dumb and simple.
void A_RandomShadowFrame(mobj_t *actor)
{
mobj_t *fire;
mobj_t *fake;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_RandomShadowFrame", (actor)))
return;
#endif
if (!actor->extravalue1) // Hack that spawns thoks that look like random shadows. Otherwise the state would overwrite our frame and that's a pain.
{
fake = P_SpawnMobj(actor->x, actor->y, actor->z, MT_THOK);
fake->sprite = SPR_ENM1;
fake->frame = P_RandomRange(0, 6);
P_SetScale(fake, FRACUNIT*3/2);
fake->scale = FRACUNIT*3/2;
fake->destscale = FRACUNIT*3/2;
fake->angle = actor->angle;
fake->tics = -1;
actor->flags2 |= MF2_DONTDRAW;
actor->extravalue1 = 1;
}
P_SetScale(actor, FRACUNIT*3/2);
// I have NO CLUE how to hardcode all of that fancy Linedef Executor shit so the fire spinout will be done by these entities directly.
if (P_LookForPlayers(actor, false, false, 380<<FRACBITS)) // got target
{
if (actor->target && !actor->target->player->powers[pw_flashing]
&& !actor->target->player->kartstuff[k_invincibilitytimer]
&& !actor->target->player->kartstuff[k_growshrinktimer]
&& !actor->target->player->kartstuff[k_spinouttimer]
&& P_IsObjectOnGround(actor->target)
&& actor->z == actor->target->z)
{
P_DamageMobj(actor->target, actor, actor, 1);
P_InstaThrust(actor->target, actor->angle, 16<<FRACBITS);
fire = P_SpawnMobj(actor->target->x, actor->target->y, actor->target->z, MT_THOK);
P_SetMobjStateNF(fire, S_QUICKBOOM1);
P_SetScale(fire, 4<<FRACBITS);
fire->color = SKINCOLOR_KETCHUP;
S_StartSound(actor->target, sfx_fire2);
}
}
return;
}