diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 82 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 76 | ||||
-rw-r--r-- | src/game/bg_public.h | 16 | ||||
-rw-r--r-- | src/game/g_active.c | 71 | ||||
-rw-r--r-- | src/game/g_combat.c | 6 | ||||
-rw-r--r-- | src/game/g_local.h | 8 | ||||
-rw-r--r-- | src/game/g_weapon.c | 76 | ||||
-rw-r--r-- | src/game/tremulous.h | 11 |
8 files changed, 150 insertions, 196 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 7e41c7fa..bcb90316 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1244,7 +1244,8 @@ classAttributes_t bg_classList[ ] = 0.001f, //float bob; 350, //int steptime; ABUILDER_SPEED, //float speed; - 1.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_B_LEV1, PCL_NONE, PCL_NONE }, //int children[ 3 ]; ABUILDER_TTE, //int timetoevolve; ABUILDER_VALUE //int value; @@ -1274,7 +1275,8 @@ classAttributes_t bg_classList[ ] = 0.001f, //float bob; 200, //int steptime; ABUILDER_UPG_SPEED, //float speed; - 1.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; 0, //int timetoevolve; ABUILDER_UPG_VALUE //int value; @@ -1304,7 +1306,8 @@ classAttributes_t bg_classList[ ] = 0.0f, //float bob; 25, //int steptime; SOLDIER_SPEED, //float speed; - 5.0f, //float sticky; + 10.0f, //float acceleration; + 20.0f, //float friction; { PCL_A_O_LEV1, PCL_NONE, PCL_NONE }, //int children[ 3 ]; SOLDIER_TTE, //int timetoevolve; SOLDIER_VALUE //int value; @@ -1335,7 +1338,8 @@ classAttributes_t bg_classList[ ] = 0.001f, //float bob; 25, //int steptime; HYDRA_SPEED, //float speed; - 4.0f, //float sticky; + 10.0f, //float acceleration; + 10.0f, //float friction; { PCL_A_O_LEV2, PCL_A_O_LEV1_UPG, PCL_NONE }, //int children[ 3 ]; HYDRA_TTE, //int timetoevolve; HYDRA_VALUE //int value; @@ -1366,7 +1370,8 @@ classAttributes_t bg_classList[ ] = 0.001f, //float bob; 25, //int steptime; HYDRA_UPG_SPEED, //float speed; - 4.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_O_LEV2, PCL_NONE, PCL_NONE }, //int children[ 3 ]; HYDRA_UPG_TTE, //int timetoevolve; HYDRA_UPG_VALUE //int value; @@ -1396,7 +1401,8 @@ classAttributes_t bg_classList[ ] = 0.0005f, //float bob; 25, //int steptime; DRAGOON_SPEED, //float speed; - 3.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_O_LEV3, PCL_A_O_LEV2_UPG, PCL_NONE }, //int children[ 3 ]; DRAGOON_TTE, //int timetoevolve; DRAGOON_VALUE //int value; @@ -1426,7 +1432,8 @@ classAttributes_t bg_classList[ ] = 0.0005f, //float bob; 25, //int steptime; DRAGOON_UPG_SPEED, //float speed; - 3.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_O_LEV3, PCL_NONE, PCL_NONE }, //int children[ 3 ]; DRAGOON_UPG_TTE, //int timetoevolve; DRAGOON_UPG_VALUE //int value; @@ -1456,7 +1463,8 @@ classAttributes_t bg_classList[ ] = 0.0f, //float bob; 60, //int steptime; CHIMERA_SPEED, //float speed; - 5.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_O_LEV4, PCL_A_O_LEV3_UPG, PCL_NONE }, //int children[ 3 ]; CHIMERA_TTE, //int timetoevolve; CHIMERA_VALUE //int value; @@ -1486,7 +1494,8 @@ classAttributes_t bg_classList[ ] = 0.0f, //float bob; 60, //int steptime; CHIMERA_UPG_SPEED, //float speed; - 5.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_A_O_LEV4, PCL_NONE, PCL_NONE }, //int children[ 3 ]; CHIMERA_UPG_TTE, //int timetoevolve; CHIMERA_UPG_VALUE //int value; @@ -1495,7 +1504,7 @@ classAttributes_t bg_classList[ ] = PCL_A_O_LEV4, //int classnum; "bigmofo", //char *classname; "Big Mofo", //char *humanname; - "bigmofo", //char *modelname; + "bug", //char *modelname; 1.2f, //float modelScale; "default", //char *skinname; "alien_general_hud", //char *hudname; @@ -1510,13 +1519,14 @@ classAttributes_t bg_classList[ ] = BMOFO_REGEN, //int regenRate; SCA_CANJUMP|SCA_NOWEAPONDRIFT| SCA_FOVWARPS|SCA_ALIENSENSE|SCA_NOFOOTSTEPS, //int abilities; - WP_GROUND_POUND, //weapon_t startWeapon + WP_CHARGE, //weapon_t startWeapon 0.0f, //float buildDist; 90, //int fov; - 0.0f, //float bob; + 0.001f, //float bob; 60, //int steptime; BMOFO_SPEED, //float speed; - 5.0f, //float sticky; + 5.0f, //float acceleration; + 6.0f, //float friction; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; 0, //int timetoevolve; BMOFO_VALUE //int value; @@ -1545,7 +1555,8 @@ classAttributes_t bg_classList[ ] = 0.002f, //float bob; 200, //int steptime; 1.0f, //float speed; - 1.0f, //float sticky; + 10.0f, //float acceleration; + 6.0f, //float friction; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; 0, //int timetoevolve; 0 //int value; @@ -1561,7 +1572,7 @@ classAttributes_t bg_classList[ ] = "bsuit", ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), { 0, 0, 0 }, { 0, 0, 0, }, { 0, 0, 0, }, { 0, 0, 0, }, { 0, 0, 0, }, 0, 0, 0, 0, 0, WP_NONE, 0.0f, 0, - 0.0f, 0, 1.0f, 1.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0 + 0.0f, 0, 1.0f, 1.0f, 1.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0 } }; @@ -1663,7 +1674,7 @@ float BG_FindModelScaleForClass( int pclass ) } } - Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindModelScaleForClass\n" ); + Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindModelScaleForClass( %d )\n", pclass ); return 1.0f; } @@ -1916,10 +1927,10 @@ float BG_FindSpeedForClass( int pclass ) /* ============== -BG_FindStickyForClass +BG_FindAccelerationForClass ============== */ -float BG_FindStickyForClass( int pclass ) +float BG_FindAccelerationForClass( int pclass ) { int i; @@ -1927,12 +1938,33 @@ float BG_FindStickyForClass( int pclass ) { if( bg_classList[ i ].classNum == pclass ) { - return bg_classList[ i ].sticky; + return bg_classList[ i ].acceleration; } } - Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindStickyForClass\n" ); - return 1.0f; + Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindAccelerationForClass\n" ); + return 10.0f; +} + +/* +============== +BG_FindFrictionForClass +============== +*/ +float BG_FindFrictionForClass( int pclass ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == pclass ) + { + return bg_classList[ i ].friction; + } + } + + Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindFrictionForClass\n" ); + return 6.0f; } /* @@ -2548,7 +2580,7 @@ weaponAttributes_t bg_weapons[ ] = WUT_ALIENS //WUTeam_t team; }, { - WP_GROUND_POUND, //int weaponNum; + WP_CHARGE, //int weaponNum; 0, //int price; ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages SLOT_WEAPON, //int slots; @@ -2560,11 +2592,11 @@ weaponAttributes_t bg_weapons[ ] = qtrue, //int infiniteAmmo; qfalse, //int usesEnergy; BMOFO_CLAW_REPEAT, //int repeatRate1; - BMOFO_KNOCK_REPEAT, //int repeatRate2; - BMOFO_CLAW_REPEAT, //int repeatRate3; + 0, //int repeatRate2; + 0, //int repeatRate3; 0, //int reloadTime; qfalse, //qboolean hasAltMode; - qtrue, //qboolean hasThirdMode; + qfalse, //qboolean hasThirdMode; qfalse, //qboolean purchasable; 0, //int buildDelay; WUT_ALIENS //WUTeam_t team; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 67194f97..d6b3a542 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -251,10 +251,8 @@ static void PM_Friction( void ) // if getting knocked back, no friction if( !( pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) ) { - float sticky = BG_FindStickyForClass( pm->ps->stats[ STAT_PCLASS ] ); - - control = speed < pm_stopspeed * sticky ? pm_stopspeed * sticky : speed; - drop += control*pm_friction*pml.frametime; + control = speed < pm_stopspeed ? pm_stopspeed : speed; + drop += control * BG_FindFrictionForClass( pm->ps->stats[ STAT_PCLASS ] ) * pml.frametime; } } } @@ -307,7 +305,7 @@ static void PM_Accelerate( vec3_t wishdir, float wishspeed, float accel ) accelspeed = addspeed; for( i = 0; i < 3; i++ ) - pm->ps->velocity[ i ] += accelspeed*wishdir[ i ]; + pm->ps->velocity[ i ] += accelspeed * wishdir[ i ]; #else // proper way (avoids strafe jump maxspeed bug), but feels bad vec3_t wishVelocity; @@ -344,13 +342,8 @@ static float PM_CmdScale( usercmd_t *cmd ) float total; float scale; float modifier = 1.0f; - static int time; - int dTime; int aForward, aRight; - dTime = pm->cmd.serverTime - time; - time = pm->cmd.serverTime; - 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 ) ) ) { @@ -389,7 +382,10 @@ static float PM_CmdScale( usercmd_t *cmd ) } } - if( pm->ps->pm_type == PM_GRABBED || pm->ps->pm_type == PM_KNOCKED ) + if( pm->ps->weapon == WP_CHARGE && pm->ps->pm_flags & PMF_CHARGE ) + modifier *= ( 1.0f + ( pm->ps->stats[ STAT_MISC ] / (float)BMOFO_CHARGE_TIME ) * ( BMOFO_CHARGE_SPEED - 1.0f ) ); + + if( pm->ps->pm_type == PM_GRABBED ) modifier = 0.0f; if( !BG_ClassHasAbility( pm->ps->stats[ STAT_PCLASS ], SCA_CANJUMP ) ) @@ -463,27 +459,19 @@ PM_CheckCharge */ static void PM_CheckCharge( void ) { - vec3_t forward; - - if( pm->ps->weapon != WP_GROUND_POUND ) + if( pm->ps->weapon != WP_CHARGE ) return; if( pm->cmd.buttons & BUTTON_ATTACK2 ) { - pm->ps->pm_flags &= ~PMF_CHARGE_POUNCE; + pm->ps->pm_flags &= ~PMF_CHARGE; return; } - - if( pm->ps->pm_flags & PMF_CHARGE_POUNCE ) - return; - - if( pm->ps->stats[ STAT_MISC ] == 0 ) - return; - - pm->ps->pm_flags |= PMF_CHARGE_POUNCE; - AngleVectors( pm->ps->viewangles, forward, NULL, NULL ); - VectorMA( pm->ps->velocity, pm->ps->stats[ STAT_MISC ], forward, pm->ps->velocity ); + if( pm->ps->stats[ STAT_MISC ] > 0 ) + pm->ps->pm_flags |= PMF_CHARGE; + else + pm->ps->pm_flags &= ~PMF_CHARGE; } /* @@ -500,11 +488,11 @@ static qboolean PM_CheckPounce( void ) if( pm->cmd.buttons & BUTTON_ATTACK2 ) { - pm->ps->pm_flags &= ~PMF_CHARGE_POUNCE; + pm->ps->pm_flags &= ~PMF_CHARGE; return qfalse; } - if( pm->ps->pm_flags & PMF_CHARGE_POUNCE ) + if( pm->ps->pm_flags & PMF_CHARGE ) return qfalse; if( pm->ps->stats[ STAT_MISC ] == 0 ) @@ -513,7 +501,7 @@ static qboolean PM_CheckPounce( void ) pml.groundPlane = qfalse; // jumping away pml.walking = qfalse; - pm->ps->pm_flags |= PMF_CHARGE_POUNCE; + pm->ps->pm_flags |= PMF_CHARGE; pm->ps->groundEntityNum = ENTITYNUM_NONE; @@ -560,7 +548,7 @@ static qboolean PM_CheckJump( void ) return qfalse; //can't jump and charge at the same time - if( ( pm->ps->weapon == WP_GROUND_POUND ) && pm->ps->stats[ STAT_MISC ] > 0 ) + if( ( pm->ps->weapon == WP_CHARGE ) && pm->ps->stats[ STAT_MISC ] > 0 ) return qfalse; if( ( pm->ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) && @@ -575,7 +563,7 @@ static qboolean PM_CheckJump( void ) return qfalse; //can't jump whilst grabbed - if( pm->ps->pm_type == PM_GRABBED && pm->ps->pm_type == PM_KNOCKED ) + if( pm->ps->pm_type == PM_GRABBED ) { pm->cmd.upmove = 0; return qfalse; @@ -1055,7 +1043,7 @@ static void PM_ClimbMove( void ) if( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) accelerate = pm_airaccelerate; else - accelerate = pm_accelerate; + accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); PM_Accelerate( wishdir, wishspeed, accelerate ); @@ -1175,7 +1163,7 @@ static void PM_WalkMove( void ) if( ( pml.groundTrace.surfaceFlags & SURF_SLICK ) || pm->ps->pm_flags & PMF_TIME_KNOCKBACK ) accelerate = pm_airaccelerate; else - accelerate = pm_accelerate; + accelerate = BG_FindAccelerationForClass( pm->ps->stats[ STAT_PCLASS ] ); PM_Accelerate( wishdir, wishspeed, accelerate ); @@ -2438,9 +2426,6 @@ static void PM_Weapon( void ) if( pm->ps->stats[ STAT_STATE ] & SS_HOVELING ) return; - if( pm->ps->stats[ STAT_STATE ] & SS_KNOCKEDOVER ) - return; - // check for dead player if( pm->ps->stats[ STAT_HEALTH ] <= 0 ) { @@ -2896,25 +2881,6 @@ void PM_UpdateViewAngles( playerState_t *ps, const usercmd_t *cmd ) ps->delta_angles[ i ] -= ANGLE2SHORT( fabs( diff ) * 0.05f ); } } - - //fix the view to the lock point - if( ps->pm_type == PM_KNOCKED ) - { - for( i = 0; i < 3; i++ ) - { - float diff = AngleSubtract( ps->viewangles[ i ], ps->grapplePoint[ i ] ); - - while( diff > 180.0f ) - diff -= 360.0f; - while( diff < -180.0f ) - diff += 360.0f; - - if( diff < 0 ) - ps->delta_angles[ i ] += ANGLE2SHORT( fabs( diff ) ); - else if( diff > 0 ) - ps->delta_angles[ i ] -= ANGLE2SHORT( fabs( diff ) ); - } - } } @@ -3075,7 +3041,7 @@ void PmoveSingle (pmove_t *pmove) // update the viewangles PM_UpdateViewAngles( pm->ps, &pm->cmd ); - if ( pm->ps->pm_type == PM_DEAD || pm->ps->pm_type == PM_GRABBED || pm->ps->pm_type == PM_KNOCKED ) + if ( pm->ps->pm_type == PM_DEAD || pm->ps->pm_type == PM_GRABBED ) PM_DeadMove( ); PM_DropTimers( ); diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 1e9ffff9..b923f88d 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -110,7 +110,6 @@ typedef enum PM_GRABBED, // like dead, but for when the player is still live PM_DEAD, // no acceleration or turning, but free falling PM_FREEZE, // stuck in place with no control - PM_KNOCKED, // knocked over PM_INTERMISSION, // no movement or status bar PM_SPINTERMISSION // no movement or status bar } pmtype_t; @@ -139,7 +138,7 @@ typedef enum #define PMF_FOLLOW 4096 // spectate following another player #define PMF_SCOREBOARD 8192 // spectate as a scoreboard #define PMF_INVULEXPAND 16384 // invulnerability sphere set to full size -#define PMF_CHARGE_POUNCE 32768 //TA: keep track of pouncing +#define PMF_CHARGE 32768 //TA: keep track of pouncing #define PMF_ALL_TIMES (PMF_TIME_WATERJUMP|PMF_TIME_LAND|PMF_TIME_KNOCKBACK) @@ -231,8 +230,6 @@ typedef enum #define SS_BOOSTED 0x00000200 #define SS_SLOWLOCKED 0x00000400 #define SS_POISONCLOUDED 0x00000800 -#define SS_KNOCKEDOVER 0x00001000 -#define SS_GETTINGUP 0x00002000 #define SB_VALID_TOGGLEBIT 0x00004000 @@ -321,7 +318,7 @@ typedef enum WP_POUNCE_UPG, WP_AREA_ZAP, WP_DIRECT_ZAP, - WP_GROUND_POUND, + WP_CHARGE, WP_BLASTER, WP_MACHINEGUN, @@ -801,7 +798,7 @@ typedef enum MOD_TRIGGER_HURT, MOD_ABUILDER_CLAW, - MOD_VENOM, + MOD_SOLDIER_BITE, MOD_HYDRA_CLAW, MOD_HYDRA_PCLOUD, MOD_DRAGOON_CLAW, @@ -809,6 +806,7 @@ typedef enum MOD_CHIMERA_CLAW, MOD_CHIMERA_ZAP, MOD_BMOFO_CLAW, + MOD_BMOFO_CHARGE, MOD_SLOWBLOB, MOD_POISON, @@ -898,7 +896,8 @@ typedef struct float bob; int steptime; float speed; - float sticky; + float acceleration; + float friction; int children[ 3 ]; int timeToEvolve; @@ -1083,7 +1082,8 @@ int BG_FindRegenRateForClass( int pclass ); int BG_FindFovForClass( int pclass ); float BG_FindBobForClass( int pclass ); float BG_FindSpeedForClass( int pclass ); -float BG_FindStickyForClass( int pclass ); +float BG_FindAcclerationForClass( int pclass ); +float BG_FindFrictionForClass( int pclass ); int BG_FindSteptimeForClass( int pclass ); qboolean BG_ClassHasAbility( int pclass, int ability ); weapon_t BG_FindStartWeaponForClass( int pclass ); diff --git a/src/game/g_active.c b/src/game/g_active.c index 35fa4c1f..6d296b5a 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -213,6 +213,12 @@ void ClientImpacts( gentity_t *ent, pmove_t *pm ) if( ( ent->r.svFlags & SVF_BOT ) && ( ent->touch ) ) ent->touch( ent, other, &trace ); + //charge attack + if( ent->client->ps.weapon == WP_CHARGE && + ent->client->ps.stats[ STAT_MISC ] > 0 && + ent->client->charging ) + ChargeAttack( ent, other ); + if( !other->touch ) continue; @@ -484,25 +490,37 @@ void ClientTimerActions( gentity_t *ent, int msec ) client->ps.stats[ STAT_MISC ] = DRAGOON_POUNCE_SPEED; } - //client is charging up for a charge - if( client->ps.weapon == WP_GROUND_POUND ) + //client is charging up for a... charge + if( client->ps.weapon == WP_CHARGE ) { - if( client->ps.stats[ STAT_MISC ] < BMOFO_CHARGE_SPEED && ucmd->buttons & BUTTON_ATTACK2 ) + if( client->ps.stats[ STAT_MISC ] < BMOFO_CHARGE_TIME && ucmd->buttons & BUTTON_ATTACK2 ) { - client->ps.stats[ STAT_MISC ] += ( 100.0f / (float)BMOFO_CHARGE_TIME ) * BMOFO_CHARGE_SPEED; - client->allowedToCharge = qtrue; + client->charging = qfalse; //should already be off, just making sure + + client->ps.stats[ STAT_MISC ] += 100; + + if( client->ps.stats[ STAT_MISC ] > BMOFO_CHARGE_TIME ) + client->ps.stats[ STAT_MISC ] = BMOFO_CHARGE_TIME; } if( !( ucmd->buttons & BUTTON_ATTACK2 ) ) { if( client->ps.stats[ STAT_MISC ] > 0 ) - client->chargePayload = client->ps.stats[ STAT_MISC ]; + { + client->ps.stats[ STAT_MISC ] -= 100; + client->charging = qtrue; - client->ps.stats[ STAT_MISC ] = 0; + //if the charger has stopped moving take a chunk of charge away + if( VectorLength( client->ps.velocity ) < 64.0f ) + client->ps.stats[ STAT_MISC ] = client->ps.stats[ STAT_MISC ] >> 1; + } + + if( client->ps.stats[ STAT_MISC ] <= 0 ) + { + client->ps.stats[ STAT_MISC ] = 0; + client->charging = qfalse; + } } - - if( client->ps.stats[ STAT_MISC ] > BMOFO_CHARGE_SPEED ) - client->ps.stats[ STAT_MISC ] = BMOFO_CHARGE_SPEED; } //client is charging up an lcannon @@ -866,9 +884,6 @@ void ClientThink_real( gentity_t *ent ) else if( client->ps.stats[ STAT_STATE ] & SS_BLOBLOCKED || client->ps.stats[ STAT_STATE ] & SS_GRABBED ) client->ps.pm_type = PM_GRABBED; - else if( client->ps.stats[ STAT_STATE ] & SS_GETTINGUP || - client->ps.stats[ STAT_STATE ] & SS_KNOCKEDOVER ) - client->ps.pm_type = PM_KNOCKED; else client->ps.pm_type = PM_NORMAL; @@ -893,29 +908,6 @@ void ClientThink_real( gentity_t *ent ) if( client->ps.stats[ STAT_STATE ] & SS_POISONCLOUDED && client->lastPoisonCloudedTime + HYDRA_PCLOUD_TIME < level.time ) client->ps.stats[ STAT_STATE ] &= ~SS_POISONCLOUDED; - - if( client->ps.stats[ STAT_STATE ] & SS_KNOCKEDOVER && - client->lastKnockedOverTime + BMOFO_KOVER_TIME < level.time && - ucmd->upmove > 0 ) - { - client->lastGetUpTime = level.time; - G_AddPredictableEvent( ent, EV_GETUP, 0 ); - client->ps.stats[ STAT_STATE ] &= ~SS_KNOCKEDOVER; - client->ps.stats[ STAT_STATE ] |= SS_GETTINGUP; - - //FIXME: getup animation - client->ps.legsAnim = - ( ( client->ps.legsAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | BOTH_DEATH2; - client->ps.torsoAnim = - ( ( client->ps.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | BOTH_DEATH2; - } - - if( client->ps.stats[ STAT_STATE ] & SS_GETTINGUP && - client->lastGetUpTime + BMOFO_GETUP_TIME < level.time ) - { - client->ps.stats[ STAT_STATE ] &= ~SS_GETTINGUP; - VectorCopy( ent->client->ps.grapplePoint, ent->client->ps.viewangles ); - } client->ps.gravity = g_gravity.value; @@ -949,7 +941,7 @@ void ClientThink_real( gentity_t *ent ) // set up for pmove oldEventSequence = client->ps.eventSequence; - memset (&pm, 0, sizeof(pm)); + memset( &pm, 0, sizeof( pm ) ); if( !( ucmd->buttons & BUTTON_TALK ) ) //&& client->ps.weaponTime <= 0 ) //TA: erk more server load { @@ -971,11 +963,6 @@ void ClientThink_real( gentity_t *ent ) pm.autoWeaponHit[ client->ps.weapon ] = CheckPounceAttack( ent ); break; - case WP_GROUND_POUND: - if( client->ps.weaponTime <= 0 ) - pm.autoWeaponHit[ client->ps.weapon ] = CheckChargeAttack( ent ); - break; - default: break; } diff --git a/src/game/g_combat.c b/src/game/g_combat.c index d60bb4b7..579cec2f 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -291,7 +291,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->takedamage = qtrue; // can still be gibbed self->s.weapon = WP_NONE; - self->s.powerups = 0; + /*self->s.powerups = 0;*/ //TA: class is encoded into powers in trem self->r.contents = CONTENTS_BODY; //self->r.contents = CONTENTS_CORPSE; @@ -304,7 +304,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->s.loopSound = 0; - self->r.maxs[2] = -8; + self->r.maxs[ 2 ] = -8; // don't allow respawn until the death anim is done // g_forcerespawn may force spawning at some later time @@ -847,7 +847,7 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, if( !dir ) dflags |= DAMAGE_NO_KNOCKBACK; else - VectorNormalize(dir); + VectorNormalize( dir ); knockback = damage; if( knockback > 200 ) diff --git a/src/game/g_local.h b/src/game/g_local.h index dcfbf4be..165b9c90 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -151,6 +151,7 @@ struct gentity_s int splashRadius; int methodOfDeath; int splashMethodOfDeath; + int chargeRepeat; int count; @@ -353,15 +354,12 @@ struct gclient_s int lastLockTime; int lastSlowTime; int lastBoostedTime; - int lastKnockedOverTime; - int lastGetUpTime; int lastCreepSlowTime; //TA: time until creep can be removed int pouncePayload; //TA: amount of damage pounce attack will do qboolean allowedToPounce; - int chargePayload; //TA: amount of damage charge attack will do - qboolean allowedToCharge; + qboolean charging; vec3_t hovelOrigin; //TA: player origin before entering hovel @@ -662,7 +660,7 @@ void SnapVectorTowards( vec3_t v, vec3_t to ); qboolean CheckVenomAttack( gentity_t *ent ); void CheckGrabAttack( gentity_t *ent ); qboolean CheckPounceAttack( gentity_t *ent ); -qboolean CheckChargeAttack( gentity_t *ent ); +void ChargeAttack( gentity_t *ent, gentity_t *victim ); // diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 71d1b4c5..a7809263 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -541,7 +541,8 @@ qboolean CheckVenomAttack( gentity_t *ent ) VectorMA( muzzle, SOLDIER_BITE_RANGE, forward, end ); - trap_Trace (&tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT); + trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); + if ( tr.surfaceFlags & SURF_NOIMPACT ) return qfalse; @@ -565,7 +566,7 @@ qboolean CheckVenomAttack( gentity_t *ent ) tent->s.weapon = ent->s.weapon; } - G_Damage( traceEnt, ent, ent, forward, tr.endpos, SOLDIER_BITE_DMG, DAMAGE_NO_KNOCKBACK, MOD_VENOM ); + G_Damage( traceEnt, ent, ent, forward, tr.endpos, SOLDIER_BITE_DMG, DAMAGE_NO_KNOCKBACK, MOD_SOLDIER_BITE ); return qtrue; } @@ -875,67 +876,45 @@ void directZapFire( gentity_t *ent ) /* ====================================================================== -GROUND POUND +CHARGE ====================================================================== */ /* =============== -CheckChargeAttack +ChargeAttack =============== */ -qboolean CheckChargeAttack( gentity_t *ent ) +void ChargeAttack( gentity_t *ent, gentity_t *victim ) { - //FIXME - trace_t tr; - vec3_t end; gentity_t *tent; - gentity_t *traceEnt; - int damage; - - if( !ent->client->allowedToCharge ) - return qfalse; - - // set aiming directions - AngleVectors( ent->client->ps.viewangles, forward, right, up ); - - CalcMuzzlePoint( ent, forward, right, up, muzzle ); - - VectorMA( muzzle, BMOFO_CHARGE_RANGE, forward, end ); - - trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); - - //miss - if( tr.fraction >= 1.0 ) - return qfalse; - - if( tr.surfaceFlags & SURF_NOIMPACT ) - return qfalse; - - traceEnt = &g_entities[ tr.entityNum ]; + int damage; + vec3_t forward, normal; + + if( level.time < victim->chargeRepeat ) + return; - // send blood impact - if( traceEnt->takedamage && traceEnt->client ) + victim->chargeRepeat = level.time + BMOFO_CHARGE_REPEAT; + + VectorSubtract( victim->s.origin, ent->s.origin, forward ); + VectorNormalize( forward ); + VectorNegate( forward, normal ); + + if( victim->client ) { - tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT ); - tent->s.otherEntityNum = traceEnt->s.number; - tent->s.eventParm = DirToByte( tr.plane.normal ); + tent = G_TempEntity( victim->s.origin, EV_MISSILE_HIT ); + tent->s.otherEntityNum = victim->s.number; + tent->s.eventParm = DirToByte( normal ); tent->s.weapon = ent->s.weapon; } - if( !traceEnt->takedamage ) - return qfalse; - - damage = (int)( ( (float)ent->client->chargePayload / (float)BMOFO_CHARGE_SPEED ) * BMOFO_CHARGE_DMG ); - - G_Damage( traceEnt, ent, ent, forward, tr.endpos, damage, DAMAGE_NO_KNOCKBACK, MOD_VENOM ); - - ent->client->allowedToCharge = qfalse; + if( !victim->takedamage ) + return; - G_Printf( "charge!\n" ); + damage = (int)( ( (float)ent->client->ps.stats[ STAT_MISC ] / (float)BMOFO_CHARGE_TIME ) * BMOFO_CHARGE_DMG ); - return qtrue; + G_Damage( victim, ent, ent, forward, victim->s.origin, damage, 0, MOD_BMOFO_CHARGE ); } //====================================================================== @@ -985,9 +964,6 @@ void FireWeapon3( gentity_t *ent ) case WP_DIRECT_ZAP: areaZapFire( ent ); break; - case WP_GROUND_POUND: - slowBlobFire( ent ); - break; default: break; @@ -1077,7 +1053,7 @@ void FireWeapon( gentity_t *ent ) case WP_DIRECT_ZAP: meleeAttack( ent, CHIMERA_CLAW_RANGE, CHIMERA_CLAW_DMG, MOD_CHIMERA_CLAW ); break; - case WP_GROUND_POUND: + case WP_CHARGE: meleeAttack( ent, BMOFO_CLAW_RANGE, BMOFO_CLAW_DMG, MOD_BMOFO_CLAW ); break; diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 47857a97..4bac0e4e 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -76,17 +76,12 @@ #define BMOFO_CLAW_DMG ADM(150) #define BMOFO_CLAW_RANGE 128.0f #define BMOFO_CLAW_REPEAT 750 -#define BMOFO_KNOCK_RANGE 200.0f -#define BMOFO_KNOCK_REPEAT 15000 -#define BMOFO_KOVER_TIME 2000 -#define BMOFO_GETUP_TIME 1000 #define BMOFO_REGEN_RANGE 200.0f #define BMOFO_REGEN_MOD 2.0f - -#define BMOFO_CHARGE_SPEED 5000 +#define BMOFO_CHARGE_SPEED 2.0f #define BMOFO_CHARGE_TIME 2000 -#define BMOFO_CHARGE_RANGE 48.0f -#define BMOFO_CHARGE_DMG ADM(300) +#define BMOFO_CHARGE_REPEAT 500 +#define BMOFO_CHARGE_DMG ADM(200) |