]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Earthquake for falling, obviously stronger than that of footsteps
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 19:22:36 +0000 (21:22 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 19:22:36 +0000 (21:22 +0200)
data/defaultVT.cfg
data/qcsrc/server/cl_physics.qc

index 8bdfc19312e01dcd2a6a5e32191eac35bb8e177f..dbfe893c7c8241bb8f56f947ca88062d39dc667a 100644 (file)
@@ -1663,9 +1663,10 @@ set g_healthsize_soundfactor 0.5 "The sounds players make are amplified or reduc
 set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resizes the exterior weapon model"\r
 set g_healthsize_weapon_scalefactor 1 "Amount by which player size resizes the view weapon model"\r
 set g_healthsize_weapon_scalefactor_pos 6 "Amount by which the view model is moved vertically based on player size"\r
-\r
 set g_healthsize_quake_step 10 "The view of nearby players is shaken by this amount when a macro walks near them (requires g_footsteps)"\r
-set g_healthsize_quake_step_radius 500 "Radius in which a player must be to shake the view"\r
+set g_healthsize_quake_step_radius 500 "Radius in which a player must be located to shake the view"\r
+set g_healthsize_quake_fall 20 "The view of nearby players is shaken by this amount when a macro falls near them"\r
+set g_healthsize_quake_fall_radius 750 "Radius in which a player must be located to shake the view"\r
 \r
 set g_power 5 "when armor is below this level, the HUD, crosshair and helper will not work"\r
 set g_power_reboot 2 "amount of time it takes to boot a player's subsystems once he has enough armor"\r
index 3dd65f7c8f0e958138e5a145e4cdacf0075395e1..73de99315478b195d454d0136e0737b166cd733f 100644 (file)
@@ -879,6 +879,31 @@ void SV_PlayerPhysics()
                                                pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', self.scale);\r
                                        }\r
                                        sound(self, CHAN_AUTO, "misc/macro_hitground.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM);\r
+\r
+                                       // earthquake effect for nearby players when a macro falls\r
+                                       if(cvar("g_healthsize_quake_fall"))\r
+                                       {\r
+                                               entity head;\r
+                                               for(head = findradius(self.origin, cvar("g_healthsize_quake_fall_radius")); head; head = head.chain)\r
+                                               {\r
+                                                       if not(head.classname == "player" || head.classname == "spectator")\r
+                                                               continue;\r
+                                                       if(head == self || head.spectatee_status == num_for_edict(self))\r
+                                                               continue; // not for self\r
+                                                       if not(head.flags & FL_ONGROUND)\r
+                                                               continue; // we only feel the ground shaking if we are sitting on it\r
+\r
+                                                       float shake;\r
+                                                       shake = vlen(head.origin - self.origin);\r
+                                                       if(shake)\r
+                                                               shake = 1 - bound(0, shake / cvar("g_healthsize_quake_fall_radius"), 1);\r
+                                                       shake *= cvar("g_healthsize_quake_fall");\r
+\r
+                                                       head.punchvector_x += crandom() * shake;\r
+                                                       head.punchvector_y += crandom() * shake;\r
+                                                       head.punchvector_z += crandom() * shake;\r
+                                               }\r
+                                       }\r
                                }\r
                                else\r
                                {\r