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