Merge pull request #15 from wolfy852/next

Add the Jump Thok ability and water running flag for use by custom characters
This commit is contained in:
Alam Arias 2014-07-06 23:07:40 -04:00
commit 2c6f83c8c9
4 changed files with 15 additions and 3 deletions

View File

@ -38,6 +38,7 @@ typedef enum
SF_HIRES = 1<<3, // Draw the sprite 2x as small?
SF_NOSKID = 1<<4, // No skid particles etc
SF_NOSPEEDADJUST = 1<<5, // Skin-specific version of disablespeedadjust
SF_RUNONWATER = 1<<6, // Run on top of water FOFs?
} skinflags_t;
//Primary and secondary skin abilities
@ -55,7 +56,8 @@ typedef enum
CA_TELEKINESIS,
CA_FALLSWITCH,
CA_JUMPBOOST,
CA_AIRDRILL
CA_AIRDRILL,
CA_JUMPTHOK
} charability_t;
//Secondary skin abilities

View File

@ -7507,6 +7507,7 @@ struct {
{"SF_HIRES",SF_HIRES},
{"SF_NOSKID",SF_NOSKID},
{"SF_NOSPEEDADJUST",SF_NOSPEEDADJUST},
{"SF_RUNONWATER",SF_RUNONWATER},
// Character abilities!
// Primary
@ -7523,6 +7524,7 @@ struct {
{"CA_FALLSWITCH",CA_FALLSWITCH},
{"CA_JUMPBOOST",CA_JUMPBOOST},
{"CA_AIRDRILL",CA_AIRDRILL},
{"CA_JUMPTHOK",CA_JUMPTHOK},
// Secondary
{"CA2_NONE",CA2_NONE}, // now slot 0!
{"CA2_SPINDASH",CA2_SPINDASH},

View File

@ -2398,7 +2398,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->charability == CA_SWIM) || player->powers[pw_super]) && player->mo->ceilingz-*rover->topheight >= player->mo->height)
&& (((player->charability == CA_SWIM) || player->powers[pw_super] || player->charflags & SF_RUNONWATER) && 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))

View File

@ -3733,6 +3733,7 @@ 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
// Now it's Sonic's abilities turn!
if (player->pflags & PF_JUMPED)
{
@ -3742,12 +3743,19 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
P_DoSuperTransformation(player, false);
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
fixed_t actionspd = player->actionspd;
if (player->mo->eflags & MFE_UNDERWATER)
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));
if (maptol & TOL_2D)