Advertisement
Guest User

Plazma Burst Official Wiki - Calculating accuracy

a guest
Feb 21st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. == Weapon frame logic ==
  2.  
  3. // High limit
  4. if ( gun.av > gun.stat_average_max )
  5. gun.av = gun.stat_average_max - gun.stat_average_subtract;
  6. else
  7. {
  8. // Accuracy restoration
  9. gun.av -= gun.stat_average_subtract * GSPEED;
  10. }
  11.  
  12. // Low limit
  13. if ( gun.av < gun.stat_average_min )
  14. gun.av = gun.stat_average_min;
  15.  
  16. == End of frame logic ==
  17.  
  18.  
  19.  
  20. == Shot logic ==
  21.  
  22. // "u" is a temporary variable, defines spread intensity for all bullets
  23. u = ( Math.random() * 2 - 1 ) * gun.av * gun.av * 2;
  24.  
  25. // Add
  26. gun.av += gun.stat_average_add;
  27.  
  28.  
  29. == For each bullet (bullet_number starts with 0): ==
  30.  
  31. // Calculate "xx" which is bullet trajectory angle
  32. if ( player.stability < 0.5 )
  33. xx = u - Math.PI/2 - gun.rotation_radians;
  34. else
  35. xx = u + player.look_angle + Math.PI;
  36.  
  37. xx += gun.stat_average / gun.stat_count * bullet_number + Math.random() * gun.stat_average / gun.stat_count - gun.stat_average / 2;
  38.  
  39. == End of shot logic ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement