MCPcopy Create free account
hub / github.com/JACoders/OpenJK / ForceSpeed

Function ForceSpeed

code/game/wp_saber.cpp:10049–10078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10047}
10048
10049void ForceSpeed( gentity_t *self, int duration )
10050{
10051 if ( self->health <= 0 )
10052 {
10053 return;
10054 }
10055 if (self->client->ps.forceAllowDeactivateTime < level.time &&
10056 (self->client->ps.forcePowersActive & (1 << FP_SPEED)) )
10057 {//stop using it
10058 WP_ForcePowerStop( self, FP_SPEED );
10059 return;
10060 }
10061 if ( !WP_ForcePowerUsable( self, FP_SPEED, 0 ) )
10062 {
10063 return;
10064 }
10065 if ( self->client->ps.saberLockTime > level.time )
10066 {//FIXME: can this be a way to break out?
10067 return;
10068 }
10069
10070 WP_DebounceForceDeactivateTime( self );
10071
10072 WP_ForcePowerStart( self, FP_SPEED, 0 );
10073 if ( duration )
10074 {
10075 self->client->ps.forcePowerDuration[FP_SPEED] = level.time + duration;
10076 }
10077 G_Sound( self, G_SoundIndex( "sound/weapons/force/speed.wav" ) );
10078}
10079
10080void WP_StartForceHealEffects( gentity_t *self )
10081{

Callers 6

PM_CheckForceUseButtonFunction · 0.70
ClientCommandFunction · 0.70
ProcessGenericCmdFunction · 0.70
Jedi_DodgeEvasionFunction · 0.70
Jedi_AttackFunction · 0.70
WP_CheckForcedPowersFunction · 0.70

Calls 6

WP_ForcePowerStopFunction · 0.70
WP_ForcePowerUsableFunction · 0.70
WP_ForcePowerStartFunction · 0.70
G_SoundFunction · 0.70
G_SoundIndexFunction · 0.70

Tested by

no test coverage detected