Add the Jump Thok ability for use by custom characters

This commit is contained in:
wolfy852 2014-07-05 02:08:39 -05:00
parent c130be77b1
commit 39ce16a468
3 changed files with 12 additions and 2 deletions

View file

@ -55,7 +55,8 @@ typedef enum
CA_TELEKINESIS, CA_TELEKINESIS,
CA_FALLSWITCH, CA_FALLSWITCH,
CA_JUMPBOOST, CA_JUMPBOOST,
CA_AIRDRILL CA_AIRDRILL,
CA_JUMPTHOK
} charability_t; } charability_t;
//Secondary skin abilities //Secondary skin abilities

View file

@ -7523,6 +7523,7 @@ struct {
{"CA_FALLSWITCH",CA_FALLSWITCH}, {"CA_FALLSWITCH",CA_FALLSWITCH},
{"CA_JUMPBOOST",CA_JUMPBOOST}, {"CA_JUMPBOOST",CA_JUMPBOOST},
{"CA_AIRDRILL",CA_AIRDRILL}, {"CA_AIRDRILL",CA_AIRDRILL},
{"CA_JUMPTHOK",CA_JUMPTHOK},
// Secondary // Secondary
{"CA2_NONE",CA2_NONE}, // now slot 0! {"CA2_NONE",CA2_NONE}, // now slot 0!
{"CA2_SPINDASH",CA2_SPINDASH}, {"CA2_SPINDASH",CA2_SPINDASH},

View file

@ -3733,6 +3733,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{ {
case CA_THOK: case CA_THOK:
case CA_HOMINGTHOK: case CA_HOMINGTHOK:
case CA_JUMPTHOK: // Credit goes to CZ64 and Sryder13 for the original
// Now it's Sonic's abilities turn! // Now it's Sonic's abilities turn!
if (player->pflags & PF_JUMPED) if (player->pflags & PF_JUMPED)
{ {
@ -3742,12 +3743,19 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
P_DoSuperTransformation(player, false); P_DoSuperTransformation(player, false);
else // Otherwise, THOK! else // Otherwise, THOK!
{ {
if (!(player->pflags & PF_THOKKED) || (player->charability2 == CA2_MULTIABILITY)) if (!(player->pflags & PF_THOKKED) || ((player->charability2 == CA2_MULTIABILITY) && (!(player->charability == CA_JUMPTHOK))))
{ {
// Catapult the player // Catapult the player
fixed_t actionspd = player->actionspd; fixed_t actionspd = player->actionspd;
if (player->mo->eflags & MFE_UNDERWATER) if (player->mo->eflags & MFE_UNDERWATER)
actionspd >>= 1; actionspd >>= 1;
if (player->charability == CA_JUMPTHOK)
{
if ((actionspd == 60*FRACUNIT) && (actionspd > player->normalspeed)) //Limit only at default
actionspd = player->normalspeed;
player->pflags &= ~PF_JUMPED;
P_DoJump(player, false);
}
P_InstaThrust(player->mo, player->mo->angle, FixedMul(actionspd, player->mo->scale)); P_InstaThrust(player->mo, player->mo->angle, FixedMul(actionspd, player->mo->scale));
if (maptol & TOL_2D) if (maptol & TOL_2D)