diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 6 | ||||
-rw-r--r-- | src/game/bg_pmove.c | 22 | ||||
-rw-r--r-- | src/game/g_buildable.c | 64 | ||||
-rw-r--r-- | src/game/g_client.c | 6 | ||||
-rw-r--r-- | src/game/g_cmds.c | 9 | ||||
-rw-r--r-- | src/game/g_combat.c | 3 | ||||
-rw-r--r-- | src/game/g_local.h | 1 | ||||
-rw-r--r-- | src/game/g_main.c | 8 | ||||
-rw-r--r-- | src/game/g_physics.c | 46 | ||||
-rw-r--r-- | src/game/g_spawn.c | 8 | ||||
-rw-r--r-- | src/game/g_weapon.c | 6 | ||||
-rw-r--r-- | src/game/tremulous.h | 22 |
12 files changed, 109 insertions, 92 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index ee3fdf7f..413ab89f 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1776,14 +1776,14 @@ classAttributes_t bg_classList[ ] = "default", //char *skinname; 2.0f, //float shadowScale; "alien_general_hud", //char *hudname; - ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + ( 1 << S3 ), //int stages { -30, -30, -20 }, //vec3_t mins; { 30, 30, 20 }, //vec3_t maxs; { 30, 30, 20 }, //vec3_t crouchmaxs; { -15, -15, -4 }, //vec3_t deadmins; { 15, 15, 4 }, //vec3_t deadmaxs; 0.0f, //float zOffset - 50, 50, //int viewheight, crouchviewheight; + 35, 35, //int viewheight, crouchviewheight; BMOFO_HEALTH, //int health; 0.0f, //float fallDamage; BMOFO_REGEN, //int regenRate; @@ -3794,7 +3794,7 @@ upgradeAttributes_t bg_upgrades[ ] = { UP_HELMET, //int upgradeNum; HELMET_PRICE, //int price; - ( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages + ( 1 << S2 )|( 1 << S3 ), //int stages SLOT_HEAD, //int slots; "helmet", //char *upgradeName; "Helmet", //char *upgradeHumanName; diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 4f8fe643..bfc47a22 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -1955,10 +1955,10 @@ static void PM_GroundClimbTrace( void ) } } - if ( trace.fraction >= 1.0f ) + if( trace.fraction >= 1.0f ) { // if the trace didn't hit anything, we are in free fall - PM_GroundTraceMissed(); + PM_GroundTraceMissed( ); pml.groundPlane = qfalse; pml.walking = qfalse; pm->ps->eFlags &= ~EF_WALLCLIMB; @@ -1974,7 +1974,7 @@ static void PM_GroundClimbTrace( void ) pml.walking = qtrue; // hitting solid ground will end a waterjump - if (pm->ps->pm_flags & PMF_TIME_WATERJUMP) + if( pm->ps->pm_flags & PMF_TIME_WATERJUMP ) { pm->ps->pm_flags &= ~(PMF_TIME_WATERJUMP | PMF_TIME_LAND); pm->ps->pm_time = 0; @@ -2033,7 +2033,7 @@ static void PM_GroundTrace( void ) point[ 0 ] = pm->ps->origin[ 0 ]; point[ 1 ] = pm->ps->origin[ 1 ]; - point[ 2 ] = pm->ps->origin[ 2 ] - 0.25; + point[ 2 ] = pm->ps->origin[ 2 ] - 0.25f; pm->trace( &trace, pm->ps->origin, pm->mins, pm->maxs, point, pm->ps->clientNum, pm->tracemask ); @@ -2048,7 +2048,7 @@ static void PM_GroundTrace( void ) VectorCopy( refNormal, pm->ps->grapplePoint ); // if the trace didn't hit anything, we are in free fall - if( trace.fraction == 1.0 ) + if( trace.fraction == 1.0f ) { PM_GroundTraceMissed( ); pml.groundPlane = qfalse; @@ -2090,7 +2090,7 @@ static void PM_GroundTrace( void ) } // check if getting thrown off the ground - if( pm->ps->velocity[ 2 ] > 0 && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10 ) + if( pm->ps->velocity[ 2 ] > 0.0f && DotProduct( pm->ps->velocity, trace.plane.normal ) > 10.0f ) { if( pm->debugLevel ) Com_Printf( "%i:kickoff\n", c_pmove ); @@ -2646,10 +2646,6 @@ static void PM_Weapon( void ) if( pm->ps->weaponTime > 0 ) pm->ps->weaponTime -= pml.msec; - //TA: if we haven't got the weapon - if( !BG_gotWeapon( pm->ps->weapon, pm->ps->stats ) && pm->ps->weapon != WP_NONE ) - PM_BeginWeaponChange( WP_NONE ); - // check for weapon change // can't change if weapon is firing, but can change // again if lowering or raising @@ -2683,6 +2679,7 @@ static void PM_Weapon( void ) else pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD; + //something external thinks a weapon change is necessary if( pm->ps->weapon != pm->cmd.weapon && pm->ps->pm_flags & PMF_WEAPON_SWITCH ) { pm->ps->pm_flags &= ~PMF_WEAPON_SWITCH; @@ -3141,7 +3138,7 @@ PmoveSingle */ void trap_SnapVector( float *v ); -void PmoveSingle (pmove_t *pmove) +void PmoveSingle( pmove_t *pmove ) { int ammo, clips, maxclips; @@ -3158,9 +3155,8 @@ void PmoveSingle (pmove_t *pmove) pm->watertype = 0; pm->waterlevel = 0; - /*if ( pm->ps->stats[STAT_HEALTH] <= 0 ) { + if( pm->ps->stats[ STAT_HEALTH ] <= 0 ) pm->tracemask &= ~CONTENTS_BODY; // corpses can fly through bodies - }*/ // make sure walking button is clear if they are running, to avoid // proxy no-footsteps cheats diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 10662feb..e0b59fa5 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -1653,6 +1653,12 @@ qboolean HMGTurret_CheckTarget( gentity_t *self, gentity_t *target, qboolean ign trace_t trace; gentity_t *traceEnt; + if( !target ) + return qfalse; + + if( !target->client ) + return qfalse; + if( target->client->ps.stats[ STAT_STATE ] & SS_HOVELING ) return qfalse; @@ -1982,6 +1988,64 @@ void HSpawn_Think( gentity_t *self ) +/* +=============== +G_BuildableThink + +General think function for buildables +=============== +*/ +void G_BuildableThink( gentity_t *ent, int msec ) +{ + int bHealth = BG_FindHealthForBuildable( ent->s.modelindex ); + int bRegen = BG_FindRegenRateForBuildable( ent->s.modelindex ); + + //pack health, power and dcc + + //toggle spawned flag for buildables + if( !ent->spawned ) + { + if( ent->buildTime + BG_FindBuildTimeForBuildable( ent->s.modelindex ) < level.time ) + { + ent->takedamage = qtrue; + ent->spawned = qtrue; + } + } + + ent->s.generic1 = (int)( ( (float)ent->health / (float)bHealth ) * B_HEALTH_SCALE ); + + if( ent->s.generic1 < 0 ) + ent->s.generic1 = 0; + + if( ent->powered ) + ent->s.generic1 |= B_POWERED_TOGGLEBIT; + + if( ent->dcced ) + ent->s.generic1 |= B_DCCED_TOGGLEBIT; + + if( ent->spawned ) + ent->s.generic1 |= B_SPAWNED_TOGGLEBIT; + + ent->time1000 += msec; + + if( ent->time1000 >= 1000 ) + { + ent->time1000 -= 1000; + + //regenerate health + if( ent->health > 0 && ent->health < bHealth && bRegen ) + { + ent->health += bRegen; + + if( ent->health > bHealth ) + ent->health = bHealth; + } + } + + //fall back on normal physics routines + G_Physics( ent, msec ); +} + /* =============== diff --git a/src/game/g_client.c b/src/game/g_client.c index f6394d41..f2f83d63 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -649,12 +649,6 @@ void SpawnCorpse( gentity_t *ent ) body->takedamage = qfalse; - //make the make player entity disappear - ent->takedamage = qfalse; - ent->s.eType = ET_INVISIBLE; - ent->r.contents = 0; - ent->s.solid = 0; - ent->r.s.solid = 0; body->health = ent->health = ent->client->ps.stats[ STAT_HEALTH ]; ent->health = ent->client->ps.stats[ STAT_HEALTH ] = GIB_HEALTH - 1; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index c63eee1a..4144b28b 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1346,8 +1346,7 @@ void Cmd_Buy_f( gentity_t *ent ) //force a weapon change ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH; - ent->client->ps.weapon = weapon; - trap_SendServerCommand( ent->client->ps.clientNum, va( "weaponswitch %d", weapon ) ); + trap_SendServerCommand( ent-g_entities, va( "weaponswitch %d", weapon ) ); //set build delay/pounce etc to 0 ent->client->ps.stats[ STAT_MISC ] = 0; @@ -1494,7 +1493,11 @@ void Cmd_Sell_f( gentity_t *ent ) //if we have this weapon selected, force a new selection if( weapon == ent->client->ps.weapon ) - G_AddEvent( ent, EV_NEXT_WEAPON, ent->client->ps.clientNum ); + { + //force a weapon change + ent->client->ps.pm_flags |= PMF_WEAPON_SWITCH; + trap_SendServerCommand( ent-g_entities, va( "weaponswitch %d", WP_BLASTER ) ); + } } else if( upgrade != UP_NONE ) { diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 265ee182..847d8988 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -297,8 +297,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->s.weapon = WP_NONE; /*self->s.powerups = 0;*/ //TA: class is encoded into powerups in trem - self->r.contents = CONTENTS_BODY; - //self->r.contents = CONTENTS_CORPSE; + self->r.contents = CONTENTS_CORPSE; self->s.angles[ PITCH ] = 0; self->s.angles[ ROLL ] = 0; diff --git a/src/game/g_local.h b/src/game/g_local.h index 9ca44a71..fef66751 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -576,6 +576,7 @@ typedef enum qboolean AHovel_Blocked( gentity_t *hovel, gentity_t *player, qboolean provideExit ); gentity_t *G_CheckSpawnPoint( vec3_t origin, vec3_t normal, buildable_t spawn, vec3_t spawnOrigin ); +void G_BuildableThink( gentity_t *ent, int msec ); qboolean G_BuildableRange( vec3_t origin, float r, buildable_t buildable ); itemBuildError_t G_itemFits( gentity_t *ent, buildable_t buildable, int distance, vec3_t origin ); gentity_t *G_buildItem( gentity_t *builder, buildable_t buildable, vec3_t origin, vec3_t angles ); diff --git a/src/game/g_main.c b/src/game/g_main.c index e6e981a3..9f77e610 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1606,7 +1606,13 @@ void G_RunFrame( int levelTime ) continue; } - if( ent->s.eType == ET_BUILDABLE || ent->s.eType == ET_CORPSE || ent->physicsObject ) + if( ent->s.eType == ET_BUILDABLE ) + { + G_BuildableThink( ent, msec ); + continue; + } + + if( ent->s.eType == ET_CORPSE || ent->physicsObject ) { G_Physics( ent, msec ); continue; diff --git a/src/game/g_physics.c b/src/game/g_physics.c index e5e69b19..a1183ad4 100644 --- a/src/game/g_physics.c +++ b/src/game/g_physics.c @@ -81,52 +81,6 @@ void G_Physics( gentity_t *ent, int msec ) trace_t tr; int contents; int mask; - int bHealth = BG_FindHealthForBuildable( ent->s.modelindex ); - int bRegen = BG_FindRegenRateForBuildable( ent->s.modelindex ); - - //pack health, power and dcc - if( ent->s.eType == ET_BUILDABLE ) - { - //toggle spawned flag for buildables - if( !ent->spawned ) - { - if( ent->buildTime + BG_FindBuildTimeForBuildable( ent->s.modelindex ) < level.time ) - { - ent->takedamage = qtrue; - ent->spawned = qtrue; - } - } - - ent->s.generic1 = (int)( ( (float)ent->health / (float)bHealth ) * B_HEALTH_SCALE ); - - if( ent->s.generic1 < 0 ) - ent->s.generic1 = 0; - - if( ent->powered ) - ent->s.generic1 |= B_POWERED_TOGGLEBIT; - - if( ent->dcced ) - ent->s.generic1 |= B_DCCED_TOGGLEBIT; - - if( ent->spawned ) - ent->s.generic1 |= B_SPAWNED_TOGGLEBIT; - - ent->time1000 += msec; - - if( ent->time1000 >= 1000 ) - { - ent->time1000 -= 1000; - - //regenerate health - if( ent->health < bHealth && bRegen ) - { - ent->health += bRegen; - - if( ent->health > bHealth ) - ent->health = bHealth; - } - } - } // if groundentity has been set to -1, it may have been pushed off an edge if( ent->s.groundEntityNum == -1 ) diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c index 00d618c3..71ecaed8 100644 --- a/src/game/g_spawn.c +++ b/src/game/g_spawn.c @@ -605,10 +605,10 @@ void SP_worldspawn( void ) G_SpawnString( "humanMaxStage", "2", &s ); trap_Cvar_Set( "g_humanMaxStage", s ); - G_SpawnString( "humanStage2Threshold", "50", &s ); + G_SpawnString( "humanStage2Threshold", "15", &s ); trap_Cvar_Set( "g_humanStage2Threshold", s ); - G_SpawnString( "humanStage3Threshold", "100", &s ); + G_SpawnString( "humanStage3Threshold", "30", &s ); trap_Cvar_Set( "g_humanStage3Threshold", s ); G_SpawnString( "alienBuildPoints", "1000", &s ); @@ -617,10 +617,10 @@ void SP_worldspawn( void ) G_SpawnString( "alienMaxStage", "2", &s ); trap_Cvar_Set( "g_alienMaxStage", s ); - G_SpawnString( "alienStage2Threshold", "50", &s ); + G_SpawnString( "alienStage2Threshold", "15", &s ); trap_Cvar_Set( "g_alienStage2Threshold", s ); - G_SpawnString( "alienStage3Threshold", "100", &s ); + G_SpawnString( "alienStage3Threshold", "30", &s ); trap_Cvar_Set( "g_alienStage3Threshold", s ); G_SpawnString( "enableDust", "0", &s ); diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index dc2c6b38..e5130a43 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -425,13 +425,13 @@ void painSawFire( gentity_t *ent ) VectorMA( muzzle, PAINSAW_RANGE, forward, end ); trap_Trace( &tr, muzzle, NULL, NULL, end, ent->s.number, MASK_SHOT ); - if ( tr.surfaceFlags & SURF_NOIMPACT ) + if( tr.surfaceFlags & SURF_NOIMPACT ) return; traceEnt = &g_entities[ tr.entityNum ]; // send blood impact - if ( traceEnt->takedamage && traceEnt->client ) + if( traceEnt->takedamage && traceEnt->client ) { tent = G_TempEntity( tr.endpos, EV_MISSILE_HIT ); tent->s.otherEntityNum = traceEnt->s.number; @@ -440,7 +440,7 @@ void painSawFire( gentity_t *ent ) tent->s.generic1 = ent->s.generic1; //weaponMode } - if ( traceEnt->takedamage ) + if( traceEnt->takedamage ) G_Damage( traceEnt, ent, ent, forward, tr.endpos, PAINSAW_DAMAGE, DAMAGE_NO_KNOCKBACK, MOD_PAINSAW ); } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 9e9c0534..b8454759 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -22,7 +22,7 @@ * */ -#define ALIEN_WDMG_MODIFIER 1.0f +#define ALIEN_WDMG_MODIFIER 0.8f #define ADM(d) ((int)((float)d*ALIEN_WDMG_MODIFIER)) #define ABUILDER_BUILD_REPEAT 500 @@ -31,14 +31,14 @@ #define ABUILDER_CLAW_REPEAT 1000 #define ABUILDER_BASE_DELAY 9000 #define ABUILDER_ADV_DELAY 4000 -#define ABUILDER_BLOB_DMG ADM(20) +#define ABUILDER_BLOB_DMG ADM(5) #define ABUILDER_BLOB_REPEAT 1000 #define ABUILDER_BLOB_SPEED 800.0f #define ABUILDER_BLOB_SPEED_MOD 0.5f #define ABUILDER_BLOB_TIME 5000 #define SOLDIER_BITE_DMG ADM(60) -#define SOLDIER_BITE_RANGE 96.0f +#define SOLDIER_BITE_RANGE 64.0f #define SOLDIER_BITE_REPEAT 500 #define HYDRA_CLAW_DMG ADM(40) @@ -103,7 +103,7 @@ #define ALIEN_HLTH_MODIFIER 1.0f #define AHM(h) ((int)((float)h*ALIEN_HLTH_MODIFIER)) -#define ALIEN_VALUE_MODIFIER 3.0f +#define ALIEN_VALUE_MODIFIER 4.0f #define AVM(h) ((int)((float)h*ALIEN_VALUE_MODIFIER)) #define ABUILDER_SPEED 0.8f @@ -201,7 +201,7 @@ #define BARRICADE_BP 80 #define BARRICADE_BT 10000 -#define BARRICADE_HEALTH ABHM(500) +#define BARRICADE_HEALTH ABHM(350) #define BARRICADE_REGEN 15 #define BARRICADE_SPLASHDAMAGE 50 #define BARRICADE_SPLASHRADIUS 50 @@ -363,10 +363,10 @@ #define LCANNON_REPEAT 500 #define LCANNON_CHARGEREPEAT 1000 #define LCANNON_RELOAD 2000 -#define LCANNON_DAMAGE HDM(200) -#define LCANNON_SECONDARY_DAMAGE HDM(20) +#define LCANNON_DAMAGE HDM(500) +#define LCANNON_SECONDARY_DAMAGE HDM(50) #define LCANNON_SPEED 250 -#define LCANNON_CHARGE_TIME 2000 +#define LCANNON_CHARGE_TIME 1000 #define LASGUN_PRICE 200 #define LASGUN_AMMO 300 @@ -377,7 +377,7 @@ #define PAINSAW_PRICE 100 #define PAINSAW_REPEAT 75 #define PAINSAW_DAMAGE HDM(5) -#define PAINSAW_RANGE 32 +#define PAINSAW_RANGE 48.0f #define HBUILD_PRICE 0 #define HBUILD_REPEAT 1000 @@ -514,8 +514,8 @@ #define HUMAN_BACK_MODIFIER 0.7f #define HUMAN_SIDE_MODIFIER 0.8f -#define STAMINA_STOP_RESTORE 20 -#define STAMINA_WALK_RESTORE 10 +#define STAMINA_STOP_RESTORE 25 +#define STAMINA_WALK_RESTORE 15 #define STAMINA_SPRINT_TAKE 8 #define STAMINA_LARMOUR_TAKE 4 |