case 3:
// If currently in the air from a jump, and you pressed the
// button again and have the ability to fly, do so!
if(!player->thokked && !(player->powers[pw_tailsfly]) && (player->mfjumped) && (player->mo->eflags & MF_UNDERWATER))
{
P_SetPlayerMobjState(player->mo, S_PLAY_ABL1); // Change to the flying animation
if(maptol & TOL_ADVENTURE)
player->powers[pw_tailsfly] = tailsflytics/2 + 1;
else
player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer
player->mfjumped = player->mfspinning = player->mfstartdash = 0;
player->thokked = true;
}
// If currently flying, give an ascend boost.
elseif(player->powers[pw_tailsfly])
{
if(!player->fly1)
player->fly1 = 20;
else
player->fly1 = 2;
}
else
if(!player->thokked)
{
// Catapult the player
if((player->mo->eflags & MF_UNDERWATER))
P_InstaThrust(player->mo, player->mo->angle, MAXMOVE/2);
else
P_InstaThrust(player->mo, player->mo->angle, MAXMOVE);
if(player->mo->info->attacksound) S_StartSound(player->mo, player->mo->info->attacksound); // Play the THOK sound
// Now check the player's color so the right THOK object is displayed.
if(player->skincolor != 0)
{
mobj_t* mobj;
mobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z - (player->mo->info->height - player->mo->height)/3, player->mo->info->painchance);
mobj->flags = (mobj->flags & ~MF_TRANSLATION) | ((player->powers[pw_super] ? 15 : player->skincolor)<<MF_TRANSSHIFT);
}
// Must press jump while holding down spin to activate.
if(cv_homing.value && !player->homing && player->mfjumped)
{
if(P_LookForEnemies(player))
if(player->mo->tracer)
player->homing = 3*TICRATE;
}
#ifdef ANNOYINGSTEP
player->mo->eflags &= ~MF_STEPPEDUP;
#endif
Must i explain?
Fly/Swim in water Thok out of it