* Turned CA_DASHMODE into SF_DASHMODE.

* SF_DASHMODE users can now dash on water.
* Gave CA_HOVER its own states/sprite2s.
* Gave Super Sonic's hover his own hover-run state/sprite2.
This commit is contained in:
toasterbabe 2016-12-24 00:11:54 +00:00
parent 102f26182b
commit 578b809557
7 changed files with 115 additions and 76 deletions

View file

@ -45,6 +45,7 @@ typedef enum
SF_MARIODAMAGE = SF_NOJUMPDAMAGE|SF_STOMPDAMAGE, // The Mario method of being able to damage enemies, etc.
SF_MACHINE = 1<<10, // Beep boop. Are you a robot?
SF_NOSPINDASHDUST = 1<<11, // Don't spawn dust particles when charging a spindash
SF_DASHMODE = 1<<12, // Sonic Advance 2 style top speed increase?
// free up to and including 1<<31
} skinflags_t;
@ -65,7 +66,6 @@ typedef enum
CA_JUMPBOOST,
CA_AIRDRILL,
CA_JUMPTHOK,
CA_DASHMODE,
CA_BOUNCE,
CA_TWINSPIN
} charability_t;

View file

@ -3816,6 +3816,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_PLAY_CLING",
"S_PLAY_CLIMB",
// CA_FLOAT/CA_SLOWFALL
"S_PLAY_FLOAT",
"S_PLAY_FLOAT_RUN",
// CA_BOUNCE
"S_PLAY_BOUNCE",
"S_PLAY_BOUNCE_LANDING",
@ -3844,6 +3848,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_PLAY_SUPER_EDGE",
"S_PLAY_SUPER_RIDE",
"S_PLAY_SUPER_FLOAT",
"S_PLAY_SUPER_FLOAT_RUN",
// SF_SUPER
"S_PLAY_SUPERTRANS1",
@ -7194,6 +7199,7 @@ struct {
{"SF_MARIODAMAGE",SF_MARIODAMAGE},
{"SF_MACHINE",SF_MACHINE},
{"SF_NOSPINDASHDUST",SF_NOSPINDASHDUST},
{"SF_DASHMODE",SF_DASHMODE},
// Character abilities!
// Primary
@ -7211,7 +7217,6 @@ struct {
{"CA_JUMPBOOST",CA_JUMPBOOST},
{"CA_AIRDRILL",CA_AIRDRILL},
{"CA_JUMPTHOK",CA_JUMPTHOK},
{"CA_DASHMODE",CA_DASHMODE},
{"CA_BOUNCE",CA_BOUNCE},
{"CA_TWINSPIN",CA_TWINSPIN},
// Secondary

View file

@ -402,6 +402,9 @@ char spr2names[NUMPLAYERSPRITES][5] =
"CLNG",
"CLMB",
"FLT_",
"FRUN",
"BNCE",
"BLND",
@ -426,6 +429,7 @@ char spr2names[NUMPLAYERSPRITES][5] =
"SEDG",
"SRID",
"SFLT",
"SFRN",
"NTRN",
"NSTD",
@ -517,8 +521,12 @@ state_t states[NUMSTATES] =
{SPR_PLAY, SPR2_CLNG|FF_ANIMATE, -1, {NULL}, 0, 4, S_NULL}, // S_PLAY_CLING
{SPR_PLAY, SPR2_CLMB, 5, {NULL}, 0, 0, S_PLAY_CLIMB}, // S_PLAY_CLIMB
// CA_FLOAT/CA_SLOWFALL
{SPR_PLAY, SPR2_FLT , 7, {NULL}, 0, 0, S_PLAY_FLOAT}, // S_PLAY_FLOAT
{SPR_PLAY, SPR2_FRUN, 7, {NULL}, 0, 0, S_PLAY_FLOAT_RUN}, // S_PLAY_FLOAT_RUN
// CA_BOUNCE
{SPR_PLAY, SPR2_BNCE|FF_ANIMATE, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_BOUNCE
{SPR_PLAY, SPR2_BNCE|FF_ANIMATE, -1, {NULL}, 0, 0, S_NULL}, // S_PLAY_BOUNCE
{SPR_PLAY, SPR2_BLND|FF_SPR2ENDSTATE, 2, {NULL}, S_PLAY_BOUNCE, 4, S_PLAY_BOUNCE_LANDING}, // S_PLAY_BOUNCE_LANDING
// CA_TWINSPIN
@ -545,6 +553,7 @@ state_t states[NUMSTATES] =
{SPR_PLAY, SPR2_SEDG|FF_ANIMATE, -1, {NULL}, 0, 12, S_NULL}, // S_PLAY_SUPER_EDGE
{SPR_PLAY, SPR2_SRID, 4, {NULL}, 0, 0, S_PLAY_SUPER_RIDE}, // S_PLAY_SUPER_RIDE
{SPR_PLAY, SPR2_SFLT, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT}, // S_PLAY_SUPER_FLOAT
{SPR_PLAY, SPR2_SFRN, 7, {NULL}, 0, 0, S_PLAY_SUPER_FLOAT_RUN}, // S_PLAY_SUPER_FLOAT_RUN
// SF_SUPER
{SPR_PLAY, SPR2_TRNS, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS

View file

@ -604,6 +604,9 @@ enum playersprite
SPR2_CLNG, // cling
SPR2_CLMB, // climb
SPR2_FLT , // float
SPR2_FRUN, // float run
SPR2_BNCE, // bounce
SPR2_BLND, // bounce landing
@ -628,6 +631,7 @@ enum playersprite
SPR2_SEDG, // super edge
SPR2_SRID, // super ride
SPR2_SFLT, // super float
SPR2_SFRN, // super float run
SPR2_NTRN, // NiGHTS transformation
SPR2_NSTD, // NiGHTS stand
@ -700,7 +704,7 @@ typedef enum state
S_PLAY_SPIN,
S_PLAY_DASH,
S_PLAY_GASP,
S_PLAY_JUMP, // spin jump
S_PLAY_JUMP,
S_PLAY_SPRING,
S_PLAY_FALL,
S_PLAY_EDGE,
@ -716,6 +720,10 @@ typedef enum state
S_PLAY_CLING,
S_PLAY_CLIMB,
// CA_FLOAT/CA_SLOWFALL
S_PLAY_FLOAT,
S_PLAY_FLOAT_RUN,
// CA_BOUNCE
S_PLAY_BOUNCE,
S_PLAY_BOUNCE_LANDING,
@ -738,12 +746,13 @@ typedef enum state
S_PLAY_SUPER_DRWN,
S_PLAY_SUPER_SPIN,
S_PLAY_SUPER_GASP,
S_PLAY_SUPER_JUMP, // see note above
S_PLAY_SUPER_JUMP,
S_PLAY_SUPER_SPRING,
S_PLAY_SUPER_FALL,
S_PLAY_SUPER_EDGE,
S_PLAY_SUPER_RIDE,
S_PLAY_SUPER_FLOAT,
S_PLAY_SUPER_FLOAT_RUN,
// SF_SUPER
S_PLAY_SUPER_TRANS,

View file

@ -460,9 +460,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
}
// CA_DASHMODE users destroy spikes and monitors, CA_TWINSPIN users and CA2_MELEE users destroy spikes.
// SF_DASHMODE users destroy spikes and monitors, CA_TWINSPIN users and CA2_MELEE users destroy spikes.
if ((tmthing->player)
&& (((tmthing->player->charability == CA_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE)
&& (((tmthing->player->charflags & SF_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE)
&& (thing->flags & (MF_MONITOR) || thing->type == MT_SPIKE))
|| ((((tmthing->player->charability == CA_TWINSPIN) && (tmthing->player->panim == PA_ABILITY))
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2))
@ -1086,7 +1086,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough.
{
if (player->pflags & PF_BOUNCING)
P_DoAbilityBounce(player);
P_DoAbilityBounce(player, false);
return false;
}
else

View file

@ -233,11 +233,11 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2)
spr2 = SPR2_FALL;
break;
case SPR2_FLY:
case SPR2_FLY :
spr2 = SPR2_SPNG;
break;
case SPR2_SWIM:
spr2 = SPR2_FLY;
spr2 = SPR2_FLY ;
break;
case SPR2_TIRE:
spr2 = (player && player->charability == CA_SWIM) ? SPR2_SWIM : SPR2_FLY;
@ -253,6 +253,13 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2)
spr2 = SPR2_CLMB;
break;
case SPR2_FLT :
spr2 = SPR2_WALK;
break;
case SPR2_FRUN:
spr2 = SPR2_RUN ;
break;
case SPR2_BNCE:
spr2 = SPR2_FALL;
break;
@ -317,6 +324,9 @@ UINT8 P_GetMobjSprite2(mobj_t *mobj, UINT8 spr2)
case SPR2_SFLT:
spr2 = SPR2_SWLK;
break;
case SPR2_SFRN:
spr2 = SPR2_SRUN;
break;
// NiGHTS sprites.
case SPR2_NTRN:
@ -470,6 +480,10 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FALL);
case S_PLAY_EDGE:
return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_EDGE);
case S_PLAY_FLOAT:
return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FLOAT);
case S_PLAY_FLOAT_RUN:
return P_SetPlayerMobjState(mobj, S_PLAY_SUPER_FLOAT_RUN);
default:
break;
}
@ -496,12 +510,15 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
player->panim = PA_EDGE;
break;
case S_PLAY_WALK:
case S_PLAY_FLOAT:
case S_PLAY_SUPER_WALK:
case S_PLAY_SUPER_FLOAT:
player->panim = PA_WALK;
break;
case S_PLAY_RUN:
case S_PLAY_FLOAT_RUN:
case S_PLAY_SUPER_RUN:
case S_PLAY_SUPER_FLOAT_RUN:
player->panim = PA_RUN;
break;
case S_PLAY_PEEL:
@ -607,7 +624,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
else
mobj->tics = 2;
}
else if (P_IsObjectOnGround(mobj) || player->powers[pw_super]) // Only if on the ground or superflying.
else if (P_IsObjectOnGround(mobj) || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super]) // Only if on the ground or superflying.
{
if (player->panim == PA_WALK)
{
@ -3250,22 +3267,26 @@ static void P_PlayerZMovement(mobj_t *mo)
{
if (mo->player->cmomx || mo->player->cmomy)
{
if (mo->player->charability == CA_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL)
if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL)
P_SetPlayerMobjState(mo, S_PLAY_PEEL);
else if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) && mo->player->panim != PA_RUN)
else if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale)
&& (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->state-states == S_PLAY_SUPER_FLOAT_RUN))
P_SetPlayerMobjState(mo, S_PLAY_RUN);
else if ((mo->player->rmomx || mo->player->rmomy) && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_SUPER_FLOAT))
else if ((mo->player->rmomx || mo->player->rmomy)
&& (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->state-states == S_PLAY_SUPER_FLOAT))
P_SetPlayerMobjState(mo, S_PLAY_WALK);
else if (!mo->player->rmomx && !mo->player->rmomy && mo->player->panim != PA_IDLE)
P_SetPlayerMobjState(mo, S_PLAY_STND);
}
else
{
if (mo->player->charability == CA_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL)
if (mo->player->charflags & SF_DASHMODE && mo->player->dashmode >= 3*TICRATE && mo->player->panim != PA_PEEL)
P_SetPlayerMobjState(mo, S_PLAY_PEEL);
if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale) && mo->player->panim != PA_RUN)
else if (mo->player->speed >= FixedMul(mo->player->runspeed, mo->scale)
&& (mo->player->panim != PA_RUN || mo->state-states == S_PLAY_FLOAT_RUN || mo->state-states == S_PLAY_SUPER_FLOAT_RUN))
P_SetPlayerMobjState(mo, S_PLAY_RUN);
else if ((mo->momx || mo->momy) && (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_SUPER_FLOAT))
else if ((mo->momx || mo->momy)
&& (mo->player->panim != PA_WALK || mo->state-states == S_PLAY_FLOAT || mo->state-states == S_PLAY_SUPER_FLOAT))
P_SetPlayerMobjState(mo, S_PLAY_WALK);
else if (!mo->momx && !mo->momy && mo->player->panim != PA_IDLE)
P_SetPlayerMobjState(mo, S_PLAY_STND);
@ -3582,7 +3603,7 @@ static boolean P_SceneryZMovement(mobj_t *mo)
boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
{
if (!(player->pflags & PF_NIGHTSMODE) && !player->homing
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER) && player->mo->ceilingz-*rover->topheight >= player->mo->height)
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= 3*TICRATE) && player->mo->ceilingz-*rover->topheight >= player->mo->height)
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
&& !(player->pflags & PF_SLIDING)
&& abs(player->mo->z - *rover->topheight) < FixedMul(30*FRACUNIT, player->mo->scale))
@ -4148,7 +4169,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
if (mobj->player->cmd.forwardmove || mobj->player->cmd.sidemove)
P_InstaThrust(
mobj,
R_PointToAngle(mobj->x, mobj->y) + R_PointToAngle2(0, 0, mobj->player->cmd.forwardmove<<FRACBITS, -mobj->player->cmd.sidemove<<FRACBITS),
mobj->angle + R_PointToAngle2(0, 0, mobj->player->cmd.forwardmove<<FRACBITS, -mobj->player->cmd.sidemove<<FRACBITS),
mobj->player->speed);
goto animonly; // no need for checkposition - doesn't move at ALL
}

View file

@ -1778,7 +1778,7 @@ static void P_CheckBustableBlocks(player_t *player)
// if it's not an FF_SHATTER, you must be spinning (and not jumping)
// or be super
// or have CA_GLIDEANDCLIMB
// or be in dashmode with CA_DASHMODE
// or be in dashmode with SF_DASHMODE
// or be using CA_TWINSPIN
// or be using CA2_MELEE
// or are drilling in NiGHTS
@ -1788,7 +1788,7 @@ static void P_CheckBustableBlocks(player_t *player)
&& !(player->powers[pw_super])
&& !(player->charability == CA_GLIDEANDCLIMB)
&& !(player->pflags & PF_BOUNCING)
&& !((player->charability == CA_DASHMODE) && (player->dashmode >= 3*TICRATE))
&& !((player->charflags & SF_DASHMODE) && (player->dashmode >= 3*TICRATE))
&& !((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY))
&& !(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)
&& !(player->pflags & PF_DRILLING)
@ -3673,18 +3673,10 @@ void P_DoJump(player_t *player, boolean soundandstate)
player->mo->momz = 24*FRACUNIT;
else if (player->powers[pw_super])
{
if (player->charability == CA_FLOAT)
player->mo->momz = 28*FRACUNIT; //Obscene jump height anyone?
else if (player->charability == CA_SLOWFALL)
player->mo->momz = 37*(FRACUNIT/2); //Less obscene because during super, floating propells oneself upward.
else // Default super jump momentum.
player->mo->momz = 13*FRACUNIT;
player->mo->momz = 13*FRACUNIT;
// Add a boost for super characters with float/slowfall and multiability.
if (player->charability2 == CA2_MULTIABILITY &&
(player->charability == CA_FLOAT || player->charability == CA_SLOWFALL))
player->mo->momz += 2*FRACUNIT;
else if (player->charability == CA_JUMPBOOST)
if (player->charability == CA_JUMPBOOST)
{
if (player->charability2 == CA2_MULTIABILITY)
player->mo->momz += FixedMul(FRACUNIT/4, dist6);
@ -3692,12 +3684,6 @@ void P_DoJump(player_t *player, boolean soundandstate)
player->mo->momz += FixedMul(FRACUNIT/8, dist6);
}
}
else if (player->charability2 == CA2_MULTIABILITY &&
(player->charability == CA_FLOAT || player->charability == CA_SLOWFALL))
{
// Multiability exceptions, since some abilities cannot effectively use it and need a boost.
player->mo->momz = 12*FRACUNIT; // Increased jump height due to ineffective repeat.
}
else
{
player->mo->momz = 39*(FRACUNIT/4); // Default jump momentum.
@ -4205,7 +4191,6 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
case CA_THOK:
case CA_HOMINGTHOK:
case CA_JUMPTHOK: // Credit goes to CZ64 and Sryder13 for the original
case CA_DASHMODE: // Credit goes to Iceman404
// Now it's Sonic's abilities turn!
// THOK!
if (!(player->pflags & PF_THOKKED) || (player->charability2 == CA2_MULTIABILITY))
@ -4213,7 +4198,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
// Catapult the player
fixed_t actionspd = player->actionspd;
if (player->charability == CA_DASHMODE)
if (player->charflags & SF_DASHMODE)
actionspd = max(player->normalspeed, FixedDiv(player->speed, player->mo->scale));
if (player->mo->eflags & MFE_UNDERWATER)
@ -4290,12 +4275,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
case CA_DOUBLEJUMP: // Double-Jump
if (!(player->pflags & PF_THOKKED) || ((player->charability2 == CA2_MULTIABILITY) && (player->secondjump < (player->actionspd >> FRACBITS))))
{
// Allow infinite double jumping if super.
if (!player->powers[pw_super])
player->pflags |= PF_THOKKED;
else
player->secondjump = 0;
player->pflags |= PF_THOKKED;
player->pflags &= ~PF_JUMPED;
P_DoJump(player, true);
player->secondjump++;
@ -4303,8 +4283,13 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
break;
case CA_FLOAT: // Float
case CA_SLOWFALL: // Slow descent hover
if (!player->secondjump)
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
{
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT);
player->pflags |= PF_THOKKED;
player->pflags &= ~(PF_JUMPED|PF_SPINNING);
player->secondjump = 1;
}
break;
case CA_TELEKINESIS:
if (!(player->pflags & PF_THOKKED) || player->charability2 == CA2_MULTIABILITY)
@ -4400,12 +4385,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->mo->momz = 0;
else if (player->charability == CA_SLOWFALL)
{
if (player->powers[pw_super])
{
if (P_MobjFlip(player->mo)*player->mo->momz < gravity*16)
player->mo->momz = P_MobjFlip(player->mo)*gravity*16; //Float upward 4x as fast while super.
}
else if (P_MobjFlip(player->mo)*player->mo->momz < -gravity*4)
if (P_MobjFlip(player->mo)*player->mo->momz < -gravity*4)
player->mo->momz = P_MobjFlip(player->mo)*-gravity*4;
}
player->pflags &= ~PF_SPINNING;
@ -4417,11 +4397,20 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->pflags &= ~PF_JUMPDOWN;
// Repeat abilities, but not double jump!
if (player->charability2 == CA2_MULTIABILITY && player->charability != CA_DOUBLEJUMP)
player->secondjump = 0;
else if (player->charability == CA_FLOAT && player->secondjump == 1)
player->secondjump = 2;
if (player->secondjump == 1 && player->charability != CA_DOUBLEJUMP)
{
if (player->charability2 == CA2_MULTIABILITY)
{
player->pflags |= PF_JUMPED;
P_SetPlayerMobjState(player->mo, S_PLAY_JUMP);
player->secondjump = 0;
}
else
{
P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
player->secondjump = 2;
}
}
// If letting go of the jump button while still on ascent, cut the jump height.
if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1)
@ -6696,16 +6685,22 @@ static void P_MovePlayer(player_t *player)
if ((cmd->forwardmove != 0 || cmd->sidemove != 0) || (player->powers[pw_super] && !onground))
{
// If the player is in dashmode, here's their peelout.
if (player->charability == CA_DASHMODE && player->dashmode >= 3*TICRATE && player->panim == PA_RUN && !player->skidtime && (onground || player->powers[pw_super]))
if (player->charflags & SF_DASHMODE && player->dashmode >= 3*TICRATE && player->panim == PA_RUN && !player->skidtime && (onground || player->powers[pw_super]))
P_SetPlayerMobjState (player->mo, S_PLAY_PEEL);
// If the player is moving fast enough,
// break into a run!
else if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime && (onground || player->powers[pw_super]))
P_SetPlayerMobjState (player->mo, S_PLAY_RUN);
else if (player->speed >= runspd && player->panim == PA_WALK && !player->skidtime
&& (onground || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super]))
{
if (!onground)
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT_RUN);
else
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
}
// Super floating at slow speeds has its own special animation.
else if (player->powers[pw_super] && player->panim == PA_IDLE && !onground)
P_SetPlayerMobjState (player->mo, S_PLAY_SUPER_FLOAT);
// Floating at slow speeds has its own special animation.
else if ((((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super]) && player->panim == PA_IDLE && !onground)
P_SetPlayerMobjState (player->mo, S_PLAY_FLOAT);
// Otherwise, just walk.
else if ((player->rmomx || player->rmomy) && player->panim == PA_IDLE)
@ -6714,15 +6709,15 @@ static void P_MovePlayer(player_t *player)
// If your peelout animation is playing, and you're
// going too slow, switch back to the run.
if (player->charability == CA_DASHMODE && player->panim == PA_PEEL && player->dashmode < 3*TICRATE)
if (player->charflags & SF_DASHMODE && player->panim == PA_PEEL && player->dashmode < 3*TICRATE)
P_SetPlayerMobjState(player->mo, S_PLAY_RUN);
// If your running animation is playing, and you're
// going too slow, switch back to the walking frames.
if (player->panim == PA_RUN && player->speed < runspd)
{
if (!onground && player->powers[pw_super])
P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT);
if (onground || ((player->charability == CA_FLOAT || player->charability == CA_SLOWFALL) && player->secondjump == 1) || player->powers[pw_super])
P_SetPlayerMobjState(player->mo, S_PLAY_FLOAT);
else
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
}
@ -6790,6 +6785,7 @@ static void P_MovePlayer(player_t *player)
if (!(player->pflags & PF_JUMPDOWN) || (onground && P_MobjFlip(player->mo)*player->mo->momz <= 0)) // If not holding the jump button OR on flat ground
{
P_ResetPlayer(player); // down, stop bouncing.
player->pflags |= PF_THOKKED;
if (onground)
P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
else if (player->charability2 == CA2_MULTIABILITY)
@ -9432,12 +9428,13 @@ void P_PlayerThink(player_t *player)
player->pflags &= ~PF_SLIDING;
#define dashmode player->dashmode
// Dash mode ability
if ((player->charability == CA_DASHMODE) && !(player->gotflag) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho.
// Dash mode - thanks be to Iceman404
if ((player->charflags & SF_DASHMODE) && !(player->gotflag) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho.
{
if (player->speed >= FixedMul(player->runspeed, player->mo->scale) || (player->pflags & PF_STARTDASH))
if (player->secondjump != 1 && (player->speed >= FixedMul(player->runspeed, player->mo->scale) || (player->pflags & PF_STARTDASH)))
{
dashmode++; // Counter. Adds 1 to dash mode per tic in top speed.
if (dashmode < 3*TICRATE + 3)
dashmode++; // Counter. Adds 1 to dash mode per tic in top speed.
if (dashmode == 3*TICRATE) // This isn't in the ">=" equation because it'd cause the sound to play infinitely.
S_StartSound(player->mo, sfx_s3ka2); // If the player enters dashmode, play this sound on the the tic it starts.
}
@ -9456,16 +9453,14 @@ void P_PlayerThink(player_t *player)
}
else if (P_IsObjectOnGround(player->mo)) // Activate dash mode if we're on the ground.
{
if (player->normalspeed < skins[player->skin].actionspd) // If the player normalspeed is not currently at actionspd in dash mode, add speed each tic
player->normalspeed = player->normalspeed + 1*FRACUNIT/5; // Enter Dash Mode smoothly.
if (player->normalspeed < skins[player->skin].normalspeed*2) // If the player normalspeed is not currently at normalspeed*2 in dash mode, add speed each tic
player->normalspeed += FRACUNIT/5; // Enter Dash Mode smoothly.
if (player->jumpfactor < FixedMul(skins[player->skin].jumpfactor, 5*FRACUNIT/4)) // Boost jump height.
player->jumpfactor = player->jumpfactor + 1*FRACUNIT/300;
player->jumpfactor += FRACUNIT/300;
}
dashmode = min(dashmode, 3*TICRATE + 3);
if (player->normalspeed >= skins[player->skin].actionspd)
if (player->normalspeed >= skins[player->skin].normalspeed*2)
{
mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages
ghost->fuse = 2; // Makes the images fade quickly