From: Mircea Kitsune Date: Sun, 10 Apr 2011 15:22:56 +0000 (+0300) Subject: Use the same probability system on players as on gibs. The cvar can be set to anythin... X-Git-Tag: xonotic-v0.6.0~110^2^2~121 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d7b9211578dbf13a1ca200aa7a3d25a0aecbf61e;p=xonotic%2Fxonotic-data.pk3dir.git Use the same probability system on players as on gibs. The cvar can be set to anything between 0 and 1 to specify probability of the effect showing each tick, allowing its intensity to be tweaked client side for performance and personal taste. --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 18d0c87ce..d7fbec91e 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -353,8 +353,8 @@ set g_teleport_maxspeed 0 "maximum speed that a player can keep when going throu set sv_damageeffect_tick 0.05 "how often the damage effect is updated (particles per second), low values might cause lag" set sv_damageeffect_lifetime 0.04 "how much a damage effect lasts, multiplied by damage amount" set sv_damageeffect_lifetime_max 5 "maximum amount of lifetime a damage effect may have at a time" -set cl_damageeffect 1 "enable weapon damage effects on players, value specifies particle count offset" -set cl_damageeffect_gib_probability 0.15 "probability of effect showing on gibs each tick (used to reduce the effect on gibs)" +set cl_damageeffect 1 "enable weapon damage effects on players, values between 0 and 1 specify probability of the effect showing on players each tick (used to reduce the effect)" +set cl_damageeffect_gibs 0.15 "probability of the effect showing on gibs each tick (used to reduce the effect)" set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the player respawns" set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate" diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 81feea23e..8f8414464 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -306,4 +306,4 @@ float autocvar_crosshair_color_by_health; float autocvar_cl_hitsound; float autocvar_cl_hitsound_antispam_time; float autocvar_cl_damageeffect; -float autocvar_cl_damageeffect_gib_probability; +float autocvar_cl_damageeffect_gibs; diff --git a/qcsrc/client/gibs.qc b/qcsrc/client/gibs.qc index b899eb22c..4c07a1b59 100644 --- a/qcsrc/client/gibs.qc +++ b/qcsrc/client/gibs.qc @@ -322,11 +322,12 @@ void Ent_DamageEffect() for(head = world; (head = find(head, classname, "gib")); ) { if(head.team == entnumber) - if(random() < autocvar_cl_damageeffect_gib_probability) - pointparticles(particleeffectnum(effectnum), head.origin, '0 0 0', autocvar_cl_damageeffect); + if(random() < autocvar_cl_damageeffect_gibs) + pointparticles(particleeffectnum(effectnum), head.origin, '0 0 0', 1); } // Now apply the effect to the player. This shouldn't be done on gibbed bodies, but there's no way // to tell between them and the respawned player, if both have damage effects at the same time. - pointparticles(particleeffectnum(effectnum), org, '0 0 0', autocvar_cl_damageeffect); + if(random() < autocvar_cl_damageeffect) + pointparticles(particleeffectnum(effectnum), org, '0 0 0', 1); }