Instawhip twirl

This commit is contained in:
AJ Martinez 2023-05-17 13:47:37 -07:00
parent a3cc422706
commit 466f7dece0

View file

@ -11,19 +11,29 @@ void Obj_InstaWhipThink (mobj_t *whip)
}
else
{
mobj_t *mo = whip->target;
player_t *player = mo->player;
// Follow player
whip->flags &= ~(MF_NOCLIPTHING);
P_MoveOrigin(whip, whip->target->x, whip->target->y, whip->target->z + whip->target->height/2);
P_SetScale(whip, whip->target->scale);
P_MoveOrigin(whip, mo->x, mo->y, mo->z + mo->height/2);
whip->flags |= MF_NOCLIPTHING;
// Twirl
whip->angle = whip->target->angle + (ANG30 * 2 * whip->fuse);
whip->target->player->drawangle = whip->angle;
if (player->follower)
player->follower->angle = whip->angle;
player->pflags |= PF_GAINAX;
player->glanceDir = -2;
// Visuals
whip->renderflags |= RF_NOSPLATBILLBOARD;
if (whip->renderflags & RF_DONTDRAW)
whip->renderflags &= ~RF_DONTDRAW;
else
whip->renderflags |= RF_DONTDRAW;
P_SetScale(whip, whip->target->scale);
}
}