| 10047 | } |
| 10048 | |
| 10049 | void 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 | |
| 10080 | void WP_StartForceHealEffects( gentity_t *self ) |
| 10081 | { |
no test coverage detected