From: MirceaKitsune Date: Sat, 3 Mar 2012 18:50:28 +0000 (+0200) Subject: Shake the ground when a giant player is nearby. Not yet finished and working properly X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7f8e42d33ae70d5581bb79e3ee1838fe7c5364c2;p=voretournament%2Fvoretournament.git Shake the ground when a giant player is nearby. Not yet finished and working properly --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 2709f352..8bdfc193 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -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" set g_healthsize_weapon_scalefactor_pos 6 "Amount by which the view model is moved vertically based on player size" +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)" +set g_healthsize_quake_step_radius 500 "Radius in which a player must be to shake the view" + set g_power 5 "when armor is below this level, the HUD, crosshair and helper will not work" set g_power_reboot 2 "amount of time it takes to boot a player's subsystems once he has enough armor" set g_power_reboot_spawn 1 "when enabled, a player's subsystems must boot whenever he spawns" diff --git a/data/qcsrc/server/sv_main.qc b/data/qcsrc/server/sv_main.qc index 28b470e0..3bf49db9 100644 --- a/data/qcsrc/server/sv_main.qc +++ b/data/qcsrc/server/sv_main.qc @@ -114,6 +114,25 @@ void CreatureFrame (void) else GlobalSound(globalsound_step, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1)); sound(self, CHAN_AUTO, "misc/macro_footstep.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM); + + entity head; + for(head = findradius(self.origin, cvar("g_healthsize_quake_step_radius")); head; head = head.chain) + { + if(head.classname != "player") + continue; + + float shake; + shake = vlen(head.origin - self.origin); + if(shake) + shake = 1 - (shake / cvar("g_healthsize_quake_step_radius")); + shake *= cvar("g_healthsize_quake_step"); + + head.punchvector_x += crandom() * shake; + head.punchvector_y += crandom() * shake; + head.punchvector_z += crandom() * shake; + + dprint(strcat(head.netname, " | ", ftos(shake), " --------\n")); + } } else {