]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/sv_main.qc
Shake the ground when a giant player is nearby. Not yet finished and working properly
[voretournament/voretournament.git] / data / qcsrc / server / sv_main.qc
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