diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 35 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 2 | ||||
-rw-r--r-- | src/game/bg_public.h | 3 | ||||
-rw-r--r-- | src/game/g_cmds.c | 10 | ||||
-rw-r--r-- | src/game/g_combat.c | 20 | ||||
-rw-r--r-- | src/game/g_weapon.c | 18 | ||||
-rw-r--r-- | src/game/q_math.c | 13 | ||||
-rw-r--r-- | src/game/tremulous.h | 14 |
8 files changed, 99 insertions, 16 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 167ce0d5..ec8f2df6 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1423,6 +1423,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 1.0f, //float knockbackScale; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; 0, //int cost; 0 //int value; @@ -1460,6 +1461,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 130.0f, //float jumpMagnitude; + 1.0f, //float knockbackScale; { PCL_A_B_LEV1, PCL_A_O_BASE, PCL_NONE }, //int children[ 3 ]; ABUILDER_COST, //int cost; ABUILDER_VALUE //int value; @@ -1497,6 +1499,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 1.0f, //float knockbackScale; { PCL_A_O_BASE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; ABUILDER_UPG_COST, //int cost; ABUILDER_UPG_VALUE //int value; @@ -1535,6 +1538,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 400.0f, //float stopSpeed; 250.0f, //float jumpMagnitude; + 2.0f, //float knockbackScale; { PCL_A_O_LEV1, PCL_NONE, PCL_NONE }, //int children[ 3 ]; SOLDIER_COST, //int cost; SOLDIER_VALUE //int value; @@ -1573,6 +1577,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 300.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 1.2f, //float knockbackScale; { PCL_A_O_LEV2, PCL_A_O_LEV1_UPG, PCL_NONE }, //int children[ 3 ]; HYDRA_COST, //int cost; HYDRA_VALUE //int value; @@ -1611,6 +1616,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 300.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 1.1f, //float knockbackScale; { PCL_A_O_LEV2, PCL_NONE, PCL_NONE }, //int children[ 3 ]; HYDRA_UPG_COST, //int cost; HYDRA_UPG_VALUE //int value; @@ -1649,6 +1655,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 400.0f, //float jumpMagnitude; + 0.8f, //float knockbackScale; { PCL_A_O_LEV3, PCL_A_O_LEV2_UPG, PCL_NONE }, //int children[ 3 ]; CHIMERA_COST, //int cost; CHIMERA_VALUE //int value; @@ -1687,6 +1694,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 400.0f, //float jumpMagnitude; + 0.7f, //float knockbackScale; { PCL_A_O_LEV3, PCL_NONE, PCL_NONE }, //int children[ 3 ]; CHIMERA_UPG_COST, //int cost; CHIMERA_UPG_VALUE //int value; @@ -1725,6 +1733,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 200.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 0.5f, //float knockbackScale; { PCL_A_O_LEV4, PCL_A_O_LEV3_UPG, PCL_NONE }, //int children[ 3 ]; DRAGOON_COST, //int cost; DRAGOON_VALUE //int value; @@ -1763,6 +1772,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 200.0f, //float stopSpeed; 270.0f, //float jumpMagnitude; + 0.4f, //float knockbackScale; { PCL_A_O_LEV4, PCL_NONE, PCL_NONE }, //int children[ 3 ]; DRAGOON_UPG_COST, //int cost; DRAGOON_UPG_VALUE //int value; @@ -1801,6 +1811,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 170.0f, //float jumpMagnitude; + 0.1f, //float knockbackScale; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; BMOFO_COST, //int cost; BMOFO_VALUE //int value; @@ -1839,6 +1850,7 @@ classAttributes_t bg_classList[ ] = 6.0f, //float friction; 100.0f, //float stopSpeed; 220.0f, //float jumpMagnitude; + 1.0f, //float knockbackScale; { PCL_NONE, PCL_NONE, PCL_NONE }, //int children[ 3 ]; 0, //int cost; 0 //int value; @@ -1855,7 +1867,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.0f, 0, 0, 0, 0.0f, 0, 0, WP_NONE, 0.0f, 0, - 0.0f, 1.0f, 0, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 270.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0 + 0.0f, 1.0f, 0, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 270.0f, 1.0f, { PCL_NONE, PCL_NONE, PCL_NONE }, 0, 0 } }; @@ -2445,6 +2457,27 @@ float BG_FindJumpMagnitudeForClass( int pclass ) /* ============== +BG_FindKnockbackScaleForClass +============== +*/ +float BG_FindKnockbackScaleForClass( int pclass ) +{ + int i; + + for( i = 0; i < bg_numPclasses; i++ ) + { + if( bg_classList[ i ].classNum == pclass ) + { + return bg_classList[ i ].knockbackScale; + } + } + + Com_Printf( S_COLOR_YELLOW "WARNING: fallthrough in BG_FindKnockbackScaleForClass\n" ); + return 1.0f; +} + +/* +============== BG_FindSteptimeForClass ============== */ diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 1ab23c62..3c3983ea 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -2767,7 +2767,7 @@ static void PM_Weapon( void ) } // check for end of clip - if( ( !ammo && clips ) || pm->ps->pm_flags & PMF_WEAPON_RELOAD ) + if( ( !ammo || pm->ps->pm_flags & PMF_WEAPON_RELOAD ) && clips ) { pm->ps->pm_flags &= ~PMF_WEAPON_RELOAD; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 02ffad71..6a119b27 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -904,6 +904,7 @@ typedef struct float friction; float stopSpeed; float jumpMagnitude; + float knockbackScale; int children[ 3 ]; int cost; @@ -1131,6 +1132,7 @@ float BG_FindAirAccelerationForClass( int pclass ); float BG_FindFrictionForClass( int pclass ); float BG_FindStopSpeedForClass( int pclass ); float BG_FindJumpMagnitudeForClass( int pclass ); +float BG_FindKnockbackScaleForClass( int pclass ); int BG_FindSteptimeForClass( int pclass ); qboolean BG_ClassHasAbility( int pclass, int ability ); weapon_t BG_FindStartWeaponForClass( int pclass ); @@ -1254,3 +1256,4 @@ float VectorDistance( vec3_t v1, vec3_t v2 ); float VectorMinComponent( vec3_t v ); float VectorMaxComponent( vec3_t v ); +float round( float v ); diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index b2d56731..8630329b 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -466,7 +466,7 @@ void Cmd_Team_f( gentity_t *ent ) if( g_teamForceBalance.integer && level.numAlienClients > level.numHumanClients ) { //FIXME: pleasant dialog - trap_SendServerCommand( ent-g_entities, "The alien team has too many players\n" ); + trap_SendServerCommand( ent-g_entities, "print \"The alien team has too many players\n\"" ); return; } @@ -477,7 +477,7 @@ void Cmd_Team_f( gentity_t *ent ) if( g_teamForceBalance.integer && level.numHumanClients > level.numAlienClients ) { //FIXME: pleasant dialog - trap_SendServerCommand( ent-g_entities, "The human team has too many players\n" ); + trap_SendServerCommand( ent-g_entities, "print \"The human team has too many players\n\"" ); return; } @@ -1821,6 +1821,12 @@ void G_StopFollowing( gentity_t *ent ) ent->client->sess.sessionTeam = TEAM_SPECTATOR; ent->client->sess.spectatorState = SPECTATOR_FREE; ent->client->ps.pm_flags &= ~PMF_FOLLOW; + + ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBING; + ent->client->ps.stats[ STAT_STATE ] &= ~SS_WALLCLIMBINGCEILING; + ent->client->ps.eFlags &= ~EF_WALLCLIMB; + ent->client->ps.viewangles[ PITCH ] = 0.0f; + ent->r.svFlags &= ~SVF_BOT; ent->client->ps.clientNum = ent - g_entities; } diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 675b917d..6ffe9edc 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -216,6 +216,15 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int if( attacker == self || OnSameTeam( self, attacker ) ) { AddScore( attacker, -1 ); + + //punish team kills and suicides + if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) + attacker->client->ps.persistant[ PERS_CREDIT ]--; + else if( attacker->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) + attacker->client->ps.persistant[ PERS_CREDIT ] -= ASPAWN_VALUE; + + if( attacker->client->ps.persistant[ PERS_CREDIT ] < 0 ) + attacker->client->ps.persistant[ PERS_CREDIT ] = 0; } else { @@ -271,8 +280,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int { attacker->client->ps.persistant[ PERS_CREDIT ]++; - if( attacker->client->ps.persistant[ PERS_CREDIT ] > HUMAN_MAX_CREDITS ) - attacker->client->ps.persistant[ PERS_CREDIT ] = HUMAN_MAX_CREDITS; + if( attacker->client->ps.persistant[ PERS_CREDIT ] > ALIEN_MAX_KILLS ) + attacker->client->ps.persistant[ PERS_CREDIT ] = ALIEN_MAX_KILLS; } // Add team bonuses @@ -870,6 +879,13 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, VectorNormalize( dir ); knockback = damage; + + if( targ->client ) + { + knockback = (int)( (float)knockback * + BG_FindKnockbackScaleForClass( targ->client->ps.stats[ STAT_PCLASS ] ) ); + } + if( knockback > 200 ) knockback = 200; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index 850ccd72..4b6f45d6 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -435,10 +435,22 @@ void painSawFire( gentity_t *ent ) traceEnt = &g_entities[ tr.entityNum ]; // send blood impact - if( traceEnt->takedamage && traceEnt->client ) + if( traceEnt->takedamage ) { - tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT ); - tent->s.otherEntityNum = traceEnt->s.number; + vec3_t temp; + + //hack to get the particle system to line up with the weapon + VectorCopy( tr.endpos, temp ); + temp[ 2 ] -= 10.0f; + + if( traceEnt->client ) + { + tent = G_TempEntity( temp, EV_MISSILE_HIT ); + tent->s.otherEntityNum = traceEnt->s.number; + } + else + tent = G_TempEntity( temp, EV_MISSILE_MISS ); + tent->s.eventParm = DirToByte( tr.plane.normal ); tent->s.weapon = ent->s.weapon; tent->s.generic1 = ent->s.generic1; //weaponMode diff --git a/src/game/q_math.c b/src/game/q_math.c index 1cfe25cc..cbc7fdac 100644 --- a/src/game/q_math.c +++ b/src/game/q_math.c @@ -1465,3 +1465,16 @@ float VectorMinComponent( vec3_t v ) return smallest; } + +/* +=============== +round +=============== +*/ +float round( float v ) +{ + if( v >= 0.5f ) + return ceil( v ); + else + return floor( v ); +} diff --git a/src/game/tremulous.h b/src/game/tremulous.h index a7b943ff..7d2c423b 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -52,7 +52,7 @@ #define HYDRA_GRAB_TIME 1000 #define HYDRA_PCLOUD_DMG ADM(5) #define HYDRA_PCLOUD_RANGE 200.0f -#define HYDRA_PCLOUD_REPEAT 1000 +#define HYDRA_PCLOUD_REPEAT 2000 #define HYDRA_PCLOUD_TIME 10000 #define CHIMERA_CLAW_DMG ADM(50) @@ -243,7 +243,7 @@ #define HIVE_CREEPSIZE 120 #define HIVE_RANGE 400.0f #define HIVE_REPEAT 10000 -#define HIVE_DMG 30 +#define HIVE_DMG 20 #define HIVE_SPEED 230.0f #define HIVE_DIR_CHANGE_PERIOD 500 @@ -263,7 +263,7 @@ #define OVERMIND_BT 30000 #define OVERMIND_HEALTH ABHM(1000) #define OVERMIND_REGEN 10 -#define OVERMIND_SPLASHDAMAGE 100 +#define OVERMIND_SPLASHDAMAGE 15 #define OVERMIND_SPLASHRADIUS 300 #define OVERMIND_CREEPSIZE 120 #define OVERMIND_ATTACK_RANGE 150.0f @@ -307,7 +307,7 @@ * */ -#define HUMAN_WDMG_MODIFIER 1.05f +#define HUMAN_WDMG_MODIFIER 1.1f #define HDM(d) ((int)((float)d*HUMAN_WDMG_MODIFIER)) #define BLASTER_REPEAT 600 @@ -361,12 +361,12 @@ #define PRIFLE_PRICE 400 #define PRIFLE_CLIPS 50 -#define PRIFLE_SPAWNCLIPS 3 -#define PRIFLE_MAXCLIPS 3 +#define PRIFLE_SPAWNCLIPS 2 +#define PRIFLE_MAXCLIPS 2 #define PRIFLE_REPEAT 100 #define PRIFLE_RELOAD 2000 #define PRIFLE_DMG HDM(10) -#define PRIFLE_SPEED 1500 +#define PRIFLE_SPEED 1000 #define FLAMER_PRICE 450 #define FLAMER_GAS 80 |