]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Shake the ground when a giant player is nearby. Not yet finished and working properly
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 18:50:28 +0000 (20:50 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 3 Mar 2012 18:50:28 +0000 (20:50 +0200)
data/defaultVT.cfg
data/qcsrc/server/sv_main.qc

index 2709f352db4d915a883c31250fd8861240462c43..8bdfc19312e01dcd2a6a5e32191eac35bb8e177f 100644 (file)
@@ -1664,6 +1664,9 @@ set g_healthsize_exteriorweapon_scalefactor 1 "Amount by which player size resiz
 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
+\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
 set g_power_reboot_spawn 1 "when enabled, a player's subsystems must boot whenever he spawns"\r
index 28b470e0709ae3770a7c365c541dbb76a0395e0a..3bf49db91deca33f6a8f2d3ef7f654b252f23956 100644 (file)
@@ -114,6 +114,25 @@ void CreatureFrame (void)
                                                        else\r
                                                                GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));\r
                                                        sound(self, CHAN_AUTO, "misc/macro_footstep.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM);\r
+\r
+                                                       entity head;\r
+                                                       for(head = findradius(self.origin, cvar("g_healthsize_quake_step_radius")); head; head = head.chain)\r
+                                                       {\r
+                                                               if(head.classname != "player")\r
+                                                                       continue;\r
+\r
+                                                               float shake;\r
+                                                               shake = vlen(head.origin - self.origin);\r
+                                                               if(shake)\r
+                                                                       shake = 1 - (shake / cvar("g_healthsize_quake_step_radius"));\r
+                                                               shake *= cvar("g_healthsize_quake_step");\r
+\r
+                                                               head.punchvector_x += crandom() * shake;\r
+                                                               head.punchvector_y += crandom() * shake;\r
+                                                               head.punchvector_z += crandom() * shake;\r
+\r
+                                                               dprint(strcat(head.netname, " | ", ftos(shake), " --------\n"));\r
+                                                       }\r
                                                }\r
                                                else\r
                                                {\r