GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));\r
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 * normal_to_macro, 1), ATTN_NORM);\r
+ sound(self, CHAN_AUTO, "misc/macro_footstep.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM);\r
+\r
+ // earthquake effect for nearby players when a macro walks by\r
+ if(cvar("g_healthsize_quake_step"))\r
+ {\r
+ entity head;\r
+ for(head = findradius(self.origin, cvar("g_healthsize_quake_step_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
+ if(head.stat_eaten)\r
+ continue; // not for prey\r
+\r
+ float shake;\r
+ shake = vlen(head.origin - self.origin);\r
+ if(shake)\r
+ shake = 1 - bound(0, shake / cvar("g_healthsize_quake_step_radius"), 1);\r
+ shake *= playersize_macro(self) * 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
+ }\r
}\r
else\r
{\r
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)\r
- GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE, 1));\r
+ GlobalSound(globalsound_metalstep, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);\r
else\r
- GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE, 1));\r
+ GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);\r
}\r
}\r
}\r