hit_water.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. class Hit_Water : EffBulletImpactBase
  2. {
  3. void Hit_Water()
  4. {
  5. SetSingleParticle(ParticleList.IMPACT_WATER_SMALL_ENTER);
  6. m_AngledEnter = 10;
  7. }
  8. override void EvaluateEffect(Object directHit, int componentIndex, vector pos, int impact_type, vector surfNormal, vector exitPos, vector inSpeed, vector outSpeed, string ammoType)
  9. {
  10. super.EvaluateEffect(directHit, componentIndex, pos, impact_type, surfNormal, exitPos, inSpeed, outSpeed, ammoType);
  11. m_SurfNormal = "0 0 0";
  12. }
  13. override float CalculateStoppingForce(float in_speedf, float out_speedf, string ammoType, float weight)
  14. {
  15. float projectile_weight_coef = weight / DEFAULT_PROJECTILE_WEIGHT;
  16. float stopping_force = (in_speedf - out_speedf) * projectile_weight_coef;
  17. if ( stopping_force < 350 )
  18. SetEnterParticle(ParticleList.IMPACT_WATER_SMALL_ENTER);
  19. if ( stopping_force >= 350 && stopping_force < 750 )
  20. SetEnterParticle(ParticleList.IMPACT_WATER_MEDIUM_ENTER);
  21. if ( stopping_force >= 750 )
  22. SetEnterParticle(ParticleList.IMPACT_WATER_LARGE_ENTER);
  23. return stopping_force;
  24. }
  25. override void OnEnterCalculations( Particle p )
  26. {
  27. // no particle scaling
  28. }
  29. override void OnExitCalculations(Particle p, float outSpeedf)
  30. {
  31. // no particle scaling
  32. }
  33. override void OnRicochetCalculations(Particle p, float outspeedf)
  34. {
  35. // no particle scaling
  36. }
  37. override void OnEnterAngledCalculations(Particle p)
  38. {
  39. // no particle scaling
  40. }
  41. }