summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorenneract <trem.redman@gmail.com>2014-12-13 16:06:15 +0100
committerenneract <trem.redman@gmail.com>2014-12-13 16:06:15 +0100
commitd1853e239ae258e394a516f0eeda80f430a1a328 (patch)
treec32016d8a27b10d09d2331ea5314f0ccf63346e0
parent2fde9f3481239b2b2226ee812dd34ed4d8d5d6d6 (diff)
View quake, improved Rocket Launcher assets.
(FIXME: Rocket explosion doesn't fade out)
-rw-r--r--assets/gfx/rocketx/0002.jpgbin0 -> 4605 bytes
-rw-r--r--assets/gfx/rocketx/0003.jpgbin0 -> 6454 bytes
-rw-r--r--assets/gfx/rocketx/0004.jpgbin0 -> 7373 bytes
-rw-r--r--assets/gfx/rocketx/0005.jpgbin0 -> 7978 bytes
-rw-r--r--assets/gfx/rocketx/0006.jpgbin0 -> 8260 bytes
-rw-r--r--assets/gfx/rocketx/0007.jpgbin0 -> 8351 bytes
-rw-r--r--assets/gfx/rocketx/0008.jpgbin0 -> 8448 bytes
-rw-r--r--assets/gfx/rocketx/0009.jpgbin0 -> 8560 bytes
-rw-r--r--assets/gfx/rocketx/0010.jpgbin0 -> 8660 bytes
-rw-r--r--assets/gfx/rocketx/0011.jpgbin0 -> 8827 bytes
-rw-r--r--assets/gfx/rocketx/0012.jpgbin0 -> 8947 bytes
-rw-r--r--assets/gfx/rocketx/0013.jpgbin0 -> 9079 bytes
-rw-r--r--assets/gfx/rocketx/0014.jpgbin0 -> 9090 bytes
-rw-r--r--assets/gfx/rocketx/0015.jpgbin0 -> 9029 bytes
-rw-r--r--assets/gfx/rocketx/0016.jpgbin0 -> 9019 bytes
-rw-r--r--assets/gfx/rocketx/0017.jpgbin0 -> 8935 bytes
-rw-r--r--assets/gfx/rocketx/0018.jpgbin0 -> 8850 bytes
-rw-r--r--assets/gfx/rocketx/0019.jpgbin0 -> 8662 bytes
-rw-r--r--assets/gfx/rocketx/0020.jpgbin0 -> 8450 bytes
-rw-r--r--assets/gfx/rocketx/0021.jpgbin0 -> 8249 bytes
-rw-r--r--assets/gfx/rocketx/0022.jpgbin0 -> 8022 bytes
-rw-r--r--assets/gfx/rocketx/0023.jpgbin0 -> 7930 bytes
-rw-r--r--assets/gfx/rocketx/0024.jpgbin0 -> 7733 bytes
-rw-r--r--assets/gfx/rocketx/0025.jpgbin0 -> 7581 bytes
-rw-r--r--assets/gfx/rocketx/0026.jpgbin0 -> 7346 bytes
-rw-r--r--assets/gfx/rocketx/0027.jpgbin0 -> 7060 bytes
-rw-r--r--assets/gfx/rocketx/0028.jpgbin0 -> 6750 bytes
-rw-r--r--assets/gfx/rocketx/0029.jpgbin0 -> 6433 bytes
-rw-r--r--assets/gfx/rocketx/0030.jpgbin0 -> 6090 bytes
-rw-r--r--assets/models/weapons/lcannon/weapon.cfg2
-rw-r--r--assets/models/weapons/lightning/weapon.cfg1
-rw-r--r--assets/models/weapons/rocketl/rocketl.md3bin5796 -> 6004 bytes
-rw-r--r--assets/models/weapons/rocketl/rocketl_flash.md3bin0 -> 868 bytes
-rw-r--r--assets/models/weapons/rocketl/weapon.cfg2
-rw-r--r--assets/scripts/hw_rocketl.particle41
-rw-r--r--assets/scripts/hw_rocketl.shader302
-rw-r--r--src/cgame/cg_local.h8
-rw-r--r--src/cgame/cg_main.c10
-rw-r--r--src/cgame/cg_view.c34
-rw-r--r--src/cgame/cg_weapons.c42
40 files changed, 402 insertions, 40 deletions
diff --git a/assets/gfx/rocketx/0002.jpg b/assets/gfx/rocketx/0002.jpg
new file mode 100644
index 0000000..776768b
--- /dev/null
+++ b/assets/gfx/rocketx/0002.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0003.jpg b/assets/gfx/rocketx/0003.jpg
new file mode 100644
index 0000000..91313e7
--- /dev/null
+++ b/assets/gfx/rocketx/0003.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0004.jpg b/assets/gfx/rocketx/0004.jpg
new file mode 100644
index 0000000..a1848ed
--- /dev/null
+++ b/assets/gfx/rocketx/0004.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0005.jpg b/assets/gfx/rocketx/0005.jpg
new file mode 100644
index 0000000..da5e255
--- /dev/null
+++ b/assets/gfx/rocketx/0005.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0006.jpg b/assets/gfx/rocketx/0006.jpg
new file mode 100644
index 0000000..6d026ba
--- /dev/null
+++ b/assets/gfx/rocketx/0006.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0007.jpg b/assets/gfx/rocketx/0007.jpg
new file mode 100644
index 0000000..c18ce0d
--- /dev/null
+++ b/assets/gfx/rocketx/0007.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0008.jpg b/assets/gfx/rocketx/0008.jpg
new file mode 100644
index 0000000..06a2d74
--- /dev/null
+++ b/assets/gfx/rocketx/0008.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0009.jpg b/assets/gfx/rocketx/0009.jpg
new file mode 100644
index 0000000..6e7bc69
--- /dev/null
+++ b/assets/gfx/rocketx/0009.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0010.jpg b/assets/gfx/rocketx/0010.jpg
new file mode 100644
index 0000000..400d603
--- /dev/null
+++ b/assets/gfx/rocketx/0010.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0011.jpg b/assets/gfx/rocketx/0011.jpg
new file mode 100644
index 0000000..17e0220
--- /dev/null
+++ b/assets/gfx/rocketx/0011.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0012.jpg b/assets/gfx/rocketx/0012.jpg
new file mode 100644
index 0000000..6765bf9
--- /dev/null
+++ b/assets/gfx/rocketx/0012.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0013.jpg b/assets/gfx/rocketx/0013.jpg
new file mode 100644
index 0000000..a543aba
--- /dev/null
+++ b/assets/gfx/rocketx/0013.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0014.jpg b/assets/gfx/rocketx/0014.jpg
new file mode 100644
index 0000000..5ed10d8
--- /dev/null
+++ b/assets/gfx/rocketx/0014.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0015.jpg b/assets/gfx/rocketx/0015.jpg
new file mode 100644
index 0000000..5fe6015
--- /dev/null
+++ b/assets/gfx/rocketx/0015.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0016.jpg b/assets/gfx/rocketx/0016.jpg
new file mode 100644
index 0000000..24f0d16
--- /dev/null
+++ b/assets/gfx/rocketx/0016.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0017.jpg b/assets/gfx/rocketx/0017.jpg
new file mode 100644
index 0000000..3b037f5
--- /dev/null
+++ b/assets/gfx/rocketx/0017.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0018.jpg b/assets/gfx/rocketx/0018.jpg
new file mode 100644
index 0000000..b479532
--- /dev/null
+++ b/assets/gfx/rocketx/0018.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0019.jpg b/assets/gfx/rocketx/0019.jpg
new file mode 100644
index 0000000..288bd52
--- /dev/null
+++ b/assets/gfx/rocketx/0019.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0020.jpg b/assets/gfx/rocketx/0020.jpg
new file mode 100644
index 0000000..97f2d10
--- /dev/null
+++ b/assets/gfx/rocketx/0020.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0021.jpg b/assets/gfx/rocketx/0021.jpg
new file mode 100644
index 0000000..3443b96
--- /dev/null
+++ b/assets/gfx/rocketx/0021.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0022.jpg b/assets/gfx/rocketx/0022.jpg
new file mode 100644
index 0000000..b14747d
--- /dev/null
+++ b/assets/gfx/rocketx/0022.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0023.jpg b/assets/gfx/rocketx/0023.jpg
new file mode 100644
index 0000000..da23eb0
--- /dev/null
+++ b/assets/gfx/rocketx/0023.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0024.jpg b/assets/gfx/rocketx/0024.jpg
new file mode 100644
index 0000000..bfe4476
--- /dev/null
+++ b/assets/gfx/rocketx/0024.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0025.jpg b/assets/gfx/rocketx/0025.jpg
new file mode 100644
index 0000000..3c95e8b
--- /dev/null
+++ b/assets/gfx/rocketx/0025.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0026.jpg b/assets/gfx/rocketx/0026.jpg
new file mode 100644
index 0000000..31590ea
--- /dev/null
+++ b/assets/gfx/rocketx/0026.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0027.jpg b/assets/gfx/rocketx/0027.jpg
new file mode 100644
index 0000000..004d27f
--- /dev/null
+++ b/assets/gfx/rocketx/0027.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0028.jpg b/assets/gfx/rocketx/0028.jpg
new file mode 100644
index 0000000..96405cb
--- /dev/null
+++ b/assets/gfx/rocketx/0028.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0029.jpg b/assets/gfx/rocketx/0029.jpg
new file mode 100644
index 0000000..c344ab9
--- /dev/null
+++ b/assets/gfx/rocketx/0029.jpg
Binary files differ
diff --git a/assets/gfx/rocketx/0030.jpg b/assets/gfx/rocketx/0030.jpg
new file mode 100644
index 0000000..779691b
--- /dev/null
+++ b/assets/gfx/rocketx/0030.jpg
Binary files 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
--- a/assets/models/weapons/rocketl/rocketl.md3
+++ b/assets/models/weapons/rocketl/rocketl.md3
Binary files 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
--- /dev/null
+++ b/assets/models/weapons/rocketl/rocketl_flash.md3
Binary files 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
@@ -38,40 +38,7 @@ models/weapons/rocketl/impactPS
{
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 );
}