diff options
-rw-r--r-- | src/cgame/cg_buildable.c | 190 | ||||
-rw-r--r-- | src/cgame/cg_ents.c | 36 | ||||
-rw-r--r-- | src/cgame/cg_event.c | 43 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 41 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 18 | ||||
-rw-r--r-- | src/cgame/cg_particles.c | 12 | ||||
-rw-r--r-- | src/cgame/cg_playerstate.c | 10 | ||||
-rw-r--r-- | src/game/bg_misc.c | 2 | ||||
-rw-r--r-- | src/game/bg_public.h | 14 | ||||
-rw-r--r-- | src/game/g_buildable.c | 32 | ||||
-rw-r--r-- | src/game/g_client.c | 5 | ||||
-rw-r--r-- | src/game/g_combat.c | 20 | ||||
-rw-r--r-- | src/game/tremulous.h | 2 |
13 files changed, 291 insertions, 134 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c index 84c8226b..119a84a4 100644 --- a/src/cgame/cg_buildable.c +++ b/src/cgame/cg_buildable.c @@ -34,6 +34,171 @@ char *cg_buildableSoundNames[ MAX_BUILDABLE_ANIMATIONS ] = sfxHandle_t defaultAlienSounds[ MAX_BUILDABLE_ANIMATIONS ]; sfxHandle_t defaultHumanSounds[ MAX_BUILDABLE_ANIMATIONS ]; + +/* +================== +CG_AlienBuildableExplosionFragment +================== +*/ +void CG_AlienBuildableExplosionFragment( vec3_t origin, vec3_t velocity, qhandle_t hModel ) +{ + localEntity_t *le; + refEntity_t *re; + + le = CG_AllocLocalEntity( ); + re = &le->refEntity; + + le->leType = LE_FRAGMENT; + le->startTime = cg.time; + le->endTime = le->startTime + 5000 + random( ) * 3000; + + VectorCopy( origin, re->origin ); + AxisCopy( axisDefault, re->axis ); + re->hModel = hModel; + + le->pos.trType = TR_GRAVITY; + VectorCopy( origin, le->pos.trBase ); + VectorCopy( velocity, le->pos.trDelta ); + le->pos.trTime = cg.time; + + le->bounceFactor = 0.3; + + le->leBounceSoundType = LEBS_BLOOD; + le->leMarkType = LEMT_GREENBLOOD; +} + +/* +=================== +CG_AlienBuildableExplosion + +Generated a bunch of gibs launching out from a location +=================== +*/ +#define GGIB_VELOCITY 250 +#define GGIB_JUMP 250 +void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir ) +{ + vec3_t velocity; + int count; + particleSystem_t *ps; + + // allow gibs to be turned off for speed + if( cg_gibs.integer ) + { + for( count = 0; count <= 9; count++ ) + { + velocity[ 0 ] = crandom( ) * GGIB_VELOCITY; + velocity[ 1 ] = crandom( ) * GGIB_VELOCITY; + velocity[ 2 ] = GGIB_JUMP + crandom( ) * GGIB_VELOCITY; + CG_AlienBuildableExplosionFragment( origin, velocity, cgs.media.gibAbdomen ); + } + } + + //particle system + ps = CG_SpawnNewParticleSystem( cgs.media.alienBuildableDestroyedPS ); + CG_SetParticleSystemOrigin( ps, origin ); + CG_SetParticleSystemNormal( ps, dir ); + CG_AttachParticleSystemToOrigin( ps ); +} + + +/* +================== +CG_HumanBuildableExplosionFragment +================== +*/ +static void CG_HumanBuildableExplosionFragment( vec3_t origin, vec3_t velocity, qhandle_t hModel ) +{ + localEntity_t *le; + refEntity_t *re; + + le = CG_AllocLocalEntity( ); + re = &le->refEntity; + + le->leType = LE_FRAGMENT; + le->startTime = cg.time; + le->endTime = le->startTime + 10000 + ( crandom( ) * 3000 ); + + VectorCopy( origin, re->origin ); + AxisCopy( axisDefault, re->axis ); + re->hModel = hModel; + re->shaderTime = cg.time / 1000.0f; + + le->pos.trType = TR_GRAVITY; + VectorCopy( origin, le->pos.trBase ); + VectorCopy( velocity, le->pos.trDelta ); + le->pos.trTime = cg.time; + + le->bounceFactor = 0.3; + + le->leBounceSoundType = LEBS_BANG; + le->leMarkType = LEMT_BANG; +} + + +/* +================= +CG_HumanBuildableExplosion + +Called for human buildables as they are destroyed +================= +*/ +#define EXF_VELOCITY 250 +#define EXF_JUMP 250 +void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir ) +{ + vec3_t lightColor, fragOrigin, velocity; + localEntity_t *le; + int i; + qhandle_t gibModel; + particleSystem_t *ps; + + lightColor[ 0 ] = 1; + lightColor[ 1 ] = 0.75; + lightColor[ 2 ] = 0.0; + + trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.humanBuildableExpl ); + + // + // create the explosion -- only the light is important really + // + le = CG_MakeExplosion( origin, dir, cgs.media.dishFlashModel, + cgs.media.explosionShader, + 1000, qtrue ); + le->light = 300; + VectorCopy( lightColor, le->lightColor ); + + //fragments + for( i = 1; i <= 8; i++ ) + { + VectorCopy( origin, fragOrigin ); + velocity[ 0 ] = crandom( ) * EXF_VELOCITY; + velocity[ 1 ] = crandom( ) * EXF_VELOCITY; + velocity[ 2 ] = EXF_JUMP + crandom( ) * EXF_VELOCITY; + + switch( i ) + { + case 1: gibModel = cgs.media.metalGib1; break; + case 2: gibModel = cgs.media.metalGib2; break; + case 3: gibModel = cgs.media.metalGib3; break; + case 4: gibModel = cgs.media.metalGib4; break; + case 5: gibModel = cgs.media.metalGib5; break; + case 6: gibModel = cgs.media.metalGib6; break; + case 7: gibModel = cgs.media.metalGib7; break; + case 8: gibModel = cgs.media.metalGib8; break; + } + + CG_HumanBuildableExplosionFragment( fragOrigin, velocity, gibModel ); + } + + //particle system + ps = CG_SpawnNewParticleSystem( cgs.media.humanBuildableDestroyedPS ); + CG_SetParticleSystemOrigin( ps, origin ); + CG_SetParticleSystemNormal( ps, dir ); + CG_AttachParticleSystemToOrigin( ps ); +} + + #define CREEP_SCALEDOWN_TIME 3000 #define CREEP_SIZE 64.0f @@ -83,7 +248,7 @@ static void CG_Creep( centity_t *cent ) size = CREEP_SIZE * frac; if( size > 0.0f ) - CG_ImpactMark( cgs.media.greenBloodMarkShader, origin, cent->currentState.origin2, + CG_ImpactMark( cgs.media.creepShader, origin, cent->currentState.origin2, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, qfalse, size, qtrue ); } @@ -579,21 +744,6 @@ void CG_GhostBuildable( buildable_t buildable ) trap_R_AddRefEntityToScene( &ent ); } -#define MAX_SMOKE_TIME 500 -#define MIN_SMOKE_TIME 100 -#define SMOKE_SPREAD 89.0f -#define SMOKE_LIFETIME 1000 - -#define MAX_SPARK_TIME 5000 -#define MIN_SPARK_TIME 800 -#define SPARK_SPREAD 80.0f -#define SPARK_LIFETIME 1500 - -#define BLEED_TIME 1500 -#define BLEED_SPREAD 80.0f -#define BLEED_LIFETIME 1000 -#define MAX_BLEED_BLOBS 6 - /* ================== CG_BuildableParticleEffects @@ -742,7 +892,15 @@ void CG_Buildable( centity_t *cent ) // if set to invisible, skip if( es->eFlags & EF_NODRAW ) + { + if( cent->buildablePS != NULL ) + { + CG_DestroyParticleSystem( cent->buildablePS ); + cent->buildablePS = NULL; + } + return; + } memset ( &ent, 0, sizeof( ent ) ); diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c index dda0e3e0..0d8f26de 100644 --- a/src/cgame/cg_ents.c +++ b/src/cgame/cg_ents.c @@ -631,7 +631,7 @@ static void CG_LightFlare( centity_t *cent ) if( cg_lightFlare.integer == FLARE_REALFADE ) { //draw "correct" albeit inefficient flares - srLocal = cent->lastFlareSrcRadius; + srLocal = cent->lfs.lastSrcRadius; //flare radius is likely to be the same as last frame so start with it do @@ -657,7 +657,7 @@ static void CG_LightFlare( centity_t *cent ) ratio = srLocal / srcRadius; - cent->lastFlareSrcRadius = srLocal; + cent->lfs.lastSrcRadius = srLocal; } else if( cg_lightFlare.integer == FLARE_TIMEFADE ) { @@ -666,30 +666,30 @@ static void CG_LightFlare( centity_t *cent ) CG_Trace( &tr, start, mins, maxs, end, cg.predictedPlayerState.clientNum, MASK_SHOT ); - if( ( tr.fraction < 1.0f || tr.startsolid ) && cent->flareStatus ) + if( ( tr.fraction < 1.0f || tr.startsolid ) && cent->lfs.status ) { - cent->flareStatus = qfalse; - cent->lastFlareTime = cg.time; + cent->lfs.status = qfalse; + cent->lfs.lastTime = cg.time; } - else if( ( tr.fraction == 1.0f && !tr.startsolid ) && !cent->flareStatus ) + else if( ( tr.fraction == 1.0f && !tr.startsolid ) && !cent->lfs.status ) { - cent->flareStatus = qtrue; - cent->lastFlareTime = cg.time; + cent->lfs.status = qtrue; + cent->lfs.lastTime = cg.time; } //fade flare up - if( cent->flareStatus ) + if( cent->lfs.status ) { - if( cent->lastFlareTime + es->time > cg.time ) - ratio = (float)( cg.time - cent->lastFlareTime ) / es->time; + if( cent->lfs.lastTime + es->time > cg.time ) + ratio = (float)( cg.time - cent->lfs.lastTime ) / es->time; } //fade flare down - if( !cent->flareStatus ) + if( !cent->lfs.status ) { - if( cent->lastFlareTime + es->time > cg.time ) + if( cent->lfs.lastTime + es->time > cg.time ) { - ratio = (float)( cg.time - cent->lastFlareTime ) / es->time; + ratio = (float)( cg.time - cent->lfs.lastTime ) / es->time; ratio = 1.0f - ratio; } else @@ -710,12 +710,12 @@ static void CG_LightFlare( centity_t *cent ) } else { - ratio = cent->lastFlareRatio; - flare.radius = cent->lastFlareRadius; + ratio = cent->lfs.lastRatio; + flare.radius = cent->lfs.lastRadius; } - cent->lastFlareRatio = ratio; - cent->lastFlareRadius = flare.radius; + cent->lfs.lastRatio = ratio; + cent->lfs.lastRadius = flare.radius; if( ratio < 1.0f ) { diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 5a0c29a1..bf77d489 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -94,7 +94,7 @@ static void CG_Obituary( entityState_t *ent ) message = "should have run further"; break; case MOD_ASPAWN: - message = "was melted by the acid blood"; + message = "shouldn't have trod in the acid"; break; case MOD_MGTURRET: message = "was gunned down by a turret"; @@ -661,10 +661,16 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) CG_MissileHitWall( es->weapon, es->generic1, 0, position, dir, IMPACTSOUND_METAL ); break; - case EV_BUILDABLE_EXPLOSION: - DEBUGNAME( "EV_BUILDABLE_EXPLOSION" ); + case EV_HUMAN_BUILDABLE_EXPLOSION: + DEBUGNAME( "EV_HUMAN_BUILDABLE_EXPLOSION" ); ByteToDir( es->eventParm, dir ); - CG_Explosion( 0, position, dir ); + CG_HumanBuildableExplosion( position, dir ); + break; + + case EV_ALIEN_BUILDABLE_EXPLOSION: + DEBUGNAME( "EV_ALIEN_BUILDABLE_EXPLOSION" ); + ByteToDir( es->eventParm, dir ); + CG_AlienBuildableExplosion( position, dir ); break; case EV_TESLATRAIL: @@ -738,12 +744,6 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) CG_GibPlayer( cent->lerpOrigin ); break; - case EV_GIB_ALIEN: - DEBUGNAME( "EV_GIB_ALIEN" ); - trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.gibSound ); - CG_GenericGib( cent->lerpOrigin ); - break; - case EV_STOPLOOPINGSOUND: DEBUGNAME( "EV_STOPLOOPINGSOUND" ); trap_S_StopLoopingSound( es->number ); @@ -760,7 +760,7 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) if( clientNum == cg.predictedPlayerState.clientNum ) { //FIXME: change to "negative" sound - trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); + trap_S_StartLocalSound( cgs.media.buildableRepairedSound, CHAN_LOCAL_SOUND ); cg.lastBuildAttempt = cg.time; } break; @@ -812,6 +812,27 @@ void CG_EntityEvent( centity_t *cent, vec3_t position ) } break; + case EV_ALIEN_EVOLVE: + DEBUGNAME( "EV_ALIEN_EVOLVE" ); + trap_S_StartSound( NULL, es->number, CHAN_BODY, cgs.media.alienEvolveSound ); + { + particleSystem_t *ps = CG_SpawnNewParticleSystem( cgs.media.alienEvolvePS ); + CG_SetParticleSystemCent( ps, cent ); + CG_AttachParticleSystemToCent( ps ); + } + break; + + case EV_ALIEN_ACIDTUBE: + DEBUGNAME( "EV_ALIEN_ACIDTUBE" ); + { + particleSystem_t *ps = CG_SpawnNewParticleSystem( cgs.media.alienAcidTubePS ); + CG_SetParticleSystemCent( ps, cent ); + ByteToDir( es->eventParm, dir ); + CG_SetParticleSystemNormal( ps, dir ); + CG_AttachParticleSystemToCent( ps ); + } + break; + case EV_PLAYER_RESPAWN: DEBUGNAME( "EV_PLAYER_RESPAWN" ); if( es->number == cg.clientNum ) diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index af572513..b5b35a43 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -224,6 +224,7 @@ typedef struct baseParticle_s qboolean overdrawProtection; qboolean realLight; + qboolean cullOnStartSolid; } baseParticle_t; @@ -390,6 +391,15 @@ typedef struct qboolean barrelSpinning; } playerEntity_t; +typedef struct lightFlareStatus_s +{ + float lastSrcRadius; //caching of likely flare source radius + float lastRadius; //caching of likely flare radius + float lastRatio; //caching of likely flare ratio + int lastTime; //last time flare was visible/occluded + qboolean status; //flare is visble? +} lightFlareStatus_t; + //================================================= #define MAX_CENTITY_PARTICLE_SYSTEMS 8 @@ -437,11 +447,7 @@ typedef struct centity_s buildableAnimNumber_t oldBuildableAnim; //to detect when new anims are set particleSystem_t *buildablePS; - float lastFlareSrcRadius; //caching of likely flare source radius - float lastFlareRadius; //caching of likely flare radius - float lastFlareRatio; //caching of likely flare ratio - int lastFlareTime; //last time flare was visible/occluded - qboolean flareStatus; //flare is visble? + lightFlareStatus_t lfs; qboolean doorState; @@ -1114,13 +1120,6 @@ typedef struct sfxHandle_t useNothingSound; sfxHandle_t wearOffSound; sfxHandle_t footsteps[ FOOTSTEP_TOTAL ][ 4 ]; - sfxHandle_t sfx_ric1; - sfxHandle_t sfx_ric2; - sfxHandle_t sfx_ric3; - sfxHandle_t sfx_railg; - sfxHandle_t sfx_rockexp; - sfxHandle_t sfx_plasmaexp; - sfxHandle_t sfx_flamerexp; sfxHandle_t gibSound; sfxHandle_t gibBounce1Sound; sfxHandle_t gibBounce2Sound; @@ -1134,10 +1133,8 @@ typedef struct sfxHandle_t fallSound; sfxHandle_t jumpPadSound; - sfxHandle_t hitSound; - sfxHandle_t hitSoundHighArmor; - sfxHandle_t hitSoundLowArmor; - sfxHandle_t hitTeamSound; + sfxHandle_t hgrenb1aSound; + sfxHandle_t hgrenb2aSound; sfxHandle_t voteNow; sfxHandle_t votePassed; @@ -1169,9 +1166,6 @@ typedef struct qhandle_t selectCursor; qhandle_t sizeCursor; - sfxHandle_t hgrenb1aSound; - sfxHandle_t hgrenb2aSound; - //TA: for wolf trail effects qhandle_t sparkFlareShader; @@ -1192,9 +1186,15 @@ typedef struct sfxHandle_t buildableRepairedSound; qhandle_t poisonCloudPS; + qhandle_t alienEvolvePS; + qhandle_t alienAcidTubePS; + sfxHandle_t alienEvolveSound; + qhandle_t humanBuildableDamagedPS; + qhandle_t humanBuildableDestroyedPS; qhandle_t alienBuildableDamagedPS; + qhandle_t alienBuildableDestroyedPS; } cgMedia_t; @@ -1517,6 +1517,8 @@ sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ); void CG_GhostBuildable( buildable_t buildable ); void CG_Buildable( centity_t *cent ); void CG_InitBuildables( ); +void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir ); +void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir ); // // cg_spriter.c @@ -1588,7 +1590,6 @@ void CG_RegisterWeapon( int weaponNum ); void CG_FireWeapon( centity_t *cent, weaponMode_t weaponMode ); void CG_MissileHitWall( weapon_t weapon, weaponMode_t weaponMode, int clientNum, vec3_t origin, vec3_t dir, impactSound_t soundType ); -void CG_Explosion( int clientNum, vec3_t origin, vec3_t dir ); void CG_MissileHitPlayer( weapon_t weapon, weaponMode_t weaponMode, vec3_t origin, vec3_t dir, int entityNum ); void CG_Bullet( vec3_t origin, int sourceEntityNum, vec3_t normal, qboolean flesh, int fleshEntityNum ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index d5b85231..93c0e431 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -590,8 +590,6 @@ static void CG_RegisterSounds( void ) cgs.media.talkSound = trap_S_RegisterSound( "sound/player/talk.wav", qfalse ); cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav", qfalse ); - cgs.media.hitSound = trap_S_RegisterSound( "sound/feedback/hit.wav", qfalse ); - cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav", qfalse ); cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav", qfalse ); cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav", qfalse ); @@ -640,14 +638,9 @@ static void CG_RegisterSounds( void ) cgs.media.jetpackIdleSound = trap_S_RegisterSound( "sound/upgrades/jetpack/idle.wav", qfalse ); cgs.media.jetpackAscendSound = trap_S_RegisterSound( "sound/upgrades/jetpack/hi.wav", qfalse ); - cgs.media.humanBuildableExpl = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse ); + cgs.media.alienEvolveSound = trap_S_RegisterSound( "sound/player/alienevolve.wav", qfalse ); - // FIXME: only needed with item - cgs.media.sfx_ric1 = trap_S_RegisterSound( "sound/weapons/machinegun/ric1.wav", qfalse ); - cgs.media.sfx_ric2 = trap_S_RegisterSound( "sound/weapons/machinegun/ric2.wav", qfalse ); - cgs.media.sfx_ric3 = trap_S_RegisterSound( "sound/weapons/machinegun/ric3.wav", qfalse ); - cgs.media.sfx_plasmaexp = trap_S_RegisterSound( "sound/weapons/plasma/plasmx1a.wav", qfalse ); - cgs.media.sfx_flamerexp = trap_S_RegisterSound( "sound/weapons/flamer/fireimpc.wav", qfalse ); + cgs.media.humanBuildableExpl = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse ); cgs.media.hgrenb1aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb1a.wav", qfalse ); cgs.media.hgrenb2aSound = trap_S_RegisterSound( "sound/weapons/grenade/hgrenb2a.wav", qfalse ); @@ -716,6 +709,8 @@ static void CG_RegisterGraphics( void ) cgs.media.greenBloodMarkShader = trap_R_RegisterShader( "greenBloodMark" ); cgs.media.explosionTrailShader = trap_R_RegisterShader( "explosionTrail" ); + cgs.media.creepShader = trap_R_RegisterShader( "creep" ); + cgs.media.scannerBlipShader = trap_R_RegisterShader( "gfx/2d/blip" ); cgs.media.scannerLineShader = trap_R_RegisterShader( "white" ); /*cgs.media.scannerShader = trap_R_RegisterShader( "gfx/2d/scanner" );*/ @@ -788,7 +783,8 @@ static void CG_RegisterGraphics( void ) cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" ); cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" ); - cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "poisonCloud" ); + cgs.media.poisonCloudPS = CG_RegisterParticleSystem( "poisonCloudPS" ); + cgs.media.alienAcidTubePS = CG_RegisterParticleSystem( "alienAcidTubePS" ); cgs.media.jetPackDescendPS = CG_RegisterParticleSystem( "jetPackDescendPS" ); cgs.media.jetPackHoverPS = CG_RegisterParticleSystem( "jetPackHoverPS" ); @@ -796,6 +792,8 @@ static void CG_RegisterGraphics( void ) cgs.media.humanBuildableDamagedPS = CG_RegisterParticleSystem( "humanBuildableDamagedPS" ); cgs.media.alienBuildableDamagedPS = CG_RegisterParticleSystem( "alienBuildableDamagedPS" ); + cgs.media.humanBuildableDestroyedPS = CG_RegisterParticleSystem( "humanBuildableDestroyedPS" ); + cgs.media.alienBuildableDestroyedPS = CG_RegisterParticleSystem( "alienBuildableDestroyedPS" ); // register the inline models cgs.numInlineModels = trap_CM_NumInlineModels( ); diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c index 52b9203e..fee11a04 100644 --- a/src/cgame/cg_particles.c +++ b/src/cgame/cg_particles.c @@ -805,6 +805,12 @@ static qboolean CG_ParseParticle( baseParticle_t *bp, char **text_p ) continue; } + else if( !Q_stricmp( token, "cullOnStartSolid" ) ) + { + bp->cullOnStartSolid = qtrue; + + continue; + } else if( !Q_stricmp( token, "radius" ) ) { token = COM_Parse( text_p ); @@ -1624,8 +1630,12 @@ static void CG_EvaluateParticlePhysics( particle_t *p ) } //remove particles that get into a CONTENTS_NODROP brush - if( ( trap_CM_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) || trace.startsolid ) + if( ( trap_CM_PointContents( trace.endpos, 0 ) & CONTENTS_NODROP ) || + ( bp->cullOnStartSolid && trace.startsolid ) ) { + if( cg_debugParticles.integer >= 1 ) + CG_Printf( "Particle in CONTENTS_NODROP or trace.startsolid\n" ); + p->valid = qfalse; return; } diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c index d43f41a8..68a0a2f1 100644 --- a/src/cgame/cg_playerstate.c +++ b/src/cgame/cg_playerstate.c @@ -241,16 +241,6 @@ void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops ) if( ps->persistant[ PERS_TEAM ] != ops->persistant[ PERS_TEAM ] ) return; - // hit changes - if( ps->persistant[ PERS_HITS ] > ops->persistant[ PERS_HITS ] ) - { - /*armor = ps->persistant[PERS_ATTACKEE_ARMOR] & 0xff; - health = ps->persistant[PERS_ATTACKEE_ARMOR] >> 8;*/ - trap_S_StartLocalSound( cgs.media.hitSound, CHAN_LOCAL_SOUND ); - } - else if( ps->persistant[ PERS_HITS ] < ops->persistant[ PERS_HITS ] ) - trap_S_StartLocalSound( cgs.media.hitTeamSound, CHAN_LOCAL_SOUND ); - // health changes of more than -1 should make pain sounds if( ps->stats[ STAT_HEALTH ] < ops->stats[ STAT_HEALTH ] - 1 ) { diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c index 70136c4d..e23dc962 100644 --- a/src/game/bg_misc.c +++ b/src/game/bg_misc.c @@ -135,7 +135,7 @@ buildableAttributes_t bg_buildableList[ ] = ACIDTUBE_REGEN, //int regenRate; ACIDTUBE_SPLASHDAMAGE, //int splashDamage; ACIDTUBE_SPLASHRADIUS, //int splashRadius; - MOD_ASPAWN, //int meansOfDeath; + MOD_ATUBE, //int meansOfDeath; BIT_ALIENS, //int team; ( 1 << WP_ABUILD )|( 1 << WP_ABUILD2 ), //weapon_t buildWeapon; BANIM_IDLE1, //int idleAnim; diff --git a/src/game/bg_public.h b/src/game/bg_public.h index def97d26..8a505c1a 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -521,7 +521,6 @@ typedef enum EV_MISSILE_HIT, EV_MISSILE_MISS, EV_MISSILE_MISS_METAL, - EV_BUILDABLE_EXPLOSION, //TA: human item explosions EV_TESLATRAIL, EV_ALIENZAP, EV_BULLET, // otherEntity is the shooter @@ -533,19 +532,22 @@ typedef enum EV_OBITUARY, EV_GIB_PLAYER, // gib a previously living player - EV_GIB_ALIEN, //TA: generic green gib for aliens EV_BUILD_CONSTRUCT, //TA EV_BUILD_DESTROY, //TA + EV_BUILD_DELAY, //TA: can't build yet + EV_BUILD_REPAIR, //TA: repairing buildable + EV_BUILD_REPAIRED, //TA: buildable has full health + EV_HUMAN_BUILDABLE_EXPLOSION, + EV_ALIEN_BUILDABLE_EXPLOSION, + EV_ALIEN_ACIDTUBE, + + EV_ALIEN_EVOLVE, EV_DEBUG_LINE, EV_STOPLOOPINGSOUND, EV_TAUNT, - EV_BUILD_DELAY, //TA: can't build yet - EV_BUILD_REPAIR, //TA: repairing buildable - EV_BUILD_REPAIRED, //TA: buildable has full health - EV_OVERMIND_ATTACK, //TA: overmind under attack EV_OVERMIND_DYING, //TA: overmind close to death EV_OVERMIND_SPAWNS, //TA: overmind needs spawns diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 2d4a19c7..84e25106 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -407,17 +407,15 @@ void ASpawn_Blast( gentity_t *self ) { vec3_t dir; - // we don't have a valid direction, so just point straight up - dir[ 0 ] = dir[ 1 ] = 0; - dir[ 2 ] = 1; + VectorCopy( self->s.origin2, dir ); //do a bit of radius damage G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage, self->splashRadius, self, self->splashMethodOfDeath, PTE_ALIENS ); //pretty events and item cleanup - self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed - G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) ); + self->s.eFlags |= EF_NODRAW; //don't draw the model once it's destroyed + G_AddEvent( self, EV_ALIEN_BUILDABLE_EXPLOSION, DirToByte( dir ) ); self->timestamp = level.time; self->think = ASpawn_Melt; self->nextthink = level.time + 500; //wait .5 seconds before damaging others @@ -623,9 +621,7 @@ void ABarricade_Blast( gentity_t *self ) { vec3_t dir; - // we don't have a valid direction, so just point straight up - dir[ 0 ] = dir[ 1 ] = 0; - dir[ 2 ] = 1; + VectorCopy( self->s.origin2, dir ); //do a bit of radius damage G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage, @@ -633,7 +629,7 @@ void ABarricade_Blast( gentity_t *self ) //pretty events and item cleanup self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed - G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) ); + G_AddEvent( self, EV_ALIEN_BUILDABLE_EXPLOSION, DirToByte( dir ) ); self->timestamp = level.time; self->think = A_CreepRecede; self->nextthink = level.time + 500; //wait .5 seconds before damaging others @@ -704,7 +700,7 @@ void AAcidTube_Damage( gentity_t *self ) if( !( self->s.eFlags & EF_FIRING ) ) { self->s.eFlags |= EF_FIRING; - G_AddEvent( self, EV_GIB_ALIEN, DirToByte( self->s.origin2 ) ); + G_AddEvent( self, EV_ALIEN_ACIDTUBE, DirToByte( self->s.origin2 ) ); } if( ( self->timestamp + ACIDTUBE_REPEAT ) > level.time ) @@ -987,9 +983,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int { vec3_t dir; - // we don't have a valid direction, so just point straight up - dir[ 0 ] = dir[ 1 ] = 0; - dir[ 2 ] = 1; + VectorCopy( self->s.origin2, dir ); //do a bit of radius damage G_SelectiveRadiusDamage( self->s.pos.trBase, self->parent, self->splashDamage, @@ -997,7 +991,7 @@ void AHovel_Die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int //pretty events and item cleanup self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed - G_AddEvent( self, EV_GIB_ALIEN, DirToByte( dir ) ); + G_AddEvent( self, EV_ALIEN_BUILDABLE_EXPLOSION, DirToByte( dir ) ); self->timestamp = level.time; self->think = ASpawn_Melt; self->nextthink = level.time + 500; //wait .5 seconds before damaging others @@ -1492,13 +1486,13 @@ qboolean HMGTurret_TrackEnemy( gentity_t *self ) if( self->dcced ) { - accuracyTolerance = MGTURRET_ACCURACYTOLERANCE; - angularSpeed = MGTURRET_ANGULARSPEED; + accuracyTolerance = MGTURRET_DCC_ACCURACYTOLERANCE; + angularSpeed = MGTURRET_DCC_ANGULARSPEED; } else { - accuracyTolerance = MGTURRET_DCC_ACCURACYTOLERANCE; - angularSpeed = MGTURRET_DCC_ANGULARSPEED; + accuracyTolerance = MGTURRET_ACCURACYTOLERANCE; + angularSpeed = MGTURRET_ANGULARSPEED; } VectorSubtract( self->enemy->s.pos.trBase, self->s.pos.trBase, dirToTarget ); @@ -1807,7 +1801,7 @@ void HSpawn_Blast( gentity_t *self ) dir[ 2 ] = 1; self->s.eFlags |= EF_NODRAW; //don't draw the model once its destroyed - G_AddEvent( self, EV_BUILDABLE_EXPLOSION, DirToByte( dir ) ); + G_AddEvent( self, EV_HUMAN_BUILDABLE_EXPLOSION, DirToByte( dir ) ); self->timestamp = level.time; //do some radius damage diff --git a/src/game/g_client.c b/src/game/g_client.c index f56267c5..cf66ae1e 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -1473,7 +1473,10 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn, vec3_t origin, vec3_t angles VectorScale( dir, UP_VEL, client->ps.velocity ); } else - G_AddPredictableEvent( ent, EV_GIB_ALIEN, DirToByte( up ) ); + { + //evolution particle system + G_AddPredictableEvent( ent, EV_ALIEN_EVOLVE, DirToByte( up ) ); + } } // the respawned flag will be cleared after the attack and jump keys come up diff --git a/src/game/g_combat.c b/src/game/g_combat.c index 3a04ad44..3d57b5b0 100644 --- a/src/game/g_combat.c +++ b/src/game/g_combat.c @@ -72,23 +72,6 @@ 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_PTEAM ] == PTE_HUMANS ) - G_AddEvent( self, EV_GIB_PLAYER, killer ); - else - G_AddEvent( self, EV_GIB_ALIEN, killer ); - - self->takedamage = qfalse; - self->s.eType = ET_INVISIBLE; - self->r.contents = 0; -} - -/* -================== body_die ================== */ @@ -102,9 +85,6 @@ void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int d self->health = GIB_HEALTH + 1; return; } - - //TA: no gibbing - //GibEntity( self, 0 ); } diff --git a/src/game/tremulous.h b/src/game/tremulous.h index 3ee4bbd7..b030e6d5 100644 --- a/src/game/tremulous.h +++ b/src/game/tremulous.h @@ -213,7 +213,7 @@ #define ACIDTUBE_SPLASHRADIUS 200 #define ACIDTUBE_CREEPSIZE 120 #define ACIDTUBE_RANGE 200.0f -#define ACIDTUBE_REPEAT 10000 +#define ACIDTUBE_REPEAT 3000 #define HIVE_BP 50 #define HIVE_HEALTH ABHM(100) |