She's a lot more complete.

* Melee now has a proper weightiness to it with a landing frame.
* If you have twinspin too, do a somersalt when running and hitting the melee button.
* If you have melee, go into the melee landing frame when twinspinning into the ground.
This commit is contained in:
toasterbabe 2017-03-19 16:48:35 +00:00
parent 1582aee909
commit 3a6f659b93
8 changed files with 43 additions and 20 deletions

View file

@ -3940,6 +3940,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
// CA2_MELEE // CA2_MELEE
"S_PLAY_MELEE", "S_PLAY_MELEE",
"S_PLAY_MELEE_FINISH", "S_PLAY_MELEE_FINISH",
"S_PLAY_MELEE_LANDING",
// SF_SUPER // SF_SUPER
"S_PLAY_SUPERTRANS1", "S_PLAY_SUPERTRANS1",

View file

@ -543,4 +543,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls. /// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls.
//#define PAPER_COLLISIONCORRECTION //#define PAPER_COLLISIONCORRECTION
/// Hudname padding.
#define SKINNAMEPADDING
#endif // __DOOMDEF__ #endif // __DOOMDEF__

View file

@ -421,6 +421,7 @@ char spr2names[NUMPLAYERSPRITES][5] =
"TWIN", "TWIN",
"MLEE", "MLEE",
"MLEL",
"TRNS", "TRNS",
@ -531,6 +532,7 @@ state_t states[NUMSTATES] =
// CA2_MELEE // CA2_MELEE
{SPR_PLAY, SPR2_MLEE|FF_SPR2ENDSTATE, 1, {NULL}, S_PLAY_MELEE_FINISH, 0, S_PLAY_MELEE}, // S_PLAY_MELEE {SPR_PLAY, SPR2_MLEE|FF_SPR2ENDSTATE, 1, {NULL}, S_PLAY_MELEE_FINISH, 0, S_PLAY_MELEE}, // S_PLAY_MELEE
{SPR_PLAY, SPR2_MLEE, 20, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_MELEE_FINISH {SPR_PLAY, SPR2_MLEE, 20, {NULL}, 0, 0, S_PLAY_FALL}, // S_PLAY_MELEE_FINISH
{SPR_PLAY, SPR2_MLEL, 35, {NULL}, 0, 0, S_PLAY_WALK}, // S_PLAY_MELEE_LANDING
// SF_SUPER // SF_SUPER
{SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS {SPR_PLAY, SPR2_TRNS|FF_SPR2SUPER, 4, {NULL}, 0, 0, S_PLAY_SUPER_TRANS2}, // S_PLAY_SUPER_TRANS

View file

@ -634,6 +634,7 @@ enum playersprite
SPR2_TWIN, // twinspin SPR2_TWIN, // twinspin
SPR2_MLEE, // melee SPR2_MLEE, // melee
SPR2_MLEL, // melee land
SPR2_TRNS, // transformation SPR2_TRNS, // transformation
@ -741,6 +742,7 @@ typedef enum state
// CA2_MELEE // CA2_MELEE
S_PLAY_MELEE, S_PLAY_MELEE,
S_PLAY_MELEE_FINISH, S_PLAY_MELEE_FINISH,
S_PLAY_MELEE_LANDING,
// SF_SUPER // SF_SUPER
S_PLAY_SUPER_TRANS, S_PLAY_SUPER_TRANS,

View file

@ -379,7 +379,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
if (elementalpierce == 2) if (elementalpierce == 2)
P_DoBubbleBounce(player); P_DoBubbleBounce(player);
else else if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
toucher->momz = -toucher->momz; toucher->momz = -toucher->momz;
} }
if (player->pflags & PF_BOUNCING) if (player->pflags & PF_BOUNCING)
@ -437,7 +437,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{ {
if (elementalpierce == 2) if (elementalpierce == 2)
P_DoBubbleBounce(player); P_DoBubbleBounce(player);
else else if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
toucher->momz = -toucher->momz; toucher->momz = -toucher->momz;
} }
if (player->pflags & PF_BOUNCING) if (player->pflags & PF_BOUNCING)

View file

@ -1085,7 +1085,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
{ {
if (elementalpierce == 2) if (elementalpierce == 2)
P_DoBubbleBounce(player); P_DoBubbleBounce(player);
else else if (!(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))
*momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically.
} }
if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough.

View file

@ -468,6 +468,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
case S_PLAY_SPINDASH: // ...but the act of SPINDASHING is charability2 specific. case S_PLAY_SPINDASH: // ...but the act of SPINDASHING is charability2 specific.
case S_PLAY_MELEE: case S_PLAY_MELEE:
case S_PLAY_MELEE_FINISH: case S_PLAY_MELEE_FINISH:
case S_PLAY_MELEE_LANDING:
player->panim = PA_ABILITY2; player->panim = PA_ABILITY2;
break; break;
case S_PLAY_RIDE: case S_PLAY_RIDE:
@ -3194,8 +3195,8 @@ static void P_PlayerZMovement(mobj_t *mo)
// aren't pressing any controls. // aren't pressing any controls.
if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy && !(mo->player->pflags & PF_SPINNING)) if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy && !(mo->player->pflags & PF_SPINNING))
{ {
mo->momx = mo->momx/2; mo->momx >>= 1;
mo->momy = mo->momy/2; mo->momy >>= 1;
} }
} }
@ -3206,10 +3207,11 @@ static void P_PlayerZMovement(mobj_t *mo)
mo->player->skidtime = TICRATE; mo->player->skidtime = TICRATE;
mo->tics = -1; mo->tics = -1;
} }
else if (mo->player->charability2 == CA2_MELEE && mo->player->panim == PA_ABILITY2) else if (mo->player->charability2 == CA2_MELEE && ((mo->player->charability == CA_TWINSPIN && mo->player->panim == PA_ABILITY) || (mo->player->panim == PA_ABILITY2)))
{ {
P_InstaThrust(mo, mo->angle, 0); P_SetPlayerMobjState(mo, S_PLAY_MELEE_LANDING);
P_SetPlayerMobjState(mo, S_PLAY_STND); mo->tics = mo->player->powers[pw_nocontrol] = (mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(mo->movefactor)))>>FRACBITS;
S_StartSound(mo, sfx_s3k8b);
} }
else if (mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN) else if (mo->player->pflags & PF_JUMPED || (mo->player->pflags & (PF_SPINNING|PF_USEDOWN)) != (PF_SPINNING|PF_USEDOWN)
|| mo->player->powers[pw_tailsfly] || mo->state-states == S_PLAY_FLY_TIRED) || mo->player->powers[pw_tailsfly] || mo->state-states == S_PLAY_FLY_TIRED)

View file

@ -3815,20 +3815,34 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
} }
break; break;
case CA2_MELEE: // Melee attack case CA2_MELEE: // Melee attack
if (!(player->panim == PA_ABILITY2) && (cmd->buttons & BT_USE) && player->speed < FixedMul(10<<FRACBITS, player->mo->scale) if (!(player->panim == PA_ABILITY2) && (cmd->buttons & BT_USE)
&& !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN)
&& canstand) && canstand)
{ {
P_ResetPlayer(player); P_ResetPlayer(player);
player->mo->z += P_MobjFlip(player->mo); if ((player->charability == CA_TWINSPIN) && (player->speed > FixedMul(player->runspeed, player->mo->scale)))
player->mo->momx = player->cmomx = 0; {
player->mo->momy = player->cmomy = 0; P_DoJump(player, false);
P_SetObjectMomZ(player->mo, player->mindash, false); player->jumping = 0;
P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->maxdash, player->mo->scale)); player->mo->momz = FixedMul(player->mo->momz, 3*FRACUNIT/2);
P_SetPlayerMobjState(player->mo, S_PLAY_MELEE); player->pflags |= PF_THOKKED;
player->pflags |= PF_USEDOWN; P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
S_StartSound(player->mo, sfx_s3k8b); S_StartSound(player->mo, sfx_s3k8b);
} }
else
{
player->powers[pw_nocontrol] = TICRATE;
player->mo->z += P_MobjFlip(player->mo);
P_SetObjectMomZ(player->mo, player->mindash, false);
if (FixedMul(player->speed, FINECOSINE(((player->mo->angle - R_PointToAngle2(0, 0, player->rmomx, player->rmomy)) >> ANGLETOFINESHIFT) & FINEMASK)) < FixedMul(player->maxdash, player->mo->scale))
P_InstaThrust(player->mo, player->mo->angle, FixedMul(player->maxdash, player->mo->scale));
player->mo->momx += player->cmomx;
player->mo->momy += player->cmomy;
P_SetPlayerMobjState(player->mo, S_PLAY_MELEE);
S_StartSound(player->mo, sfx_s3k42);
}
player->pflags |= PF_USEDOWN;
}
break; break;
} }
} }
@ -6503,11 +6517,10 @@ static void P_SkidStuff(player_t *player)
// If your push angle is more than this close to a full 180 degrees, trigger a skid. // If your push angle is more than this close to a full 180 degrees, trigger a skid.
if (dang > ANGLE_157h) if (dang > ANGLE_157h)
{ {
player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS;
S_StartSound(player->mo, sfx_skid);
if (player->panim != PA_WALK) if (player->panim != PA_WALK)
P_SetPlayerMobjState(player->mo, S_PLAY_WALK); P_SetPlayerMobjState(player->mo, S_PLAY_WALK);
player->mo->tics = player->skidtime; player->mo->tics = player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS;
S_StartSound(player->mo, sfx_skid);
} }
} }
} }