summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_public.h4
-rw-r--r--src/game/g_active.c4
-rw-r--r--src/game/g_buildable.c45
-rw-r--r--src/game/g_combat.c6
-rw-r--r--src/game/g_local.h5
-rw-r--r--src/game/g_misc.c5
6 files changed, 52 insertions, 17 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index a4e6ea46..0f53ef30 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -484,7 +484,8 @@ typedef enum {
EV_POWERUP_REGEN,
EV_GIB_PLAYER, // gib a previously living player
- EV_GIB_GENERIC, //TA: generic green gib for droids
+ EV_GIB_DROID, //TA: generic green gib for droids
+ EV_ITEM_RECEDE, //TA: sent when creep should recede
EV_DEBUG_LINE,
EV_STOPLOOPINGSOUND,
@@ -781,4 +782,5 @@ qboolean BG_gotWeapon( int weapon, int stats[ ] );*/
//TA: conceptually should live in q_shared.h
void AxisToAngles( vec3_t axis[3], vec3_t angles);
float arccos( float x );
+#define Vector2Set(v, x, y) ((v)[0]=(x), (v)[1]=(y))
diff --git a/src/game/g_active.c b/src/game/g_active.c
index e4a1ffbf..6b0c7218 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -737,7 +737,7 @@ 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" ) )
{
@@ -753,7 +753,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 4a75366f..cc67c2eb 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -36,6 +36,27 @@ void nullDieFunction( gentity_t *self, gentity_t *inflictor, gentity_t *attacker
{
}
+/*
+================
+D_CreepRecede
+
+Called when an droid spawn dies
+================
+*/
+void D_CreepRecede( gentity_t *self )
+{
+ if( ( self->timestamp + 100 ) == level.time )
+ G_AddEvent( self, EV_ITEM_RECEDE, 0 );
+
+ if( ( self->timestamp + 10000 ) > level.time )
+ {
+ self->nextthink = level.time + 500;
+ trap_LinkEntity( self );
+ }
+ else
+ G_FreeEntity( self );
+}
+
/*
================
@@ -49,6 +70,9 @@ void DSpawn_Melt( gentity_t *self )
G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, 2,
self->splashRadius, self, self->splashMethodOfDeath, PTE_DROIDS );
+ if( ( self->timestamp + 500 ) == level.time )
+ G_AddEvent( self, EV_ITEM_RECEDE, 0 );
+
if( ( self->timestamp + 10000 ) > level.time )
{
self->nextthink = level.time + 500;
@@ -80,7 +104,7 @@ void DSpawn_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->splashRadius, self, self->splashMethodOfDeath, PTE_DROIDS );
self->s.modelindex = 0; //don't draw the model once its destroyed
- G_AddEvent( self, EV_GIB_GENERIC, DirToByte( dir ) );
+ G_AddEvent( self, EV_GIB_DROID, DirToByte( dir ) );
self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
self->die = nullDieFunction;
@@ -110,11 +134,14 @@ void DDef1_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
self->splashRadius, self, self->splashMethodOfDeath, PTE_DROIDS );
self->s.modelindex = 0; //don't draw the model once its destroyed
- G_AddEvent( self, EV_GIB_GENERIC, DirToByte( dir ) );
+ G_AddEvent( self, EV_GIB_DROID, DirToByte( dir ) );
self->r.contents = CONTENTS_TRIGGER;
self->timestamp = level.time;
- self->freeAfterEvent = qtrue;
self->die = nullDieFunction;
+ self->think = D_CreepRecede;
+ self->nextthink = level.time + 100;
+
+ trap_LinkEntity( self );
}
@@ -127,8 +154,10 @@ think function for Droid Spawn
*/
void DSpawn_Think( gentity_t *self )
{
- if( self->parentNode == NULL )
- self->parentNode = createCreepNode( self->s.origin );
+ /*if( self->parentNode == NULL )
+ self->parentNode = createCreepNode( self );
+
+ VectorCopy( self->s.origin, self->parentNode->s.origin );*/
self->nextthink = level.time + 100;
}
@@ -167,7 +196,7 @@ void DDef1_Think( gentity_t *self )
}
}
- if( minDistance <= CREEP_BASESIZE )
+ if( minDistance <= ( CREEP_BASESIZE * 3 ) )
self->parentNode = closestSpawn;
else
{
@@ -187,7 +216,7 @@ 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 15
+#define HDEF1_ANGULARSPEED 10
#define HDEF1_FIRINGSPEED 200
#define HDEF1_ACCURACYTOLERANCE 10
#define HDEF1_VERTICALCAP 20
@@ -461,7 +490,7 @@ qboolean itemFits( gentity_t *ent, gitem_t *item, int distance )
if( !Q_stricmp( creepent->classname, "team_droid_spawn" ) )
{
VectorSubtract( entity_origin, creepent->s.origin, temp_v );
- if( VectorLength( temp_v ) <= CREEP_BASESIZE )
+ if( VectorLength( temp_v ) <= ( CREEP_BASESIZE * 3 ) )
{
nearcreep = qtrue;
break;
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 77b836f6..0f915e0a 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -326,7 +326,11 @@ GibEntity
==================
*/
void GibEntity( gentity_t *self, int killer ) {
- G_AddEvent( self, EV_GIB_PLAYER, killer );
+ if( self->client->ps.stats[ STAT_PCLASS ] == PTE_HUMANS )
+ G_AddEvent( self, EV_GIB_PLAYER, killer );
+ else
+ G_AddEvent( self, EV_GIB_DROID, killer );
+
self->takedamage = qfalse;
self->s.eType = ET_INVISIBLE;
self->r.contents = 0;
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 54d73c90..b7e02177 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -474,11 +474,6 @@ qboolean itemFits( gentity_t *ent, gitem_t *item, int distance );
gentity_t *Build_Item( gentity_t *ent, gitem_t *item, int distance );
//
-// g_creep.c
-//
-gentity_t *createCreepNode( vec3_t origin );
-
-//
// g_utils.c
//
int G_ModelIndex( char *name );
diff --git a/src/game/g_misc.c b/src/game/g_misc.c
index 60f5dd70..8b776118 100644
--- a/src/game/g_misc.c
+++ b/src/game/g_misc.c
@@ -118,6 +118,11 @@ void ShineTorch( gentity_t *self )
else
G_SetOrigin( self, to );
+ VectorCopy( angles, self->s.apos.trBase );
+
+ //so we can use the predicted values client side if available
+ self->s.frame = self->parent->s.number;
+
trap_LinkEntity( self );
}