Skip to content

Commit

Permalink
use walking key instead for kicks
Browse files Browse the repository at this point in the history
- enable non-saber staff kicks in mp
  • Loading branch information
TwelveEyes committed Jul 2, 2024
1 parent 0759954 commit 4acf717
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
9 changes: 6 additions & 3 deletions code/game/bg_pmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11164,9 +11164,10 @@ qboolean PM_SaberThrowable( void )
qboolean PM_CheckAltKickAttack( void )
{
if ( (pm->cmd.buttons&BUTTON_ALT_ATTACK)
&& (!(pm->ps->pm_flags&PMF_ALT_ATTACK_HELD) ||PM_SaberInReturn(pm->ps->saberMove))
&& (pm->cmd.buttons&BUTTON_WALKING)
&& (!(pm->ps->pm_flags&PMF_ALT_ATTACK_HELD) /* ||PM_SaberInReturn(pm->ps->saberMove) */)
&& (!PM_FlippingAnim(pm->ps->legsAnim)||pm->ps->legsAnimTimer<=250)
&& (!PM_SaberThrowable()||(pm->ps->pm_flags&PMF_FORCE_FOCUS_HELD))
// && (!PM_SaberThrowable())
// && pm->ps->SaberActive()
&& !(pm->ps->saber[0].saberFlags&SFL_NO_KICKS)//okay to do kicks with this saber
&& (!pm->ps->dualSabers || !(pm->ps->saber[1].saberFlags&SFL_NO_KICKS) )//okay to do kicks with this saber
Expand Down Expand Up @@ -12258,15 +12259,17 @@ void PM_WeaponLightsaber(void)
}
}


if ( pm->ps->weaponTime > 0 )
{
//FIXME: allow some window of opportunity to change your attack
// if it just started and your directional input is different
// than it was before... but only 100 milliseconds at most?
//OR: Make it so that attacks don't start until 100ms after you
// press the attack button...???
// kick code block used to be here, has been moved above outside this if scope
if ( (pm->ps->clientNum < MAX_CLIENTS||PM_ControlledByPlayer()) //player
&& PM_SaberInReturn( pm->ps->saberMove )//in a saber return move - FIXME: what about transitions?
// && PM_SaberInReturn( pm->ps->saberMove )//in a saber return move - FIXME: what about transitions?
//&& pm->ps->torsoAnimTimer<=250//towards the end of a saber return anim
&& pm->ps->saberBlocked == BLOCKED_NONE//not interacting with any other saber
&& !(pm->cmd.buttons&BUTTON_ATTACK)//not trying to swing the saber
Expand Down
9 changes: 8 additions & 1 deletion code/game/wp_saber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7003,6 +7003,13 @@ void WP_SaberThrow( gentity_t *self, usercmd_t *ucmd )
return;
}

if ( (ucmd->buttons&BUTTON_ALT_ATTACK)
&& (ucmd->buttons&BUTTON_WALKING)
&& !(self->client->ps.pm_flags&PMF_ALT_ATTACK_HELD) )
{//don't throw when trying to kick
return;
}

if ( !g_saberNewControlScheme->integer )
{
if ( PM_SaberInKata( (saberMoveName_t)self->client->ps.saberMove ) )
Expand Down Expand Up @@ -7033,7 +7040,7 @@ void WP_SaberThrow( gentity_t *self, usercmd_t *ucmd )
{//don't even have it out
return;
}
else if ( (ucmd->buttons&BUTTON_ALT_ATTACK) && !(self->client->ps.pm_flags&PMF_ALT_ATTACK_HELD) && !(self->client->ps.pm_flags&PMF_FORCE_FOCUS_HELD) )
else if ( (ucmd->buttons&BUTTON_ALT_ATTACK) && !(self->client->ps.pm_flags&PMF_ALT_ATTACK_HELD) )
{//still holding it, not still holding attack from a previous throw, so throw it.
if ( !(self->client->ps.saberEventFlags&SEF_INWATER) && WP_SaberLaunch( self, saberent, qtrue ) )
{
Expand Down
7 changes: 4 additions & 3 deletions codemp/game/bg_saber.c
Original file line number Diff line number Diff line change
Expand Up @@ -2708,7 +2708,8 @@ qboolean PM_CheckAltKickAttack( void )
if ( (pm->cmd.buttons&BUTTON_ALT_ATTACK)
//&& (!(pm->ps->pm_flags&PMF_ALT_ATTACK_HELD)||PM_SaberInReturn(pm->ps->saberMove))
&& (!BG_FlippingAnim(pm->ps->legsAnim)||pm->ps->legsTimer<=250)
&& (pm->ps->fd.saberAnimLevel == SS_STAFF/*||!pm->ps->saber[0].throwable*/) && !pm->ps->saberHolstered )
// && (pm->ps->fd.saberAnimLevel == SS_STAFF/*||!pm->ps->saber[0].throwable*/) && !pm->ps->saberHolstered
)
{
return qtrue;
}
Expand Down Expand Up @@ -2967,11 +2968,11 @@ void PM_WeaponLightsaber(void)

if ( (pm->cmd.buttons & BUTTON_ALT_ATTACK) )
{ //might as well just check for a saber throw right here
if (pm->ps->fd.saberAnimLevel == SS_STAFF)
if ( (pm->cmd.buttons & BUTTON_WALKING) /* pm->ps->fd.saberAnimLevel == SS_STAFF */)
{ //kick instead of doing a throw
//if in a saber attack return anim, can interrupt it with a kick
if ( pm->ps->weaponTime > 0//can't fire yet
&& PM_SaberInReturn( pm->ps->saberMove )//in a saber return move - FIXME: what about transitions?
// && PM_SaberInReturn( pm->ps->saberMove )//in a saber return move - FIXME: what about transitions?
//&& pm->ps->weaponTime <= 250//should be able to fire soon
//&& pm->ps->torsoTimer <= 250//torso almost done
&& pm->ps->saberBlocked == BLOCKED_NONE//not interacting with any other saber
Expand Down

0 comments on commit 4acf717

Please sign in to comment.