HitscanPrototype.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Content.Shared.Damage;
  2. using Content.Shared.Physics;
  3. using Content.Shared.Weapons.Reflect;
  4. using Robust.Shared.Audio;
  5. using Robust.Shared.Prototypes;
  6. using Robust.Shared.Utility;
  7. namespace Content.Shared.Weapons.Ranged;
  8. [Prototype]
  9. public sealed partial class HitscanPrototype : IPrototype, IShootable
  10. {
  11. [ViewVariables]
  12. [IdDataField]
  13. public string ID { get; private set; } = default!;
  14. [ViewVariables(VVAccess.ReadWrite), DataField("staminaDamage")]
  15. public float StaminaDamage;
  16. [ViewVariables(VVAccess.ReadWrite), DataField("damage")]
  17. public DamageSpecifier? Damage;
  18. [ViewVariables(VVAccess.ReadOnly), DataField("muzzleFlash")]
  19. public SpriteSpecifier? MuzzleFlash;
  20. [ViewVariables(VVAccess.ReadOnly), DataField("travelFlash")]
  21. public SpriteSpecifier? TravelFlash;
  22. [ViewVariables(VVAccess.ReadOnly), DataField("impactFlash")]
  23. public SpriteSpecifier? ImpactFlash;
  24. [DataField("collisionMask")]
  25. public int CollisionMask = (int) CollisionGroup.Opaque;
  26. /// <summary>
  27. /// What we count as for reflection.
  28. /// </summary>
  29. [DataField("reflective")] public ReflectType Reflective = ReflectType.Energy;
  30. /// <summary>
  31. /// Sound that plays upon the thing being hit.
  32. /// </summary>
  33. [DataField("sound")]
  34. public SoundSpecifier? Sound;
  35. /// <summary>
  36. /// Force the hitscan sound to play rather than potentially playing the entity's sound.
  37. /// </summary>
  38. [ViewVariables(VVAccess.ReadWrite), DataField("forceSound")]
  39. public bool ForceSound;
  40. /// <summary>
  41. /// Try not to set this too high.
  42. /// </summary>
  43. [DataField("maxLength")]
  44. public float MaxLength = 20f;
  45. }