From d1853e239ae258e394a516f0eeda80f430a1a328 Mon Sep 17 00:00:00 2001 From: enneract Date: Sat, 13 Dec 2014 16:06:15 +0100 Subject: View quake, improved Rocket Launcher assets. (FIXME: Rocket explosion doesn't fade out) --- assets/gfx/rocketx/0002.jpg | Bin 0 -> 4605 bytes assets/gfx/rocketx/0003.jpg | Bin 0 -> 6454 bytes assets/gfx/rocketx/0004.jpg | Bin 0 -> 7373 bytes assets/gfx/rocketx/0005.jpg | Bin 0 -> 7978 bytes assets/gfx/rocketx/0006.jpg | Bin 0 -> 8260 bytes assets/gfx/rocketx/0007.jpg | Bin 0 -> 8351 bytes assets/gfx/rocketx/0008.jpg | Bin 0 -> 8448 bytes assets/gfx/rocketx/0009.jpg | Bin 0 -> 8560 bytes assets/gfx/rocketx/0010.jpg | Bin 0 -> 8660 bytes assets/gfx/rocketx/0011.jpg | Bin 0 -> 8827 bytes assets/gfx/rocketx/0012.jpg | Bin 0 -> 8947 bytes assets/gfx/rocketx/0013.jpg | Bin 0 -> 9079 bytes assets/gfx/rocketx/0014.jpg | Bin 0 -> 9090 bytes assets/gfx/rocketx/0015.jpg | Bin 0 -> 9029 bytes assets/gfx/rocketx/0016.jpg | Bin 0 -> 9019 bytes assets/gfx/rocketx/0017.jpg | Bin 0 -> 8935 bytes assets/gfx/rocketx/0018.jpg | Bin 0 -> 8850 bytes assets/gfx/rocketx/0019.jpg | Bin 0 -> 8662 bytes assets/gfx/rocketx/0020.jpg | Bin 0 -> 8450 bytes assets/gfx/rocketx/0021.jpg | Bin 0 -> 8249 bytes assets/gfx/rocketx/0022.jpg | Bin 0 -> 8022 bytes assets/gfx/rocketx/0023.jpg | Bin 0 -> 7930 bytes assets/gfx/rocketx/0024.jpg | Bin 0 -> 7733 bytes assets/gfx/rocketx/0025.jpg | Bin 0 -> 7581 bytes assets/gfx/rocketx/0026.jpg | Bin 0 -> 7346 bytes assets/gfx/rocketx/0027.jpg | Bin 0 -> 7060 bytes assets/gfx/rocketx/0028.jpg | Bin 0 -> 6750 bytes assets/gfx/rocketx/0029.jpg | Bin 0 -> 6433 bytes assets/gfx/rocketx/0030.jpg | Bin 0 -> 6090 bytes assets/models/weapons/lcannon/weapon.cfg | 2 + assets/models/weapons/lightning/weapon.cfg | 1 + assets/models/weapons/rocketl/rocketl.md3 | Bin 5796 -> 6004 bytes assets/models/weapons/rocketl/rocketl_flash.md3 | Bin 0 -> 868 bytes assets/models/weapons/rocketl/weapon.cfg | 2 + assets/scripts/hw_rocketl.particle | 41 +--- assets/scripts/hw_rocketl.shader | 302 ++++++++++++++++++++++++ src/cgame/cg_local.h | 8 + src/cgame/cg_main.c | 10 +- src/cgame/cg_view.c | 34 +++ src/cgame/cg_weapons.c | 42 +++- 40 files changed, 402 insertions(+), 40 deletions(-) create mode 100644 assets/gfx/rocketx/0002.jpg create mode 100644 assets/gfx/rocketx/0003.jpg create mode 100644 assets/gfx/rocketx/0004.jpg create mode 100644 assets/gfx/rocketx/0005.jpg create mode 100644 assets/gfx/rocketx/0006.jpg create mode 100644 assets/gfx/rocketx/0007.jpg create mode 100644 assets/gfx/rocketx/0008.jpg create mode 100644 assets/gfx/rocketx/0009.jpg create mode 100644 assets/gfx/rocketx/0010.jpg create mode 100644 assets/gfx/rocketx/0011.jpg create mode 100644 assets/gfx/rocketx/0012.jpg create mode 100644 assets/gfx/rocketx/0013.jpg create mode 100644 assets/gfx/rocketx/0014.jpg create mode 100644 assets/gfx/rocketx/0015.jpg create mode 100644 assets/gfx/rocketx/0016.jpg create mode 100644 assets/gfx/rocketx/0017.jpg create mode 100644 assets/gfx/rocketx/0018.jpg create mode 100644 assets/gfx/rocketx/0019.jpg create mode 100644 assets/gfx/rocketx/0020.jpg create mode 100644 assets/gfx/rocketx/0021.jpg create mode 100644 assets/gfx/rocketx/0022.jpg create mode 100644 assets/gfx/rocketx/0023.jpg create mode 100644 assets/gfx/rocketx/0024.jpg create mode 100644 assets/gfx/rocketx/0025.jpg create mode 100644 assets/gfx/rocketx/0026.jpg create mode 100644 assets/gfx/rocketx/0027.jpg create mode 100644 assets/gfx/rocketx/0028.jpg create mode 100644 assets/gfx/rocketx/0029.jpg create mode 100644 assets/gfx/rocketx/0030.jpg create mode 100644 assets/models/weapons/rocketl/rocketl_flash.md3 diff --git a/assets/gfx/rocketx/0002.jpg b/assets/gfx/rocketx/0002.jpg new file mode 100644 index 0000000..776768b Binary files /dev/null and b/assets/gfx/rocketx/0002.jpg differ diff --git a/assets/gfx/rocketx/0003.jpg b/assets/gfx/rocketx/0003.jpg new file mode 100644 index 0000000..91313e7 Binary files /dev/null and b/assets/gfx/rocketx/0003.jpg differ diff --git a/assets/gfx/rocketx/0004.jpg b/assets/gfx/rocketx/0004.jpg new file mode 100644 index 0000000..a1848ed Binary files /dev/null and b/assets/gfx/rocketx/0004.jpg differ diff --git a/assets/gfx/rocketx/0005.jpg b/assets/gfx/rocketx/0005.jpg new file mode 100644 index 0000000..da5e255 Binary files /dev/null and b/assets/gfx/rocketx/0005.jpg differ diff --git a/assets/gfx/rocketx/0006.jpg b/assets/gfx/rocketx/0006.jpg new file mode 100644 index 0000000..6d026ba Binary files /dev/null and b/assets/gfx/rocketx/0006.jpg differ diff --git a/assets/gfx/rocketx/0007.jpg b/assets/gfx/rocketx/0007.jpg new file mode 100644 index 0000000..c18ce0d Binary files /dev/null and b/assets/gfx/rocketx/0007.jpg differ diff --git a/assets/gfx/rocketx/0008.jpg b/assets/gfx/rocketx/0008.jpg new file mode 100644 index 0000000..06a2d74 Binary files /dev/null and b/assets/gfx/rocketx/0008.jpg differ diff --git a/assets/gfx/rocketx/0009.jpg b/assets/gfx/rocketx/0009.jpg new file mode 100644 index 0000000..6e7bc69 Binary files /dev/null and b/assets/gfx/rocketx/0009.jpg differ diff --git a/assets/gfx/rocketx/0010.jpg b/assets/gfx/rocketx/0010.jpg new file mode 100644 index 0000000..400d603 Binary files /dev/null and b/assets/gfx/rocketx/0010.jpg differ diff --git a/assets/gfx/rocketx/0011.jpg b/assets/gfx/rocketx/0011.jpg new file mode 100644 index 0000000..17e0220 Binary files /dev/null and b/assets/gfx/rocketx/0011.jpg differ diff --git a/assets/gfx/rocketx/0012.jpg b/assets/gfx/rocketx/0012.jpg new file mode 100644 index 0000000..6765bf9 Binary files /dev/null and b/assets/gfx/rocketx/0012.jpg differ diff --git a/assets/gfx/rocketx/0013.jpg b/assets/gfx/rocketx/0013.jpg new file mode 100644 index 0000000..a543aba Binary files /dev/null and b/assets/gfx/rocketx/0013.jpg differ diff --git a/assets/gfx/rocketx/0014.jpg b/assets/gfx/rocketx/0014.jpg new file mode 100644 index 0000000..5ed10d8 Binary files /dev/null and b/assets/gfx/rocketx/0014.jpg differ diff --git a/assets/gfx/rocketx/0015.jpg b/assets/gfx/rocketx/0015.jpg new file mode 100644 index 0000000..5fe6015 Binary files /dev/null and b/assets/gfx/rocketx/0015.jpg differ diff --git a/assets/gfx/rocketx/0016.jpg b/assets/gfx/rocketx/0016.jpg new file mode 100644 index 0000000..24f0d16 Binary files /dev/null and b/assets/gfx/rocketx/0016.jpg differ diff --git a/assets/gfx/rocketx/0017.jpg b/assets/gfx/rocketx/0017.jpg new file mode 100644 index 0000000..3b037f5 Binary files /dev/null and b/assets/gfx/rocketx/0017.jpg differ diff --git a/assets/gfx/rocketx/0018.jpg b/assets/gfx/rocketx/0018.jpg new file mode 100644 index 0000000..b479532 Binary files /dev/null and b/assets/gfx/rocketx/0018.jpg differ diff --git a/assets/gfx/rocketx/0019.jpg b/assets/gfx/rocketx/0019.jpg new file mode 100644 index 0000000..288bd52 Binary files /dev/null and b/assets/gfx/rocketx/0019.jpg differ diff --git a/assets/gfx/rocketx/0020.jpg b/assets/gfx/rocketx/0020.jpg new file mode 100644 index 0000000..97f2d10 Binary files /dev/null and b/assets/gfx/rocketx/0020.jpg differ diff --git a/assets/gfx/rocketx/0021.jpg b/assets/gfx/rocketx/0021.jpg new file mode 100644 index 0000000..3443b96 Binary files /dev/null and b/assets/gfx/rocketx/0021.jpg differ diff --git a/assets/gfx/rocketx/0022.jpg b/assets/gfx/rocketx/0022.jpg new file mode 100644 index 0000000..b14747d Binary files /dev/null and b/assets/gfx/rocketx/0022.jpg differ diff --git a/assets/gfx/rocketx/0023.jpg b/assets/gfx/rocketx/0023.jpg new file mode 100644 index 0000000..da23eb0 Binary files /dev/null and b/assets/gfx/rocketx/0023.jpg differ diff --git a/assets/gfx/rocketx/0024.jpg b/assets/gfx/rocketx/0024.jpg new file mode 100644 index 0000000..bfe4476 Binary files /dev/null and b/assets/gfx/rocketx/0024.jpg differ diff --git a/assets/gfx/rocketx/0025.jpg b/assets/gfx/rocketx/0025.jpg new file mode 100644 index 0000000..3c95e8b Binary files /dev/null and b/assets/gfx/rocketx/0025.jpg differ diff --git a/assets/gfx/rocketx/0026.jpg b/assets/gfx/rocketx/0026.jpg new file mode 100644 index 0000000..31590ea Binary files /dev/null and b/assets/gfx/rocketx/0026.jpg differ diff --git a/assets/gfx/rocketx/0027.jpg b/assets/gfx/rocketx/0027.jpg new file mode 100644 index 0000000..004d27f Binary files /dev/null and b/assets/gfx/rocketx/0027.jpg differ diff --git a/assets/gfx/rocketx/0028.jpg b/assets/gfx/rocketx/0028.jpg new file mode 100644 index 0000000..96405cb Binary files /dev/null and b/assets/gfx/rocketx/0028.jpg differ diff --git a/assets/gfx/rocketx/0029.jpg b/assets/gfx/rocketx/0029.jpg new file mode 100644 index 0000000..c344ab9 Binary files /dev/null and b/assets/gfx/rocketx/0029.jpg differ diff --git a/assets/gfx/rocketx/0030.jpg b/assets/gfx/rocketx/0030.jpg new file mode 100644 index 0000000..779691b Binary files /dev/null and b/assets/gfx/rocketx/0030.jpg differ diff --git a/assets/models/weapons/lcannon/weapon.cfg b/assets/models/weapons/lcannon/weapon.cfg index e6f1ab4..5719fdc 100644 --- a/assets/models/weapons/lcannon/weapon.cfg +++ b/assets/models/weapons/lcannon/weapon.cfg @@ -16,6 +16,7 @@ primary impactMark 32 gfx/marks/bullet_mrk impactSound 0 models/weapons/lcannon/impact0.wav impactParticleSystem models/weapons/lcannon/impactPS2 + impactQuake 1 } secondary @@ -30,4 +31,5 @@ secondary impactMark 8 gfx/marks/bullet_mrk impactSound 0 models/weapons/lcannon/impact0.wav impactParticleSystem models/weapons/lcannon/secondaryImpactPS2 + impactQuake 5 } diff --git a/assets/models/weapons/lightning/weapon.cfg b/assets/models/weapons/lightning/weapon.cfg index 4d48e0f..9b33568 100644 --- a/assets/models/weapons/lightning/weapon.cfg +++ b/assets/models/weapons/lightning/weapon.cfg @@ -10,6 +10,7 @@ primary flashSound 0 models/weapons/lightning/flash0.wav firingSound models/weapons/lightning/firing.wav + flashQuake 0.6 impactMark 6 gfx/marks/bullet_mrk impactSound 0 models/weapons/lightning/impact0.wav diff --git a/assets/models/weapons/rocketl/rocketl.md3 b/assets/models/weapons/rocketl/rocketl.md3 index 4119209..d515cf4 100644 Binary files a/assets/models/weapons/rocketl/rocketl.md3 and b/assets/models/weapons/rocketl/rocketl.md3 differ diff --git a/assets/models/weapons/rocketl/rocketl_flash.md3 b/assets/models/weapons/rocketl/rocketl_flash.md3 new file mode 100644 index 0000000..c1acf35 Binary files /dev/null and b/assets/models/weapons/rocketl/rocketl_flash.md3 differ diff --git a/assets/models/weapons/rocketl/weapon.cfg b/assets/models/weapons/rocketl/weapon.cfg index e5dafc6..5c6b70b 100644 --- a/assets/models/weapons/rocketl/weapon.cfg +++ b/assets/models/weapons/rocketl/weapon.cfg @@ -11,9 +11,11 @@ primary flashDlightColor 1.0 0.7 0.0 flashSound 0 models/weapons/rocketl/flash0.wav + flashQuake 1 impactMark 32 gfx/marks/bullet_mrk impactSound 0 models/weapons/rocketl/impact0.wav impactParticleSystem models/weapons/rocketl/impactPS + impactQuake 50 } diff --git a/assets/scripts/hw_rocketl.particle b/assets/scripts/hw_rocketl.particle index 891ac18..289fced 100644 --- a/assets/scripts/hw_rocketl.particle +++ b/assets/scripts/hw_rocketl.particle @@ -34,44 +34,11 @@ models/weapons/rocketl/missilePS models/weapons/rocketl/impactPS { - ejector - { - particle - { - shader sync rocketFlareParticle - displacement 0 0 0 0 - - velocityType normal - - velocityDir linear - - velocityMagnitude 0 - velocity 0 0 0 ~0 - - accelerationType static - accelerationDir linear - acceleration 0 0 0 ~0 - accelerationMagnitude 0 - - radius 0 50 100 - alpha 250 1 0 - rotation 0 ~-15 ~15 - bounce 0.0 - - lifeTime 40 - } - - count 1 - delay 0 - period 0 - 0 - } - ejector { particle { shader sync gfx/sprites/smoke - //shader sync flame3 flame4 flame5 flame6 flame7 flame8 flame9 flame10 flame11 flame12 flame13 flame14 flame15 flame16 flame17 flame18 flame19 flame20 flame21 flame22 flame23 flame24 flame25 displacement 0 0 0 0 velocityType normal @@ -103,7 +70,7 @@ models/weapons/rocketl/impactPS { particle { - shader sync flame3 flame4 flame5 flame6 flame7 flame8 flame9 flame10 flame11 flame12 flame13 flame14 flame15 flame16 flame17 flame18 flame19 flame20 flame21 flame22 flame23 flame24 flame25 + shader sync rocketx1 rocketx2 rocketx3 rocketx4 rocketx5 rocketx6 rocketx7 rocketx8 rocketx9 rocketx10 rocketx11 rocketx12 rocketx13 rocketx14 rocketx15 rocketx16 rocketx17 rocketx18 rocketx19 rocketx20 rocketx21 rocketx22 rocketx23 rocketx24 rocketx25 rocketx26 rocketx27 rocketx28 rocketx29 displacement 0 0 0 0 velocityType normal @@ -118,9 +85,9 @@ models/weapons/rocketl/impactPS acceleration 0 0 -1 ~5 accelerationMagnitude 25 - radius 0 0 100 - alpha 250 .75 0 - rotation 0 ~-15 ~15 + radius 0 30 70 + alpha 250 1 0 + rotation ~360 0 0 bounce 0.0 color 0 { 0.8 0.2 0.2 } - diff --git a/assets/scripts/hw_rocketl.shader b/assets/scripts/hw_rocketl.shader index 28c56cb..45abbb8 100644 --- a/assets/scripts/hw_rocketl.shader +++ b/assets/scripts/hw_rocketl.shader @@ -56,3 +56,305 @@ rocketThrust } } +models/weapons/rocketl/flash +{ + nopicmip + cull disable + { + map gfx/rocketx/0006.jpg + blendFunc GL_ONE GL_ONE + } +} + +// BEST ROCKET EPXLSION EVAR! +rocketx1 +{ + nopicmip + cull disable + { + map gfx/rocketx/0002.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx2 +{ + nopicmip + cull disable + { + map gfx/rocketx/0003.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx3 +{ + nopicmip + cull disable + { + map gfx/rocketx/0004.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx4 +{ + nopicmip + cull disable + { + map gfx/rocketx/0005.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx5 +{ + nopicmip + cull disable + { + map gfx/rocketx/0006.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx6 +{ + nopicmip + cull disable + { + map gfx/rocketx/0007.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx7 +{ + nopicmip + cull disable + { + map gfx/rocketx/0008.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx8 +{ + nopicmip + cull disable + { + map gfx/rocketx/0009.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx9 +{ + nopicmip + cull disable + { + map gfx/rocketx/0010.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx10 +{ + nopicmip + cull disable + { + map gfx/rocketx/0011.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx11 +{ + nopicmip + cull disable + { + map gfx/rocketx/0012.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx12 +{ + nopicmip + cull disable + { + map gfx/rocketx/0013.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx13 +{ + nopicmip + cull disable + { + map gfx/rocketx/0014.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx14 +{ + nopicmip + cull disable + { + map gfx/rocketx/0015.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx15 +{ + nopicmip + cull disable + { + map gfx/rocketx/0016.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx16 +{ + nopicmip + cull disable + { + map gfx/rocketx/0017.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx17 +{ + nopicmip + cull disable + { + map gfx/rocketx/0018.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx18 +{ + nopicmip + cull disable + { + map gfx/rocketx/0019.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx19 +{ + nopicmip + cull disable + { + map gfx/rocketx/0020.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx20 +{ + nopicmip + cull disable + { + map gfx/rocketx/0021.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx21 +{ + nopicmip + cull disable + { + map gfx/rocketx/0022.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx22 +{ + nopicmip + cull disable + { + map gfx/rocketx/0023.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx23 +{ + nopicmip + cull disable + { + map gfx/rocketx/0024.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx24 +{ + nopicmip + cull disable + { + map gfx/rocketx/0025.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx25 +{ + nopicmip + cull disable + { + map gfx/rocketx/0026.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx26 +{ + nopicmip + cull disable + { + map gfx/rocketx/0027.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx27 +{ + nopicmip + cull disable + { + map gfx/rocketx/0028.jpg + blendFunc GL_ONE GL_ONE + } +} + + +rocketx28 +{ + nopicmip + cull disable + { + map gfx/rocketx/0029.jpg + blendFunc GL_ONE GL_ONE + } +} + +rocketx29 +{ + nopicmip + cull disable + { + map gfx/rocketx/0030.jpg + blendFunc GL_ONE GL_ONE + } +} + diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index d979046..97a21d9 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -787,6 +787,7 @@ typedef struct weaponInfoMode_s vec3_t flashDlightColor; sfxHandle_t flashSound[ 4 ]; // fast firing weapons randomly choose qboolean continuousFlash; + float flashQuake; qhandle_t missileModel; sfxHandle_t missileSound; @@ -816,6 +817,7 @@ typedef struct weaponInfoMode_s qhandle_t impactMarkSize; sfxHandle_t impactSound[ 4 ]; //random impact sound sfxHandle_t impactFleshSound[ 4 ]; //random impact sound + float impactQuake; } weaponInfoMode_t; // each WP_* weapon enum has an associated weaponInfo_t @@ -1159,6 +1161,8 @@ typedef struct int nearUsableBuildable; int nextWeaponClickTime; + + float viewQuake; } cg_t; @@ -1586,6 +1590,9 @@ extern vmCvar_t cg_chatTeamPrefix; extern vmCvar_t cg_drawBubble; extern vmCvar_t cg_BubbleZoom; +extern vmCvar_t cg_viewQuake; +extern vmCvar_t cg_viewQuakeLambda; + // // cg_main.c // @@ -1627,6 +1634,7 @@ void CG_TestModelNextSkin_f( void ); void CG_TestModelPrevSkin_f( void ); void CG_AddBufferedSound( sfxHandle_t sfx ); void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView, qboolean demoPlayback ); +void CG_InduceViewQuake( vec3_t src, float mag ); void CG_OffsetFirstPersonView( void ); void CG_OffsetThirdPersonView( void ); void CG_OffsetShoulderView( void ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 6be1d50..c5ad444 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -226,7 +226,10 @@ vmCvar_t cg_chatTeamPrefix; vmCvar_t cg_drawBubble; vmCvar_t cg_BubbleZoom; -vmCvar_t cg_EDGEFPSFIX; +vmCvar_t cg_EDGEFPSFIX; + +vmCvar_t cg_viewQuake; +vmCvar_t cg_viewQuakeLambda; typedef struct { @@ -371,7 +374,10 @@ static cvarTable_t cvarTable[ ] = // { &cg_chatTeamPrefix, "cg_chatTeamPrefix", "1", CVAR_ARCHIVE} { &cg_chatTeamPrefix, "cg_chatTeamPrefix", "1", CVAR_ARCHIVE}, - { &cg_EDGEFPSFIX, "cg_EDGEFPSFIX", "0", CVAR_ARCHIVE|CVAR_USERINFO } + { &cg_EDGEFPSFIX, "cg_EDGEFPSFIX", "0", CVAR_ARCHIVE|CVAR_USERINFO }, + + { &cg_viewQuake, "cg_viewQuake", "1", CVAR_ARCHIVE }, + { &cg_viewQuakeLambda, "cg_viewQuakeLambda", "-10", CVAR_ARCHIVE } }; static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] ); diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c index a0142d0..68f9287 100644 --- a/src/cgame/cg_view.c +++ b/src/cgame/cg_view.c @@ -537,6 +537,26 @@ static void CG_StepOffset( void ) #define PCLOUD_ZOOM_FREQUENCY 0.625f // 2.5s / 4 #define PCLOUD_DISORIENT_DURATION 2500 +/* +=============== +CG_InduceViewQuake +=============== +*/ + +void CG_InduceViewQuake( vec3_t src, float mag ) +{ + if( !src ) + { + cg.viewQuake += mag; + } + else + { + float dist; + + dist = Distance( src, cg.refdef.vieworg ); + cg.viewQuake += mag / dist / dist * 1000.0f; + } +} /* =============== @@ -838,6 +858,20 @@ void CG_OffsetFirstPersonView( void ) // add step offset CG_StepOffset( ); + + + // view quake + if( cg.thisFrameTeleport ) + { + cg.viewQuake = 0; + } + else + { + angles[ PITCH ] += crandom( ) * cg.viewQuake * cg_viewQuake.value; + angles[ YAW ] += crandom( ) * cg.viewQuake * cg_viewQuake.value; + + cg.viewQuake *= pow( 2, (float)cg.frametime * 1.0e-3 * cg_viewQuakeLambda.value ); + } } //====================================================================== diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 21d0352..8e3b438 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -416,6 +416,26 @@ static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p continue; } + else if( !Q_stricmp( token, "impactQuake" ) ) + { + token = COM_Parse( text_p ); + if( !token ) + break; + + wim->impactQuake = atof( token ); + + continue; + } + else if( !Q_stricmp( token, "flashQuake" ) ) + { + token = COM_Parse( text_p ); + if( !token ) + break; + + wim->flashQuake = atof( token ); + + continue; + } else if( !Q_stricmp( token, "}" ) ) return qtrue; //reached the end of this weapon section else @@ -1827,6 +1847,14 @@ void CG_FireWeapon( centity_t *cent, weaponMode_t weaponMode ) if( wi->wim[ weaponMode ].flashSound[ c ] ) trap_S_StartSound( NULL, es->number, CHAN_WEAPON, wi->wim[ weaponMode ].flashSound[ c ] ); } + + if( cent == &cg.predictedPlayerEntity ) + { + float quake; + + quake = wi->wim[ weaponMode ].flashQuake; + CG_InduceViewQuake( NULL, quake ); + } } @@ -1843,7 +1871,7 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN qhandle_t mark = 0; qhandle_t ps = 0; int c; - float radius = 1.0f; + float radius = 1.0f, quake; weaponInfo_t *weapon = &cg_weapons[ weaponNum ]; if( weaponMode <= WPM_NONE || weaponMode >= WPM_NUM_WEAPONMODES ) @@ -1852,6 +1880,7 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN mark = weapon->wim[ weaponMode ].impactMark; radius = weapon->wim[ weaponMode ].impactMarkSize; ps = weapon->wim[ weaponMode ].impactParticleSystem; + quake = weapon->wim[ weaponMode ].impactQuake; if( soundType == IMPACTSOUND_FLESH ) { @@ -1905,6 +1934,11 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN // if( radius > 0.0f ) CG_ImpactMark( mark, origin, dir, random( ) * 360, 1, 1, 1, 1, qfalse, radius, qfalse ); + + if( weaponNum == WP_LUCIFER_CANNON ) + quake *= charge; + + CG_InduceViewQuake( origin, quake ); } @@ -1918,6 +1952,7 @@ void CG_MissileHitEntity( weapon_t weaponNum, weaponMode_t weaponMode, { vec3_t normal; weaponInfo_t *weapon = &cg_weapons[ weaponNum ]; + float quake = weapon->wim[ weaponMode ].impactQuake; VectorCopy( dir, normal ); VectorInverse( normal ); @@ -1947,6 +1982,11 @@ void CG_MissileHitEntity( weapon_t weaponNum, weaponMode_t weaponMode, CG_MissileHitWall( weaponNum, weaponMode, 0, origin, dir, sound, charge ); } + + if( weaponNum == WP_LUCIFER_CANNON ) + quake *= charge; + + CG_InduceViewQuake( origin, quake ); } -- cgit