diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_pmove.c | 14 | ||||
-rw-r--r-- | src/game/bg_public.h | 13 | ||||
-rw-r--r-- | src/game/g_active.c | 9 | ||||
-rw-r--r-- | src/game/g_buildable.c | 19 | ||||
-rw-r--r-- | src/game/g_client.c | 31 | ||||
-rw-r--r-- | src/game/g_cmds.c | 20 | ||||
-rw-r--r-- | src/game/g_combat.c | 139 | ||||
-rw-r--r-- | src/game/g_main.c | 4 | ||||
-rw-r--r-- | src/game/g_misc.c | 45 | ||||
-rw-r--r-- | src/game/g_missile.c | 4 | ||||
-rw-r--r-- | src/game/g_weapon.c | 10 |
11 files changed, 78 insertions, 230 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 9081b4ca..f36cd3e3 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -300,7 +300,7 @@ static void PM_Friction( void ) { // if getting knocked back, no friction if ( ! (pm->ps->pm_flags & PMF_TIME_KNOCKBACK) ) { if( ( pm->ps->stats[ STAT_PTEAM ] == PTE_DROIDS ) && - ( pm->ps->stats[ STAT_PCLASS ] == PCL_D_BASE ) ) + ( pm->ps->stats[ STAT_PCLASS ] == PCL_D_O_BASE ) ) { control = speed < pm_stopspeed*5 ? pm_stopspeed*5 : speed; } @@ -1875,7 +1875,7 @@ static void PM_CheckDuck (void) switch( pm->ps->stats[ STAT_PCLASS ] ) { - case PCL_D_BUILDER: + case PCL_D_B_BASE: VectorSet( PCmins, -15, -15, -20 ); VectorSet( PCmaxs, 15, 15, 20 ); VectorSet( PCcmaxs, 15, 15, 20 ); @@ -1883,7 +1883,7 @@ static void PM_CheckDuck (void) PCcvh = 12; break; - case PCL_D_BASE: + case PCL_D_O_BASE: VectorSet( PCmins, -15, -15, -15 ); VectorSet( PCmaxs, 15, 15, 15 ); VectorSet( PCcmaxs, 15, 15, 15 ); @@ -1891,6 +1891,14 @@ static void PM_CheckDuck (void) PCcvh = 4; break; + case PCL_D_D_BASE: + VectorSet( PCmins, -15, -15, -15 ); + VectorSet( PCmaxs, 15, 15, 15 ); + VectorSet( PCcmaxs, 15, 15, 15 ); + PCvh = 4; + PCcvh = 4; + break; + case PCL_H_BASE: VectorSet( PCmins, -15, -15, -24 ); VectorSet( PCmaxs, 15, 15, 32 ); diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 0f53ef30..e096b33d 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -603,16 +603,9 @@ typedef enum { //FIXME: switch to enums at some point //TA: player classes -#define PCL_D_BUILDER 1 -#define PCL_D_BASE 2 -#define PCL_D_OFF1 3 -#define PCL_D_OFF2 4 -#define PCL_D_OFF3 5 -#define PCL_D_OFF4 6 -#define PCL_D_OFF5 7 -#define PCL_D_OFF6 8 -#define PCL_D_OFF7 9 -#define PCL_D_OFF8 10 +#define PCL_D_B_BASE 1 +#define PCL_D_O_BASE 2 +#define PCL_D_D_BASE 3 #define PCL_H_BASE 11 diff --git a/src/game/g_active.c b/src/game/g_active.c index 6b0c7218..3c48cbc7 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -737,13 +737,14 @@ void ClientThink_real( gentity_t *ent ) { client->ps.speed = g_speed.value * client->classSpeed; //TA: slow player if standing in creep - /*for ( i = 1, creepNode = g_entities + i; i < level.num_entities; i++, creepNode++ ) + for ( i = 1, creepNode = g_entities + i; i < level.num_entities; i++, creepNode++ ) { - if( !Q_stricmp( creepNode->classname, "team_droid_creep" ) ) + if( ( !Q_stricmp( creepNode->classname, "team_droid_spawn" ) ) || + ( !Q_stricmp( creepNode->classname, "team_droid_def1" ) ) ) { VectorSubtract( client->ps.origin, creepNode->s.origin, temp_v ); - if( ( VectorLength( temp_v ) <= creepNode->s.frame ) && + if( ( VectorLength( temp_v ) <= CREEP_BASESIZE ) && ( temp_v[ 2 ] <= 21 ) && //assumes mins of player is (x, x, -24) ( client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) ) { @@ -753,7 +754,7 @@ void ClientThink_real( gentity_t *ent ) { break; } } - }*/ + } if( !cSlowed ) client->ps.stats[ STAT_STATE ] &= ~SS_CREEPSLOWED; diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index cc67c2eb..98fbe237 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -216,9 +216,9 @@ void DDef1_Think( gentity_t *self ) // Anthony "inolen" Pesch (www.inolen.com) //with modifications by me of course :) #define HDEF1_RANGE 500 -#define HDEF1_ANGULARSPEED 10 +#define HDEF1_ANGULARSPEED 15 #define HDEF1_FIRINGSPEED 200 -#define HDEF1_ACCURACYTOLERANCE 10 +#define HDEF1_ACCURACYTOLERANCE HDEF1_ANGULARSPEED - 5 #define HDEF1_VERTICALCAP 20 /* @@ -231,6 +231,7 @@ Used by HDef1_Think to track enemy location qboolean hdef1_trackenemy( gentity_t *self ) { vec3_t dirToTarget, angleToTarget, angularDiff; + float temp; VectorSubtract( self->enemy->s.pos.trBase, self->s.pos.trBase, dirToTarget ); VectorNormalize( dirToTarget ); @@ -246,11 +247,14 @@ qboolean hdef1_trackenemy( gentity_t *self ) else self->turloc[ PITCH ] = angleToTarget[ PITCH ]; - if( self->turloc[ PITCH ] < -HDEF1_VERTICALCAP ) + temp = fabs( self->turloc[ PITCH ] ); + if( temp > 180 ) + temp -= 360; + + if( temp < -HDEF1_VERTICALCAP ) + self->turloc[ PITCH ] = (-360)+HDEF1_VERTICALCAP; + else if( temp > HDEF1_VERTICALCAP ) self->turloc[ PITCH ] = -HDEF1_VERTICALCAP; - - if( self->turloc[ PITCH ] > HDEF1_VERTICALCAP ) - self->turloc[ PITCH ] = HDEF1_VERTICALCAP; if( angularDiff[ YAW ] < -HDEF1_ACCURACYTOLERANCE ) self->turloc[ YAW ] += HDEF1_ANGULARSPEED; @@ -284,7 +288,7 @@ void hdef1_fireonenemy( gentity_t *self ) AngleVectors( self->turloc, aimVector, NULL, NULL ); //fire_flamer( self, self->s.pos.trBase, aimVector ); fire_plasma( self, self->s.pos.trBase, aimVector ); - G_AddEvent( self, EV_FIRE_WEAPON, 0 ); + //G_AddEvent( self, EV_FIRE_WEAPON, 0 ); self->count = level.time + HDEF1_FIRINGSPEED; } @@ -388,7 +392,6 @@ void HSpawn_Blast( gentity_t *self ) self->splashRadius, self, self->splashMethodOfDeath ); G_FreeEntity( self ); - trap_LinkEntity( self ); //update spawn counts CalculateRanks( ); diff --git a/src/game/g_client.c b/src/game/g_client.c index 49868661..788aa1e1 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -945,10 +945,13 @@ void ClientUserinfoChanged( int clientNum ) { //Q_strncpyz( model, Info_ValueForKey (userinfo, "model"), sizeof( model ) ); switch( client->pers.pclass ) { - case PCL_D_BASE: + case PCL_D_O_BASE: Q_strncpyz( model, "klesk", sizeof( model ) ); break; - case PCL_D_BUILDER: + case PCL_D_D_BASE: + Q_strncpyz( model, "orbb", sizeof( model ) ); + break; + case PCL_D_B_BASE: Q_strncpyz( model, "lucy", sizeof( model ) ); break; case PCL_H_BASE: @@ -1304,7 +1307,7 @@ void ClientSpawn(gentity_t *ent) { // clear entity values switch( ent->client->pers.pclass ) { - case PCL_D_BUILDER: + case PCL_D_B_BASE: client->pers.maxHealth = 50; client->ps.stats[STAT_MAX_HEALTH] = 50; client->ps.stats[STAT_ARMOR] = 50; @@ -1324,7 +1327,7 @@ void ClientSpawn(gentity_t *ent) { client->classSpeed = 0.5; break; - case PCL_D_BASE: + case PCL_D_O_BASE: client->pers.maxHealth = 25; client->ps.stats[STAT_MAX_HEALTH] = 25; client->ps.eFlags = flags; @@ -1344,6 +1347,26 @@ void ClientSpawn(gentity_t *ent) { client->classSpeed = 2.0; break; + case PCL_D_D_BASE: + client->pers.maxHealth = 50; + client->ps.stats[STAT_MAX_HEALTH] = 50; + client->ps.eFlags = flags; + + VectorCopy (playerMins, ent->r.mins); + VectorCopy (playerMaxs, ent->r.maxs); + + client->ps.clientNum = index; + + BG_packWeapon( WP_VENOM, client->ps.stats ); + BG_packAmmoArray( WP_VENOM, client->ps.ammo, client->ps.powerups, 0, 0, 0 ); + + client->ps.stats[ STAT_ABILITIES ] |= SCA_WALLCLIMBER; + client->ps.stats[ STAT_ABILITIES ] |= SCA_CANJUMP; + client->ps.stats[ STAT_ABILITIES ] |= SCA_NOWEAPONDRIFT; + BG_packAttributes( 160, 0, 25, client->ps.stats ); + client->classSpeed = 1.5; + break; + case PCL_H_BASE: client->pers.maxHealth = 100; client->ps.stats[STAT_MAX_HEALTH] = 100; diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 09884232..1bdb9f59 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1563,25 +1563,11 @@ void Cmd_Class_f( gentity_t *ent ) } if( !Q_stricmp(s, "0") ) - ent->client->pers.pclass = PCL_D_BUILDER; + ent->client->pers.pclass = PCL_D_B_BASE; else if( !Q_stricmp(s, "1") ) - ent->client->pers.pclass = PCL_D_BASE; + ent->client->pers.pclass = PCL_D_O_BASE; else if( !Q_stricmp(s, "2") ) - ent->client->pers.pclass = PCL_D_OFF1; - else if( !Q_stricmp(s, "3") ) - ent->client->pers.pclass = PCL_D_OFF2; - else if( !Q_stricmp(s, "4") ) - ent->client->pers.pclass = PCL_D_OFF3; - else if( !Q_stricmp(s, "5") ) - ent->client->pers.pclass = PCL_D_OFF4; - else if( !Q_stricmp(s, "6") ) - ent->client->pers.pclass = PCL_D_OFF5; - else if( !Q_stricmp(s, "7") ) - ent->client->pers.pclass = PCL_D_OFF6; - else if( !Q_stricmp(s, "8") ) - ent->client->pers.pclass = PCL_D_OFF7; - else if( !Q_stricmp(s, "9") ) - ent->client->pers.pclass = PCL_D_OFF8; + ent->client->pers.pclass = PCL_D_D_BASE; else { trap_SendServerCommand( ent-g_entities, va("print \"Unknown class\n\"" ) ); diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 0f915e0a..a14adeb7 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -90,140 +90,6 @@ int CalculatePoints( gentity_t *victim, gentity_t *attacker ) if( !victim->client || !attacker->client ) return 0; - /*switch( victim->client->ps.stats[STAT_PCLASS] ) - { - case PCL_D_BUILDER: - victim_value = 1; - break; - case PCL_H_BUILDER: - victim_value = 1; - break; - case PCL_D_BASE: - victim_value = 2; - break; - case PCL_H_BASE: - victim_value = 2; - break; - case PCL_D_OFF1: - victim_value = 3; - break; - case PCL_H_OFF1: - victim_value = 3; - break; - case PCL_D_OFF2: - victim_value = 4; - break; - case PCL_H_OFF2: - victim_value = 4; - break; - case PCL_D_OFF3: - victim_value = 5; - break; - case PCL_H_OFF3: - victim_value = 5; - break; - case PCL_D_OFF4: - victim_value = 6; - break; - case PCL_H_OFF4: - victim_value = 6; - break; - case PCL_D_OFF5: - victim_value = 7; - break; - case PCL_H_OFF5: - victim_value = 7; - break; - case PCL_D_OFF6: - victim_value = 8; - break; - case PCL_H_OFF6: - victim_value = 8; - break; - case PCL_D_OFF7: - victim_value = 9; - break; - case PCL_H_OFF7: - victim_value = 9; - break; - case PCL_D_OFF8: - victim_value = 10; - break; - case PCL_H_OFF8: - victim_value = 10; - break; - default: - victim_value = 1; - } - - switch( attacker->client->ps.stats[STAT_PCLASS] ) - { - case PCL_D_BUILDER: - attacker_value = 1; - break; - case PCL_H_BUILDER: - attacker_value = 1; - break; - case PCL_D_BASE: - attacker_value = 2; - break; - case PCL_H_BASE: - attacker_value = 2; - break; - case PCL_D_OFF1: - attacker_value = 3; - break; - case PCL_H_OFF1: - attacker_value = 3; - break; - case PCL_D_OFF2: - attacker_value = 4; - break; - case PCL_H_OFF2: - attacker_value = 4; - break; - case PCL_D_OFF3: - attacker_value = 5; - break; - case PCL_H_OFF3: - attacker_value = 5; - break; - case PCL_D_OFF4: - attacker_value = 6; - break; - case PCL_H_OFF4: - attacker_value = 6; - break; - case PCL_D_OFF5: - attacker_value = 7; - break; - case PCL_H_OFF5: - attacker_value = 7; - break; - case PCL_D_OFF6: - attacker_value = 8; - break; - case PCL_H_OFF6: - attacker_value = 8; - break; - case PCL_D_OFF7: - attacker_value = 9; - break; - case PCL_H_OFF7: - attacker_value = 9; - break; - case PCL_D_OFF8: - attacker_value = 10; - break; - case PCL_H_OFF8: - attacker_value = 10; - break; - default: - attacker_value = 1; - } - - return ( victim_value / attacker_value ) * 10;*/ - return 1; } @@ -325,8 +191,9 @@ void LookAtKiller( gentity_t *self, gentity_t *inflictor, gentity_t *attacker ) GibEntity ================== */ -void GibEntity( gentity_t *self, int killer ) { - if( self->client->ps.stats[ STAT_PCLASS ] == PTE_HUMANS ) +void GibEntity( gentity_t *self, int killer ) +{ + if( self->client->ps.stats[ STAT_PTEAM ] == PTE_HUMANS ) G_AddEvent( self, EV_GIB_PLAYER, killer ); else G_AddEvent( self, EV_GIB_DROID, killer ); diff --git a/src/game/g_main.c b/src/game/g_main.c index 42ddcf20..7019451a 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -298,11 +298,11 @@ G_RegisterPlayerModels */ void G_RegisterPlayerModels( void ) { - char *precacheModels[ MAX_CLIENTS ] = { "klesk", "lucy", "sarge", NULL }; + char *precacheModels[ MAX_CLIENTS ] = { "klesk", "orbb", "lucy", "sarge", NULL }; char *s; int i; - for( i = 0; i < 3; i++ ) + for( i = 0; i < 4; i++ ) { s = va("n\\%s%d\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d", "precache", i, 0, precacheModels[ i ], precacheModels[ i ], 0, 0, "7", 100, 0, 0, 0, 0); diff --git a/src/game/g_misc.c b/src/game/g_misc.c index 8b776118..dc952b5d 100644 --- a/src/game/g_misc.c +++ b/src/game/g_misc.c @@ -70,58 +70,21 @@ void SP_light( gentity_t *self ) { G_FreeEntity( self ); } -#define TORCHR 200 -#define TORCHG 200 -#define TORCHB 255 - //TA: position/colour/intensity calculating function void ShineTorch( gentity_t *self ) { trace_t tr; - vec3_t from, to, length; - vec3_t angles, forward; - int r, g, b, i; - int veclength; + vec3_t origin, angles; - VectorCopy( self->parent->s.pos.trBase, from ); + VectorCopy( self->parent->s.pos.trBase, origin ); VectorCopy( self->parent->s.apos.trBase, angles ); - from[2] += self->parent->client->ps.viewheight; - - AngleVectors( angles, forward, NULL, NULL ); - VectorMA( from, 4096, forward, to ); - - trap_Trace( &tr, from, NULL, NULL, to, self->parent->s.number, MASK_SOLID ); - - VectorSubtract( tr.endpos, from, length ); - veclength = VectorLength( length ); - - //hack to place the light source slightly in front of what the player is pointing at - VectorMA( tr.endpos, -(veclength / 5), forward, tr.endpos ); - - //adjust brightness and intensity based on how far away subject is - r = TORCHR * 450 / veclength; - g = TORCHG * 450 / veclength; - b = TORCHB * 450 / veclength; - if( r > TORCHR ) r = TORCHR; - if( g > TORCHG ) g = TORCHG; - if( b > TORCHB ) b = TORCHB; - - i = veclength / 2; - if( i > 255 ) i = 255; - if( i < 0 ) i = 0; - - self->s.constantLight = r | ( g << 8 ) | ( b << 16 ) | ( i << 24 ); - - if( tr.fraction < 1.0 ) - G_SetOrigin( self, tr.endpos ); - else - G_SetOrigin( self, to ); + G_SetOrigin( self, origin ); VectorCopy( angles, self->s.apos.trBase ); //so we can use the predicted values client side if available - self->s.frame = self->parent->s.number; + self->s.clientNum = self->parent->s.number; trap_LinkEntity( self ); } diff --git a/src/game/g_missile.c b/src/game/g_missile.c index 5aa3564c..7aa86cc5 100644 --- a/src/game/g_missile.c +++ b/src/game/g_missile.c @@ -343,8 +343,8 @@ gentity_t *fire_plasma (gentity_t *self, vec3_t start, vec3_t dir) bolt->damage = 20; bolt->splashDamage = 15; bolt->splashRadius = 20; - //bolt->methodOfDeath = MOD_PLASMA; - //bolt->splashMethodOfDeath = MOD_PLASMA_SPLASH; + //bolt->methodOfDeath = MOD_FLAMER; + //bolt->splashMethodOfDeath = MOD_FLAMER_SPLASH; bolt->clipmask = MASK_SHOT; bolt->target_ent = NULL; diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index e02a453c..f378212a 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -653,8 +653,12 @@ void Weapon_Venom_Fire( gentity_t *ent ) { LogAccuracyHit =============== */ -qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker ) { - if( !target->takedamage ) { +qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker ) +{ + //TA: theres a crash bug in here somewhere, but i'm too lazy to find it hence, + return qfalse; + + /*if( !target->takedamage ) { return qfalse; } @@ -678,7 +682,7 @@ qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker ) { return qfalse; } - return qtrue; + return qtrue;*/ } |