diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/bg_misc.c | 41 | ||||
-rw-r--r-- | src/game/bg_public.h | 5 | ||||
-rw-r--r-- | src/game/g_buildable.c | 14 | ||||
-rw-r--r-- | src/game/g_weapon.c | 2 |
4 files changed, 54 insertions, 8 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index a2f521e3..3c7a2fc7 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -1263,6 +1263,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.5f, //float minNormal; qtrue, //qboolean invertNormal; qfalse, //qboolean creepTest; + 120, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1289,6 +1290,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qtrue, //qboolean creepTest; + 120, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1315,6 +1317,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qtrue, //qboolean creepTest; + 120, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1341,6 +1344,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qtrue, //qboolean invertNormal; qtrue, //qboolean creepTest; + 120, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1364,9 +1368,10 @@ buildableAttributes_t bg_buildableList[ ] = 0, //int turretFireSpeed; 400, //int turretRange; WP_LOCKBLOB_LAUNCHER, //weapon_t turretProjType; - 0.707f, //float minNormal; - qfalse, //qboolean invertNormal; + 0.0f, //float minNormal; + qtrue, //qboolean invertNormal; qtrue, //qboolean creepTest; + 30, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1393,6 +1398,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 120, //int creepSize; qtrue //qboolean reactorTest; }, { @@ -1419,6 +1425,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1445,6 +1452,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1471,6 +1479,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1497,6 +1506,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1523,6 +1533,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1549,6 +1560,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1575,6 +1587,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1601,6 +1614,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1627,6 +1641,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qtrue //qboolean reactorTest; }, { @@ -1653,6 +1668,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; }, { @@ -1679,6 +1695,7 @@ buildableAttributes_t bg_buildableList[ ] = 0.707f, //float minNormal; qfalse, //qboolean invertNormal; qfalse, //qboolean creepTest; + 0, //int creepSize; qfalse //qboolean reactorTest; } }; @@ -2153,6 +2170,26 @@ int BG_FindCreepTestForBuildable( int bclass ) /* ============== +BG_FindCreepSizeForBuildable +============== +*/ +int BG_FindCreepSizeForBuildable( int bclass ) +{ + int i; + + for( i = 0; i < bg_numBuildables; i++ ) + { + if( bg_buildableList[ i ].buildNum == bclass ) + { + return bg_buildableList[ i ].creepSize; + } + } + + return CREEP_BASESIZE; +} + +/* +============== BG_FindUniqueTestForBuildable ============== */ diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 284bbf86..4dbe2542 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -887,6 +887,8 @@ typedef struct qboolean invertNormal; qboolean creepTest; + int creepSize; + qboolean reactorTest; } buildableAttributes_t; @@ -958,6 +960,7 @@ weapon_t BG_FindProjTypeForBuildable( int bclass ); float BG_FindMinNormalForBuildable( int bclass ); qboolean BG_FindInvertNormalForBuildable( int bclass ); int BG_FindCreepTestForBuildable( int bclass ); +int BG_FindCreepSizeForBuildable( int bclass ); int BG_FindUniqueTestForBuildable( int bclass ); int BG_FindClassNumForName( char *name ); @@ -1077,5 +1080,5 @@ qboolean BG_gotWeapon( int weapon, int stats[ ] );*/ #define MAX_BOTS_TEXT 8192 //TA: conceptually should live in q_shared.h -void AxisToAngles( vec3_t axis[3], vec3_t angles); +void AxisToAngles( vec3_t axis[3], vec3_t angles ); #define Vector2Set(v, x, y) ((v)[0]=(x), (v)[1]=(y)) diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 013a7e93..f59e8d9c 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -355,7 +355,7 @@ void DSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->die = nullDieFunction; self->think = DSpawn_Blast; - self->nextthink = level.time + 15000; //wait .5 seconds before damaging others + self->nextthink = level.time + 5000; //wait .5 seconds before damaging others trap_LinkEntity( self ); } @@ -477,7 +477,7 @@ void DBarricade_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, self->die = nullDieFunction; self->think = DBarricade_Blast; - self->nextthink = level.time + 15000; + self->nextthink = level.time + 5000; trap_LinkEntity( self ); } @@ -609,7 +609,8 @@ void DBooster_Touch( gentity_t *self, gentity_t *other, trace_t *trace ) //================================================================================== -#define BLOB_PROJSPEED 500 +#define BLOB_PROJSPEED 500 +#define MIN_DOT 0.85f // max angle = acos( MIN_DOT ) /* ================ @@ -686,6 +687,11 @@ qboolean ddef_checktarget( gentity_t *self, gentity_t *target, int range ) if( VectorLength( distance ) > range ) // is the target within range? return qfalse; + //only allow a narrow field of "vision" + VectorNormalize( distance ); //is now direction of target + if( DotProduct( distance, self->s.origin2 ) < MIN_DOT ) + return qfalse; + trap_Trace( &trace, self->s.pos.trBase, NULL, NULL, target->s.pos.trBase, self->s.number, MASK_SHOT ); if ( trace.contents & CONTENTS_SOLID ) // can we see the target? return qfalse; @@ -1456,7 +1462,7 @@ void HSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int self->die = nullDieFunction; self->think = HSpawn_Blast; - self->nextthink = level.time + 15000; //wait 1.5 seconds before damaging others + self->nextthink = level.time + 5000; //wait 1.5 seconds before damaging others self->powered = qfalse; //free up power trap_LinkEntity( self ); diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index d27adb73..be708264 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -434,7 +434,7 @@ void Weapon_Flamer_Fire (gentity_t *ent) { m = fire_flamer (ent, muzzle, forward); -// VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics + VectorAdd( m->s.pos.trDelta, ent->client->ps.velocity, m->s.pos.trDelta ); // "real" physics } /* |