1
0

ProjectileSpreadComponent.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Weapons.Ranged.Systems;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Shared.Projectiles;
  5. /// <summary>
  6. /// Spawns a spread of the projectiles when fired
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, Access(typeof(SharedGunSystem))]
  9. public sealed partial class ProjectileSpreadComponent : Component
  10. {
  11. /// <summary>
  12. /// The entity prototype that will be fired by the rest of the spread.
  13. /// Will generally be the same entity prototype as the first projectile being fired.
  14. /// Needed for ammo components that do not specify a fired prototype, unlike cartridges.
  15. /// </summary>
  16. [DataField(required: true)]
  17. public EntProtoId Proto;
  18. /// <summary>
  19. /// How much the ammo spreads when shot, in degrees. Does nothing if count is 0.
  20. /// </summary>
  21. [DataField]
  22. public Angle Spread = Angle.FromDegrees(5);
  23. /// <summary>
  24. /// How many prototypes are spawned when shot.
  25. /// </summary>
  26. [DataField]
  27. public int Count = 1;
  28. }