Gun spread overlay (#8588)

This commit is contained in:
metalgearsloth
2022-06-04 14:19:14 +10:00
committed by GitHub
parent 27b3ca04c5
commit e06cabecbb
7 changed files with 142 additions and 4 deletions

View File

@@ -196,8 +196,10 @@ public sealed partial class GunSystem : SharedGunSystem
component.LastFire = component.NextFire;
// Convert it so angle can go either side.
var random = Random.NextGaussian(0, 0.5);
var random = Random.NextFloat(-0.5f, 0.5f);
var spread = component.CurrentAngle.Theta * random;
var angle = new Angle(direction.Theta + component.CurrentAngle.Theta * random);
DebugTools.Assert(spread <= component.MaxAngle.Theta);
return angle;
}