Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions src/game/client/neo/c_neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,21 +1228,16 @@ void C_NEO_Player::PreThink( void )
m_bHasBeenAirborneForTooLongToSuperJump = false;
}

if (m_iNeoClass == NEO_CLASS_RECON)
if (m_iNeoClass == NEO_CLASS_RECON &&
(m_afButtonPressed & IN_JUMP) && (m_nButtons & IN_SPEED) &&
IsAllowedToSuperJump())
{
if ((m_afButtonPressed & IN_JUMP) && (m_nButtons & IN_SPEED))
SuitPower_Drain(SUPER_JMP_COST);
bool forward = m_nButtons & IN_FORWARD;
bool backward = m_nButtons & IN_BACK;
if (forward xor backward)
{
// If player holds both forward + back, only use up AUX power.
// This movement trick replaces the original NT's trick of
// sideways-superjumping with the intent of dumping AUX for a
// jump setup that requires sprint jumping without the superjump.
if (IsAllowedToSuperJump())
{
if (!((m_nButtons & IN_FORWARD) && (m_nButtons & IN_BACK)))
{
SuperJump();
}
}
SuperJump();
}
}

Expand Down Expand Up @@ -1462,7 +1457,7 @@ bool C_NEO_Player::IsAllowedToSuperJump(void)

// Only superjump if we have a reasonable jump direction in mind
// NEO TODO (Rain): should we support sideways superjumping?
if ((m_nButtons & (IN_FORWARD | IN_BACK)) == 0)
if ((m_nButtons & (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT)) == 0)
{
return false;
}
Expand Down Expand Up @@ -1493,7 +1488,20 @@ void C_NEO_Player::SuperJump(void)
// We don't give an upwards boost aside from regular jump
forward.z = 0;

ApplyAbsVelocityImpulse(forward * neo_recon_superjump_intensity.GetFloat());
// Flip direction if jumping backwards
if (m_nButtons & IN_BACK)
{
forward = -forward;
}

float boostIntensity = GetPlayerMaxSpeed();
if (m_nButtons & (IN_MOVELEFT | IN_MOVERIGHT))
{
constexpr float sideWaysNerf = 0.70710678118; // 1 / sqrt(2);
boostIntensity *= sideWaysNerf;
}

ApplyAbsVelocityImpulse(forward * boostIntensity);
}

float C_NEO_Player::CloakPower_CurrentVisualPercentage(void) const
Expand Down
40 changes: 17 additions & 23 deletions src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,29 +1066,16 @@ void CNEO_Player::PreThink(void)
NetworkStateChanged();
}

if (m_iNeoClass == NEO_CLASS_RECON)
if (m_iNeoClass == NEO_CLASS_RECON &&
(m_afButtonPressed & IN_JUMP) && (m_nButtons & IN_SPEED) &&
IsAllowedToSuperJump())
{
if ((m_afButtonPressed & IN_JUMP) && (m_nButtons & IN_SPEED))
SuitPower_Drain(SUPER_JMP_COST);
bool forward = m_nButtons & IN_FORWARD;
bool backward = m_nButtons & IN_BACK;
if (forward xor backward)
{
if (IsAllowedToSuperJump())
{
SuitPower_Drain(SUPER_JMP_COST);

// If player holds both forward + back, only use up AUX power.
// This movement trick replaces the original NT's trick of
// sideways-superjumping with the intent of dumping AUX for a
// jump setup that requires sprint jumping without the superjump.
if (!((m_nButtons & IN_FORWARD) && (m_nButtons & IN_BACK)))
{
SuperJump();
}
}
// Allow intentional AUX dump (see comment above)
// even when not allowed to actually superjump.
else if ((m_nButtons & IN_FORWARD) && (m_nButtons & IN_BACK))
{
SuitPower_Drain(SUPER_JMP_COST);
}
SuperJump();
}
}

Expand Down Expand Up @@ -1220,6 +1207,13 @@ void CNEO_Player::SuperJump(void)
forward = -forward;
}

float boostIntensity = GetPlayerMaxSpeed();
if (m_nButtons & (IN_MOVELEFT | IN_MOVERIGHT))
{
constexpr float sideWaysNerf = 0.70710678118; // 1 / sqrt(2);
boostIntensity *= sideWaysNerf;
}

// NEO TODO (Rain): handle underwater case
// NEO TODO (Rain): handle ladder mounted case
// NEO TODO (Rain): handle "mounted" use key context case
Expand Down Expand Up @@ -1257,7 +1251,7 @@ void CNEO_Player::SuperJump(void)
pOther->AddFlag(FL_BASEVELOCITY);
#endif

ApplyAbsVelocityImpulse(forward * neo_recon_superjump_intensity.GetFloat());
ApplyAbsVelocityImpulse(forward * boostIntensity);
}

bool CNEO_Player::IsAllowedToSuperJump(void)
Expand All @@ -1280,7 +1274,7 @@ bool CNEO_Player::IsAllowedToSuperJump(void)

// Only superjump if we have a reasonable jump direction in mind
// NEO TODO (Rain): should we support sideways superjumping?
if ((m_nButtons & (IN_FORWARD | IN_BACK)) == 0)
if ((m_nButtons & (IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT)) == 0)
{
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/game/shared/neo/neo_player_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ ConVar cl_autoreload_when_empty("cl_autoreload_when_empty", "1", FCVAR_USERINFO
true, 0.0f, true, 1.0f);
ConVar neo_aim_hold("neo_aim_hold", "0", FCVAR_USERINFO | FCVAR_ARCHIVE, "Hold to aim as opposed to toggle aim.", true, 0.0f, true, 1.0f);
#endif
ConVar neo_recon_superjump_intensity("neo_recon_superjump_intensity", "250", FCVAR_REPLICATED | FCVAR_CHEAT,
"Recon superjump intensity multiplier.", true, 1.0, false, 0);

ConVar neo_ghost_bhopping("neo_ghost_bhopping", "0", FCVAR_REPLICATED, "Allow ghost bunnyhopping", true, 0, true, 1);

Expand Down
2 changes: 0 additions & 2 deletions src/game/shared/neo/neo_player_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ extern bool IsThereRoomForLeanSlide(CNEO_Player *player,
// Is the player allowed to aim zoom with a weapon of this type?
bool IsAllowedToZoom(CNEOBaseCombatWeapon *pWep);

extern ConVar neo_recon_superjump_intensity;

//ConVar sv_neo_resupply_anywhere("sv_neo_resupply_anywhere", "0", FCVAR_CHEAT | FCVAR_REPLICATED);

inline const char* GetNeoClassName(int neoClassIdx)
Expand Down