From: Mircea Kitsune Date: Thu, 27 Oct 2011 12:13:48 +0000 (+0300) Subject: Calculate impact speed starting from minimum velocity, not actual velocity. Also... X-Git-Tag: xonotic-v0.6.0~35^2~18^2~126 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b43cb7e040a50b242071bd242c4597b6f40c264e;p=xonotic%2Fxonotic-data.pk3dir.git Calculate impact speed starting from minimum velocity, not actual velocity. Also fix particles so that their count is reduced / increased properly. --- diff --git a/effectinfo.txt b/effectinfo.txt index 610ae1a23..06e153bf8 100644 --- a/effectinfo.txt +++ b/effectinfo.txt @@ -6411,7 +6411,7 @@ rotate -180 180 -20 20 // metal impact effect // used in qcsrc/server/mutators/sandbox.qc: pointparticles(particleeffectnum("impact_metal"), self.origin, '0 0 0', 1); effect impact_metal -countabsolute 1 +count 1 type alphastatic tex 0 8 size 3 6 @@ -6438,7 +6438,7 @@ gravity 1 // stone impact effect // used in qcsrc/server/mutators/sandbox.qc: pointparticles(particleeffectnum("impact_stone"), self.origin, '0 0 0', 1); effect impact_stone -countabsolute 1 +count 1 type alphastatic tex 0 8 size 3 6 @@ -6450,7 +6450,7 @@ originjitter 20 20 5 // debris effect impact_stone notunderwater -count 2 +count 1 type alphastatic tex 66 68 color 0x000000 0x886644 @@ -6465,7 +6465,7 @@ rotate -180 180 -1000 1000 // wood impact effect // used in qcsrc/server/mutators/sandbox.qc: pointparticles(particleeffectnum("impact_wood"), self.origin, '0 0 0', 1); effect impact_wood -countabsolute 1 +count 1 type alphastatic tex 0 8 size 3 6 @@ -6491,7 +6491,7 @@ gravity 1 // flesh impact effect // used in qcsrc/server/mutators/sandbox.qc: pointparticles(particleeffectnum("impact_flesh"), self.origin, '0 0 0', 1); effect impact_flesh -countabsolute 0.5 +count 0.5 type alphastatic tex 0 8 size 8 12 diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 3b07fc8b5..b8f30c42c 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -19,11 +19,12 @@ void sandbox_Object_Touch() // make particle count and sound volume depend on impact speed float intensity; intensity = vlen(self.velocity) + vlen(other.velocity); - if(intensity) // check this first to avoid divisions by 0 + if(intensity) // avoid divisions by 0 intensity /= 2; // average the two velocities if not(intensity >= autocvar_g_sandbox_object_material_velocity_min) return; // impact not strong enough to do anything // now offset intensity and apply it to the effects + intensity -= autocvar_g_sandbox_object_material_velocity_min; // start from minimum velocity, not actual velocity intensity = bound(0, intensity * autocvar_g_sandbox_object_material_velocity_factor, 1); switch(self.material)