GrapplingGunComponent.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Robust.Shared.Audio;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Utility;
  4. namespace Content.Shared.Weapons.Ranged.Components;
  5. // I have tried to make this as generic as possible but "delete joint on cycle / right-click reels in" is very specific behavior.
  6. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  7. public sealed partial class GrapplingGunComponent : Component
  8. {
  9. /// <summary>
  10. /// Hook's reeling force and speed - the higher the number, the faster the hook rewinds.
  11. /// </summary>
  12. [DataField, AutoNetworkedField]
  13. public float ReelRate = 2.5f;
  14. [DataField("jointId"), AutoNetworkedField]
  15. public string Joint = string.Empty;
  16. [DataField, AutoNetworkedField]
  17. public EntityUid? Projectile;
  18. [ViewVariables(VVAccess.ReadWrite), DataField("reeling"), AutoNetworkedField]
  19. public bool Reeling;
  20. [ViewVariables(VVAccess.ReadWrite), DataField("reelSound"), AutoNetworkedField]
  21. public SoundSpecifier? ReelSound = new SoundPathSpecifier("/Audio/Weapons/reel.ogg")
  22. {
  23. Params = AudioParams.Default.WithLoop(true)
  24. };
  25. [ViewVariables(VVAccess.ReadWrite), DataField("cycleSound"), AutoNetworkedField]
  26. public SoundSpecifier? CycleSound = new SoundPathSpecifier("/Audio/Weapons/Guns/MagIn/kinetic_reload.ogg");
  27. [DataField, ViewVariables]
  28. public SpriteSpecifier RopeSprite =
  29. new SpriteSpecifier.Rsi(new ResPath("Objects/Weapons/Guns/Launchers/grappling_gun.rsi"), "rope");
  30. public EntityUid? Stream;
  31. }