some fixing of func_explosive

This commit is contained in:
Scott Brooks 2002-03-21 00:26:46 +00:00
parent 3f7ac89c0c
commit fc7319051a
3 changed files with 78 additions and 30 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.21 2002/03/21 00:26:46 blaze
// some fixing of func_explosive
//
// Revision 1.20 2002/03/04 20:50:59 jbravo // Revision 1.20 2002/03/04 20:50:59 jbravo
// No floating scores over dead bodies, triangles disabled, and no viewing // No floating scores over dead bodies, triangles disabled, and no viewing
// names of enemys just of teammates. // names of enemys just of teammates.
@ -998,30 +1001,30 @@ void CG_BreakGlass( vec3_t playerOrigin, int glassParm, int type ) {
debris3 = cgs.media.wood03; debris3 = cgs.media.wood03;
bounceFactor = 0.8f; bounceFactor = 0.8f;
} }
else if ( (glassParm & RQ3_DEBRIS_METAL) == RQ3_DEBRIS_METAL) else if ( (glassParm & RQ3_DEBRIS_METAL) == RQ3_DEBRIS_METAL)
{ {
//CG_Printf("Launching metal\n"); //CG_Printf("Launching metal\n");
debris1 = cgs.media.metal01; debris1 = cgs.media.metal01;
debris2 = cgs.media.metal02; debris2 = cgs.media.metal02;
debris3 = cgs.media.metal03; debris3 = cgs.media.metal03;
bounceFactor = 0.7f; bounceFactor = 0.7f;
} }
else if ( (glassParm & RQ3_DEBRIS_CERAMIC) == RQ3_DEBRIS_CERAMIC) else if ( (glassParm & RQ3_DEBRIS_CERAMIC) == RQ3_DEBRIS_CERAMIC)
{ {
//CG_Printf("Launching ceramic\n"); //CG_Printf("Launching ceramic\n");
debris1 = cgs.media.ceramic01; debris1 = cgs.media.ceramic01;
debris2 = cgs.media.ceramic02; debris2 = cgs.media.ceramic02;
debris3 = cgs.media.ceramic03; debris3 = cgs.media.ceramic03;
bounceFactor = 0.7f; bounceFactor = 0.7f;
} }
else if ( (glassParm & RQ3_DEBRIS_PAPER) == RQ3_DEBRIS_PAPER) else if ( (glassParm & RQ3_DEBRIS_PAPER) == RQ3_DEBRIS_PAPER)
{ {
//CG_Printf("Launching paper\n"); //CG_Printf("Launching paper\n");
debris1 = cgs.media.paper01; debris1 = cgs.media.paper01;
debris2 = cgs.media.paper02; debris2 = cgs.media.paper02;
debris3 = cgs.media.paper03; debris3 = cgs.media.paper03;
bounceFactor = 0.2f; bounceFactor = 0.2f;
} }
else if ( (glassParm & RQ3_DEBRIS_BRICK) == RQ3_DEBRIS_BRICK) else if ( (glassParm & RQ3_DEBRIS_BRICK) == RQ3_DEBRIS_BRICK)
{ {
//CG_Printf("Launching brick\n"); //CG_Printf("Launching brick\n");
@ -1141,12 +1144,16 @@ Generated a bunch of gibs launching out from the breakables location
=================== ===================
*/ */
#define BREAK_VELOCITY 550 #define BREAK_VELOCITY 550
#define BREAK_JUMP 150 #define BREAK_JUMP 1500
void CG_BreakBreakable( centity_t *cent, int eParam ) { void CG_BreakBreakable( centity_t *cent, int eParam ) {
localEntity_t *le;
vec3_t origin, velocity; vec3_t origin, velocity;
qhandle_t model; qhandle_t model;
sfxHandle_t sound; sfxHandle_t sound;
qhandle_t mod;
qhandle_t shader;
int i, mass, material; int i, mass, material;
float tension, bouncyness, size; float tension, bouncyness, size;
int modelbias[10] = { 0, 0, 0, 0, 1, 1, 1, 2, 2 }; int modelbias[10] = { 0, 0, 0, 0, 1, 1, 1, 2, 2 };
@ -1160,6 +1167,7 @@ void CG_BreakBreakable( centity_t *cent, int eParam ) {
bouncyness = 0.25 * (((eParam) & 0x3) + 1); bouncyness = 0.25 * (((eParam) & 0x3) + 1);
mass = eParam; mass = eParam;
material = (cent->currentState.powerups >> 12) & 0x000F; material = (cent->currentState.powerups >> 12) & 0x000F;
tension = 0.0667 * (float)((cent->currentState.powerups >> 8) & 0x000F); tension = 0.0667 * (float)((cent->currentState.powerups >> 8) & 0x000F);
bouncyness = 0.0667 * (float)((cent->currentState.powerups >> 4) & 0x000F); bouncyness = 0.0667 * (float)((cent->currentState.powerups >> 4) & 0x000F);
@ -1167,13 +1175,26 @@ void CG_BreakBreakable( centity_t *cent, int eParam ) {
if (mass == 0) mass = 1; if (mass == 0) mass = 1;
if (size <= 0) size = 1; if (size <= 0) size = 1;
if (material) material--; //if (material) material--;
VectorCopy( cent->currentState.origin, origin ); VectorCopy( cent->currentState.origin, origin );
sound = cgs.media.breakable_snd[material]; sound = cgs.media.breakable_snd[material];
trap_S_StartSound( origin, cent->currentState.number, CHAN_BODY, sound ); trap_S_StartSound( origin, cent->currentState.number, CHAN_BODY, sound );
// create an explosion
mod = cgs.media.dishFlashModel;
shader = cgs.media.grenadeExplosionShader;
le = CG_MakeExplosion( origin, velocity,
mod,
shader,
600, qtrue );
le->light = 300;
le->lightColor[0] = 1;
le->lightColor[1] = 0.75;
le->lightColor[2] = 0.50;
for (i = 0; i < mass; i++) { for (i = 0; i < mass; i++) {
velocity[0] = (crandom() * BREAK_VELOCITY) * tension; velocity[0] = (crandom() * BREAK_VELOCITY) * tension;
velocity[1] = (crandom() * BREAK_VELOCITY) * tension; velocity[1] = (crandom() * BREAK_VELOCITY) * tension;
@ -1181,4 +1202,6 @@ void CG_BreakBreakable( centity_t *cent, int eParam ) {
model = cgs.media.breakable_frag[material][(int)(2.0 * random())]; model = cgs.media.breakable_frag[material][(int)(2.0 * random())];
CG_LaunchBreakableFrag( origin, velocity, model, bouncyness, size ); CG_LaunchBreakableFrag( origin, velocity, model, bouncyness, size );
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.47 2002/03/21 00:26:20 blaze
// some fixing of func_explosive
//
// Revision 1.46 2002/03/17 21:32:23 jbravo // Revision 1.46 2002/03/17 21:32:23 jbravo
// Fixed the dynamic teamnames system up a bit to reduce traffic // Fixed the dynamic teamnames system up a bit to reduce traffic
// //
@ -211,6 +214,8 @@ vmCvar_t cg_RQ3_ssgSensitivity4x;
vmCvar_t cg_RQ3_ssgSensitivity6x; vmCvar_t cg_RQ3_ssgSensitivity6x;
//Blaze: Which ssg crosshair to use //Blaze: Which ssg crosshair to use
vmCvar_t cg_RQ3_ssgCrosshair; vmCvar_t cg_RQ3_ssgCrosshair;
//Blaze: Allow stuff to be done automatically on round start/end
vmCvar_t cg_RQ3_autoAction;
//Elder: smoke puffs, sparks, etc. //Elder: smoke puffs, sparks, etc.
vmCvar_t cg_RQ3_impactEffects; vmCvar_t cg_RQ3_impactEffects;
//Elder: toggle client-side laser drawing //Elder: toggle client-side laser drawing
@ -406,6 +411,8 @@ static cvarTable_t cvarTable[] = { // bk001129
{ &cg_RQ3_ssgSensitivity2x, "cg_RQ3_ssgSensitivity2x", "0.4", CVAR_ARCHIVE }, { &cg_RQ3_ssgSensitivity2x, "cg_RQ3_ssgSensitivity2x", "0.4", CVAR_ARCHIVE },
{ &cg_RQ3_ssgSensitivity4x, "cg_RQ3_ssgSensitivity4x", "0.2", CVAR_ARCHIVE }, { &cg_RQ3_ssgSensitivity4x, "cg_RQ3_ssgSensitivity4x", "0.2", CVAR_ARCHIVE },
{ &cg_RQ3_ssgSensitivity6x, "cg_RQ3_ssgSensitivity6x", "0.1", CVAR_ARCHIVE }, { &cg_RQ3_ssgSensitivity6x, "cg_RQ3_ssgSensitivity6x", "0.1", CVAR_ARCHIVE },
//Blaze: Added to let people autop perform actions on match start/end
{ &cg_RQ3_autoAction, "cg_RQ3_autoAction", "0", CVAR_ARCHIVE },
//Makro - this should be latched //Makro - this should be latched
{ &cg_RQ3_ssgCrosshair, "cg_RQ3_ssgCrosshair", "0", CVAR_ARCHIVE | CVAR_LATCH }, { &cg_RQ3_ssgCrosshair, "cg_RQ3_ssgCrosshair", "0", CVAR_ARCHIVE | CVAR_LATCH },
{ &cg_RQ3_ssgColorR, "cg_RQ3_ssgColorR", "0.0", CVAR_ARCHIVE }, { &cg_RQ3_ssgColorR, "cg_RQ3_ssgColorR", "0.0", CVAR_ARCHIVE },
@ -800,6 +807,10 @@ static void CG_RegisterSounds( void ) {
cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse ); cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse );
cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse ); cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse );
//Blaze: func_explosive sounds
cgs.media.breakable_snd[0] = trap_S_RegisterSound( "sound/world/glassbk.wav", qfalse );
cgs.media.breakable_snd[1] = trap_S_RegisterSound ("sound/weapons/rocket/rocklx1a.wav", qfalse);
//Elder: RQ3 sounds //Elder: RQ3 sounds
cgs.media.kickSound = trap_S_RegisterSound( "sound/misc/kick.wav", qfalse); cgs.media.kickSound = trap_S_RegisterSound( "sound/misc/kick.wav", qfalse);
cgs.media.lensSound = trap_S_RegisterSound( "sound/misc/lens.wav", qfalse); cgs.media.lensSound = trap_S_RegisterSound( "sound/misc/lens.wav", qfalse);
@ -1210,35 +1221,43 @@ static void CG_RegisterGraphics( void ) {
cgs.media.gibSkull = trap_R_RegisterModel( "models/gibs/skull.md3" ); cgs.media.gibSkull = trap_R_RegisterModel( "models/gibs/skull.md3" );
cgs.media.gibBrain = trap_R_RegisterModel( "models/gibs/brain.md3" ); cgs.media.gibBrain = trap_R_RegisterModel( "models/gibs/brain.md3" );
//Blaze: Breakable Glass //Blaze: Breakable Glass
cgs.media.glass01 = trap_R_RegisterModel( "models/breakables/glass01.md3" ); i=0;
cgs.media.glass02 = trap_R_RegisterModel( "models/breakables/glass02.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.glass01 = trap_R_RegisterModel( "models/breakables/glass01.md3" );
cgs.media.glass03 = trap_R_RegisterModel( "models/breakables/glass03.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.glass02 = trap_R_RegisterModel( "models/breakables/glass02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.glass03 = trap_R_RegisterModel( "models/breakables/glass03.md3" );
//Elder: additional debris //Elder: additional debris
//Todo: load only if in the level //Todo: load only if in the level
cgs.media.wood01 = trap_R_RegisterModel( "models/breakables/wood01.md3" ); i++;
cgs.media.wood02 = trap_R_RegisterModel( "models/breakables/wood02.md3" );
cgs.media.wood03 = trap_R_RegisterModel( "models/breakables/wood03.md3" );
cgs.media.metal01 = trap_R_RegisterModel( "models/breakables/metal01.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.wood01 = trap_R_RegisterModel( "models/breakables/wood01.md3" );
cgs.media.metal02 = trap_R_RegisterModel( "models/breakables/metal02.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.wood02 = trap_R_RegisterModel( "models/breakables/wood02.md3" );
cgs.media.metal03 = trap_R_RegisterModel( "models/breakables/metal03.md3" ); cgs.media.breakable_frag[i][2] = cgs.media.wood03 = trap_R_RegisterModel( "models/breakables/wood03.md3" );
cgs.media.ceramic01 = trap_R_RegisterModel( "models/breakables/ceramic01.md3" ); i++;
cgs.media.ceramic02 = trap_R_RegisterModel( "models/breakables/ceramic02.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.metal01 = trap_R_RegisterModel( "models/breakables/metal01.md3" );
cgs.media.ceramic03 = trap_R_RegisterModel( "models/breakables/ceramic03.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.metal02 = trap_R_RegisterModel( "models/breakables/metal02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.metal03 = trap_R_RegisterModel( "models/breakables/metal03.md3" );
cgs.media.paper01 = trap_R_RegisterModel( "models/breakables/paper01.md3" ); i++;
cgs.media.paper02 = trap_R_RegisterModel( "models/breakables/paper02.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.ceramic01 = trap_R_RegisterModel( "models/breakables/ceramic01.md3" );
cgs.media.paper03 = trap_R_RegisterModel( "models/breakables/paper03.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.ceramic02 = trap_R_RegisterModel( "models/breakables/ceramic02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.ceramic03 = trap_R_RegisterModel( "models/breakables/ceramic03.md3" );
cgs.media.brick01 = trap_R_RegisterModel( "models/breakables/brick01.md3" ); i++;
cgs.media.brick02 = trap_R_RegisterModel( "models/breakables/brick02.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.paper01 = trap_R_RegisterModel( "models/breakables/paper01.md3" );
cgs.media.brick03 = trap_R_RegisterModel( "models/breakables/brick03.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.paper02 = trap_R_RegisterModel( "models/breakables/paper02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.paper03 = trap_R_RegisterModel( "models/breakables/paper03.md3" );
cgs.media.concrete01 = trap_R_RegisterModel( "models/breakables/concrete01.md3" ); i++;
cgs.media.concrete02 = trap_R_RegisterModel( "models/breakables/concrete02.md3" ); cgs.media.breakable_frag[i][0] = cgs.media.brick01 = trap_R_RegisterModel( "models/breakables/brick01.md3" );
cgs.media.concrete03 = trap_R_RegisterModel( "models/breakables/concrete03.md3" ); cgs.media.breakable_frag[i][1] = cgs.media.brick02 = trap_R_RegisterModel( "models/breakables/brick02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.brick03 = trap_R_RegisterModel( "models/breakables/brick03.md3" );
i++;
cgs.media.breakable_frag[i][0] = cgs.media.concrete01 = trap_R_RegisterModel( "models/breakables/concrete01.md3" );
cgs.media.breakable_frag[i][1] = cgs.media.concrete02 = trap_R_RegisterModel( "models/breakables/concrete02.md3" );
cgs.media.breakable_frag[i][2] = cgs.media.concrete03 = trap_R_RegisterModel( "models/breakables/concrete03.md3" );
//Elder: akimbos - some of the stuff isn't in yet :p //Elder: akimbos - some of the stuff isn't in yet :p
cgs.media.akimboModel = trap_R_RegisterModel( "models/weapons2/akimbo/akimbo.md3" ); cgs.media.akimboModel = trap_R_RegisterModel( "models/weapons2/akimbo/akimbo.md3" );
@ -1365,6 +1384,8 @@ static void CG_RegisterGraphics( void ) {
cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" ); cgs.media.shadowMarkShader = trap_R_RegisterShader( "markShadow" );
cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" ); cgs.media.wakeMarkShader = trap_R_RegisterShader( "wake" );
cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" ); cgs.media.bloodMarkShader = trap_R_RegisterShader( "bloodMark" );
//Blaze: added for explosive boxes and grenades
cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" );
// Elder: added // Elder: added
cgs.media.slashMarkShader = trap_R_RegisterShader( "gfx/damage/slash_mrk" ); cgs.media.slashMarkShader = trap_R_RegisterShader( "gfx/damage/slash_mrk" );
cgs.media.glassMarkShader = trap_R_RegisterShader( "gfx/damage/glass_mrk" ); cgs.media.glassMarkShader = trap_R_RegisterShader( "gfx/damage/glass_mrk" );

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.56 2002/03/21 00:26:11 blaze
// some fixing of func_explosive
//
// Revision 1.55 2002/03/18 19:19:08 slicer // Revision 1.55 2002/03/18 19:19:08 slicer
// Fixed bandage bugs ( i hope ) // Fixed bandage bugs ( i hope )
// //
@ -1024,7 +1027,8 @@ void CG_RegisterWeapon( int weaponNum ) {
weaponInfo->trailRadius = 32; weaponInfo->trailRadius = 32;
MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 ); MAKERGB( weaponInfo->flashDlightColor, 1, 0.70f, 0 );
//weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/grenade/gren_throw.wav", qfalse ); //weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/grenade/gren_throw.wav", qfalse );
cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" ); //Blaze: Make sure we load this as we may have exploding crates
//cgs.media.grenadeExplosionShader = trap_R_RegisterShader( "grenadeExplosion" );
// Load the animation information // Load the animation information
Com_sprintf( filename, sizeof(filename), "models/weapons2/grenade/animation.cfg" ); Com_sprintf( filename, sizeof(filename), "models/weapons2/grenade/animation.cfg" );