3 float m_ScalingByDistance;
9 SetRicochetParticle(
ParticleList.IMPACT_MEATBONES_RICOCHET);
12 m_EnterSplashCoef = 0.002;
13 m_ExitSplashCoef = 0.006;
14 m_ScalingByDistance = 0.05;
16 MIN_SCALING_PARAM = 0.2;
19 override float CalculateStoppingForce(
float in_speedf,
float out_speedf,
string ammoType,
float weight)
26 float projectile_weight_coef = weight / DEFAULT_PROJECTILE_WEIGHT;
28 float stopping_force = in_speedf * projectile_weight_coef;
48 return stopping_force;
51 override void Event_OnStarted()
53 super.Event_OnStarted();
63 BloodSplatGround( m_ExitPos,
m_OutSpeed, 0.8 );
68 void BloodSplatGround(
vector start_pos,
vector speed_vector,
float decay_coef )
71 float power = m_StoppingForce;
73 float rnd_offset = 0.5;
74 float rnd_offset_2 = rnd_offset * 0.5;
78 pos = pos + ( speed_vector * 0.001 );
79 pos = pos +
Vector( rnd_offset_2 -
Math.RandomFloat( 0, rnd_offset ), 0, rnd_offset_2 -
Math.RandomFloat( 0, rnd_offset ) );
80 pos[1] =
GetGame().SurfaceY(pos[0], pos[2]);
83 eff.SetAutodestroy(
true);
90 blood.SetOrientation(ori);
91 blood.ScaleParticleParam(
EmitorParam.SIZE, upscale);
94 blood_chunks.SetOrientation(ori);
96 power = power * decay_coef;
97 upscale = upscale +
Math.RandomFloat(0.1, 1);
103 void BloodSplatWall()
128 override void OnEnterCalculations(
Particle p )
131 float velocity_min = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef);
132 float velocity_max = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef);
133 float size = MIN_SCALING_PARAM + ( m_StoppingForce * m_EnterSplashCoef);
134 float birth_rate = MIN_SCALING_PARAM + (m_StoppingForce * m_EnterSplashCoef/2);
145 float distance =
vector.Distance(camera_pos,
m_Pos);
146 float scaling_by_distance = (distance*1.2) * m_ScalingByDistance;
149 float current_FOV =
Camera.GetCurrentFOV();
150 float config_FOV =
GetDayZGame().GetUserFOVFromConfig();
151 float FOV_scale = current_FOV / config_FOV;
152 scaling_by_distance = scaling_by_distance * FOV_scale;
154 if (scaling_by_distance > 5)
155 scaling_by_distance = 5;
157 size = size + scaling_by_distance;
158 velocity_min = velocity_min + scaling_by_distance;
159 velocity_max = velocity_max + scaling_by_distance;
161 if (velocity_min < MIN_SCALING_PARAM)
162 velocity_min = MIN_SCALING_PARAM;
164 if (velocity_max < MIN_SCALING_PARAM * 2)
165 velocity_max = MIN_SCALING_PARAM * 2;
167 if (size < MIN_SCALING_PARAM)
168 size = MIN_SCALING_PARAM;
170 if (birth_rate < MIN_SCALING_PARAM)
171 birth_rate = MIN_SCALING_PARAM;
173 p.ScaleParticleParam(
EmitorParam.VELOCITY, velocity_min);
174 p.ScaleParticleParam(
EmitorParam.VELOCITY_RND, velocity_max);
176 p.ScaleParticleParam(
EmitorParam.BIRTH_RATE, birth_rate);
179 override void OnExitCalculations(
Particle p,
float outSpeedf)
181 float velocity_rnd = outSpeedf * m_ExitSplashCoef;
182 float birth_rate_rnd_def = outSpeedf * m_ExitSplashCoef;
183 float size = outSpeedf * m_ExitSplashCoef;
185 if (velocity_rnd < MIN_SCALING_PARAM)
186 velocity_rnd = MIN_SCALING_PARAM;
188 if (size < MIN_SCALING_PARAM)
189 size = MIN_SCALING_PARAM;
194 if (birth_rate_rnd_def < MIN_SCALING_PARAM)
195 birth_rate_rnd_def = MIN_SCALING_PARAM;
197 p.ScaleParticleParam(
EmitorParam.VELOCITY_RND, velocity_rnd);
198 p.ScaleParticleParam(
EmitorParam.BIRTH_RATE, birth_rate_rnd_def);