Several Changes. New type of breakables.

This commit is contained in:
q3rally 2011-06-17 21:49:33 +00:00
parent c7c9efeccf
commit 4403389e04
3 changed files with 12 additions and 56 deletions

View file

@ -1027,56 +1027,6 @@ void CG_ShowDebris( vec3_t srcOrigin, int count, int evType ) {
}
/*
===================
CG_StartEarthquake
Starts an earthquake effect
===================
*/
int flagEarthquake = qfalse;
int earthquakeIntensity = 0;
int earthquakeStoptime = 0;
void CG_StartEarthquake(int intensity, int duration)
{
flagEarthquake = qtrue;
if ( intensity < earthquakeIntensity )
return;
earthquakeIntensity = intensity;
earthquakeStoptime = cg.time + duration;
}
void CG_Earthquake()
{
static float terremotoX, terremotoY, terremotoZ;
static terremotoTime = 0;
float realInt;
if ( !flagEarthquake )
return;
if ( earthquakeStoptime < cg.time )
{
flagEarthquake = qfalse;
earthquakeIntensity = 0;
return;
}
if ( terremotoTime < cg.time )
{
terremotoTime = cg.time += 50;
realInt = ((float)earthquakeIntensity + 1.0) / 2.0;
terremotoX = random() * realInt - realInt / 2;
terremotoY = random() * realInt - realInt / 2;
terremotoZ = random() * realInt - realInt / 2;
}
cg.refdefViewAngles[0] += terremotoX;
cg.refdefViewAngles[1] += terremotoY;
cg.refdefViewAngles[2] += terremotoZ;
AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis );
}
/*
===================

View file

@ -338,6 +338,14 @@ typedef enum {
LETT_DEBRIS_CONCRETE, // emits a (gray) smoke trail
LETT_DEBRIS_WOOD // emits a (brown) dust trail
} leTrailType_t; // defines bounce behavior and trail on fragment local entities
typedef enum {
PT_GRAVITY,
PT_LINEAR_UP,
PT_LINEAR_DOWN,
PT_LINEAR_BOTH
} particleType_t;
typedef struct localEntity_s {
struct localEntity_s *prev, *next;
leType_t leType;
@ -361,8 +369,9 @@ typedef struct localEntity_s {
float light;
vec3_t lightColor;
leMarkType_t leMarkType; // mark to leave on fragment impact
leBounceSoundType_t leBounceSoundType;
leMarkType_t leMarkType; // mark to leave on fragment impact
leBounceSoundType_t leBounceSoundType; // sound to play on fragment impact
leTrailType_t leTrailType; // trail to show behind fragment
refEntity_t refEntity;
} localEntity_t;

View file

@ -929,10 +929,7 @@ static void CG_RegisterSounds( void ) {
cgs.media.regenSound = trap_S_RegisterSound("sound/items/regen.wav", qfalse);
cgs.media.protectSound = trap_S_RegisterSound("sound/items/protect3.wav", qfalse);
// Q3Rally Code Start: use proper sound
cgs.media.shieldSound = trap_S_RegisterSound("sound/weapons/machinegun/ric3.wav", qfalse);
cgs.media.glassSound = trap_S_RegisterSound("sound/breakable/glass.wav", qfalse);
cgs.media.woodSound = trap_S_RegisterSound("sound/breakable/wood.wav", qfalse);
cgs.media.metalSound = trap_S_RegisterSound("sound/breakable/metal.wav", qfalse);
cgs.media.shieldSound = trap_S_RegisterSound("sound/weapons/machinegun/ric3.wav", qfalse);
// Q3Rally Code END
cgs.media.n_healthSound = trap_S_RegisterSound("sound/items/n_health.wav", qfalse );
cgs.media.hgrenb1aSound = trap_S_RegisterSound("sound/weapons/grenade/hgrenb1a.wav", qfalse);