diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-12 16:35:30 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-12 16:35:30 +0200 |
commit | 7555c06c51090eea7a90254d35f5c376992605aa (patch) | |
tree | adb9fa15977fe9af2363cc963feef3707648ddbd /src/game/bg_pmove.c | |
parent | 0acd120b36b4eac1d55646d09745bb39c15dd0fc (diff) |
Add a delay to Rocket Launcher shots.
Diffstat (limited to 'src/game/bg_pmove.c')
-rw-r--r-- | src/game/bg_pmove.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index b19dd68..051f6e6 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2892,13 +2892,18 @@ static void PM_BeginWeaponChange( int weapon ) if( pm->ps->weaponstate == WEAPON_DROPPING ) return; + // prevent storing a primed rocket launcher + if( pm->ps->weapon == WP_ROCKET_LAUNCHER && + pm->ps->stats[ STAT_MISC ] > 0 ) + return; + // cancel a reload pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD; if( pm->ps->weaponstate == WEAPON_RELOADING ) pm->ps->weaponTime = 0; //special case to prevent storing a charged up lcannon - if( (pm->ps->weapon == WP_LUCIFER_CANNON || pm->ps->weapon == WP_FLAMER) ) + if( (pm->ps->weapon == WP_LUCIFER_CANNON || pm->ps->weapon == WP_FLAMER ) ) pm->ps->stats[ STAT_MISC ] = 0; pm->ps->weaponstate = WEAPON_DROPPING; @@ -3120,6 +3125,19 @@ static void PM_Weapon( void ) pm->ps->eFlags |= EF_WARN_CHARGE; } + if( pm->ps->weapon == WP_ROCKET_LAUNCHER ) + { + if( ( ( !pm->ps->weaponTime && ( pm->cmd.buttons & BUTTON_ATTACK ) ) + || pm->ps->stats[ STAT_MISC ] > 0 ) && pm->ps->ammo ) + { + if( pm->ps->stats[ STAT_MISC ] == 0 ) + PM_AddEvent( EV_ROCKETL_PRIME ); + + pm->ps->stats[ STAT_MISC ] += pml.msec; + pm->ps->eFlags |= EF_WARN_CHARGE; + } + } + // don't allow attack until all buttons are up if( pm->ps->pm_flags & PMF_RESPAWNED ) return; @@ -3412,16 +3430,7 @@ static void PM_Weapon( void ) case WP_MASS_DRIVER: - { - if(pm->ps->ammo > 6 && attack3) - { - attack3 = attack2 = qtrue; - } - else - attack2 = attack3 = qfalse; - } - //attack2 is handled on the client for zooming (cg_view.c) - + //attack2 is handled on the client for zooming (cg_view.c) if( !attack1 ) { pm->ps->weaponTime = 0; @@ -3430,6 +3439,19 @@ static void PM_Weapon( void ) } break; + case WP_ROCKET_LAUNCHER: + if( pm->ps->stats[ STAT_MISC ] > ROCKETL_DELAY ) + { + attack1 = qtrue; + pm->ps->stats[ STAT_MISC ] = 0; + } + else + { + pm->ps->weaponTime = 0; + pm->ps->weaponstate = WEAPON_READY; + return; + } + default: if( !attack1 && !attack2 && !attack3 ) { |