Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
hit_water.c
Go to the documentation of this file.
2 {
3  void Hit_Water()
4  {
5  SetSingleParticle(ParticleList.IMPACT_WATER_SMALL_ENTER);
6 
7  m_AngledEnter = 10;
8  }
9 
10  override void EvaluateEffect(Object directHit, int componentIndex, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, string ammoType)
11  {
12  super.EvaluateEffect(directHit, componentIndex, pos, impact_type, surfNormal, exitPos, inSpeed, outSpeed, ammoType);
13 
14  m_SurfNormal = "0 0 0";
15  }
16 
17  override float CalculateStoppingForce(float in_speedf, float out_speedf, string ammoType, float weight)
18  {
19  float projectile_weight_coef = weight / DEFAULT_PROJECTILE_WEIGHT;
20 
21  float stopping_force = (in_speedf - out_speedf) * projectile_weight_coef;
22 
23  if ( stopping_force < 350 )
24  SetEnterParticle(ParticleList.IMPACT_WATER_SMALL_ENTER);
25 
26  if ( stopping_force >= 350 && stopping_force < 750 )
27  SetEnterParticle(ParticleList.IMPACT_WATER_MEDIUM_ENTER);
28 
29  if ( stopping_force >= 750 )
30  SetEnterParticle(ParticleList.IMPACT_WATER_LARGE_ENTER);
31 
32  return stopping_force;
33  }
34 
35  override void OnEnterCalculations( Particle p )
36  {
37  // no particle scaling
38  }
39 
40  override void OnExitCalculations(Particle p, float outSpeedf)
41  {
42  // no particle scaling
43  }
44 
45  override void OnRicochetCalculations(Particle p, float outspeedf)
46  {
47  // no particle scaling
48  }
49 
50  override void OnEnterAngledCalculations(Particle p)
51  {
52  // no particle scaling
53  }
54 }
Particle
Legacy way of using particles in the game.
Definition: particle.c:6
EffBulletImpactBase
Definition: bulletimpactbase.c:1
ParticleList
Definition: particlelist.c:11
vector
Definition: enconvert.c:105
Hit_Water
Definition: hit_water.c:1
Object
Definition: objecttyped.c:1