diff options
author | Tim Angus <tim@ngus.net> | 2002-04-04 03:21:11 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2002-04-04 03:21:11 +0000 |
commit | 6a455b5b5435f5d3c06f58b1ec42b4afd52aec03 (patch) | |
tree | daf336ec0dd63c02e50a4b0e49b2f55c88eb94aa /src/game | |
parent | 251dc1d16b5302a541f4cbd4f45fa23718db75bd (diff) |
New jetpack
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 26 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 54 | ||||
-rw-r--r-- | src/game/bg_public.h | 2 | ||||
-rw-r--r-- | src/game/g_active.c | 6 |
4 files changed, 78 insertions, 10 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index a6f3eb48..c9249823 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -2858,6 +2858,32 @@ upgradeAttributes_t bg_upgrades[ ] = 0, //int ammo; 1, //int clips; WUT_HUMANS //WUTeam_t team; + }, + { + UP_100CGAMMO, //int upgradeNum; + 10, //int price; + ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + SLOT_NONE, //int slots; + "100cgammo", //char *upgradeName; + "100 Chaingun bullets", //char *upgradeHumanName; + "icons/iconw_gauntlet", + WP_CHAINGUN, //weapon_t weaponAmmo; + 100, //int ammo; + 0, //int clips; + WUT_HUMANS //WUTeam_t team; + }, + { + UP_200GAS, //int upgradeNum; + 10, //int price; + ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + SLOT_NONE, //int slots; + "200gas", //char *upgradeName; + "200 Flamer gas", //char *upgradeHumanName; + "icons/iconw_gauntlet", + WP_FLAMER, //weapon_t weaponAmmo; + 200, //int ammo; + 0, //int clips; + WUT_HUMANS //WUTeam_t team; } }; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 05d434fd..e4b95260 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -32,11 +32,11 @@ float pm_wadeScale = 0.70f; float pm_accelerate = 10.0f; float pm_airaccelerate = 1.0f; float pm_wateraccelerate = 4.0f; -float pm_flyaccelerate = 8.0f; +float pm_flyaccelerate = 4.0f; float pm_friction = 6.0f; float pm_waterfriction = 1.0f; -float pm_flightfriction = 3.0f; +float pm_flightfriction = 6.0f; float pm_spectatorfriction = 5.0f; int c_pmove = 0; @@ -211,6 +211,9 @@ static void PM_Friction( void ) { } // apply flying friction + if( BG_gotItem( UP_JETPACK, pm->ps->stats ) && BG_activated( UP_JETPACK, pm->ps->stats ) ) + drop += speed * pm_flightfriction * pml.frametime; + if ( pm->ps->pm_type == PM_SPECTATOR ) { drop += speed*pm_spectatorfriction*pml.frametime; } @@ -297,7 +300,8 @@ static float PM_CmdScale( usercmd_t *cmd ) { dTime = pm->cmd.serverTime - time; time = pm->cmd.serverTime; - if( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS && pm->ps->pm_type == PM_NORMAL ) + if( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS && pm->ps->pm_type == PM_NORMAL && + !( BG_gotItem( UP_JETPACK, pm->ps->stats ) && BG_activated( UP_JETPACK, pm->ps->stats ) ) ) { if( !( pm->ps->stats[ STAT_STATE ] & SS_SPEEDBOOST ) ) { @@ -650,6 +654,43 @@ static void PM_WaterMove( void ) { PM_SlideMove( qfalse ); } +/* +=================== +PM_JetPackMove + +Only with the jetpack +=================== +*/ +static void PM_JetPackMove( void ) { + int i; + vec3_t wishvel; + float wishspeed; + vec3_t wishdir; + float scale; + + //normal slowdown + PM_Friction( ); + + scale = PM_CmdScale( &pm->cmd ); + + // user intentions + for( i = 0; i < 2; i++ ) + wishvel[ i ] = scale * pml.forward[ i ] * pm->cmd.forwardmove + scale * pml.right[ i ] * pm->cmd.rightmove; + + if( pm->cmd.upmove > 0.0f ) + wishvel[ 2 ] = 48.0f; + if( pm->cmd.upmove < 0.0f ) + wishvel[ 2 ] = -32.0f; + + VectorCopy( wishvel, wishdir ); + wishspeed = VectorNormalize( wishdir ); + + PM_Accelerate( wishdir, wishspeed, pm_flyaccelerate ); + + PM_StepSlideMove( qfalse, qfalse ); +} + + /* @@ -1811,7 +1852,8 @@ static void PM_CheckDuck (void) } //TA: If the standing and crouching viewheights are the same the class can't crouch - if ( ( pm->cmd.upmove < 0 ) && ( PCvh != PCcvh ) ) + if( ( pm->cmd.upmove < 0 ) && ( PCvh != PCcvh ) && + !( BG_gotItem( UP_JETPACK, pm->ps->stats ) && BG_activated( UP_JETPACK, pm->ps->stats ) ) ) { // duck pm->ps->pm_flags |= PMF_DUCKED; } @@ -2670,7 +2712,9 @@ void PmoveSingle (pmove_t *pmove) PM_DropTimers( ); - if( pm->ps->pm_flags & PMF_GRAPPLE_PULL ) + if( BG_gotItem( UP_JETPACK, pm->ps->stats ) && BG_activated( UP_JETPACK, pm->ps->stats ) ) + PM_JetPackMove( ); + else if( pm->ps->pm_flags & PMF_GRAPPLE_PULL ) { PM_GrappleMove( ); // We can wiggle a bit diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 438e2453..add68d21 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -367,6 +367,8 @@ typedef enum UP_BATTLESUIT, UP_MGCLIP, + UP_100CGAMMO, + UP_200GAS, UP_NUM_UPGRADES } upgrade_t; diff --git a/src/game/g_active.c b/src/game/g_active.c index d78e0f1c..ff229da7 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -853,11 +853,7 @@ void ClientThink_real( gentity_t *ent ) { client->lastBoostedTime + 20000 < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_BOOSTED; - if( BG_gotItem( UP_JETPACK, client->ps.stats ) && - BG_activated( UP_JETPACK, client->ps.stats ) ) - client->ps.gravity = 200.0f; - else - client->ps.gravity = g_gravity.value; + client->ps.gravity = g_gravity.value; if( BG_gotItem( UP_ANTITOXIN, client->ps.stats ) && BG_activated( UP_ANTITOXIN, client->ps.stats ) ) |