mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2025-02-17 01:22:32 +00:00
pressure change
This commit is contained in:
parent
28299fcceb
commit
8ee85a5248
6 changed files with 73 additions and 29 deletions
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.33 2002/06/09 05:16:33 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.32 2002/06/03 00:39:29 blaze
|
||||
// dont make a sound when bouncing on the ground
|
||||
//
|
||||
|
@ -1350,9 +1353,11 @@ void CG_Pressure( vec3_t origin, vec3_t dir, int type, int speed )
|
|||
le->leType = LE_PRESSURE;
|
||||
|
||||
if (type == 1)
|
||||
le->leFlags = LEF_WATER;
|
||||
le->leFlags = LEF_AIR;
|
||||
else if (type == 2)
|
||||
le->leFlags = LEF_FLAME;
|
||||
else if (type == 3)
|
||||
le->leFlags = LEF_WATER;
|
||||
else
|
||||
le->leFlags = LEF_STEAM;
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.87 2002/06/09 05:16:17 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.86 2002/06/06 01:54:26 niceass
|
||||
// pressure change
|
||||
//
|
||||
|
@ -449,7 +452,8 @@ typedef enum {
|
|||
LEF_SOUND2 = 0x0008, // sound 2 for kamikaze
|
||||
LEF_STEAM = 0x0010, // NiceAss: For pressure entities
|
||||
LEF_FLAME = 0x0020,
|
||||
LEF_WATER = 0x0040
|
||||
LEF_AIR = 0x0040,
|
||||
LEF_WATER = 0x0080
|
||||
} leFlag_t;
|
||||
|
||||
typedef enum {
|
||||
|
@ -1084,8 +1088,11 @@ typedef struct {
|
|||
qhandle_t shotgunSmokePuffShader;
|
||||
qhandle_t plasmaBallShader;
|
||||
qhandle_t waterBubbleShader;
|
||||
qhandle_t waterPressureShader;
|
||||
|
||||
// Pressure:
|
||||
qhandle_t waterPressureModel;
|
||||
qhandle_t flamePressureShader;
|
||||
|
||||
qhandle_t bloodTrailShader;
|
||||
#ifdef MISSIONPACK
|
||||
qhandle_t nailPuffShader;
|
||||
|
@ -2242,7 +2249,7 @@ void CG_ParticleSparks (vec3_t org, vec3_t vel, int duration, float x, float y,
|
|||
void CG_ParticleDust (centity_t *cent, vec3_t origin, vec3_t dir);
|
||||
void CG_ParticleMisc (qhandle_t pshader, vec3_t origin, int size, int duration, float alpha);
|
||||
void CG_ParticleExplosion (char *animStr, vec3_t origin, vec3_t vel, int duration, int sizeStart, int sizeEnd);
|
||||
void CG_ParticleWater (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale);
|
||||
void CG_ParticleAir (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale);
|
||||
void CG_ParticleSteam (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale, int Shader);
|
||||
|
||||
extern qboolean initparticles;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.16 2002/06/09 05:15:40 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.15 2002/06/06 01:54:07 niceass
|
||||
// pressure change
|
||||
//
|
||||
|
@ -834,31 +837,49 @@ void CG_AddScorePlum( localEntity_t *le ) {
|
|||
void CG_AddPressureEntity ( localEntity_t *le ) {
|
||||
vec3_t velocity;
|
||||
vec3_t origin;
|
||||
|
||||
float alpha;
|
||||
int l;
|
||||
|
||||
if (le->leFlags == LEF_WATER) {
|
||||
return;
|
||||
/*
|
||||
refEntity_t water;
|
||||
|
||||
memset( &water, 0, sizeof( water ) );
|
||||
|
||||
water.hModel = cgs.media.waterPressureModel;
|
||||
water.renderfx = RF_NOSHADOW;
|
||||
water.reType = RT_MODEL;
|
||||
|
||||
VectorCopy(le->pos.trBase, water.origin);
|
||||
|
||||
trap_R_AddRefEntityToScene( &water );
|
||||
return;
|
||||
*/
|
||||
}
|
||||
|
||||
alpha = -(cg.time - le->startTime) + (le->endTime - le->startTime);
|
||||
alpha /= (le->endTime - le->startTime);
|
||||
|
||||
//steamSound!!!
|
||||
|
||||
for (l = 0; l < 1; l++) {
|
||||
// steam:
|
||||
// steam:
|
||||
if (le->leFlags != LEF_AIR) {
|
||||
VectorScale(le->pos.trDelta, le->size + rand() % 30, velocity);
|
||||
|
||||
velocity[0] += rand() % 40 - 20;
|
||||
velocity[1] += rand() % 40 - 20;
|
||||
|
||||
VectorCopy(le->pos.trBase, origin);
|
||||
|
||||
if (le->leFlags == LEF_WATER)
|
||||
CG_ParticleWater(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1 );
|
||||
else if (le->leFlags == LEF_FLAME)
|
||||
CG_ParticleSteam(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1, cgs.media.flamePressureShader );
|
||||
else
|
||||
CG_ParticleSteam(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1, cgs.media.smokePuffShader );
|
||||
}
|
||||
else
|
||||
VectorScale(le->pos.trDelta, le->size, velocity);
|
||||
|
||||
VectorCopy(le->pos.trBase, origin);
|
||||
|
||||
if (le->leFlags == LEF_AIR)
|
||||
CG_ParticleAir(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1 );
|
||||
else if (le->leFlags == LEF_FLAME)
|
||||
CG_ParticleSteam(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1, cgs.media.flamePressureShader );
|
||||
else
|
||||
CG_ParticleSteam(le->pos.trBase, velocity, 200 + rand() % 120, alpha, 2, 1, cgs.media.smokePuffShader );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.76 2002/06/09 05:14:40 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.75 2002/06/06 20:44:16 makro
|
||||
// Removed cheat protection for cg_gunX, Y and Z
|
||||
//
|
||||
|
@ -789,8 +792,8 @@ static void CG_RegisterSounds( void ) {
|
|||
CG_LoadVoiceChats();
|
||||
#endif
|
||||
|
||||
// NiceAss: Used for pressure entities
|
||||
cgs.media.steamSound = trap_S_RegisterSound( "sound/steam.wav", qtrue );
|
||||
// NiceAss: Used for pressure entities. Not implemented yet.
|
||||
// cgs.media.steamSound = trap_S_RegisterSound( "sound/steam.wav", qtrue );
|
||||
cgs.media.oneMinuteSound = trap_S_RegisterSound( "sound/feedback/1_minute.wav", qtrue );
|
||||
cgs.media.fiveMinuteSound = trap_S_RegisterSound( "sound/feedback/5_minute.wav", qtrue );
|
||||
cgs.media.suddenDeathSound = trap_S_RegisterSound( "sound/feedback/sudden_death.wav", qtrue );
|
||||
|
@ -1353,8 +1356,8 @@ static void CG_RegisterGraphics( void ) {
|
|||
cgs.media.lagometerShader = trap_R_RegisterShader("lagometer" );
|
||||
cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" );
|
||||
|
||||
cgs.media.waterPressureShader = trap_R_RegisterShader( "waterpressure" ); // NiceAss: Used in pressure entities
|
||||
cgs.media.flamePressureShader = trap_R_RegisterShader( "flamepressure" ); // NiceAss: Used in pressure entities
|
||||
// cgs.media.waterPressureModel = trap_R_RegisterModel("models/mapobjects/reaction/watercone/watercode.md3");
|
||||
|
||||
cgs.media.waterBubbleShader = trap_R_RegisterShader( "waterBubble" );
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.11 2002/06/09 05:15:12 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.10 2002/06/06 01:53:26 niceass
|
||||
// pressure change
|
||||
//
|
||||
|
@ -2304,7 +2307,7 @@ void CG_ParticleMisc (qhandle_t pshader, vec3_t origin, int size, int duration,
|
|||
|
||||
|
||||
|
||||
void CG_ParticleWater (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale)
|
||||
void CG_ParticleAir (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale)
|
||||
{
|
||||
cparticle_t *p;
|
||||
|
||||
|
@ -2324,7 +2327,7 @@ void CG_ParticleWater (vec3_t org, vec3_t vel, int duration, float alpha, float
|
|||
else
|
||||
p->color = LIGHT_BLUE_WATER;
|
||||
|
||||
p->alpha = alpha * 0.5f;
|
||||
p->alpha = alpha;
|
||||
p->alphavel = p->alpha / ((p->endtime - p->startfade) * .0001f);
|
||||
|
||||
p->height = 1.0 * scale;
|
||||
|
@ -2332,7 +2335,7 @@ void CG_ParticleWater (vec3_t org, vec3_t vel, int duration, float alpha, float
|
|||
p->endheight = 1.0 * scale;
|
||||
p->endwidth = 1.0 * scale;
|
||||
|
||||
p->pshader = cgs.media.waterPressureShader;
|
||||
p->pshader = cgs.media.waterBubbleShader;
|
||||
|
||||
p->type = P_SMOKE;
|
||||
|
||||
|
@ -2343,11 +2346,11 @@ void CG_ParticleWater (vec3_t org, vec3_t vel, int duration, float alpha, float
|
|||
p->vel[2] = vel[2] * speed;
|
||||
|
||||
p->accel[0] = p->accel[1] = 0;
|
||||
p->accel[2] = -PARTICLE_GRAVITY * 4;
|
||||
p->accel[2] = PARTICLE_GRAVITY * 8;
|
||||
|
||||
p->vel[0] += (crandom() * 12);
|
||||
p->vel[1] += (crandom() * 12);
|
||||
p->vel[2] += (20 + (crandom() * 10)) * speed;
|
||||
p->vel[0] += (crandom() * 40);
|
||||
p->vel[1] += (crandom() * 40);
|
||||
p->vel[2] += (20 + (crandom() * 40)) * speed;
|
||||
}
|
||||
|
||||
void CG_ParticleSteam (vec3_t org, vec3_t vel, int duration, float alpha, float speed, float scale, int Shader)
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.55 2002/06/09 05:16:58 niceass
|
||||
// pressure change
|
||||
//
|
||||
// Revision 1.54 2002/06/05 23:39:40 blaze
|
||||
// unbreakables work properly. Though I already commited this.
|
||||
//
|
||||
|
@ -942,10 +945,12 @@ void SP_func_pressure( gentity_t *ent ) {
|
|||
|
||||
if (ent->mass == 0) ent->mass = 200;
|
||||
|
||||
if (!Q_stricmp(type, "water")) // bounce will hold pressure type... yeah...
|
||||
if (!Q_stricmp(type, "air")) // bounce will hold pressure type... yeah...
|
||||
ent->bounce = 1;
|
||||
else if (!Q_stricmp(type, "flame") || !Q_stricmp(type, "fire"))
|
||||
ent->bounce = 2;
|
||||
else if (!Q_stricmp(type, "water"))
|
||||
ent->bounce = 3;
|
||||
else // steam is default
|
||||
ent->bounce = 0;
|
||||
|
||||
|
@ -962,7 +967,7 @@ void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t *ent) {
|
|||
tent = G_TempEntity( origin, EV_PRESSURE );
|
||||
tent->s.eventParm = DirToByte( normal );
|
||||
|
||||
tent->s.frame = ent->bounce; // 1 = water, 2 = flame, 0 = steam
|
||||
tent->s.frame = ent->bounce; // 1 = air, 2 = flame, 0 = steam
|
||||
tent->s.powerups = ent->mass; // speed of pressure
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue