diff --git a/cgame/fx_hypospray.c b/cgame/fx_hypospray.c index c7ff4a1..3de557d 100644 --- a/cgame/fx_hypospray.c +++ b/cgame/fx_hypospray.c @@ -56,403 +56,4 @@ void FX_HypoSpray( vec3_t origin, vec3_t dir, qboolean red ) // When not red, i VectorSet(le->data.sprite.startRGB, random() * 0.5f, random() * 0.5f + 0.5f, 1.0f );// mostly blue } } -/* -void FX_HypoSpray( vec3_t origin, vec3_t dir, qboolean red ) // When not red, it'll be blue -{ - localEntity_t *le; - vec3_t color, vel, accel, angles, work, forward, right; - float scale, dscale; - int i; - //vectoangles( dir, angles ); - VectorCopy( dir, angles ); - //RPG-X: RedTechie - Debug print - //Com_Printf("dir: %f, %f, %f\nangles: %f, %f, %f\n\n",dir[0],dir[1],dir[2],angles[0],angles[1],angles[2]); - - for ( i = 0; i < NUM_HYPO_PUFFS; i++ ) - { - if ( red ) - { - VectorSet( color, 1.0f, random() * 0.4f, random() * 0.4f ); // mostly red - } - else - { - VectorSet( color, random() * 0.5f, random() * 0.5f + 0.5f, 1.0f ); // mostly blue - } - - VectorCopy( angles, work ); - - work[0] += crandom() * 12.0f; - work[1] += crandom() * 12.0f; - - - scale = random() * 256.0f + 128.0f; - VectorScale( vel, scale, vel ); - VectorScale( vel, random() * -0.3f, accel ); - - //scale = 30.0f + random() * 100.0f + 2.0f; - //dscale = 30.0f + random() * 400.0f + 24.0f; - scale = random() * 4.0f + 2.0f; - dscale = random() * 64.0f + 24.0f; - - le = FX_AddSprite( origin, //vec3_t origin, - vel,//vel, //vec3_t velocity, - qfalse, // qboolean gravity, - scale,//scale, //float scale, - dscale, //float dscale, - 0.8f + random() * 0.2f, //float startalpha - 0.0f, //float endalpha - crandom() * 120,//crandom() * 120, ///float roll - 0.0f, //float elasticity - 4000, //float killTime -9999999 -1000 - cgs.media.steamShader );//qhandle_t shader - //le->endTime = 99999999; - //le->color = color; - VectorSet(le->data.sprite.startRGB, random() * 0.5f, random() * 0.5f + 0.5f, 1.0f );// mostly blue - //le->data.sprite.startRGB = color; - //le->data.sprite.dRGB = color; - //FX_AddSprite( origin, vel, qfalse, scale, dscale, 0.8f + random() * 0.2f, 0.0f, color, color, crandom() * 120, 0.0f, 1000, cgs.media.steamShader ); - } -} - -*/ -//RPG-X: J2J - Fixed Version (incomplete right now) -/*void FX_HypoSpray( vec3_t origin, vec3_t dir, qboolean red ) // When not red, it'll be blue -{ - localEntity_t *le; - vec3_t muzzle, mins, maxs, end, color, forward, right; - float scale, dscale; - int i; - - // Move out to the end of the nozzle - //VectorMA( muzzle, 20, forward, muzzle ); - //VectorMA( muzzle, 4, vright, muzzle ); - - VectorCopy(dir, muzzle); - - AngleVectors( dir, forward, right, NULL ); - - for ( i = 0; i < NUM_HYPO_PUFFS; i++ ) - { - - if ( red ) - { - VectorSet( color, 1.0f, random() * 0.4f, random() * 0.4f ); // mostly red - } - else - { - VectorSet( color, random() * 0.5f, random() * 0.5f + 0.5f, 1.0f ); // mostly blue - } - - - VectorMA( muzzle, 24, forward, end ); - VectorSet( maxs, 6, 6, 6 ); - VectorScale( maxs, -1, mins ); - // Create the effect -- thought something was needed here, but apparently not. - VectorMA( muzzle, 20, forward, muzzle );w - VectorMA( muzzle, 4, right, muzzle ); - - - scale = random() + 2.0f; - dscale = random() * 64.0f + 24.0f; - - muzzle[0] += (scale * cos(abs(dir[1]) * 0.017453292222222222222222222222222); - muzzle[1] += (scale * sin(abs(dir[1]) * 0.017453292222222222222222222222222); - muzzle[2] += (scale * -tan(dir[0] * 0.017453292222222222222222222222222); - - VectorScale( muzzle, scale, muzzle ); - - le = FX_AddSprite( origin, //vec3_t origin, - muzzle,//vel, //vec3_t velocity, - qfalse, // qboolean gravity, - scale,//scale, //float scale, - dscale, //float dscale, - 0.8f + random() * 0.2f, //float startalpha - 0.0f, //float endalpha - crandom() * 120,//crandom() * 120, ///float roll - 0.0f, //float elasticity - 4000, //float killTime -9999999 -1000 - cgs.media.steamShader );//qhandle_t shader - - VectorSet(le->data.sprite.startRGB, random() * 0.5f, random() * 0.5f + 0.5f, 1.0f );// mostly blue - - - } - - return; - -}*/ - -//#define SCAV_SPIN 0.3 - -/*void FX_ScavengerProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ) -{ - vec3_t forward; - qboolean fired_from_NPC = qfalse; // Always - - if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0 ) - forward[2] = 1; - - // The effect you'd see from first person looks horrible from third person..or when shot by an NPC, - // so we'll just tone down the effect so it's not so horrible. :) - if ( fired_from_NPC ) - { - // Energy glow - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 8.0f + random() * 8.0f, 0.0f, - 0.7f, 0.0f, - random()*360, 0.0f, - 1.0f, - cgs.media.tetrionFlareShader ); - - // Spinning projectile core - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 8.0f + random() * 10.0f, 0.0f, - 1.0f, 0.0f, - cg.time * SCAV_SPIN, 0.0f, - 1.0f, - cgs.media.redFlareShader ); - - // leave a cool tail - FX_AddTrail( cent->lerpOrigin, - forward, qfalse, - 16, 0, - 1.0f, 0.0f, - 0.8f, 0.0f, - 0, - 1, - cgs.media.tetrionTrail2Shader ); - } - else - { - // Energy glow - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 16.0f + random() * 16.0f, 0.0f, - 0.5f, 0.0f, - random()*360, 0.0f, - 1.0f, - cgs.media.tetrionFlareShader ); - - // Spinning projectile - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 4.0f + random() * 10.0f, 0.0f, - 0.6f, 0.0f, - cg.time * SCAV_SPIN, 0.0f, - 1.0f, - cgs.media.redFlareShader ); - - // leave a cool tail - FX_AddTrail( cent->lerpOrigin, - forward, qfalse, - 64, 0, - 1.4f, 0.0f, - 0.6f, 0.0f, - 0, - 1, - cgs.media.tetrionTrail2Shader ); - } -}*/ - - -/* -------------------------- -FX_ScavengerAltFireThink -------------------------- -*/ -//#define SCAV_TRAIL_SPACING 12 - -/*void FX_ScavengerAltFireThink( centity_t *cent, const struct weaponInfo_s *weapon ) -{ - vec3_t diff; - float len; - - // Make a trail that's reasonably consistent and not so much based on frame rate. - if (cent->thinkFlag) - { - VectorSubtract( cent->lerpOrigin, cent->beamEnd, diff ); - } - else - { - VectorSubtract( cent->lerpOrigin, cent->currentState.origin2, diff ); - } - - len = VectorNormalize( diff ); - - if ( len > SCAV_TRAIL_SPACING ) - { - vec3_t origin; - int i; - float scale; - - for ( i = 0 ; i < len; i += SCAV_TRAIL_SPACING ) - { - // Calc the right spot along the trail - VectorMA( cent->lerpOrigin, -i, diff, origin ); - scale = 18.0f + (random()*5.0f); - FX_AddSprite( origin, - NULL, qfalse, - scale, -8.75, - 0.4f, 0.0f, - random() * 360, 0.0f, - 250.0f, - cgs.media.scavengerAltShader ); - } - - // Stash the current position - VectorCopy( cent->lerpOrigin, cent->beamEnd); - cent->thinkFlag = 1; - } - - // Glowing bit - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 24.0f + ( random() * 16.0f ), 0.0f, - 1.0f, 0.0f, - 0, 0.0f, - 1.0f, - cgs.media.tetrionFlareShader ); -}*/ - - -/* -------------------------- -FX_ScavengerWeaponHitWall -------------------------- -*/ -/*void FX_ScavengerWeaponHitWall( vec3_t origin, vec3_t normal, qboolean fired_by_NPC ) -{ - weaponInfo_t *weaponInfo = &cg_weapons[WP_COFFEE]; - - // Tone down when shot by an NPC - // FIXME: is this really a good idea? - if ( fired_by_NPC ) - { - // Expanding shock ring - FX_AddQuad( origin, normal, - 0.5f, 6.4f, - 0.8, 0.0, - random() * 360.0f, - 200, - cgs.media.redRingShader ); - - // Impact core - FX_AddQuad( origin, normal, - 12.0f + ( random() * 8.0f ), 3.2f, - 0.6f, 0.0f, - cg.time * SCAV_SPIN, - 100, - cgs.media.redFlareShader ); - } - else - { - // Expanding shock ring - FX_AddQuad( origin, normal, - 8.0f, 12.8f, - 1.0, 0.0, - random() * 360.0f, - 200, - cgs.media.redRingShader ); - - // Impact core - FX_AddQuad( origin, normal, - 24.0f + ( random() * 16.0f ), 6.4f, - 0.8f, 0.0f, - cg.time * SCAV_SPIN, - 100, - cgs.media.redFlareShader ); - } - - //Sound - trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, weaponInfo->mainHitSound); - - CG_ImpactMark( cgs.media.scavMarkShader, origin, normal, random()*360, 1,1,1,0.2, qfalse, random() + 5.5f, qfalse ); -}*/ - - -/* -------------------------- -FX_ScavengerWeaponHitPlayer -------------------------- -*/ -/*void FX_ScavengerWeaponHitPlayer( vec3_t origin, vec3_t normal, qboolean fired_by_NPC ) -{ - if ( fired_by_NPC ) - { - // Smaller expanding shock ring - FX_AddQuad( origin, normal, - 0.5f, 32.0f, - 0.8, 0.0, - random() * 360.0f, - 125, - cgs.media.redRingShader ); - } - else - { - // Expanding shock ring - FX_AddQuad( origin, normal, - 1.0f, 64.0f, - 0.8, 0.0, - random() * 360.0f, - 125, - cgs.media.redRingShader ); - } - - //Sound -// trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cg_weapons[WP_COFFEE].missileHitSound ); -}*/ - - - -/* -------------------------- -FX_Scavenger_Alt_Explode -------------------------- -*/ -/*void FX_ScavengerAltExplode( vec3_t origin, vec3_t dir ) -{ -// FXCylinder *fx2; - localEntity_t *le; - vec3_t direction, org; - int i; - weaponInfo_t *weaponInfo = &cg_weapons[WP_COFFEE]; - - //Orient the explosions to face the camera - VectorSubtract( cg.refdef.vieworg, origin, direction ); - VectorNormalize( direction ); - - VectorMA( origin, 12, direction, org ); - // Add an explosion and tag a light to it - //le = CG_MakeExplosion2( org, direction, cgs.media.explosionModel, 5, cgs.media.scavExplosionSlowShader, 675, qfalse, 1.0f + (random()*0.5f), LEF_NONE); - le->light = 150; - le->refEntity.renderfx |= RF_NOSHADOW; - VectorSet( le->lightColor, 1.0f, 0.6f, 0.6f ); - - VectorSet( org, (org[0] + crandom() * 8), (org[1] + crandom() * 8), (org[2] + crandom() * 8) ); - //CG_MakeExplosion2( org, direction, cgs.media.explosionModel, 5, cgs.media.scavExplosionFastShader, 375, qfalse, 0.7f + (random()*0.5f), LEF_NONE); - - //Sound - trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, weaponInfo->altHitSound ); - - CG_ImpactMark( cgs.media.compressionMarkShader, origin, dir, random()*360, 1,1,1,0.2, qfalse, - random() * 6 + 20, qfalse ); - - // Always orient horizontally - VectorSet ( direction, 0,0,1 ); - - le = FX_AddCylinder( origin, direction, 4, 0, 20, 210, 14, 140, 1.0, 0.0, 600, cgs.media.redRing2Shader, 1.5 ); - le->refEntity.data.cylinder.wrap = qtrue; - le->refEntity.data.cylinder.stscale = 6; - - for (i = 0; i < 6; i++) - { - vec3_t velocity; - - FXE_Spray( dir, 300, 175, 0.8f, velocity); - FX_AddTrail( origin, velocity, qtrue, 12.0f, -12.0f, - 2, -2, 1.0f, 1.0f, 0.2f, 1000.0f, cgs.media.tetrionTrail2Shader);*/ - /*} -}*/ diff --git a/cgame/fx_local.h b/cgame/fx_local.h index 24a60a7..65b5998 100644 --- a/cgame/fx_local.h +++ b/cgame/fx_local.h @@ -75,12 +75,7 @@ void FX_RegenBeam( vec3_t origin, vec3_t dir, int clientNum, qboolean alt_fire ) /* * tetrion disruptor */ -//void FX_TetrionProjectileThink( centity_t *cent, const struct weaponInfo_s *wi ); void FX_TetrionShot( vec3_t start, vec3_t forward ); -void FX_TetrionWeaponHitWall( vec3_t origin, vec3_t normal ); -//void FX_TetrionRicochet( vec3_t origin, vec3_t normal ); -//void FX_TetrionAltHitWall( vec3_t origin, vec3_t normal ); -void FX_TetrionAltHitPlayer( vec3_t origin, vec3_t normal ); /* * Scavenger Rifle @@ -120,16 +115,6 @@ void FX_QuantumHitWall( vec3_t origin, vec3_t normal ); void FX_QuantumAltHitWall( vec3_t origin, vec3_t normal ); void FX_QuantumColumns( vec3_t origin ); - -/* - * Dreadnought - */ -//void FX_DreadnoughtHitWall( vec3_t origin, vec3_t normal, qboolean spark ); -//void FX_DreadnoughtFire( vec3_t origin, vec3_t end, vec3_t normal, qboolean spark, qboolean impact ); -//void FX_DreadnoughtProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon ); -//void FX_DreadnoughtShotMiss( vec3_t end, vec3_t dir ); - - /* * transporter */ diff --git a/cgame/fx_tetrion.c b/cgame/fx_tetrion.c index c5cf3fc..6394533 100644 --- a/cgame/fx_tetrion.c +++ b/cgame/fx_tetrion.c @@ -1,59 +1,19 @@ #include "cg_local.h" #include "fx_local.h" - -/* -------------------------- -FX_TetrionProjectileThink -------------------------- -*/ -/*void FX_TetrionProjectileThink( centity_t *cent, const struct weaponInfo_s *wi ) -{ - vec3_t forward; - - if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0 ) - forward[2] = 1; - - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 4.0f + random() * 16.0f, 0.0f, - 0.4f, 0.0f, - random()*360, 0.0f, - 1.0f, - cgs.media.greenBurstShader ); - FX_AddSprite( cent->lerpOrigin, - NULL, qfalse, - 16.0f + random() * 16.0f, 0.0f, - 0.6f, 0.0f, - random()*360, 0.0f, - 1.0f, - cgs.media.borgFlareShader ); - FX_AddTrail( cent->lerpOrigin, - forward, qfalse, - 64, 0, - 2.0f, 0, - 0.5f, 0, - 0, - 1, - cgs.media.greenTrailShader ); -}*/ - - /* ------------------------- FX_TetrionShot ------------------------- */ #define MAXRANGE_TETRION 5000000 //RPG-X: J2J OLD: 8192 -void FX_TetrionShot( vec3_t start, vec3_t forward ) +void FX_TetrionShot( vec3_t start, vec3_t forward ) // TODO check whether I'm needed { trace_t trace; vec3_t end, dir, new_start, new_end, radial, start2, spreadFwd; float off, len, i, numBullets = 3; float firingRadius = 6, minDeviation = 0.95, maxDeviation = 1.1; qboolean render_impact = qtrue; - centity_t *traceEnt = NULL; - int clientNum = -1; for (i = 0; i < numBullets; i++) { @@ -91,150 +51,6 @@ void FX_TetrionShot( vec3_t start, vec3_t forward ) { render_impact = qfalse; } - - if (render_impact) - { - traceEnt = &cg_entities[trace.entityNum]; - clientNum = traceEnt->currentState.clientNum; - if ( (trace.entityNum != ENTITYNUM_WORLD) && (clientNum >= 0 || clientNum < MAX_CLIENTS) ) - { - // hit a player. let the shield/pain effects be the indicator for this - } - else - { - // hit something else - FX_TetrionWeaponHitWall(trace.endpos, trace.plane.normal); - } - } } } } - -/* -------------------------- -FX_TetrionWeaponHitWall -------------------------- -*/ -void FX_TetrionWeaponHitWall( vec3_t origin, vec3_t normal ) -{ -/* vec3_t vel, accel, org; - int i = 0, t = 0; - float scale = random() * 2.5 + 1.5; - - CG_ImpactMark( cgs.media.bulletmarksShader, origin, normal, random()*360, 1,1,1,0.2, qfalse, - scale, qfalse ); - - // Move out a hair to avoid z buffer nastiness - VectorMA( origin, 0.5, normal, org ); - - // Add a bit of variation every now and then - if ( rand() & 1 ) - { - FX_AddQuad( org, normal, - scale * 2, -4, - 0.5, 0.5, - 0, - 175, - cgs.media.sunnyFlareShader ); - } - - FX_AddQuad( org, normal, - scale * 4, -8, - 1.0, 1.0, - 0, - 175, - cgs.media.borgFlareShader ); - - // Add some smoke puffs - for ( i = 0; i < 2; i ++ ) - { - for ( t = 0; t < 3; t++ ) - { - vel[t] = normal[t] + crandom(); - } - - VectorScale( vel, 12 + random() * 12, vel ); - - vel[2] += 16; - - VectorScale( vel, -0.25, accel ); - FX_AddSprite( origin, - vel, qfalse, - random() * 4 + 2, 12, - 0.6 + random() * 0.4, 0.0, - random() * 180, - 0.0, - random() * 200 + 300, - cgs.media.steamShader ); - }*/ -} - -/* -------------------------- -FX_TetrionRicochet -------------------------- -*/ /* -void FX_TetrionRicochet( vec3_t origin, vec3_t normal ) -{ - vec3_t org; - - // Move away from the wall a bit to help avoid z buffer clipping. - VectorMA( origin, 0.5, normal, org ); - - FX_AddQuad( org, normal, - 24, -24, - 1.0, 0.0, - 0, - 300, - cgs.media.greenBurstShader ); - FX_AddQuad( org, normal, - 48, -48, - 0.5, 0.0, - 0, - 300, - cgs.media.borgFlareShader ); -}*/ - -/* -------------------------- -FX_TetrionAltHitWall -------------------------- -*/ -/*void FX_TetrionAltHitWall( vec3_t origin, vec3_t normal ) -{ - vec3_t org; - float scale; - - scale = random() * 2.0 + 1.0; - - CG_ImpactMark( cgs.media.bulletmarksShader, origin, normal, random()*360, 1,1,1,0.2, qfalse, - scale, qfalse ); - - // Move out a hair to avoid z buffer nastiness - VectorMA( origin, 0.5, normal, org ); - - FX_AddQuad( origin, normal, - 64, -96, - 1.0, 0.0, - 0, - 200, - cgs.media.greenBurstShader ); - FX_AddQuad( origin, normal, - 128, -192, - 1.0, 0.0, - 0, - 200, - cgs.media.borgFlareShader ); - - // kef -- urp.fixme. -// trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cg_weapons[WP_TR116].altmissileHitSound ); -}*/ - -/* -------------------------- -FX_TetrionAltHitPlayer -------------------------- -*/ -void FX_TetrionAltHitPlayer( vec3_t origin, vec3_t normal ) -{ -}