ClumsyComponent.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using Content.Shared.Damage;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. namespace Content.Shared.Clumsy;
  5. /// <summary>
  6. /// A simple clumsy tag-component.
  7. /// </summary>
  8. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  9. public sealed partial class ClumsyComponent : Component
  10. {
  11. // Standard options. Try to fit these in if you can!
  12. /// <summary>
  13. /// Sound to play when clumsy interactions fail.
  14. /// </summary>
  15. [DataField]
  16. public SoundSpecifier ClumsySound = new SoundPathSpecifier("/Audio/Items/bikehorn.ogg");
  17. /// <summary>
  18. /// Default chance to fail a clumsy interaction.
  19. /// If a system needs to use something else, add a new variable in the component, do not modify this percentage.
  20. /// </summary>
  21. [DataField, AutoNetworkedField]
  22. public float ClumsyDefaultCheck = 0.5f;
  23. /// <summary>
  24. /// Default stun time.
  25. /// If a system needs to use something else, add a new variable in the component, do not modify this number.
  26. /// </summary>
  27. [DataField, AutoNetworkedField]
  28. public TimeSpan ClumsyDefaultStunTime = TimeSpan.FromSeconds(2.5);
  29. // Specific options
  30. /// <summary>
  31. /// Sound to play after hitting your head on a table. Ouch!
  32. /// </summary>
  33. [DataField]
  34. public SoundCollectionSpecifier TableBonkSound = new SoundCollectionSpecifier("TrayHit");
  35. /// <summary>
  36. /// Stun time after failing to shoot a gun.
  37. /// </summary>
  38. [DataField, AutoNetworkedField]
  39. public TimeSpan GunShootFailStunTime = TimeSpan.FromSeconds(3);
  40. /// <summary>
  41. /// Stun time after failing to shoot a gun.
  42. /// </summary>
  43. [DataField, AutoNetworkedField]
  44. public DamageSpecifier? GunShootFailDamage;
  45. /// <summary>
  46. /// Noise to play after failing to shoot a gun. Boom!
  47. /// </summary>
  48. [DataField]
  49. public SoundSpecifier GunShootFailSound = new SoundPathSpecifier("/Audio/Weapons/Guns/Gunshots/bang.ogg");
  50. /// <summary>
  51. /// Whether or not to apply Clumsy to hyposprays.
  52. /// </summary>
  53. [DataField, AutoNetworkedField]
  54. public bool ClumsyHypo = true;
  55. /// <summary>
  56. /// Whether or not to apply Clumsy to defibs.
  57. /// </summary>
  58. [DataField, AutoNetworkedField]
  59. public bool ClumsyDefib = true;
  60. /// <summary>
  61. /// Whether or not to apply Clumsy to guns.
  62. /// </summary>
  63. [DataField, AutoNetworkedField]
  64. public bool ClumsyGuns = true;
  65. /// <summary>
  66. /// Whether or not to apply Clumsy to vaulting.
  67. /// </summary>
  68. [DataField, AutoNetworkedField]
  69. public bool ClumsyVaulting = true;
  70. /// <summary>
  71. /// Lets you define a new "failed" message for each event.
  72. /// </summary>
  73. [DataField]
  74. public LocId HypoFailedMessage = "hypospray-component-inject-self-clumsy-message";
  75. [DataField]
  76. public LocId GunFailedMessage = "gun-clumsy";
  77. [DataField]
  78. public LocId VaulingFailedMessageSelf = "bonkable-success-message-user";
  79. [DataField]
  80. public LocId VaulingFailedMessageOthers = "bonkable-success-message-others";
  81. [DataField]
  82. public LocId VaulingFailedMessageForced = "forced-bonkable-success-message";
  83. }