Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- == Weapon frame logic ==
- // High limit
- if ( gun.av > gun.stat_average_max )
- gun.av = gun.stat_average_max - gun.stat_average_subtract;
- else
- {
- // Accuracy restoration
- gun.av -= gun.stat_average_subtract * GSPEED;
- }
- // Low limit
- if ( gun.av < gun.stat_average_min )
- gun.av = gun.stat_average_min;
- == End of frame logic ==
- == Shot logic ==
- // "u" is a temporary variable, defines spread intensity for all bullets
- u = ( Math.random() * 2 - 1 ) * gun.av * gun.av * 2;
- // Add
- gun.av += gun.stat_average_add;
- == For each bullet (bullet_number starts with 0): ==
- // Calculate "xx" which is bullet trajectory angle
- if ( player.stability < 0.5 )
- xx = u - Math.PI/2 - gun.rotation_radians;
- else
- xx = u + player.look_angle + Math.PI;
- xx += gun.stat_average / gun.stat_count * bullet_number + Math.random() * gun.stat_average / gun.stat_count - gun.stat_average / 2;
- == End of shot logic ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement