From 29cbf0560f5ff9c526269c8128dd385ac0a1bccd Mon Sep 17 00:00:00 2001 From: Deserty0 Date: Wed, 29 Oct 2025 23:06:20 +1000 Subject: [PATCH] Cleanup --- .../Fishing/UI/CP14FishingWindow.xaml.cs | 2 +- .../_CP14/Fishing/CP14FishingSystem.cs | 128 +++++++++++++++++- .../Fishing/Behaviors/CP14FishBaseBehavior.cs | 22 ++- .../Fishing/CP14FishingMinigamePrototype.cs | 23 +++- ...mponents.cs => CP14FishingSerializable.cs} | 2 +- .../_CP14/Fishing/CP14SharedFishingSystem.cs | 113 ++++------------ .../Fishing/Components/CP14FishComponent.cs | 37 ++++- .../Components/CP14FishingPondComponent.cs | 10 +- .../Components/CP14FishingRodComponent.cs | 73 ++++++++-- .../Entities/Objects/Tools/fishing_rod.yml | 3 +- 10 files changed, 289 insertions(+), 124 deletions(-) rename Content.Shared/_CP14/Fishing/{Components/CP14FishingComponents.cs => CP14FishingSerializable.cs} (88%) diff --git a/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs index 556ab0e789..d2828f4f42 100644 --- a/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs +++ b/Content.Client/_CP14/Fishing/UI/CP14FishingWindow.xaml.cs @@ -66,7 +66,7 @@ public sealed partial class CP14FishingWindow : BaseWindow return; var floatBox = CalculateUIBox(_fishingMinigame.Float, rodComponent.FloatPosition); - var fishBox = CalculateUIBox(_fishingMinigame.FishIcon, fishComponent.FishPosAndDestination.X); + var fishBox = CalculateUIBox(_fishingMinigame.FishIcon, fishComponent.Position); handle.DrawTextureRect(_floatTexture, floatBox); handle.DrawTextureRect(_fishTexture, fishBox); diff --git a/Content.Server/_CP14/Fishing/CP14FishingSystem.cs b/Content.Server/_CP14/Fishing/CP14FishingSystem.cs index d89835426f..9bf3003d33 100644 --- a/Content.Server/_CP14/Fishing/CP14FishingSystem.cs +++ b/Content.Server/_CP14/Fishing/CP14FishingSystem.cs @@ -1,5 +1,131 @@ +using System.Linq; +using System.Numerics; using Content.Shared._CP14.Fishing; +using Content.Shared._CP14.Fishing.Components; +using Content.Shared.EntityTable; +using Robust.Server.GameObjects; +using Robust.Server.GameStates; +using Robust.Server.Player; +using Robust.Shared.Map; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using Robust.Shared.Timing; namespace Content.Server._CP14.Fishing; -public sealed class CP14FishingSystem : CP14SharedFishingSystem; +public sealed class CP14FishingSystem : CP14SharedFishingSystem +{ + [Dependency] private readonly EntityTableSystem _entityTable = default!; + [Dependency] private readonly MetaDataSystem _meta = default!; + [Dependency] private readonly MapSystem _map = default!; + [Dependency] private readonly PvsOverrideSystem _pvs= default!; + [Dependency] private readonly IPlayerManager _player = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; + + private MapId? _mapId; + + private EntityQuery _pondQuery; + private EntityQuery _fishQuery; + + public override void Initialize() + { + base.Initialize(); + + _pondQuery = GetEntityQuery(); + _fishQuery = GetEntityQuery(); + } + + public override void Update(float frameTime) + { + base.Update(frameTime); + + base.Update(frameTime); + + var curTime = _gameTiming.CurTime; + var query = EntityQueryEnumerator(); + + // Seeding prediction doesnt work + while (query.MoveNext(out var uid, out var fishRod)) + { + if (fishRod.User is null) + continue; + + if (fishRod.FishingFloat is null) + continue; + + if (fishRod.Target is null) + continue; + + var fish = fishRod.CaughtFish; + + if (fishRod.CaughtFish is not null && + _fishQuery.TryComp(fish, out var fishComp)) //TODO: remove multiple fish TryComp in next functions + continue; + + TryToCatchFish((uid, fishRod), curTime); + } + } + + /// + /// Tries to cath fish + /// + private bool TryToCatchFish(Entity rod, TimeSpan curTime) + { + if (rod.Comp.CaughtFish is not null) + return false; + + if (curTime < rod.Comp.FishingTime) + return false; + + var pond = rod.Comp.Target; + if (!_pondQuery.TryComp(pond, out var pondComp)) + return false; + + if (pondComp.LootTable is null) + return false; + + if (_proto.TryIndex(pondComp.LootTable, out var lootTable)) + return false; + + if (lootTable is null) + return false; + + var fishes = _entityTable.GetSpawns(lootTable, _random.GetRandom()); + var fishId = fishes.First(); + + EnsurePausedMap(); + var fish = PredictedSpawnAtPosition(fishId, new EntityCoordinates(_map.GetMap(_mapId!.Value), Vector2.Zero)); + + if (!_player.TryGetSessionByEntity(rod.Comp.User!.Value, out var session)) + return false; + + if (!_fishQuery.TryComp(fish, out var fishComp)) + return false; + + _pvs.AddSessionOverride(fish, session); + + rod.Comp.CaughtFish = fish; + fishComp.GetAwayTime = curTime; + fishComp.GetAwayTime += TimeSpan.FromSeconds(_random.NextDouble(rod.Comp.MinAwaitTime, rod.Comp.MaxAwaitTime)); + DirtyField(rod, rod.Comp, nameof(CP14FishingRodComponent.CaughtFish)); + DirtyField(fish, fishComp, nameof(CP14FishComponent.GetAwayTime)); + + return true; + } + + /// + /// Ensures that paused map exists + /// + private void EnsurePausedMap() + { + if (_map.MapExists(_mapId)) + return; + + var mapUid = _map.CreateMap(out var newMapId); + _meta.SetEntityName(mapUid, Loc.GetString("fishing-paused-map-name")); + _mapId = newMapId; + _map.SetPaused(mapUid, true); + } +} diff --git a/Content.Shared/_CP14/Fishing/Behaviors/CP14FishBaseBehavior.cs b/Content.Shared/_CP14/Fishing/Behaviors/CP14FishBaseBehavior.cs index e29f844d80..d53f7f38b6 100644 --- a/Content.Shared/_CP14/Fishing/Behaviors/CP14FishBaseBehavior.cs +++ b/Content.Shared/_CP14/Fishing/Behaviors/CP14FishBaseBehavior.cs @@ -10,15 +10,16 @@ public abstract partial class CP14FishBaseBehavior /// /// Calculates fish position /// - /// Robust random - /// Current fish coordinates - /// Calculated fish coordinates - public Vector2 TryCalculatePosition(IRobustRandom random, Vector2 fishCords) + /// Robust random interface + /// Current position of fish + /// Fish destination + /// Calculated fish position + public float TryCalculatePosition(IRobustRandom random, float fishPos, float fishDest) { var speed = CalculateSpeed(random); - var nextPos = float.Lerp(fishCords.X, fishCords.Y, speed); + var nextPos = float.Lerp(fishPos, fishDest, speed); - return new Vector2(nextPos, fishCords.Y); + return nextPos; } /// @@ -26,12 +27,21 @@ public abstract partial class CP14FishBaseBehavior /// public abstract float CalculateSpeed(IRobustRandom random); + /// + /// Speed of a fish + /// [DataField] public float Speed = 0.25f; + /// + /// Salt of speed calculations + /// [DataField] public float Difficulty = 2f; + /// + /// Base time which fish will wait in destination before selecting new + /// [DataField] public TimeSpan BaseWaitTime = TimeSpan.FromSeconds(5); } diff --git a/Content.Shared/_CP14/Fishing/CP14FishingMinigamePrototype.cs b/Content.Shared/_CP14/Fishing/CP14FishingMinigamePrototype.cs index 492814aeec..6f69a9f924 100644 --- a/Content.Shared/_CP14/Fishing/CP14FishingMinigamePrototype.cs +++ b/Content.Shared/_CP14/Fishing/CP14FishingMinigamePrototype.cs @@ -5,7 +5,7 @@ using Robust.Shared.Utility; namespace Content.Shared._CP14.Fishing; /// -/// Prototype of fishing minigame stylesheet. +/// Prototype of fishing minigame. Starter position of minigame in the bottom /// [Prototype("CP14FishingMinigameStyle")] public sealed class CP14FishingMinigamePrototype : IPrototype @@ -13,18 +13,33 @@ public sealed class CP14FishingMinigamePrototype : IPrototype [IdDataField] public string ID { get; } = default!; + /// + /// Fishing minigame background data + /// [DataField(required: true)] public FishingMinigameElementData Background; + /// + /// Fishing minigame fish icon data + /// [DataField(required: true)] public FishingMinigameElementData FishIcon; + /// + /// Fishing minigame progressbar data + /// [DataField(required: true)] public FishingMinigameElementData Progressbar; + /// + /// Fishing minigame float data + /// [DataField(required: true)] public FishingMinigameElementData Float; + /// + /// Size of the area where the float and fish will move + /// [DataField(required: true)] public float FishingMinigameSize; } @@ -33,17 +48,17 @@ public sealed class CP14FishingMinigamePrototype : IPrototype public partial struct FishingMinigameElementData { /// - /// Texture path. + /// Texture path /// [DataField(required: true)] public ResPath Texture; /// - /// Size of a texture. + /// Size of a texture /// [DataField(required: true)] public Vector2 Size; /// - /// Offset from bottom left corner. Starter position in the bottom. + /// Offset from bottom left corner /// [DataField(required: true)] public Vector2 Offset; } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishingComponents.cs b/Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs similarity index 88% rename from Content.Shared/_CP14/Fishing/Components/CP14FishingComponents.cs rename to Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs index f5b047ce8b..915fa19f04 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishingComponents.cs +++ b/Content.Shared/_CP14/Fishing/CP14FishingSerializable.cs @@ -1,6 +1,6 @@ using Robust.Shared.Serialization; -namespace Content.Shared._CP14.Fishing.Components; +namespace Content.Shared._CP14.Fishing; /// /// Key for CP14FishingBoundUserInterface diff --git a/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs b/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs index 3b658693c5..1722371b04 100644 --- a/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs +++ b/Content.Shared/_CP14/Fishing/CP14SharedFishingSystem.cs @@ -18,32 +18,22 @@ namespace Content.Shared._CP14.Fishing; public abstract class CP14SharedFishingSystem : EntitySystem { - [Dependency] private readonly EntityTableSystem _entityTable = default!; - [Dependency] private readonly MetaDataSystem _meta = default!; - [Dependency] private readonly SharedMapSystem _map = default!; - [Dependency] private readonly SharedPvsOverrideSystem _pvs= default!; [Dependency] private readonly SharedHandsSystem _hands = default!; [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!; [Dependency] private readonly SharedUserInterfaceSystem _userInterface = default!; - [Dependency] private readonly ISharedPlayerManager _player = default!; [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly INetManager _net = default!; - private MapId? _mapId; - - private EntityQuery _fishQuery; - private EntityQuery _pondQuery; + private EntityQuery _fishQuery; public override void Initialize() { base.Initialize(); _fishQuery = GetEntityQuery(); - _pondQuery = GetEntityQuery(); SubscribeLocalEvent(OnInteract); SubscribeLocalEvent(OnDropEvent); @@ -60,7 +50,6 @@ public abstract class CP14SharedFishingSystem : EntitySystem // Seeding prediction doesnt work while (query.MoveNext(out var uid, out var fishRod)) { - _random.SetSeed((int)_gameTiming.CurTick.Value + GetNetEntity(uid).Id); if (fishRod.User is null) continue; @@ -80,7 +69,8 @@ public abstract class CP14SharedFishingSystem : EntitySystem if (fishRod.CaughtFish is not null && _fishQuery.TryComp(fish, out var fishComp)) //TODO: remove multiple fish TryComp in next functions continue; - TryToCatchFish((uid, fishRod), curTime); + _random.SetSeed((int)_gameTiming.CurTick.Value + GetNetEntity(uid).Id); + UpdateFishWaitingStatus((uid, fishRod), curTime); UpdatePositions((uid, fishRod), curTime); } @@ -88,8 +78,8 @@ public abstract class CP14SharedFishingSystem : EntitySystem /// /// Handles float and fish positions updates - /// Please burn it down /// + /// Please burn it down private void UpdatePositions(Entity rod, TimeSpan curTime) { if (rod.Comp.CaughtFish is null) @@ -121,34 +111,34 @@ public abstract class CP14SharedFishingSystem : EntitySystem Math.Clamp(floatPosition - floatSpeed, 0, maxCord); } - var fishPos = fishComp.FishPosAndDestination.X; - var fishDest = fishComp.FishPosAndDestination.Y; - var fishBaseWaitTime = fishComp.FishBehavior.BaseWaitTime; + var fishPos = fishComp.Position; + var fishDest = fishComp.Destination; + var fishBaseWaitTime = fishComp.Behavior.BaseWaitTime; if (Math.Abs(fishPos - fishDest) < 0.1f) { UpdateFishDestination((fish.Value, fishComp), curTime, maxCord); - fishComp.FishSelectPosTime = curTime + fishBaseWaitTime + fishBaseWaitTime * 0.2 * _random.NextFloat(-1, 1); + fishComp.SelectPosTime = curTime + fishBaseWaitTime + fishBaseWaitTime * 0.2 * _random.NextFloat(-1, 1); } else { - fishComp.FishPosAndDestination = fishComp.FishBehavior.TryCalculatePosition(_random, fishComp.FishPosAndDestination); + fishComp.Position = fishComp.Behavior.TryCalculatePosition(_random, fishComp.Position, fishComp.Destination); } DirtyField(rod, rod.Comp, nameof(CP14FishingRodComponent.FloatPosition)); - DirtyField(fish.Value, fishComp, nameof(CP14FishComponent.FishPosAndDestination)); + DirtyField(fish.Value, fishComp, nameof(CP14FishComponent.Position)); } /// - /// Handles updating fish destination + /// Calculates new fish destination /// private void UpdateFishDestination(Entity fish, TimeSpan curTime, float maxCord) { - if (curTime < fish.Comp.FishSelectPosTime) + if (curTime < fish.Comp.SelectPosTime) return; - fish.Comp.FishPosAndDestination.X = _random.NextFloat(0, maxCord); - DirtyField(fish, fish.Comp, nameof(CP14FishComponent.FishPosAndDestination)); + fish.Comp.Destination = _random.NextFloat(0, maxCord); + DirtyField(fish, fish.Comp, nameof(CP14FishComponent.Destination)); } /// @@ -179,7 +169,7 @@ public abstract class CP14SharedFishingSystem : EntitySystem return; } - if (curTime < fishComp.FishGetAwayTime) + if (curTime < fishComp.GetAwayTime) return; rod.Comp.CaughtFish = null; @@ -187,56 +177,6 @@ public abstract class CP14SharedFishingSystem : EntitySystem PredictedDel(fish); } - /// - /// Handles fish catching - /// - private bool TryToCatchFish(Entity rod, TimeSpan curTime) - { - if (!_net.IsServer) - return false; - - if (rod.Comp.CaughtFish is not null) - return false; - - if (curTime < rod.Comp.FishingTime) - return false; - - var pond = rod.Comp.Target; - if (!_pondQuery.TryComp(pond, out var pondComp)) - return false; - - if (pondComp.LootTable is null) - return false; - - if (_proto.TryIndex(pondComp.LootTable, out var lootTable)) - return false; - - if (lootTable is null) - return false; - - var fishes = _entityTable.GetSpawns(lootTable, _random.GetRandom()); - var fishId = fishes.First(); - - EnsurePausedMap(); - var fish = PredictedSpawnAtPosition(fishId, new EntityCoordinates(_map.GetMap(_mapId!.Value), Vector2.Zero)); - - if (!_player.TryGetSessionByEntity(rod.Comp.User!.Value, out var session)) - return false; - - if (!_fishQuery.TryComp(fish, out var fishComp)) - return false; - - _pvs.AddSessionOverride(fish, session); - - rod.Comp.CaughtFish = fish; - fishComp.FishGetAwayTime = curTime; - fishComp.FishGetAwayTime += TimeSpan.FromSeconds(_random.NextDouble(rod.Comp.MinAwaitTime, rod.Comp.MaxAwaitTime)); - DirtyField(rod, rod.Comp, nameof(CP14FishingRodComponent.CaughtFish)); - DirtyField(fish, fishComp, nameof(CP14FishComponent.FishGetAwayTime)); - - return true; - } - /// /// Validates if user is still in range of fishing float /// @@ -266,6 +206,9 @@ public abstract class CP14SharedFishingSystem : EntitySystem nameof(CP14FishingRodComponent.FishHooked)); } + /// + /// Sets to user button status + /// private void OnReelingMessage(CP14FishingReelKeyMessage msg, EntitySessionEventArgs args) { if (args.SenderSession.AttachedEntity is not { } player) @@ -279,6 +222,9 @@ public abstract class CP14SharedFishingSystem : EntitySystem DirtyField(activeItem.Value, fishingRodComponent, nameof(CP14FishingRodComponent.Reeling)); } + /// + /// Starts new fishing process when user interacts with pond using fishing rod + /// private void OnInteract(Entity rod, ref AfterInteractEvent args) { if (args.Handled) @@ -307,6 +253,9 @@ public abstract class CP14SharedFishingSystem : EntitySystem ThrowFishingFloat(rod, args.Target.Value); } + /// + /// Deletes link + /// private void OnDropEvent(Entity rod, ref DroppedEvent args) { rod.Comp.User = null; @@ -333,18 +282,4 @@ public abstract class CP14SharedFishingSystem : EntitySystem _throwing.TryThrow(fishingFloat, targetCoords, rod.Comp.ThrowPower, recoil: false, doSpin: false); } - - private void EnsurePausedMap() - { - if (!_net.IsServer) - return; - - if (_map.MapExists(_mapId)) - return; - - var mapUid = _map.CreateMap(out var newMapId); - _meta.SetEntityName(mapUid, Loc.GetString("fishing-paused-map-name")); - _mapId = newMapId; - _map.SetPaused(mapUid, true); - } } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs b/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs index 61009d2476..79acf576d0 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs +++ b/Content.Shared/_CP14/Fishing/Components/CP14FishComponent.cs @@ -4,24 +4,51 @@ using Robust.Shared.GameStates; namespace Content.Shared._CP14.Fishing.Components; -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), AutoGenerateComponentPause] +/// +/// Component for fish, that can be caught via fishing +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), AutoGenerateComponentPause, Access(typeof(CP14SharedFishingSystem))] public sealed partial class CP14FishComponent : Component { + /// + /// Fish behaviour that will be used for speed calculations + /// [DataField(required: true), ViewVariables] - public CP14FishBaseBehavior FishBehavior = default!; + public CP14FishBaseBehavior Behavior; + /// + /// Time when fish will select next position + /// [AutoNetworkedField, AutoPausedField, ViewVariables] - public TimeSpan FishSelectPosTime = TimeSpan.Zero; + public TimeSpan SelectPosTime = TimeSpan.Zero; + /// + /// Time when the fish will get away if it is not hooked + /// [AutoNetworkedField, AutoPausedField, ViewVariables] - public TimeSpan FishGetAwayTime = TimeSpan.Zero; + public TimeSpan GetAwayTime = TimeSpan.Zero; + /// + /// Fish current position in minigame coordinates + /// [AutoNetworkedField, ViewVariables] - public Vector2 FishPosAndDestination; + public float Position; + /// + /// Fish destination in minigame coordinates + /// + [AutoNetworkedField, ViewVariables] + public float Destination; + + /// + /// Minimal time before fish will get away + /// [DataField] public double MinAwaitTime = 5; + /// + /// Maximum time before fish will get away + /// [DataField] public double MaxAwaitTime = 10; } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishingPondComponent.cs b/Content.Shared/_CP14/Fishing/Components/CP14FishingPondComponent.cs index 74d0edc849..fc7fd6e01f 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishingPondComponent.cs +++ b/Content.Shared/_CP14/Fishing/Components/CP14FishingPondComponent.cs @@ -1,12 +1,18 @@ -using System.Runtime.Serialization; using Content.Shared.EntityTable; +using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Shared._CP14.Fishing.Components; -[RegisterComponent] +/// +/// Component for fishing ponds +/// +[RegisterComponent, NetworkedComponent, Access(typeof(CP14SharedFishingSystem))] public sealed partial class CP14FishingPondComponent : Component { + /// + /// LootTable of loot that can be caught in this pond. Only first spawn will be caught + /// [DataField] public ProtoId? LootTable; } diff --git a/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs b/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs index 48a6b1d6fc..d2c5fa7229 100644 --- a/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs +++ b/Content.Shared/_CP14/Fishing/Components/CP14FishingRodComponent.cs @@ -6,53 +6,100 @@ namespace Content.Shared._CP14.Fishing.Components; /// /// Allows to fish with this item /// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true, true), AutoGenerateComponentPause] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true, true), AutoGenerateComponentPause, Access(typeof(CP14SharedFishingSystem))] public sealed partial class CP14FishingRodComponent : Component { // Vars + + /// + /// Link to a fishing float, attached to rod + /// [AutoNetworkedField, ViewVariables] public EntityUid? FishingFloat; + /// + /// Link to fishing rod user + /// [AutoNetworkedField, ViewVariables] public EntityUid? User; - [AutoNetworkedField, ViewVariables] - public float FloatPosition = 0f; - - [AutoNetworkedField, AutoPausedField, ViewVariables] - public TimeSpan FishingTime = TimeSpan.Zero; - + /// + /// Link to caught fish + /// [AutoNetworkedField, ViewVariables] public EntityUid? CaughtFish; - [AutoNetworkedField, ViewVariables] - public bool Reeling; - - [AutoNetworkedField, ViewVariables] - public bool FishHooked; - + /// + /// Link to a target fishing pond + /// [AutoNetworkedField, ViewVariables] public EntityUid? Target; + /// + /// Float position in minigame coordinates + /// + [AutoNetworkedField, ViewVariables] + public float FloatPosition = 0f; + + /// + /// Time when fish will be caught + /// + [AutoNetworkedField, AutoPausedField, ViewVariables] + public TimeSpan FishingTime = TimeSpan.Zero; + + /// + /// Does the user pull the fishing line + /// + [AutoNetworkedField, ViewVariables] + public bool Reeling; + + /// + /// Is fish hooked + /// + [AutoNetworkedField, ViewVariables] + public bool FishHooked; + // Data definitions + + /// + /// Fishing float prototype + /// [DataField] public EntProtoId FloatPrototype = "CP14DefaultFishingFloat"; + /// + /// Fishing minigame prototype + /// [DataField] public ProtoId FishingMinigame = "Default"; + /// + /// Speed of a float in minigame coordinates + /// [DataField] public float FloatSpeed = 2f; + /// + /// Max distance between rod and float + /// [DataField] public float MaxFishingDistance = 5f; + /// + /// Power with which float will be thrown + /// [DataField] public float ThrowPower = 10f; + /// + /// Minimal time before fish will be caught + /// [DataField] public double MinAwaitTime = 5; + /// + /// Maximum time before fish will be caught + /// [DataField] public double MaxAwaitTime = 20; } diff --git a/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml b/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml index 2a9b356149..8d144ab3ce 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/Tools/fishing_rod.yml @@ -54,8 +54,7 @@ id: CP14DefaultFishingFloat name: Fishing float description: Little floating ball. - suffix: DO NOT MAP - categories: [ ForkFiltered, DoNotMap] + categories: [ HideSpawnMenu ] components: - type: Sprite sprite: _CP14/Objects/Tools/float.rsi