Files

32 lines
999 B
C#
Raw Permalink Normal View History

2024-12-15 00:40:43 +10:00
using Content.Shared._CP14.Fishing.Components;
using Content.Shared._CP14.Fishing.Systems;
using Content.Shared.Interaction;
2024-12-01 04:28:25 +10:00
namespace Content.Server._CP14.Fishing;
2024-12-15 00:40:43 +10:00
public sealed class CP14FishingRodSystem : CP14SharedFishingRodSystem
{
[Dependency] private readonly CP14FishingProcessSystem _fishingProcess = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14FishingPoolComponent, AfterInteractUsingEvent>(OnAfterInteractUsing);
}
private void OnAfterInteractUsing(Entity<CP14FishingPoolComponent> entity, ref AfterInteractUsingEvent args)
{
if (args.Handled || !args.CanReach)
return;
if (!TryComp<CP14FishingRodComponent>(args.Used, out var fishingRodComponent))
return;
if (fishingRodComponent.Process is not null)
return;
fishingRodComponent.Process = _fishingProcess.Start((args.Used, fishingRodComponent), entity, args.User);
}
}