From 4c121fb26503548599dafae9338bd7ea64f83d84 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 17:54:50 -0500 Subject: [PATCH 01/31] cargo destinations, WIP --- .../_NF/Trade/TradeCrateComponent.cs | 11 + .../_NF/Trade/TradeCrateVisualizerSystem.cs | 53 ++++ .../Cargo/Systems/CargoSystem.Shuttle.cs | 1 + Content.Server/Cargo/Systems/CargoSystem.cs | 5 +- .../Cargo/Systems/CargoSystem.TradeCrates.cs | 85 +++++++ .../_NF/GameRule/NfAdventureRuleSystem.cs | 13 +- .../_NF/Trade/TradeCrateComponent.cs | 56 +++++ .../Trade/TradeCrateDestinationComponent.cs | 15 ++ .../Access/Systems/AccessReaderSystem.cs | 2 +- Content.Shared/Lock/LockSystem.cs | 3 - .../_NF/Trade/SharedTradeCrateComponent.cs | 8 + .../_NF/Trade/TradeCrateComponent.cs | 9 - .../TradeCrateDestinationIconPrototype.cs | 24 ++ Content.Shared/_NF/Trade/TradeCrateVisuals.cs | 13 + .../Storage/Crates/base_structurecrates.yml | 14 +- .../Structures/Storage/Crates/crates.yml | 49 ++-- .../_NF/PointsOfInterest/depots.yml | 6 +- .../_NF/trade_crate_destination_icons.yml | 227 ++++++++++++++++++ .../cargo_destination_icons.rsi/anomalous.png | Bin 0 -> 143 bytes .../cargo_destination_icons.rsi/beacon.png | Bin 0 -> 134 bytes .../cargo_destination_icons.rsi/cargo_a.png | Bin 0 -> 136 bytes .../cargo_destination_icons.rsi/cargo_b.png | Bin 0 -> 135 bytes .../cargo_destination_icons.rsi/cargo_c.png | Bin 0 -> 139 bytes .../cargo_destination_icons.rsi/cargo_d.png | Bin 0 -> 136 bytes .../cargo_destination_icons.rsi/cargo_e.png | Bin 0 -> 128 bytes .../cargo_destination_icons.rsi/cargo_f.png | Bin 0 -> 130 bytes .../cargo_destination_icons.rsi/cargo_g.png | Bin 0 -> 133 bytes .../cargo_destination_icons.rsi/cargo_h.png | Bin 0 -> 129 bytes .../cargo_destination_icons.rsi/cargo_i.png | Bin 0 -> 130 bytes .../cargo_destination_icons.rsi/cargo_j.png | Bin 0 -> 136 bytes .../cargo_destination_icons.rsi/cargo_k.png | Bin 0 -> 132 bytes .../cargo_destination_icons.rsi/cargo_l.png | Bin 0 -> 126 bytes .../cargo_destination_icons.rsi/cargo_m.png | Bin 0 -> 130 bytes .../cargo_destination_icons.rsi/cargo_n.png | Bin 0 -> 129 bytes .../cargo_destination_icons.rsi/cargo_o.png | Bin 0 -> 139 bytes .../cargo_other.png | Bin 0 -> 155 bytes .../cargo_destination_icons.rsi/cargo_p.png | Bin 0 -> 138 bytes .../cargo_priority_active.png | Bin 0 -> 244 bytes .../cargo_priority_inactive.png | Bin 0 -> 232 bytes .../cargo_destination_icons.rsi/cargo_q.png | Bin 0 -> 137 bytes .../cargo_destination_icons.rsi/cargo_r.png | Bin 0 -> 132 bytes .../cargo_destination_icons.rsi/cargo_s.png | Bin 0 -> 143 bytes .../cargo_destination_icons.rsi/cargo_t.png | Bin 0 -> 128 bytes .../cargo_destination_icons.rsi/cargo_u.png | Bin 0 -> 126 bytes .../cargo_destination_icons.rsi/cargo_v.png | Bin 0 -> 132 bytes .../cargo_destination_icons.rsi/cargo_x.png | Bin 0 -> 135 bytes .../cargo_destination_icons.rsi/cargo_y.png | Bin 0 -> 128 bytes .../cargo_destination_icons.rsi/cargo_z.png | Bin 0 -> 140 bytes .../cargo_destination_icons.rsi/caseys.png | Bin 0 -> 139 bytes .../courthouse.png | Bin 0 -> 132 bytes .../cargo_destination_icons.rsi/edison.png | Bin 0 -> 148 bytes .../cargo_destination_icons.rsi/frontier.png | Bin 0 -> 145 bytes .../cargo_destination_icons.rsi/lodge.png | Bin 0 -> 146 bytes .../cargo_destination_icons.rsi/mchobo.png | Bin 0 -> 121 bytes .../medical_poi.png | Bin 0 -> 153 bytes .../cargo_destination_icons.rsi/meta.json | 128 ++++++++++ .../cargo_destination_icons.rsi/prison.png | Bin 0 -> 130 bytes .../cargo_destination_icons.rsi/tinnias.png | Bin 0 -> 145 bytes .../cargo_destination_icons.rsi/trade.png | Bin 0 -> 151 bytes 59 files changed, 687 insertions(+), 35 deletions(-) create mode 100644 Content.Client/_NF/Trade/TradeCrateComponent.cs create mode 100644 Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs create mode 100644 Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs create mode 100644 Content.Server/_NF/Trade/TradeCrateComponent.cs create mode 100644 Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs create mode 100644 Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs delete mode 100644 Content.Shared/_NF/Trade/TradeCrateComponent.cs create mode 100644 Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs create mode 100644 Content.Shared/_NF/Trade/TradeCrateVisuals.cs create mode 100644 Resources/Prototypes/_NF/trade_crate_destination_icons.yml create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/anomalous.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/beacon.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_a.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_b.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_c.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_d.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_e.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_f.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_g.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_h.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_i.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_j.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_k.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_l.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_m.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_n.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_o.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_other.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_p.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_active.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_inactive.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_q.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_r.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_s.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_t.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_u.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_v.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_x.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_y.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_z.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/caseys.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/courthouse.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/edison.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/frontier.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/lodge.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/mchobo.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/medical_poi.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/prison.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/tinnias.png create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/trade.png diff --git a/Content.Client/_NF/Trade/TradeCrateComponent.cs b/Content.Client/_NF/Trade/TradeCrateComponent.cs new file mode 100644 index 00000000000..0565a97c367 --- /dev/null +++ b/Content.Client/_NF/Trade/TradeCrateComponent.cs @@ -0,0 +1,11 @@ +using Content.Shared._NF.Trade; + +namespace Content.Client._NF.Trade; + +/// +/// This is used to mark an entity to be used as a trade crate +/// +[RegisterComponent] +public sealed partial class TradeCrateComponent : SharedTradeCrateComponent +{ +} diff --git a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs new file mode 100644 index 00000000000..d09179c4773 --- /dev/null +++ b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs @@ -0,0 +1,53 @@ +using Content.Shared._NF.Trade; +using Robust.Client.GameObjects; +using Robust.Shared.Prototypes; + +namespace Content.Client._NF.Trade; + +/// +/// Visualizer for trade crates, largely based on Nyano's mail visualizer (thank you) +/// +public sealed class TradeCrateVisualizerSystem : VisualizerSystem +{ + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly IPrototypeManager _prototypeManager = default!; + [Dependency] private readonly SpriteSystem _spriteSystem = default!; + + private const string FallbackIconID = "CargoUnknown"; + private const string CargoPriorityActiveState = "cargo_priority"; + private const string CargoPriorityInactiveState = "cargo_priority_inactive"; + + protected override void OnAppearanceChange(EntityUid uid, TradeCrateComponent component, ref AppearanceChangeEvent args) + { + if (args.Sprite == null) + return; + + _appearance.TryGetData(uid, TradeCrateVisuals.DestinationIcon, out string job, args.Component); + + if (string.IsNullOrEmpty(job)) + job = FallbackIconID; + + if (!_prototypeManager.TryIndex(job, out var icon)) + icon = _prototypeManager.Index(FallbackIconID); + + args.Sprite.LayerSetTexture(TradeCrateVisualLayers.Icon, _spriteSystem.Frame0(icon.Icon)); + if (_appearance.TryGetData(uid, TradeCrateVisuals.IsPriority, out bool isPriority) && isPriority) + { + args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Priority, true); + if (_appearance.TryGetData(uid, TradeCrateVisuals.IsPriorityInactive, out bool inactive) && inactive) + args.Sprite.LayerSetState(TradeCrateVisualLayers.Priority, CargoPriorityInactiveState); + else + args.Sprite.LayerSetState(TradeCrateVisualLayers.Priority, CargoPriorityActiveState); + } + else + { + args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Priority, false); + } + } +} + +public enum TradeCrateVisualLayers : byte +{ + Icon, + Priority +} diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 2270374fb86..391f87f5b4b 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -374,6 +374,7 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, private void OnRoundRestart(RoundRestartCleanupEvent ev) { Reset(); + CleanupTradeCrateDestinations(ev); // Frontier } } diff --git a/Content.Server/Cargo/Systems/CargoSystem.cs b/Content.Server/Cargo/Systems/CargoSystem.cs index 5744584b839..8a8741bf06b 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.cs @@ -19,7 +19,7 @@ using Robust.Shared.Timing; using Robust.Shared.Random; using Content.Server._NF.SectorServices; // Frontier -using Content.Shared._NF.Trade.Components; // Frontier +using Content.Shared._NF.Trade; // Frontier using Content.Shared.Whitelist; // Frontier namespace Content.Server.Cargo.Systems; @@ -50,7 +50,6 @@ public sealed partial class CargoSystem : SharedCargoSystem private EntityQuery _xformQuery; private EntityQuery _blacklistQuery; - private EntityQuery _tradeCrateQuery; private EntityQuery _mobQuery; private EntityQuery _tradeQuery; @@ -64,7 +63,6 @@ public override void Initialize() _xformQuery = GetEntityQuery(); _blacklistQuery = GetEntityQuery(); - _tradeCrateQuery = GetEntityQuery(); _mobQuery = GetEntityQuery(); _tradeQuery = GetEntityQuery(); @@ -74,6 +72,7 @@ public override void Initialize() InitializeBounty(); // Frontier: add specific initialization calls here. InitializePirateBounty(); + InitializeTradeCrates(); // End Frontier } diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs new file mode 100644 index 00000000000..0ce3773bf54 --- /dev/null +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -0,0 +1,85 @@ +using System.Threading; +using Content.Server._NF.Trade; +using Content.Shared._NF.Trade; +using Content.Shared.GameTicking; +using Timer = Robust.Shared.Timing.Timer; + +namespace Content.Server.Cargo.Systems; // Needs to collide with base namespace + +public sealed partial class CargoSystem +{ + private List _destinations = new(); + + private void InitializeTradeCrates() + { + SubscribeLocalEvent(OnTradeCrateGetPriceEvent); + SubscribeLocalEvent(OnTradeCrateInit); + SubscribeLocalEvent(OnTradeCrateRemove); + + SubscribeLocalEvent(OnDestinationInit); + SubscribeLocalEvent(OnDestinationRemove); + } + + private void OnTradeCrateGetPriceEvent(EntityUid uid, TradeCrateComponent component, ref PriceCalculationEvent ev) + { + bool isDestinated = component.DestinationStation != EntityUid.Invalid && _station.GetOwningStation(uid) == component.DestinationStation; + ev.Price = isDestinated ? component.ValueAtDestination : component.ValueElsewhere; + if (component.ExpressDeliveryTime != null) + { + ev.Price += _timing.CurTime <= component.ExpressDeliveryTime ? component.ExpressOnTimeBonus : component.ExpressLatePenalty; + } + } + + private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref ComponentInit ev) + { + if (_destinations.Count > 0) + { + var destination = _destinations[_random.Next(_destinations.Count)]; + component.DestinationStation = destination; + if (TryComp(destination, out var destComp)) + _appearance.SetData(uid, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto); + } + else + { + // No destination, everywhere is elsewhere, throw the courier a bone. + component.ValueElsewhere = component.ValueAtDestination; + } + + if (component.ExpressDeliveryDuration > TimeSpan.Zero) + { + component.ExpressDeliveryTime = _timing.CurTime + component.ExpressDeliveryDuration; + _appearance.SetData(uid, TradeCrateVisuals.IsPriority, true); + + component.PriorityCancelToken = new CancellationTokenSource(); + Timer.Spawn((int)component.ExpressDeliveryDuration.TotalMilliseconds, + () => DisableTradeCratePriority(uid, component), + component.PriorityCancelToken.Token); + } + } + + private void OnTradeCrateRemove(EntityUid uid, TradeCrateComponent component, ref ComponentRemove ev) + { + component.PriorityCancelToken?.Cancel(); + } + + private void DisableTradeCratePriority(EntityUid uid, TradeCrateComponent component) + { + _appearance.SetData(uid, TradeCrateVisuals.IsPriorityInactive, true); + } + + private void OnDestinationInit(EntityUid uid, TradeCrateDestinationComponent component, ref ComponentInit ev) + { + if (!_destinations.Contains(uid)) + _destinations.Add(uid); + } + + private void OnDestinationRemove(EntityUid uid, TradeCrateDestinationComponent component, ref ComponentRemove ev) + { + _destinations.Remove(uid); + } + + private void CleanupTradeCrateDestinations(RoundRestartCleanupEvent ev) + { + _destinations.Clear(); + } +} diff --git a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs index 5ee7e6e8b7a..0e662f01759 100644 --- a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs +++ b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs @@ -29,7 +29,7 @@ using Content.Shared.GameTicking; using Robust.Shared.Enums; using Robust.Server.Player; -using Content.Server.Warps; +using Content.Server._NF.Trade; namespace Content.Server._NF.GameRule; @@ -270,11 +270,20 @@ private void GenerateDepots(List depotPrototypes, out string overrideName = proto.Name; if (i < 26) - overrideName += $" {(char) ('A' + i)}"; // " A" ... " Z" + overrideName += $" {(char)('A' + i)}"; // " A" ... " Z" else overrideName += $" {i + 1}"; // " 27", " 28"... if (TrySpawnPoiGrid(proto, offset, out var depotUid, overrideName: overrideName) && depotUid is { Valid: true } depot) { + // Nasty jank: set up destination in the station. + var depotStation = _station.GetOwningStation(depot); + if (TryComp(depotStation, out var destComp)) + { + if (i < 26) + destComp.DestinationProto = $"Cargo{(char)('A' + i)}"; + else + destComp.DestinationProto = "CargoOther"; + } depotStations.Add(depot); AddStationCoordsToSet(offset); // adjust list of actual station coords } diff --git a/Content.Server/_NF/Trade/TradeCrateComponent.cs b/Content.Server/_NF/Trade/TradeCrateComponent.cs new file mode 100644 index 00000000000..6223b917a8a --- /dev/null +++ b/Content.Server/_NF/Trade/TradeCrateComponent.cs @@ -0,0 +1,56 @@ +using System.Threading; +using Content.Shared._NF.Trade; + +namespace Content.Server._NF.Trade; + +/// +/// This is used to mark an entity to be used as a trade crate +/// +[RegisterComponent] +public sealed partial class TradeCrateComponent : SharedTradeCrateComponent +{ + /// + /// The value of the crate, in spesos, when at its destination. + /// + [DataField] + public int ValueAtDestination; + + /// + /// The value of the crate, in spesos, when delivered elsewhere. + /// + [DataField] + public int ValueElsewhere; + + /// + /// If non-zero, this crate will be an express delivery. + /// + [DataField] + public TimeSpan ExpressDeliveryDuration = TimeSpan.Zero; + + /// + /// If non-null, the package must be redeemed before this time to arrive unpenalized. + /// + [ViewVariables] + public TimeSpan? ExpressDeliveryTime; + /// + /// The bonus this package will receive if delivered on-time. + /// + [DataField] + public int ExpressOnTimeBonus; + /// + /// The penalty this package will receive if delivered late. + /// + [DataField] + public int ExpressLatePenalty; + + /// + /// This crate's destination. + /// + [ViewVariables] + public EntityUid DestinationStation; + + /// + /// Cancellation token used to disable the priority marker on + /// + public CancellationTokenSource? PriorityCancelToken; +} diff --git a/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs new file mode 100644 index 00000000000..d276e28c421 --- /dev/null +++ b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs @@ -0,0 +1,15 @@ +using Content.Shared._NF.Trade; +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Server._NF.Trade; + +/// +/// This is used to mark an entity to be used in a trade crates +/// +[RegisterComponent] +public sealed partial class TradeCrateDestinationComponent : Component +{ + [DataField] + public ProtoId DestinationProto; +} diff --git a/Content.Shared/Access/Systems/AccessReaderSystem.cs b/Content.Shared/Access/Systems/AccessReaderSystem.cs index d43e14daadd..2b0143d995f 100644 --- a/Content.Shared/Access/Systems/AccessReaderSystem.cs +++ b/Content.Shared/Access/Systems/AccessReaderSystem.cs @@ -16,7 +16,7 @@ using Robust.Shared.Collections; using Robust.Shared.Prototypes; using Robust.Shared.Timing; -using Content.Shared._NF.Trade.Components; +using Content.Shared._NF.Trade; namespace Content.Shared.Access.Systems; diff --git a/Content.Shared/Lock/LockSystem.cs b/Content.Shared/Lock/LockSystem.cs index b9a3c3fa290..531b852bef8 100644 --- a/Content.Shared/Lock/LockSystem.cs +++ b/Content.Shared/Lock/LockSystem.cs @@ -16,10 +16,7 @@ using JetBrains.Annotations; using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; -using Content.Shared._NF.Trade.Components; using Content.Shared.Emag.Components; -using System.Text; -using Content.Shared.Storage; using Robust.Shared.Audio; // Frontier - DEMAG namespace Content.Shared.Lock; diff --git a/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs b/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs new file mode 100644 index 00000000000..079afea2473 --- /dev/null +++ b/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared._NF.Trade; + +/// +/// This is used to mark an entity to be used as a trade crate +/// +public abstract partial class SharedTradeCrateComponent : Component +{ +} diff --git a/Content.Shared/_NF/Trade/TradeCrateComponent.cs b/Content.Shared/_NF/Trade/TradeCrateComponent.cs deleted file mode 100644 index 03fdcedd15c..00000000000 --- a/Content.Shared/_NF/Trade/TradeCrateComponent.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Content.Shared._NF.Trade.Components; - -/// -/// This is used to mark an entity to be used in a trade crates -/// -[RegisterComponent] -public sealed partial class TradeCrateComponent : Component -{ -} diff --git a/Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs b/Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs new file mode 100644 index 00000000000..283668e5e96 --- /dev/null +++ b/Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs @@ -0,0 +1,24 @@ +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; + +namespace Content.Shared._NF.Trade; + +/// +/// A data structure that holds relevant +/// information for trade crates (status icons). +/// +[DataDefinition, Prototype("tradeCrateDestination")] +public sealed partial class TradeCrateDestinationPrototype : IPrototype +{ + /// + /// The identifier of this prototype + /// + [IdDataField] + public string ID { get; private set; } = default!; + + /// + /// The icon that's displayed on the entity. + /// + [DataField(required: true)] + public SpriteSpecifier Icon = default!; +} diff --git a/Content.Shared/_NF/Trade/TradeCrateVisuals.cs b/Content.Shared/_NF/Trade/TradeCrateVisuals.cs new file mode 100644 index 00000000000..d4b7af8294f --- /dev/null +++ b/Content.Shared/_NF/Trade/TradeCrateVisuals.cs @@ -0,0 +1,13 @@ +using Robust.Shared.Serialization; + +namespace Content.Shared._NF.Trade; +/// +/// Stores the visuals for trade crates. +/// +[Serializable, NetSerializable] +public enum TradeCrateVisuals : byte +{ + IsPriority, + IsPriorityInactive, + DestinationIcon, +} diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml index 98923751383..394d2cdc974 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -4,11 +4,22 @@ categories: [ HideSpawnMenu ] components: - type: TradeCrate + valueAtDestination: 1500 + valueElsewhere: 400 - type: AccessReader access: [["NuclearOperative"]] - type: Icon sprite: Structures/Storage/Crates/secure.rsi - state: icon + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateDestinationLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateDestinationLayers.Priority"] + visible: false - type: Sprite sprite: Structures/Storage/Crates/secure.rsi - type: Damageable @@ -35,3 +46,4 @@ - type: SentienceTarget flavorKind: station-event-random-sentience-flavor-inanimate weight: 0.01 # 100 trade crates = 1 animal + - type: Appearance diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index c6d9ee717ed..fdd84fcb432 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -49,15 +49,19 @@ - SmallMobMask layer: - MachineLayer - - type: StaticPrice - price: 1000 - type: entity parent: CrateTradeBaseSecure id: CrateTradeBaseSecureHigh - name: high value cargo steel crate + name: express cargo steel crate categories: [ HideSpawnMenu ] components: + - type: TradeCrate + valueAtDestination: 2000 + valueElsewhere: 800 + expressDeliveryTime: 600 # ten minutes, go go + expressOnTimeBonus: 1000 + expressLatePenalty: 600 # 200/1400 - type: Icon sprite: _NF/Structures/Storage/Crates/tradelight.rsi - type: Sprite @@ -75,8 +79,6 @@ - SmallMobMask layer: - MachineLayer - - type: StaticPrice - price: 2000 - type: entity parent: @@ -121,8 +123,9 @@ sprite: _NF/Structures/Storage/Crates/contraband1_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband1_crate.rsi - - type: StaticPrice - price: 3000 + - type: TradeCrate + valueAtDestination: 3000 + valueElsewhere: 1500 - type: entity parent: CrateTradeBaseSecureContraband @@ -133,8 +136,12 @@ sprite: _NF/Structures/Storage/Crates/contraband2_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband2_crate.rsi - - type: StaticPrice - price: 5000 + - type: TradeCrate + valueAtDestination: 5000 + valueElsewhere: 2500 + expressDeliveryTime: 1200 # twenty minutes, go go + expressOnTimeBonus: 2000 + expressLatePenalty: 1500 - type: entity parent: CrateTradeBaseSecureContraband @@ -145,8 +152,12 @@ sprite: _NF/Structures/Storage/Crates/contraband3_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband3_crate.rsi - - type: StaticPrice - price: 7500 + - type: TradeCrate + valueAtDestination: 7500 + valueElsewhere: 3750 + expressDeliveryTime: 1200 # twenty minutes, go go + expressOnTimeBonus: 2500 + expressLatePenalty: 2000 - type: entity parent: CrateTradeBaseSecureContraband @@ -158,8 +169,12 @@ sprite: _NF/Structures/Storage/Crates/donkco_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/donkco_crate.rsi - - type: StaticPrice - price: 15000 + - type: TradeCrate + valueAtDestination: 10000 + valueElsewhere: 5000 + expressDeliveryTime: 1200 # twenty minutes, go go + expressOnTimeBonus: 5000 + expressLatePenalty: 2500 - type: entity parent: CrateTradeBaseSecureContraband @@ -171,8 +186,12 @@ sprite: _NF/Structures/Storage/Crates/cybersun_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/cybersun_crate.rsi - - type: StaticPrice - price: 15000 + - type: TradeCrate + valueAtDestination: 10000 + valueElsewhere: 5000 + expressDeliveryTime: 1200 # twenty minutes, go go + expressOnTimeBonus: 5000 + expressLatePenalty: 2500 - type: entity parent: CrateSecgear diff --git a/Resources/Prototypes/_NF/PointsOfInterest/depots.yml b/Resources/Prototypes/_NF/PointsOfInterest/depots.yml index d46469c1348..edf5435e393 100644 --- a/Resources/Prototypes/_NF/PointsOfInterest/depots.yml +++ b/Resources/Prototypes/_NF/PointsOfInterest/depots.yml @@ -53,6 +53,8 @@ components: - type: StationNameSetup mapNameTemplate: 'Cargo Depot' # Has a letter appended in NfAdventureSystem + - type: TradeCrateDestination + destinationProto: CargoA # Redefined in NfAdventureSystem - type: gameMap id: CargoDepotAlt @@ -64,4 +66,6 @@ stationProto: MarketFrontierOutpost components: - type: StationNameSetup - mapNameTemplate: 'Cargo Depot' # Has a letter appended in NfAdventureSystem \ No newline at end of file + mapNameTemplate: 'Cargo Depot' # Has a letter appended in NfAdventureSystem + - type: TradeCrateDestination + destinationProto: CargoA # Redefined in NfAdventureSystem diff --git a/Resources/Prototypes/_NF/trade_crate_destination_icons.yml b/Resources/Prototypes/_NF/trade_crate_destination_icons.yml new file mode 100644 index 00000000000..c6e57df7119 --- /dev/null +++ b/Resources/Prototypes/_NF/trade_crate_destination_icons.yml @@ -0,0 +1,227 @@ +- type: tradeCrateDestination + id: AnomalousLab + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: anomalous + +- type: tradeCrateDestination + id: Beacon + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: beacon + +- type: tradeCrateDestination + id: CargoA + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_a + +- type: tradeCrateDestination + id: CargoB + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_b + +- type: tradeCrateDestination + id: CargoC + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_c + +- type: tradeCrateDestination + id: CargoD + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_d + +- type: tradeCrateDestination + id: CargoE + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_e + +- type: tradeCrateDestination + id: CargoF + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_f + +- type: tradeCrateDestination + id: CargoG + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_g + +- type: tradeCrateDestination + id: CargoH + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_h + +- type: tradeCrateDestination + id: CargoI + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_i + +- type: tradeCrateDestination + id: CargoJ + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_j + +- type: tradeCrateDestination + id: CargoK + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_k + +- type: tradeCrateDestination + id: CargoL + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_l + +- type: tradeCrateDestination + id: CargoM + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_m + +- type: tradeCrateDestination + id: CargoN + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_n + +- type: tradeCrateDestination + id: CargoO + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_o + +- type: tradeCrateDestination + id: CargoP + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_p + +- type: tradeCrateDestination + id: CargoQ + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_q + +- type: tradeCrateDestination + id: CargoR + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_r + +- type: tradeCrateDestination + id: CargoS + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_s + +- type: tradeCrateDestination + id: CargoT + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_t + +- type: tradeCrateDestination + id: CargoU + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_u + +- type: tradeCrateDestination + id: CargoV + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_v + +- type: tradeCrateDestination + id: CargoX + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_x + +- type: tradeCrateDestination + id: CargoY + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_y + +- type: tradeCrateDestination + id: CargoZ + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_z + +- type: tradeCrateDestination + id: CargoOther + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + +- type: tradeCrateDestination + id: Casino + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: caseys + +- type: tradeCrateDestination + id: Courthouse + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: courthouse + +- type: tradeCrateDestination + id: Edison + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: edison + +- type: tradeCrateDestination + id: Frontier + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: frontier + +- type: tradeCrateDestination + id: Lodge + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: lodge + +- type: tradeCrateDestination + id: McHobo + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: mchobo + +- type: tradeCrateDestination + id: MedicalPOI + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: medical_poi + +- type: tradeCrateDestination + id: Prison + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: prison + +- type: tradeCrateDestination + id: RestStop + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: tinnias + +- type: tradeCrateDestination + id: Trade + icon: + sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: trade diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/anomalous.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/anomalous.png new file mode 100644 index 0000000000000000000000000000000000000000..e45a0e7eab2c188f7022153414bbfd84dd03b4a0 GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqVV*9IAre!QQxXyqR&-tbf4+fr zi|)=7Ct^ew|GyvOJwXJ<>Mxa@qGqw0B&O>D+1-?!^{>Za~~m?M$UWcWv` r+&Cwz+%>Rc5rg=GJ6vu~_gEOJqcjbP0l+XkK`}{In literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/beacon.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/beacon.png new file mode 100644 index 0000000000000000000000000000000000000000..277c55f8a8466cd5be40f3a1bdf8b82a5f6d3773 GIT binary patch literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqzMd|QAre!QQxXyqR&-tbf4+fr zi|)=7Cn7`_|GyvOEi&8Y@X74;k~1c-{?RH=)<|-i?h?)tzG3BE(bi)D4crSf9Il@| g00buvG~A!faLrIm=>OY%JD|Y~p00i_>zopr04?A#xc~qF literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_a.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_a.png new file mode 100644 index 0000000000000000000000000000000000000000..cf3b0f3f1570ffc33734abb06ca17c68cdc57fae GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq{+=$5Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?pms4&JSOcv)GvNbrmas(-c0jemr`a|=Aul*eS{u#qW^$&d90 ggEBL7T|N`TDKEoX-oCf{fJQTTy85}Sb4q9e08$z*i~s-t literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_b.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_b.png new file mode 100644 index 0000000000000000000000000000000000000000..b595b48869f74d152e6d3394a2f10db142a04ebf GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqex5FlAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x-rP)Lo6P$O)nf-VaO}B@;{; fBL$Te^O+dRDvjCOBX)WNO=j?P^>bP0l+XkKO|&jZ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_c.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_c.png new file mode 100644 index 0000000000000000000000000000000000000000..f395cab79065fc0e5f140798ab4781e03db59f23 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqL7py-Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?pms4&JSOcv)GvNbrmas(-c0jemr`a|>)qV&VZZj;&|7$s(2# hYrvTzEWueR%pfz}q*m5(pFYrZ22WQ%mvv4FO#u4tFI@lt literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_d.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_d.png new file mode 100644 index 0000000000000000000000000000000000000000..bb40259ac7e2b92205d313a4878834693c6955e5 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq{+=$5Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x-rP)Lo6PK#>Gy7SRm~#R+c8 gyBjAqGVV8LJe{D|T#^~i2sE0()78&qol`;+0HVn-Gynhq literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_e.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_e.png new file mode 100644 index 0000000000000000000000000000000000000000..6f290d4851e2b7b0645666e831f4dedf3e361a40 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq?w&4=Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x+A<*008;W1DwHru*;(F_+^VF^iz57oj9 Yzs~CaSK4&xAkat#Pgg&ebxsLQ0QPY$lK=n! literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_f.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_f.png new file mode 100644 index 0000000000000000000000000000000000000000..3d3d1fe94fe1a7de51f6f3379a31445145c161f8 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqo}Mm_Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x+A<*008;W1DwHru*;(F~VeoHrPhnVIYI anHW-b>oQlKFIfmQl)=;0&t;ucLK6Two-CmN literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_g.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_g.png new file mode 100644 index 0000000000000000000000000000000000000000..f8473ef996567f246705ec748bf4de3c6d929aab GIT binary patch literal 133 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqKAtX)Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?pms4&JSOcv)GvNN~gi)xTQh$q|QJ^cwQG+L%f}A_-O#MGb{M bsWC`hH~M?=-se+5a~V8c{an^LB{Ts5(1kBq literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_h.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_h.png new file mode 100644 index 0000000000000000000000000000000000000000..48cd1761fdede13065a636ec6afcb0a42b4b7ab7 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq9-c0aAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx9^~Mur5(X9};6WHrS<&12ht>h2EF1m+$do*#QT Z8GK~5YaM=OTnC!T;OXk;vd$@?2>>%fE&%`l literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_i.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_i.png new file mode 100644 index 0000000000000000000000000000000000000000..440fa53c299ae075713f7980dc75d6cc80920c51 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqo}Mm_Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x-r=ym9HE@BW@h+{m%dm=9ps4XES;lO)e Z26la&{|#yXwgC-g@O1TaS?83{1OQoXE?58n literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_j.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_j.png new file mode 100644 index 0000000000000000000000000000000000000000..57f0703f17f2e86b9002ffa2104ed18288b4ccdd GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq{+=$5Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3pj3b$k5NJT?$eOJSU$(Bl@^z-!(4lK dcz*2VWXN1$!2D`rh%(S<22WQ%mvv4FO#tr-EkpnS literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_k.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_k.png new file mode 100644 index 0000000000000000000000000000000000000000..38ed8b0146ca10a3fe97f798e8b5f286e895bd65 GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq-kvUwAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx9@fM&6vP^3)Hj@ASqp?ow%E+JEY<# ciup_o#{Nb>1?wV1fyOd;y85}Sb4q9e0E`eV3jhEB literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_l.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_l.png new file mode 100644 index 0000000000000000000000000000000000000000..b6181507f73e334a3e9e74ecc2563a0c8d3166ba GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFquAVNAAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3ph@wjz&DgzL&x4XiVp-|+1}b(aSOdU$w#?B!%oN!F;< T>0D3&G?2m5)z4*}Q$iB}OFAju literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_m.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_m.png new file mode 100644 index 0000000000000000000000000000000000000000..c690a132a0797669bc87d89f5a2be3c0883173f5 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqo}Mm_Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx5Xnn;t2g5(!SveuTbD`>^^>Z#1KsLja>PGjm-& a6T?GA?OLVW>*7E|89ZJ6T-G@yGywn{F)OzK literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_n.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_n.png new file mode 100644 index 0000000000000000000000000000000000000000..257b3a3365e5ce0943a473207bffe553d578a0b3 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq9-c0aAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx9^~Mh1t#hBd;gnf9N$E74`J=ELecy@%3M5)Qog aWtcQi=jZ+tZ%u(_GI+ZBxvX)qVls0GVC3#;%-ItE jG;ar!8ynl7dn^ph#|&!~?=BMpn$FgTe~DWM4f1dcGN literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_other.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_other.png new file mode 100644 index 0000000000000000000000000000000000000000..8ba3fe64f85d500bccf55bb4b124f9bbf8e1e760 GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqNuDl_Arezt`w#Lm2nx8$->fq^ z7|JTOkU{Du+m2OEuA9}Jly25npPc>Qm`j0GIcC!Rg&qe__?!*P+SVOxuxR<+uEWRs z`saq-$%<_1|GVwb=EHmLJayi&^@VIy;c>f$U)7(Pr!?#T&76|G8E6}Wr>mdKI;Vst E0OFfF>Hq)$ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_p.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_p.png new file mode 100644 index 0000000000000000000000000000000000000000..3f5113b4efbf7d67ec1677fb60323e8dac90906b GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqfu1goAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x-rP)Lo6P$O)ncR3`X31UBe2 jUggSZnApg;-<(mX)qwpn|Jg4!{YSWuZ$*BT?Eo8igVt9SKJ_v*?w_?^7xJkSn>k|4ie2B2zuVA8C$ zWk9vco-U3d8WWQf7T7*`kdVTX9MZ+?X82%IL*|lZ>6eUcP8JLdA$m-XpKb>+0+lm( My85}Sb4q9e0K5)t$p8QV literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_inactive.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_inactive.png new file mode 100644 index 0000000000000000000000000000000000000000..fb125457e49c79523b8ca062e44971a45f793457 GIT binary patch literal 232 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf5(0ceT!FNbf{Ck!O`4@)f0*_C zLbaO<(%v1O_4||A%%=fa`wYydk%I~N>*N*Fv{{an^LB{Ts5@JMI` literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_q.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_q.png new file mode 100644 index 0000000000000000000000000000000000000000..76e9ca4dff09e0a56cc7737a8b4ba2aaf92c9b80 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq0iG_7Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?pms4&JSOcv)GvNbrmas(-c0jemr`a|>)qWU_JyY*;7l%4p`v f1_W+S_gEOR-kX%$IC6#p&1Ud)^>bP0l+XkKS>G)f literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_r.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_r.png new file mode 100644 index 0000000000000000000000000000000000000000..b19b264a08a84715223b5745f5645f5e46fad1cf GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq-kvUwAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3ph@-R1Q~=5x-rP)Lo6P$O)ncR6L9rT^Y>| dc$}Ec@b9=W>u$mIhk?d2c)I$ztaD0e0ssKbFlzt+ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_s.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_s.png new file mode 100644 index 0000000000000000000000000000000000000000..afc14f0595b24710d362f0cfa6c57944a5ac10de GIT binary patch literal 143 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqVV*9IAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!`lC4&JRj=WY1T*^MB;8Y!gK!82n*X--zTt0Ai^qmQ7EBF}<| j#yopwAW&A!XJV+jV#a*%=Ff*f8yGxY{an^LB{Ts5ZJIB% literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_t.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_t.png new file mode 100644 index 0000000000000000000000000000000000000000..c7ecc315e70de87e74ecb73fc95dae9f2db8c954 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq?w&4=Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3pj3b$k5NJT?$eD`DJ!>TZEq7gJ0_5o-?*&yT&F3^sn+ Vt?c`bIsuJj@O1TaS?83{1OS9^Df|Ec literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_u.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_u.png new file mode 100644 index 0000000000000000000000000000000000000000..fe39e948b78837d6a4904115a13a8aee429b792b GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFquAVNAAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx9^~Mur73jNCmB!*@#OZI6GNw}Z)zjqT4p7KYX? W?b^$WDt-VBWbkzLb6Mw<&;$U3E-Zim literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_v.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_v.png new file mode 100644 index 0000000000000000000000000000000000000000..555bad0b7c25898deb46af2c90c70af9c9232eee GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq-kvUwAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi?9UmU3qsZqx9^~Mur0c8-VPC>x<0GSYJ$%;JTnHDFFnM5+ACC Z87yS?$2gexZkk${k?Q^pverLu6{1-oD!MelF{r5}E+?(JA); literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/caseys.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/caseys.png new file mode 100644 index 0000000000000000000000000000000000000000..5b61a169f1814acdbc26cf8db5fdf62be98ce7f1 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqL7py-Are!QQxXyqR&-tbf4+fr zi|)=7Cn7`_|GyvOEi&8Y@X74;k`W0q`%m4~m^AxVtfYj5gaB6p(~GW|7ka<0zSFyC n2IqX0FyRY~%FN7l`AiH&8zsdU@_hn5Exl^o>(0-YC322yE4 r+?y0Ov4m+~P?eMb0!fJv)xr#Xt7T_QH#e06TEpP!>gTe~DWM4fggh+0 literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/frontier.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/frontier.png new file mode 100644 index 0000000000000000000000000000000000000000..40d5d2e7fc9013e0c6b1f2171bcbe9031f80a245 GIT binary patch literal 145 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq5uPrNAre!QQxXyqR&-tbf4+fr zi|)=7Cn7`_|GyvOEi&8Y@X74;k`WR>@JFjW*&{EjJQb+6L8GA%$Ul73-~dbV0Ut+m o-gOMigqL&fU{GdeuFGd)sOOfN!ZDF)0niQxPgg&ebxsLQ0DiG9zW@LL literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/lodge.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/lodge.png new file mode 100644 index 0000000000000000000000000000000000000000..6a21fa7bcd3c058792dbf8437b7121486dfe509f GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqk)AG&Are!QQxXyqR&-tbf4+fr zi|)=7Cn7`_|GyvOEi&8Y@X74;k~1WL;Ez^$a_9jNI0VESR^Am|y=d}AHUZWX3BkLy px#W*>m3Z!8s%e5koX^uwy#ZRn;OXk;vd$@?2>{K;HpBn` literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/mchobo.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/mchobo.png new file mode 100644 index 0000000000000000000000000000000000000000..849d2604b9ff1f43857a0324daaf1e5b569d60a3 GIT binary patch literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq4xTQKAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBi!cT6U3pj3b$k5NJT?#zD`6~gU>BBbs;RBqTU?Hwr%E%bAqxt!Ko1Z+yDRo literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json new file mode 100644 index 00000000000..971ba0e7351 --- /dev/null +++ b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json @@ -0,0 +1,128 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Made by whatston3 (GitHub)", + "size": { + "x": 8, + "y": 8 + }, + "states": [ + { + "name": "anomalous" + }, + { + "name": "beacon" + }, + { + "name": "cargo_a" + }, + { + "name": "cargo_b" + }, + { + "name": "cargo_c" + }, + { + "name": "cargo_d" + }, + { + "name": "cargo_e" + }, + { + "name": "cargo_f" + }, + { + "name": "cargo_g" + }, + { + "name": "cargo_h" + }, + { + "name": "cargo_i" + }, + { + "name": "cargo_j" + }, + { + "name": "cargo_k" + }, + { + "name": "cargo_l" + }, + { + "name": "cargo_m" + }, + { + "name": "cargo_n" + }, + { + "name": "cargo_o" + }, + { + "name": "cargo_p" + }, + { + "name": "cargo_q" + }, + { + "name": "cargo_r" + }, + { + "name": "cargo_s" + }, + { + "name": "cargo_t" + }, + { + "name": "cargo_u" + }, + { + "name": "cargo_v" + }, + { + "name": "cargo_w" + }, + { + "name": "cargo_x" + }, + { + "name": "cargo_y" + }, + { + "name": "cargo_z" + }, + { + "name": "cargo_other" + }, + { + "name": "caseys" + }, + { + "name": "courthouse" + }, + { + "name": "edison" + }, + { + "name": "frontier" + }, + { + "name": "lodge" + }, + { + "name": "mchobo" + }, + { + "name": "medical_poi" + }, + { + "name": "prison" + }, + { + "name": "tinnias" + }, + { + "name": "trade" + } + ] +} diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/prison.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/prison.png new file mode 100644 index 0000000000000000000000000000000000000000..1d6e0013059559b1d411a03853fc2f49d96f7ea7 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqo}Mm_Are!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|F2J;efmETBwq+M{Pln4hL Date: Sun, 22 Dec 2024 18:08:25 -0500 Subject: [PATCH 02/31] trade crate visualizations --- Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs | 2 +- .../Structures/Storage/Crates/base_structurecrates.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs index d09179c4773..be7227e2f37 100644 --- a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs +++ b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs @@ -13,7 +13,7 @@ public sealed class TradeCrateVisualizerSystem : VisualizerSystem Date: Sun, 22 Dec 2024 18:21:11 -0500 Subject: [PATCH 03/31] fix cargo destination icons --- .../cargo_destination_icons.rsi/cargo_w.png | Bin 0 -> 132 bytes .../cargo_destination_icons.rsi/meta.json | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_w.png diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_w.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_w.png new file mode 100644 index 0000000000000000000000000000000000000000..1687c94407d824aee2cc3e706788ca5ced4d25ef GIT binary patch literal 132 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFq-kvUwAre!QQxXyqR&-tbf4+fr zi|)=7Cjvwl|CbjBiyS#{;J}8JcST**jplRCzIdX+g!M(3;enbD|A9dIc1%FV3}s2q bN@0fg(;O3bN3XC48q476>gTe~DWM4fR+chJ literal 0 HcmV?d00001 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json index 971ba0e7351..efbf749ae3e 100644 --- a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json +++ b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json @@ -94,6 +94,24 @@ { "name": "cargo_other" }, + { + "name": "cargo_priority_active" + }, + { + "name": "cargo_priority_inactive", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1 + ] + ] + }, { "name": "caseys" }, From f5c0230503c4ff60bbf17643109a5009bd78e96e Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 18:22:28 -0500 Subject: [PATCH 04/31] fix & clean dependencies --- Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs | 2 +- Content.Server/_NF/GameRule/PointOfInterestSystem.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs index 68062cdb598..39fc9c03c74 100644 --- a/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs +++ b/Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs @@ -10,7 +10,7 @@ using Content.Server.Cargo.Components; using Content.Server.GameTicking; using Content.Server.GameTicking.Rules; -using Content.Shared._NF.CCVar; // Frontier +using Content.Shared._NF.CCVar; using Robust.Shared.Configuration; using Content.Shared._NF.Bank; using Content.Server._NF.GameRule.Components; diff --git a/Content.Server/_NF/GameRule/PointOfInterestSystem.cs b/Content.Server/_NF/GameRule/PointOfInterestSystem.cs index 6e9dbd89c96..59b226d4b2a 100644 --- a/Content.Server/_NF/GameRule/PointOfInterestSystem.cs +++ b/Content.Server/_NF/GameRule/PointOfInterestSystem.cs @@ -11,6 +11,7 @@ using Content.Server.GameTicking; using Content.Shared._NF.CCVar; using Content.Shared.GameTicking; +using Content.Server._NF.Trade; namespace Content.Server._NF.GameRule; From 87c0ec14e21d8467e7cf0539883f38f2e7720197 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 18:23:29 -0500 Subject: [PATCH 05/31] fix cargo priority delays --- .../Interface/Misc/cargo_destination_icons.rsi/meta.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json index efbf749ae3e..5ff01b70768 100644 --- a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json +++ b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json @@ -95,10 +95,7 @@ "name": "cargo_other" }, { - "name": "cargo_priority_active" - }, - { - "name": "cargo_priority_inactive", + "name": "cargo_priority_active", "delays": [ [ 0.1, @@ -112,6 +109,9 @@ ] ] }, + { + "name": "cargo_priority_inactive" + }, { "name": "caseys" }, From ab6567691c8ef078c06c28963f570e7071601530 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 19:01:45 -0500 Subject: [PATCH 06/31] minor cleanup & fixes --- ...e.cs => TradeCrateDestinationPrototype.cs} | 0 .../Structures/Storage/Crates/crates.yml | 70 +++++++++++++++++++ .../_NF/PointsOfInterest/depots.yml | 1 + 3 files changed, 71 insertions(+) rename Content.Shared/_NF/Trade/{TradeCrateDestinationIconPrototype.cs => TradeCrateDestinationPrototype.cs} (100%) diff --git a/Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs b/Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs similarity index 100% rename from Content.Shared/_NF/Trade/TradeCrateDestinationIconPrototype.cs rename to Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index fdd84fcb432..34779ad03b4 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -36,6 +36,16 @@ sprite: _NF/Structures/Storage/Crates/tradedark.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/tradedark.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: EntityStorage deleteContentsOnDestruction: true - type: Fixtures @@ -66,6 +76,16 @@ sprite: _NF/Structures/Storage/Crates/tradelight.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/tradelight.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: EntityStorage deleteContentsOnDestruction: true - type: Fixtures @@ -123,6 +143,16 @@ sprite: _NF/Structures/Storage/Crates/contraband1_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband1_crate.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: TradeCrate valueAtDestination: 3000 valueElsewhere: 1500 @@ -136,6 +166,16 @@ sprite: _NF/Structures/Storage/Crates/contraband2_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband2_crate.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: TradeCrate valueAtDestination: 5000 valueElsewhere: 2500 @@ -152,6 +192,16 @@ sprite: _NF/Structures/Storage/Crates/contraband3_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/contraband3_crate.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: TradeCrate valueAtDestination: 7500 valueElsewhere: 3750 @@ -169,6 +219,16 @@ sprite: _NF/Structures/Storage/Crates/donkco_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/donkco_crate.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 @@ -186,6 +246,16 @@ sprite: _NF/Structures/Storage/Crates/cybersun_crate.rsi - type: Sprite sprite: _NF/Structures/Storage/Crates/cybersun_crate.rsi + layers: + - state: icon + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_other + map: ["enum.TradeCrateVisualLayers.Icon"] + visible: false + - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi + state: cargo_priority_inactive + map: ["enum.TradeCrateVisualLayers.Priority"] + visible: false - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 diff --git a/Resources/Prototypes/_NF/PointsOfInterest/depots.yml b/Resources/Prototypes/_NF/PointsOfInterest/depots.yml index 53abefb0626..f7e3f5345a0 100644 --- a/Resources/Prototypes/_NF/PointsOfInterest/depots.yml +++ b/Resources/Prototypes/_NF/PointsOfInterest/depots.yml @@ -31,6 +31,7 @@ name: Cargo Depot minimumDistance: 4500 maximumDistance: 6000 + spawnGamePreset: [ NFAdventure, NFPirate ] spawnGroup: CargoDepot gridPath: /Maps/_NF/POI/cargodepotalt.yml addComponents: From 563932c3e0464fbcd8dc86b8fc9f9a5e1dd4030b Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 19:28:18 -0500 Subject: [PATCH 07/31] TradeCrate: no freebies without destinations --- Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 0ce3773bf54..459b873d2aa 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -32,6 +32,7 @@ private void OnTradeCrateGetPriceEvent(EntityUid uid, TradeCrateComponent compon private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref ComponentInit ev) { + // If there are no available destinations, tough luck. if (_destinations.Count > 0) { var destination = _destinations[_random.Next(_destinations.Count)]; @@ -39,11 +40,6 @@ private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref if (TryComp(destination, out var destComp)) _appearance.SetData(uid, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto); } - else - { - // No destination, everywhere is elsewhere, throw the courier a bone. - component.ValueElsewhere = component.ValueAtDestination; - } if (component.ExpressDeliveryDuration > TimeSpan.Zero) { From 7b42b14ec9ab6ff8642bd2ce4a4d0a2fc29a312f Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 19:51:31 -0500 Subject: [PATCH 08/31] TradeCrateDestination: use string, validate proto --- Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs index d276e28c421..f6909b2b80b 100644 --- a/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs +++ b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs @@ -1,6 +1,5 @@ using Content.Shared._NF.Trade; -using Robust.Shared.GameStates; -using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server._NF.Trade; @@ -10,6 +9,6 @@ namespace Content.Server._NF.Trade; [RegisterComponent] public sealed partial class TradeCrateDestinationComponent : Component { - [DataField] - public ProtoId DestinationProto; + [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] + public string DestinationProto; } From 664b75e4bbff55c02fc67e6d5aea2b5965bbc6d8 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 20:07:27 -0500 Subject: [PATCH 09/31] fix crate duration vars --- .../_NF/Entities/Structures/Storage/Crates/crates.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 34779ad03b4..65bd3a41c5f 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -69,7 +69,7 @@ - type: TradeCrate valueAtDestination: 2000 valueElsewhere: 800 - expressDeliveryTime: 600 # ten minutes, go go + expressDeliveryDuration: 600 # ten minutes, go go expressOnTimeBonus: 1000 expressLatePenalty: 600 # 200/1400 - type: Icon @@ -179,7 +179,7 @@ - type: TradeCrate valueAtDestination: 5000 valueElsewhere: 2500 - expressDeliveryTime: 1200 # twenty minutes, go go + expressDeliveryDuration: 1200 # twenty minutes, go go expressOnTimeBonus: 2000 expressLatePenalty: 1500 @@ -205,7 +205,7 @@ - type: TradeCrate valueAtDestination: 7500 valueElsewhere: 3750 - expressDeliveryTime: 1200 # twenty minutes, go go + expressDeliveryDuration: 1200 # twenty minutes, go go expressOnTimeBonus: 2500 expressLatePenalty: 2000 @@ -232,7 +232,7 @@ - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 - expressDeliveryTime: 1200 # twenty minutes, go go + expressDeliveryDuration: 1200 # twenty minutes, go go expressOnTimeBonus: 5000 expressLatePenalty: 2500 @@ -259,7 +259,7 @@ - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 - expressDeliveryTime: 1200 # twenty minutes, go go + expressDeliveryDuration: 1200 # twenty minutes, go go expressOnTimeBonus: 5000 expressLatePenalty: 2500 From 938e16ed69de74fe15059314385406ced28db72d Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 20:20:48 -0500 Subject: [PATCH 10/31] force icon visible, fix active sprite --- Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs index be7227e2f37..1d3249b3592 100644 --- a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs +++ b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs @@ -14,7 +14,7 @@ public sealed class TradeCrateVisualizerSystem : VisualizerSystem(FallbackIconID); args.Sprite.LayerSetTexture(TradeCrateVisualLayers.Icon, _spriteSystem.Frame0(icon.Icon)); + args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Icon, true); if (_appearance.TryGetData(uid, TradeCrateVisuals.IsPriority, out bool isPriority) && isPriority) { args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Priority, true); From 010b78e4af03e28c8af16ee4be18b4d7ab6861a4 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 20:33:33 -0500 Subject: [PATCH 11/31] Fix trade crate priority markers --- .../Structures/Storage/Crates/crates.yml | 12 ++++++++++++ .../cargo_priority_active.png | Bin 244 -> 243 bytes .../Misc/cargo_destination_icons.rsi/meta.json | 10 ++-------- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 65bd3a41c5f..1b2789190e3 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -80,10 +80,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: EntityStorage @@ -147,10 +149,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: TradeCrate @@ -170,10 +174,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: TradeCrate @@ -196,10 +202,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: TradeCrate @@ -223,10 +231,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: TradeCrate @@ -250,10 +260,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: TradeCrate diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_active.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_active.png index 0359c44280df84a41789fa1daf4e6f1e8773c33b..efe841c57b3f8f6b8332a5711d95e41b81d3987c 100644 GIT binary patch delta 97 zcmeyu_?c0$Gr-TCmrII^fq{Y7)59eQNDBZl2M05dJielT=|siZ=1QI}jv*W~lM@)2 x`S>)>ax9dTunbU@kdO>iec+WSG-W0ugT@7hiM2D`{{VF{c)I$ztaD0e0sv1G7}Nj& delta 98 zcmey&_=QoiGr-TCmrII^fq{Y7)59eQNGkxb00%RWbhy`>JyCJCg|erMV~EDYuq20cF}oQ)nADKDq*?kUW1Eu&14D=&ljEn`L5x6c44$rjF6*2UngH$f8~p$P diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json index 5ff01b70768..291e0f3bda9 100644 --- a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json +++ b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json @@ -98,14 +98,8 @@ "name": "cargo_priority_active", "delays": [ [ - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1, - 0.1 + 0.2, + 0.2 ] ] }, From e1b4da9d905593cd721e07378aaa8bf1abb502c8 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 20:44:23 -0500 Subject: [PATCH 12/31] Swap contraband1 and 2 sprites --- .../Storage/Crates/base_structurecrates.yml | 2 ++ .../Structures/Storage/Crates/crates.yml | 2 ++ .../cargo_priority_active.png | Bin 243 -> 248 bytes .../Misc/cargo_destination_icons.rsi/meta.json | 2 ++ .../Crates/contraband1_crate.rsi/base.png | Bin 336 -> 342 bytes .../Crates/contraband1_crate.rsi/closed.png | Bin 345 -> 349 bytes .../Crates/contraband1_crate.rsi/icon.png | Bin 499 -> 509 bytes .../Crates/contraband1_crate.rsi/open.png | Bin 298 -> 299 bytes .../Crates/contraband2_crate.rsi/base.png | Bin 342 -> 336 bytes .../Crates/contraband2_crate.rsi/closed.png | Bin 349 -> 345 bytes .../Crates/contraband2_crate.rsi/icon.png | Bin 509 -> 499 bytes .../Crates/contraband2_crate.rsi/open.png | Bin 299 -> 298 bytes 12 files changed, 6 insertions(+) diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml index b3c0156a02c..e928dd7808f 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -14,10 +14,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: Sprite diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 1b2789190e3..1108916fd37 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -40,10 +40,12 @@ - state: icon - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_other + offset: 0.275,-0.265 map: ["enum.TradeCrateVisualLayers.Icon"] visible: false - sprite: _NF/Interface/Misc/cargo_destination_icons.rsi state: cargo_priority_inactive + offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false - type: EntityStorage diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_active.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_active.png index efe841c57b3f8f6b8332a5711d95e41b81d3987c..98f2d31b63e52bf2ad2bd8e62b14e04cd4840920 100644 GIT binary patch delta 81 zcmey&_=9nRIF|qiGXn#IhAw~bM8(-Q>Ygr+Are!Q6BwBJ_%zOPER>Y63{aJjkPK9P l;FTy8V%TiA?SUaP!?X>Iih^_g_yV;uc)I$ztaD0e0sv4m77G9X delta 76 zcmeyt_?dBnI2Q*8GXn#|@fH0`Co0Z1SMqdm4B?oWoWQ`$$ER_YW1*ykWq_)Lgk+%V g1FuA(DKi-vG%heqtexrp2dIm|)78&qol`;+094r)djJ3c diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json index 291e0f3bda9..f2197de3dca 100644 --- a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json +++ b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/meta.json @@ -98,6 +98,8 @@ "name": "cargo_priority_active", "delays": [ [ + 0.2, + 0.2, 0.2, 0.2 ] diff --git a/Resources/Textures/_NF/Structures/Storage/Crates/contraband1_crate.rsi/base.png b/Resources/Textures/_NF/Structures/Storage/Crates/contraband1_crate.rsi/base.png index d91b79835261cea13c18df1798846ec545a7a133..4c4bd96ec3521555aa3cc518adaa0b45ce9de043 100644 GIT binary patch delta 302 zcmV+}0nz@@0@ebMF@F$AL_t(oh3%9vj)O1|MSoVg0;WJzL89^nDCtt=W~p+E+=0@2 z0HidbLr9FN=;(Hf6$p$W(?FD!Uo-YFx~>5L_tO*i({nM7B_K(XiRI9?Edbzpd*FI|EXJ`~pp=3TVz3C zU;-CZ=wvYf6R<&2L_}ch#Epp(`88*bJKvY@Y#zWUw>n5N0A0G;Em)qX;N&lZ^W-ha%1ZxJ5_)OGzfp{gpR zX^JFCR(_=vi0EVfFbsA9N~!m9@q8;LCXF$8qA%w2!rz ze>H6|#thngsPjDwkYyR$lq3n1QUCxVg6~6}^)|rJ7e!J0NPil~v1?TKq0Z;3)%+7~ z0(0|$aM`mbK#*(edvXHD^r_{0-mVK5Kq-YNikP%l$<@0(CU39RI!$}KroP4)9)O6D=Q-O*M6A98@IJe( z*3(gM*VXq|*DCOH^~nBxT^A>x;=jVagn}Rl!o~RpS5vjpHseAj00000NkvXXu0mjf D2Lg zxkMTTR!QT;95Swc*1B*G5~HN8wfcQ)J$RoO9Ic_1p)A z5MYeOH=QI5Ll6}+p=UiJrLPX%4BZ{Kj=ac_Y*oFYmYPI0| zemruXe$VQTn07HMoYf)pc5US;?N!8TwE_T4noCTYOHX5+Re(;Xqm4GmFW_*rz;LuM z)>*v*&-36oPCVMsZnpsd&(}A(b*TWRgD8KuIjA-@nE})rs^s7B1+1_T>{&B7PXGV_ M07*qoM6N<$g5vn$a{vGU delta 460 zcmV;-0W<#n1M>rrF@LQ|L_t(oh3%CwYr;Sj$N!cN?Pm~Nl!79+HD90(PFdV;5d045 zQpBa9Q*d%GIApSW2D>_37db)-g?1472|CoR9qb)V{p#l`+n~EBuNk|jj0)k54>+AAn9j_vX$F@NPrL_t(oh3%9p4umiehKJ3HIvj`wg~o6MvKQb4oQ)H30m2b5 zXcVbn+&CPo=u#e=h0w5KJ_Y?J{lD-iz|A<*MHq(T)$(mQ z(O7eKW(^b delta 257 zcmV+c0sj800;&R#F@NMqL_t(oh3%9f4umieMTgBATu*?(5@ZFMa0t$UB1nSb92|n6 z5tU>tW-hUkRWy{sW+5~+eX8xB^uL5q0LysmBFnPnXrS+V?<~KYZF4EWIbZ6!R)(so zQuf>YZnow^2wfo0^CQ{E>AFq|y!Rm@0udQ04uSxpC{oTe0eT_=#+VTSBGLq2Mw%`l z1yV7CUo^%G{i1>rIgJaLD^;cz${4u?^`a&cBqj?jIv00000NkvXX Hu0mjf!69-e diff --git a/Resources/Textures/_NF/Structures/Storage/Crates/contraband2_crate.rsi/base.png b/Resources/Textures/_NF/Structures/Storage/Crates/contraband2_crate.rsi/base.png index 4c4bd96ec3521555aa3cc518adaa0b45ce9de043..d91b79835261cea13c18df1798846ec545a7a133 100644 GIT binary patch delta 296 zcmV+@0oVT40?-1GF@Fk4L_t(oh3%BF4TCTcMSmhjNrez41rtzt0M9{*QcC zU;-CZ=wvYf6R<&2L_}ch#Epp(`88*bJKvY@Y#zWUw>n5N0A0G;Em)qX;N&lZ^W-ha%1ZxJ5_)OGzfp{gpR zX^JFCR(_=vi0EVfFbsA9N~!m9@q8x~>5L_tO*i({nM7B_K(XiRI9?Edbzpd*FI|EXJ`~pp=3TVz3z ze>H6|#thngsPjDwkYyR$lq3n1QUCxVg6~6}^)|rJ7e!J0NPil~v1?TKq0Z;3)%+7~ z0(0|$aM`mbK#*(edvXHD^r_{0-mVK5Kq-YNikP%l$<@0(CU39RI!$}KroP4)9)O6D=Q-O*M6A98@IJe( z*3(gM*VXq|*DCOH^~nBxT^A>x;=jVagn}Rl!o~RpS5vjpHseAj00000NkvXXu0mjf D2;LCXF$8qA%w2!rrrF@LQ|L_t(oh3%CwYr;Sj$N!cN?Pm~Nl!79+HD90(PFdV;5d045 zQpBa9Q*d%GIApSW2D>_37db)-g?1472|CoR9qb)V{p#l`+n~EBuNk|jj0)k54>+AAn9j_vLg zxkMTTR!QT;95Swc*1B*G5~HN8wfcQ)J$RoO9Ic_1p)A z5MYeOH=QI5Ll6}+p=UiJrLPX%4BZ{Kj=ac_Y*oFYmYPI0| zemruXe$VQTn07HMoYf)pc5US;?N!8TwE_T4noCTYOHX5+Re(;Xqm4GmFW_*rz;LuM z)>*v*&-36oPCVMsZnpsd&(}A(b*TWRgD8KuIjA-@nE})rs^s7B1+1_T>{&B7PXGV_ M07*qoM6N<$g5vn$a{vGU diff --git a/Resources/Textures/_NF/Structures/Storage/Crates/contraband2_crate.rsi/open.png b/Resources/Textures/_NF/Structures/Storage/Crates/contraband2_crate.rsi/open.png index 89fd97557230cdb699cc15082a83b4925644a77c..937245adf8b4fdb71127bb769a5dedcc6207ec4d 100644 GIT binary patch delta 257 zcmV+c0sj800;&R#F@NMqL_t(oh3%9f4umieMTgBATu*?(5@ZFMa0t$UB1nSb92|n6 z5tU>tW-hUkRWy{sW+5~+eX8xB^uL5q0LysmBFnPnXrS+V?<~KYZF4EWIbZ6!R)(so zQuf>YZnow^2wfo0^CQ{E>AFq|y!Rm@0udQ04uSxpC{oTe0eT_=#+VTSBGLq2Mw%`l z1yV7CUo^%G{i1>rIgJaLD^;cz${4u?^`a&cBqj?jIv00000NkvXX Hu0mjf!69-e delta 258 zcmV+d0sa1}0;>X$F@NPrL_t(oh3%9p4umiehKJ3HIvj`wg~o6MvKQb4oQ)H30m2b5 zXcVbn+&CPo=u#e=h0w5KJ_Y?J{lD-iz|A<*MHq(T)$(mQ z(O7eKW(^b From 79b8a7dafc635b46944fa9c424029eec6906d496 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 22 Dec 2024 21:22:48 -0500 Subject: [PATCH 13/31] rotate inactive cargo priority sprite --- .../cargo_priority_inactive.png | Bin 232 -> 235 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_inactive.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_priority_inactive.png index fb125457e49c79523b8ca062e44971a45f793457..62fef274170d671a4a458500b3009165a32a7e54 100644 GIT binary patch delta 54 zcmaFC_?mIT9(^fK7sn8enaK$Z%yDjP8qMOT5?YKO1pT2@O1Ta JS?83{1ON@A65{{> delta 51 zcmaFO_=0i59vyK{7sn8enaK$Ucq=L;B^_rldVPKr$ju;N!BCie=Yk^x5O})!xvX Date: Mon, 23 Dec 2024 23:06:55 -0500 Subject: [PATCH 14/31] Trade crate examine, bonus only on dest. delivery --- .../Cargo/Systems/CargoSystem.TradeCrates.cs | 24 +++++++++++++- .../Locale/en-US/_NF/cargo/trade-crate.ftl | 3 ++ .../_NF/Catalog/Fills/Crates/trade.yml | 6 ++-- .../Structures/Storage/Crates/crates.yml | 31 ++++++++++++++++-- .../cargo_destination_icons.rsi/cargo_b.png | Bin 135 -> 129 bytes .../cargo_priority_active.png | Bin 248 -> 248 bytes .../cargo_priority_inactive.png | Bin 235 -> 116 bytes 7 files changed, 58 insertions(+), 6 deletions(-) create mode 100644 Resources/Locale/en-US/_NF/cargo/trade-crate.ftl diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 459b873d2aa..3556ca37bee 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -1,7 +1,9 @@ using System.Threading; using Content.Server._NF.Trade; using Content.Shared._NF.Trade; +using Content.Shared.Examine; using Content.Shared.GameTicking; +using Robust.Shared.GameObjects; using Timer = Robust.Shared.Timing.Timer; namespace Content.Server.Cargo.Systems; // Needs to collide with base namespace @@ -15,6 +17,7 @@ private void InitializeTradeCrates() SubscribeLocalEvent(OnTradeCrateGetPriceEvent); SubscribeLocalEvent(OnTradeCrateInit); SubscribeLocalEvent(OnTradeCrateRemove); + SubscribeLocalEvent(OnTradeCrateExamined); SubscribeLocalEvent(OnDestinationInit); SubscribeLocalEvent(OnDestinationRemove); @@ -26,8 +29,12 @@ private void OnTradeCrateGetPriceEvent(EntityUid uid, TradeCrateComponent compon ev.Price = isDestinated ? component.ValueAtDestination : component.ValueElsewhere; if (component.ExpressDeliveryTime != null) { - ev.Price += _timing.CurTime <= component.ExpressDeliveryTime ? component.ExpressOnTimeBonus : component.ExpressLatePenalty; + if (_timing.CurTime <= component.ExpressDeliveryTime && isDestinated) + ev.Price += component.ExpressOnTimeBonus; + else if (_timing.CurTime > component.ExpressDeliveryTime) + ev.Price -= component.ExpressLatePenalty; } + ev.Price = double.Max(0.0, ev.Price); // Ensure non-negative values. } private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref ComponentInit ev) @@ -58,6 +65,21 @@ private void OnTradeCrateRemove(EntityUid uid, TradeCrateComponent component, re component.PriorityCancelToken?.Cancel(); } + private void OnTradeCrateExamined(EntityUid uid, TradeCrateComponent component, ref ExaminedEvent ev) + { + if (!TryComp(component.DestinationStation, out MetaDataComponent? metadata)) + return; + + ev.PushMarkup(Loc.GetString("trade-crate-destination-station", ("destination", metadata.EntityName))); + if (component.ExpressDeliveryTime != null) + { + if (component.ExpressDeliveryTime >= _timing.CurTime) + ev.PushMarkup(Loc.GetString("trade-crate-priority-active")); + else + ev.PushMarkup(Loc.GetString("trade-crate-priority-inactive")); + } + } + private void DisableTradeCratePriority(EntityUid uid, TradeCrateComponent component) { _appearance.SetData(uid, TradeCrateVisuals.IsPriorityInactive, true); diff --git a/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl b/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl new file mode 100644 index 00000000000..9f6b025af84 --- /dev/null +++ b/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl @@ -0,0 +1,3 @@ +trade-crate-destination-station = This crate's destination is [color=springgreen]{$destination}[/color]. +trade-crate-priority-active = This crate is an [color=yellow]express delivery[/color]. It's still on time! +trade-crate-priority-inactive = This crate is an [color=#886600]express delivery[/color]. It's late. diff --git a/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml b/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml index 5976e5983f9..271405f95b0 100644 --- a/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml +++ b/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml @@ -2,10 +2,10 @@ id: CrateTradeSecureNormalFilled parent: CrateTradeBaseSecureNormal name: cargo trading crate - description: Contains goods made in the Frontier sector, ready to be sold on a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. + description: Contains goods made in the Frontier sector, ready to be sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. - type: entity id: CrateTradeSecureHighFilled parent: CrateTradeBaseSecureHigh - name: high value cargo trading crate - description: Contains high value goods made in the Frontier sector, ready to be sold on a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. + name: express cargo trading crate + description: An urgent crate of goods made in the Frontier sector, ready to be quickly sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 1108916fd37..b8b771786d6 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -29,7 +29,6 @@ - type: entity parent: CrateTradeBaseSecure id: CrateTradeBaseSecureNormal - name: cargo steel crate categories: [ HideSpawnMenu ] components: - type: Icon @@ -48,6 +47,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: EntityStorage deleteContentsOnDestruction: true - type: Fixtures @@ -73,7 +76,7 @@ valueElsewhere: 800 expressDeliveryDuration: 600 # ten minutes, go go expressOnTimeBonus: 1000 - expressLatePenalty: 600 # 200/1400 + expressLatePenalty: 1000 # 0/1000 - type: Icon sprite: _NF/Structures/Storage/Crates/tradelight.rsi - type: Sprite @@ -90,6 +93,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: EntityStorage deleteContentsOnDestruction: true - type: Fixtures @@ -159,6 +166,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate valueAtDestination: 3000 valueElsewhere: 1500 @@ -184,6 +195,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate valueAtDestination: 5000 valueElsewhere: 2500 @@ -212,6 +227,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate valueAtDestination: 7500 valueElsewhere: 3750 @@ -241,6 +260,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 @@ -270,6 +293,10 @@ offset: 0.025,-0.265 map: ["enum.TradeCrateVisualLayers.Priority"] visible: false + - state: paper + sprite: Structures/Storage/Crates/labels.rsi + offset: "-0.5,0" + map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate valueAtDestination: 10000 valueElsewhere: 5000 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_b.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_b.png index b595b48869f74d152e6d3394a2f10db142a04ebf..870ca78586d25979f762fdeedfb18e3918d1e10a 100644 GIT binary patch delta 42 wcmZo?Y-F6E!sszk)lTk!%8G0zWyO3ZhJG(I_Qj?ayBL7L)78&qol`;+0QRQ~ng9R* delta 48 zcmZo(#sZr+anf8@w+#+dHv08vw@@4h{eS delta 29 lcmeyt_=9mmmGBxPqnqK$*Qh;Rye}ZXjjt>Eak7F*P~i0Ao_klz*pBul$pKXlX-ZW8=ZF_wvks ztnK=aOC$<4Crl6idH%qGhTAOBd+T{BL<7$AGKhZXjgOLI>jN6Y;OXk;vd$@?2>?Rz BB}f1O literal 235 zcmeAS@N?(olHy`uVBq!ia0vp^93afW3?x5a^xFxf5(0ceT!FNbf{Ck!O`4@)f0*_C zLbaO<(%v1O_4||A%%=fa`wYyd1nY5 From 0588302ed045fc241378f0fc9c7c0a9b64222a85 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 14:14:14 -0500 Subject: [PATCH 15/31] Add trade posts as dest, crates ignore market rate --- .../Cargo/Systems/CargoSystem.Shuttle.cs | 30 +++++++++---- .../IgnoreMarketModifierComponent.cs | 7 +++ .../Cargo/Systems/CargoSystem.TradeCrates.cs | 8 +++- .../Storage/Crates/base_structurecrates.yml | 3 ++ .../Structures/Storage/Crates/crates.yml | 44 +++++++++---------- .../Prototypes/_NF/PointsOfInterest/trade.yml | 2 + .../_NF/PointsOfInterest/trademall.yml | 2 + 7 files changed, 64 insertions(+), 32 deletions(-) create mode 100644 Content.Server/_NF/Cargo/Components/IgnoreMarketModifierComponent.cs diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 391f87f5b4b..0e1e87417c8 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -8,9 +8,8 @@ using Content.Shared.GameTicking; using Content.Shared.Mobs; using Robust.Shared.Map; -using Robust.Shared.Random; using Robust.Shared.Audio; -using Content.Shared.Mind.Components; // Frontier +using Content.Server._NF.Cargo.Components; // Frontier namespace Content.Server.Cargo.Systems; @@ -67,11 +66,14 @@ private void UpdatePalletConsoleInterface(EntityUid uid) new CargoPalletConsoleInterfaceState(0, 0, false)); return; } - GetPalletGoods(uid, gridUid, out var toSell, out var amount); + GetPalletGoods(uid, gridUid, out var toSell, out var amount, out var noModAmount); // Frontier: add noModAmount + // Frontier if (TryComp(uid, out var priceMod)) { amount *= priceMod.Mod; } + amount += noModAmount; + // End Frontier _uiSystem.SetUiState(uid, CargoPalletConsoleUiKey.Sale, new CargoPalletConsoleInterfaceState((int) amount, toSell.Count, true)); } @@ -259,11 +261,11 @@ public static double CalculateDistance(EntityCoordinates point1, EntityCoordinat #region Station - private bool SellPallets(EntityUid consoleUid, EntityUid gridUid, out double amount) + private bool SellPallets(EntityUid consoleUid, EntityUid gridUid, out double amount, out double noMultiplierAmount) // Frontier: add noMultiplierAmount { - GetPalletGoods(consoleUid, gridUid, out var toSell, out amount); + GetPalletGoods(consoleUid, gridUid, out var toSell, out amount, out noMultiplierAmount); // Frontier: add noMultiplierAmount - Log.Debug($"Cargo sold {toSell.Count} entities for {amount}"); + Log.Debug($"Cargo sold {toSell.Count} entities for {amount} (plus {noMultiplierAmount} without mods)"); // Frontier: add section in parentheses if (toSell.Count == 0) return false; @@ -280,9 +282,10 @@ private bool SellPallets(EntityUid consoleUid, EntityUid gridUid, out double amo return true; } - private void GetPalletGoods(EntityUid consoleUid, EntityUid gridUid, out HashSet toSell, out double amount) + private void GetPalletGoods(EntityUid consoleUid, EntityUid gridUid, out HashSet toSell, out double amount, out double noMultiplierAmount) // Frontier: add noMultiplierAmount { amount = 0; + noMultiplierAmount = 0; toSell = new HashSet(); foreach (var (palletUid, _, _) in GetCargoPallets(consoleUid, gridUid, BuySellType.Sell)) @@ -313,7 +316,13 @@ private void GetPalletGoods(EntityUid consoleUid, EntityUid gridUid, out HashSet if (price == 0) continue; toSell.Add(ent); - amount += price; + + // Frontier: check for items that are immune to market modifiers + if (HasComp(ent)) + noMultiplierAmount += price; + else + amount += price; + // End Frontier: check for items that are immune to market modifiers } } } @@ -356,13 +365,16 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, return; } - if (!SellPallets(uid, gridUid, out var price)) + if (!SellPallets(uid, gridUid, out var price, out var noMultiplierPrice)) // Frontier: add noMultiplierPrice return; + // Frontier: market modifiers & immune objects if (TryComp(uid, out var priceMod)) { price *= priceMod.Mod; } + price += noMultiplierPrice; + // End Frontier: market modifiers & immune objects var stackPrototype = _protoMan.Index(component.CashType); _stack.Spawn((int) price, stackPrototype, xform.Coordinates); _audio.PlayPvs(ApproveSound, uid); diff --git a/Content.Server/_NF/Cargo/Components/IgnoreMarketModifierComponent.cs b/Content.Server/_NF/Cargo/Components/IgnoreMarketModifierComponent.cs new file mode 100644 index 00000000000..f7c688b22eb --- /dev/null +++ b/Content.Server/_NF/Cargo/Components/IgnoreMarketModifierComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Server._NF.Cargo.Components; + +/// +/// Designates an entity as ignoring market modifiers. +/// +[RegisterComponent] +public sealed partial class IgnoreMarketModifierComponent : Component; diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 3556ca37bee..941face8176 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -42,7 +42,13 @@ private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref // If there are no available destinations, tough luck. if (_destinations.Count > 0) { - var destination = _destinations[_random.Next(_destinations.Count)]; + var randomIndex = _random.Next(_destinations.Count); + // Better have more than one destination. + if (_station.GetOwningStation(uid) == _destinations[randomIndex]) + { + randomIndex = (randomIndex + 1 + _random.Next(_destinations.Count - 1)) % _destinations.Count; + } + var destination = _destinations[randomIndex]; component.DestinationStation = destination; if (TryComp(destination, out var destComp)) _appearance.SetData(uid, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto); diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml index e928dd7808f..bbb337c290e 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -49,3 +49,6 @@ flavorKind: station-event-random-sentience-flavor-inanimate weight: 0.01 # 100 trade crates = 1 animal - type: Appearance + - type: EntityStorage + capacity: 0 # stores nothing + - type: IgnoreMarketModifier diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index b8b771786d6..23e741201ef 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -72,11 +72,11 @@ categories: [ HideSpawnMenu ] components: - type: TradeCrate - valueAtDestination: 2000 + valueAtDestination: 2500 valueElsewhere: 800 - expressDeliveryDuration: 600 # ten minutes, go go - expressOnTimeBonus: 1000 - expressLatePenalty: 1000 # 0/1000 + expressDeliveryDuration: 900 # fifteen minutes, go go + expressOnTimeBonus: 1500 + expressLatePenalty: 1500 # 0/1000 - type: Icon sprite: _NF/Structures/Storage/Crates/tradelight.rsi - type: Sprite @@ -171,8 +171,8 @@ offset: "-0.5,0" map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate - valueAtDestination: 3000 - valueElsewhere: 1500 + valueAtDestination: 5000 + valueElsewhere: 2500 - type: entity parent: CrateTradeBaseSecureContraband @@ -200,9 +200,9 @@ offset: "-0.5,0" map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate - valueAtDestination: 5000 + valueAtDestination: 6000 valueElsewhere: 2500 - expressDeliveryDuration: 1200 # twenty minutes, go go + expressDeliveryDuration: 2400 # forty minutes, go go (timeout mostly for pirates & NFSD) expressOnTimeBonus: 2000 expressLatePenalty: 1500 @@ -232,11 +232,11 @@ offset: "-0.5,0" map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate - valueAtDestination: 7500 - valueElsewhere: 3750 - expressDeliveryDuration: 1200 # twenty minutes, go go - expressOnTimeBonus: 2500 - expressLatePenalty: 2000 + valueAtDestination: 8000 + valueElsewhere: 4000 + expressDeliveryDuration: 2400 # forty minutes, go go (timeout mostly for pirates & NFSD) + expressOnTimeBonus: 4000 + expressLatePenalty: 3000 - type: entity parent: CrateTradeBaseSecureContraband @@ -265,11 +265,11 @@ offset: "-0.5,0" map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate - valueAtDestination: 10000 + valueAtDestination: 12000 valueElsewhere: 5000 - expressDeliveryDuration: 1200 # twenty minutes, go go - expressOnTimeBonus: 5000 - expressLatePenalty: 2500 + expressDeliveryDuration: 2400 # forty minutes, go go (timeout mostly for pirates & NFSD) + expressOnTimeBonus: 6000 + expressLatePenalty: 3000 - type: entity parent: CrateTradeBaseSecureContraband @@ -298,11 +298,11 @@ offset: "-0.5,0" map: ["enum.PaperLabelVisuals.Layer"] - type: TradeCrate - valueAtDestination: 10000 - valueElsewhere: 5000 - expressDeliveryDuration: 1200 # twenty minutes, go go - expressOnTimeBonus: 5000 - expressLatePenalty: 2500 + valueAtDestination: 12000 + valueElsewhere: 6000 + expressDeliveryDuration: 2400 # forty minutes, go go (timeout mostly for pirates & NFSD) + expressOnTimeBonus: 6000 + expressLatePenalty: 3000 - type: entity parent: CrateSecgear diff --git a/Resources/Prototypes/_NF/PointsOfInterest/trade.yml b/Resources/Prototypes/_NF/PointsOfInterest/trade.yml index 555f321139b..0a3a408963d 100644 --- a/Resources/Prototypes/_NF/PointsOfInterest/trade.yml +++ b/Resources/Prototypes/_NF/PointsOfInterest/trade.yml @@ -40,3 +40,5 @@ mapNameTemplate: 'Trade Outpost' - type: StationDeadDrop maxDeadDrops: 3 # Many here, it's huge. + - type: TradeCrateDestination + destinationProto: Trade diff --git a/Resources/Prototypes/_NF/PointsOfInterest/trademall.yml b/Resources/Prototypes/_NF/PointsOfInterest/trademall.yml index 9b7e75158fb..4a67a6bfaa8 100644 --- a/Resources/Prototypes/_NF/PointsOfInterest/trademall.yml +++ b/Resources/Prototypes/_NF/PointsOfInterest/trademall.yml @@ -40,3 +40,5 @@ mapNameTemplate: 'Trade Mall' - type: StationDeadDrop maxDeadDrops: 2 # A few, its not as big as the original trade outpost + - type: TradeCrateDestination + destinationProto: Trade From d2c555e9cc622a847fe68783c827bb1b704f3f6b Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 14:26:35 -0500 Subject: [PATCH 16/31] Count the cove as a wildcard trade crate dest --- .../_NF/Cargo/Systems/CargoSystem.TradeCrates.cs | 3 ++- .../_NF/Trade/TradeCrateWildcardDestinationComponent.cs | 8 ++++++++ Resources/Prototypes/_NF/PointsOfInterest/cove.yml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 941face8176..832416d458b 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -25,7 +25,8 @@ private void InitializeTradeCrates() private void OnTradeCrateGetPriceEvent(EntityUid uid, TradeCrateComponent component, ref PriceCalculationEvent ev) { - bool isDestinated = component.DestinationStation != EntityUid.Invalid && _station.GetOwningStation(uid) == component.DestinationStation; + var owningStation = _station.GetOwningStation(uid); + bool isDestinated = component.DestinationStation != EntityUid.Invalid && owningStation == component.DestinationStation || HasComp(owningStation); ev.Price = isDestinated ? component.ValueAtDestination : component.ValueElsewhere; if (component.ExpressDeliveryTime != null) { diff --git a/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs b/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs new file mode 100644 index 00000000000..b78a3ba4c39 --- /dev/null +++ b/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Server._NF.Trade; + +/// +/// This marks a station as matching all trade crate destinations. +/// Useful, for example, for black market stations or pirate coves. +/// +[RegisterComponent] +public sealed partial class TradeCrateWildcardDestinationComponent : Component; \ No newline at end of file diff --git a/Resources/Prototypes/_NF/PointsOfInterest/cove.yml b/Resources/Prototypes/_NF/PointsOfInterest/cove.yml index 57bb4d1c336..c9d9bf6acc1 100644 --- a/Resources/Prototypes/_NF/PointsOfInterest/cove.yml +++ b/Resources/Prototypes/_NF/PointsOfInterest/cove.yml @@ -48,3 +48,4 @@ - type: StationDeadDropReporting messageSet: Pirate - type: StationDeadDropHintExempt + - type: TradeCrateWildcardDestination From 4b83a0bf68d499a563b2a08afe4880ebb6ed1a48 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 14:56:28 -0500 Subject: [PATCH 17/31] Remove filled trading crates (they aren't needed) --- .../Maps/_NF/Shuttles/Scrap/scrap-courserx.yml | 2 +- Resources/Maps/_NF/Shuttles/Scrap/scrap-hauler.yml | 2 +- .../Prototypes/_NF/Catalog/Cargo/cargo_trade.yml | 4 ++-- .../Prototypes/_NF/Catalog/Fills/Crates/trade.yml | 11 ----------- .../Entities/Markers/Spawners/Random/salvage.yml | 4 ++-- .../Entities/Structures/Storage/Crates/crates.yml | 13 +++++++------ Resources/_NF/migration.yml | 6 +++++- 7 files changed, 18 insertions(+), 24 deletions(-) delete mode 100644 Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml diff --git a/Resources/Maps/_NF/Shuttles/Scrap/scrap-courserx.yml b/Resources/Maps/_NF/Shuttles/Scrap/scrap-courserx.yml index 2b2da744e4f..897a0e47354 100644 --- a/Resources/Maps/_NF/Shuttles/Scrap/scrap-courserx.yml +++ b/Resources/Maps/_NF/Shuttles/Scrap/scrap-courserx.yml @@ -1407,7 +1407,7 @@ entities: - type: Transform pos: -0.5,14.5 parent: 1 -- proto: CrateTradeSecureNormalFilled +- proto: CrateTradeSecureNormal entities: - uid: 64 components: diff --git a/Resources/Maps/_NF/Shuttles/Scrap/scrap-hauler.yml b/Resources/Maps/_NF/Shuttles/Scrap/scrap-hauler.yml index 1ded56ba271..6d930e8cc95 100644 --- a/Resources/Maps/_NF/Shuttles/Scrap/scrap-hauler.yml +++ b/Resources/Maps/_NF/Shuttles/Scrap/scrap-hauler.yml @@ -1892,7 +1892,7 @@ entities: - type: Transform pos: 3.5,11.5 parent: 1 -- proto: CrateTradeSecureNormalFilled +- proto: CrateTradeSecureNormal entities: - uid: 144 components: diff --git a/Resources/Prototypes/_NF/Catalog/Cargo/cargo_trade.yml b/Resources/Prototypes/_NF/Catalog/Cargo/cargo_trade.yml index d8985d039b8..5aa339d457e 100644 --- a/Resources/Prototypes/_NF/Catalog/Cargo/cargo_trade.yml +++ b/Resources/Prototypes/_NF/Catalog/Cargo/cargo_trade.yml @@ -3,7 +3,7 @@ icon: sprite: _NF/Structures/Storage/Crates/tradedark.rsi state: icon - product: CrateTradeSecureNormalFilled + product: CrateTradeSecureNormal cost: 1000 category: cargoproduct-category-name-cargo group: market @@ -13,7 +13,7 @@ icon: sprite: _NF/Structures/Storage/Crates/tradelight.rsi state: icon - product: CrateTradeSecureHighFilled + product: CrateTradeSecureHigh cost: 2000 category: cargoproduct-category-name-cargo group: market diff --git a/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml b/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml deleted file mode 100644 index 271405f95b0..00000000000 --- a/Resources/Prototypes/_NF/Catalog/Fills/Crates/trade.yml +++ /dev/null @@ -1,11 +0,0 @@ -- type: entity - id: CrateTradeSecureNormalFilled - parent: CrateTradeBaseSecureNormal - name: cargo trading crate - description: Contains goods made in the Frontier sector, ready to be sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. - -- type: entity - id: CrateTradeSecureHighFilled - parent: CrateTradeBaseSecureHigh - name: express cargo trading crate - description: An urgent crate of goods made in the Frontier sector, ready to be quickly sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. diff --git a/Resources/Prototypes/_NF/Entities/Markers/Spawners/Random/salvage.yml b/Resources/Prototypes/_NF/Entities/Markers/Spawners/Random/salvage.yml index 6705e794405..bd38a157234 100644 --- a/Resources/Prototypes/_NF/Entities/Markers/Spawners/Random/salvage.yml +++ b/Resources/Prototypes/_NF/Entities/Markers/Spawners/Random/salvage.yml @@ -340,8 +340,8 @@ - NFCrateSalvageAssortedGoodiesTrashCart chance: 0.95 rarePrototypes: - - CrateTradeSecureNormalFilled - - CrateTradeSecureHighFilled + - CrateTradeSecureNormal + - CrateTradeSecureHigh - CrateSalvageEquipment - CrateTrashCartFilled - CrateArtifactContainer diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 23e741201ef..97e2297abf5 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -28,8 +28,9 @@ - type: entity parent: CrateTradeBaseSecure - id: CrateTradeBaseSecureNormal - categories: [ HideSpawnMenu ] + id: CrateTradeSecureNormal + name: cargo trading crate + description: Contains goods made in the Frontier sector, ready to be sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. components: - type: Icon sprite: _NF/Structures/Storage/Crates/tradedark.rsi @@ -67,13 +68,13 @@ - type: entity parent: CrateTradeBaseSecure - id: CrateTradeBaseSecureHigh - name: express cargo steel crate - categories: [ HideSpawnMenu ] + id: CrateTradeSecureHigh + name: express cargo trading crate + description: An urgent crate of goods made in the Frontier sector, ready to be quickly sold at a cargo depot for higher value. MAKE SURE THE CRATE IS INTACT. components: - type: TradeCrate valueAtDestination: 2500 - valueElsewhere: 800 + valueElsewhere: 1200 expressDeliveryDuration: 900 # fifteen minutes, go go expressOnTimeBonus: 1500 expressLatePenalty: 1500 # 0/1000 diff --git a/Resources/_NF/migration.yml b/Resources/_NF/migration.yml index 51d4980573f..0dcf1c81d21 100644 --- a/Resources/_NF/migration.yml +++ b/Resources/_NF/migration.yml @@ -172,4 +172,8 @@ NFPosterContrabandEmsCoordsDD: NFPosterContrabandEmsCoords RandomItem: null # 2024-12-22 Barrels -CrateSpaceCleaner: ChemicalBarrelSpaceCleaner \ No newline at end of file +CrateSpaceCleaner: ChemicalBarrelSpaceCleaner + +# 2024-12-24 Trading Crate Destinations +CrateTradeSecureNormalFilled: CrateTradeSecureNormal +CrateTradeSecureHighFilled: CrateTradeSecureHigh From 3025d3c0ccbf5db5a0eeb787f4a934612430aa5f Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 16:06:04 -0500 Subject: [PATCH 18/31] Remove guidebook references to cargo crates --- Resources/ServerInfo/_NF/Guidebook/Shipyard/Barge.xml | 4 ++-- Resources/ServerInfo/_NF/Guidebook/Shipyard/Hauler.xml | 2 +- Resources/ServerInfo/_NF/Guidebook/Shipyard/Loader.xml | 4 ++-- Resources/ServerInfo/_NF/Guidebook/Shipyard/Vagabond.xml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Barge.xml b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Barge.xml index b1c13f38f09..f16f91aebf2 100644 --- a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Barge.xml +++ b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Barge.xml @@ -4,8 +4,8 @@ - - + + diff --git a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Hauler.xml b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Hauler.xml index 776d34e1682..5850e3edba8 100644 --- a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Hauler.xml +++ b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Hauler.xml @@ -1,7 +1,7 @@ # HAULER-CLASS SALVAGE SHUTTLE - + diff --git a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Loader.xml b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Loader.xml index b1528e79346..59505362c02 100644 --- a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Loader.xml +++ b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Loader.xml @@ -1,8 +1,8 @@ # LOADER-CLASS CARGO SHUTTLE - - + + diff --git a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Vagabond.xml b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Vagabond.xml index 64a3298796c..2a147a5d3c9 100644 --- a/Resources/ServerInfo/_NF/Guidebook/Shipyard/Vagabond.xml +++ b/Resources/ServerInfo/_NF/Guidebook/Shipyard/Vagabond.xml @@ -3,8 +3,8 @@ - - + + From 8136aec8d40d34dd2aa51c61b90dd97811c304c8 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 21:37:47 -0500 Subject: [PATCH 19/31] 25 minutes for cargo crates with a giant comment --- .../_NF/Entities/Structures/Storage/Crates/crates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml index 97e2297abf5..455ac0ab179 100644 --- a/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml +++ b/Resources/Prototypes/_NF/Entities/Structures/Storage/Crates/crates.yml @@ -75,7 +75,7 @@ - type: TradeCrate valueAtDestination: 2500 valueElsewhere: 1200 - expressDeliveryDuration: 900 # fifteen minutes, go go + expressDeliveryDuration: 1500 # twenty-five minutes, go go (worst distance is ~6.5 km trade-cargo A, then 12 km to cargo b, 15.4 min at 20 m/s, giving ~10 minutes in adverse conditions for cargo pickup and dropoff) expressOnTimeBonus: 1500 expressLatePenalty: 1500 # 0/1000 - type: Icon From 5d4ed0d55d47131d072cfb341fb14ad742eff58d Mon Sep 17 00:00:00 2001 From: Whatstone Date: Tue, 24 Dec 2024 21:46:36 -0500 Subject: [PATCH 20/31] slightly nicer letters (A,J,T,V) --- .../cargo_destination_icons.rsi/cargo_a.png | Bin 136 -> 137 bytes .../cargo_destination_icons.rsi/cargo_j.png | Bin 136 -> 142 bytes .../cargo_destination_icons.rsi/cargo_t.png | Bin 128 -> 131 bytes .../cargo_destination_icons.rsi/cargo_v.png | Bin 132 -> 128 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_a.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_a.png index cf3b0f3f1570ffc33734abb06ca17c68cdc57fae..2c423bc0e39a1bdc7f629c60ff244bef78d18d48 100644 GIT binary patch delta 54 zcmeBR>|~sv!Wb}7)k>=+iOK9hQy#08gCS!Yt5HHq!h!d`45n^|wUL*?ycvMN)78&q Iol`;+0J(P%RsaA1 delta 53 zcmeBV>|mUr!stIy)k^b7Qy!C*!$zhwCO_6249d*Rb@@yTr@RbndHde(V*mnAS3j3^ HP6|>mu!WcSH)lK>Eva)cI$C462z*#BGuyM9w>)F5EiVQ&D>FVdQ&MBb@0AV%` A=Kufz delta 41 vcmeBU>|mUr!stIy)lD|cwTFl2$6ii`%oPUAuO@~lGXR07tDnm{r-UW|0Pzf4 diff --git a/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_t.png b/Resources/Textures/_NF/Interface/Misc/cargo_destination_icons.rsi/cargo_t.png index c7ecc315e70de87e74ecb73fc95dae9f2db8c954..56d5d77571cba9d0927a9f06459d2091329a3e22 100644 GIT binary patch delta 72 zcmZo*Y-XIG!ssY+#(A!stFxRmqYmc<;))qORNHpXRZFfLaOT{!@1g%(|Fj8j4tZczAy7x;00f?{ KelF{r5}E)lg%X4S delta 61 zcmZo*Y+;c1yxB2Adr;!P%X@0A){A)ZvJ9B P1|aZs^>bP0l+XkKo1_$h From cfcf4a588095783765d72fa485f7b89fd797a6ba Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 26 Dec 2024 14:54:53 -0500 Subject: [PATCH 21/31] Most requested revisions --- .../_NF/Trade/TradeCrateComponent.cs | 11 --- .../_NF/Trade/TradeCrateVisualizerSystem.cs | 14 ++-- .../Cargo/Systems/CargoSystem.Shuttle.cs | 2 +- .../Cargo/Systems/CargoSystem.TradeCrates.cs | 72 +++++++++---------- .../_NF/Trade/TradeCrateComponent.cs | 56 --------------- .../Trade/TradeCrateDestinationComponent.cs | 8 +-- .../TradeCrateWildcardDestinationComponent.cs | 2 +- .../_NF/Trade/SharedTradeCrateComponent.cs | 51 ++++++++++++- .../Trade/TradeCrateDestinationPrototype.cs | 6 +- 9 files changed, 100 insertions(+), 122 deletions(-) delete mode 100644 Content.Client/_NF/Trade/TradeCrateComponent.cs delete mode 100644 Content.Server/_NF/Trade/TradeCrateComponent.cs diff --git a/Content.Client/_NF/Trade/TradeCrateComponent.cs b/Content.Client/_NF/Trade/TradeCrateComponent.cs deleted file mode 100644 index 0565a97c367..00000000000 --- a/Content.Client/_NF/Trade/TradeCrateComponent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Content.Shared._NF.Trade; - -namespace Content.Client._NF.Trade; - -/// -/// This is used to mark an entity to be used as a trade crate -/// -[RegisterComponent] -public sealed partial class TradeCrateComponent : SharedTradeCrateComponent -{ -} diff --git a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs index 1d3249b3592..52ad24983c3 100644 --- a/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs +++ b/Content.Client/_NF/Trade/TradeCrateVisualizerSystem.cs @@ -5,13 +5,13 @@ namespace Content.Client._NF.Trade; /// -/// Visualizer for trade crates, largely based on Nyano's mail visualizer (thank you) +/// Visualizer for trade crates, largely based on Nyano's mail visualizer (thank you) /// public sealed class TradeCrateVisualizerSystem : VisualizerSystem { + [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly SpriteSystem _spriteSystem = default!; + [Dependency] private readonly SpriteSystem _sprite = default!; private const string FallbackIconID = "CargoOther"; private const string CargoPriorityActiveState = "cargo_priority_active"; @@ -27,10 +27,10 @@ protected override void OnAppearanceChange(EntityUid uid, TradeCrateComponent co if (string.IsNullOrEmpty(job)) job = FallbackIconID; - if (!_prototypeManager.TryIndex(job, out var icon)) - icon = _prototypeManager.Index(FallbackIconID); + if (!_proto.TryIndex(job, out var icon)) + icon = _proto.Index(FallbackIconID); - args.Sprite.LayerSetTexture(TradeCrateVisualLayers.Icon, _spriteSystem.Frame0(icon.Icon)); + args.Sprite.LayerSetTexture(TradeCrateVisualLayers.Icon, _sprite.Frame0(icon.Icon)); args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Icon, true); if (_appearance.TryGetData(uid, TradeCrateVisuals.IsPriority, out bool isPriority) && isPriority) { @@ -41,9 +41,7 @@ protected override void OnAppearanceChange(EntityUid uid, TradeCrateComponent co args.Sprite.LayerSetState(TradeCrateVisualLayers.Priority, CargoPriorityActiveState); } else - { args.Sprite.LayerSetVisible(TradeCrateVisualLayers.Priority, false); - } } } diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index 0e1e87417c8..cd32994f004 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -386,7 +386,7 @@ private void OnPalletSale(EntityUid uid, CargoPalletConsoleComponent component, private void OnRoundRestart(RoundRestartCleanupEvent ev) { Reset(); - CleanupTradeCrateDestinations(ev); // Frontier + CleanupTradeCrateDestinations(); // Frontier } } diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 832416d458b..6a6a32ae131 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -2,15 +2,13 @@ using Content.Server._NF.Trade; using Content.Shared._NF.Trade; using Content.Shared.Examine; -using Content.Shared.GameTicking; -using Robust.Shared.GameObjects; using Timer = Robust.Shared.Timing.Timer; namespace Content.Server.Cargo.Systems; // Needs to collide with base namespace public sealed partial class CargoSystem { - private List _destinations = new(); + private readonly List _destinations = new(); private void InitializeTradeCrates() { @@ -23,87 +21,89 @@ private void InitializeTradeCrates() SubscribeLocalEvent(OnDestinationRemove); } - private void OnTradeCrateGetPriceEvent(EntityUid uid, TradeCrateComponent component, ref PriceCalculationEvent ev) + private void OnTradeCrateGetPriceEvent(Entity ent, ref PriceCalculationEvent ev) { - var owningStation = _station.GetOwningStation(uid); - bool isDestinated = component.DestinationStation != EntityUid.Invalid && owningStation == component.DestinationStation || HasComp(owningStation); - ev.Price = isDestinated ? component.ValueAtDestination : component.ValueElsewhere; - if (component.ExpressDeliveryTime != null) + var owningStation = _station.GetOwningStation(ent.Owner); + var atDestination = ent.Comp.DestinationStation != EntityUid.Invalid + && owningStation == ent.Comp.DestinationStation + || HasComp(owningStation); + ev.Price = atDestination ? ent.Comp.ValueAtDestination : ent.Comp.ValueElsewhere; + if (ent.Comp.ExpressDeliveryTime != null) { - if (_timing.CurTime <= component.ExpressDeliveryTime && isDestinated) - ev.Price += component.ExpressOnTimeBonus; - else if (_timing.CurTime > component.ExpressDeliveryTime) - ev.Price -= component.ExpressLatePenalty; + if (_timing.CurTime <= ent.Comp.ExpressDeliveryTime && atDestination) + ev.Price += ent.Comp.ExpressOnTimeBonus; + else if (_timing.CurTime > ent.Comp.ExpressDeliveryTime) + ev.Price -= ent.Comp.ExpressLatePenalty; } ev.Price = double.Max(0.0, ev.Price); // Ensure non-negative values. } - private void OnTradeCrateInit(EntityUid uid, TradeCrateComponent component, ref ComponentInit ev) + private void OnTradeCrateInit(Entity ent, ref ComponentInit ev) { // If there are no available destinations, tough luck. if (_destinations.Count > 0) { var randomIndex = _random.Next(_destinations.Count); // Better have more than one destination. - if (_station.GetOwningStation(uid) == _destinations[randomIndex]) + if (_station.GetOwningStation(ent.Owner) == _destinations[randomIndex]) { randomIndex = (randomIndex + 1 + _random.Next(_destinations.Count - 1)) % _destinations.Count; } var destination = _destinations[randomIndex]; - component.DestinationStation = destination; + ent.Comp.DestinationStation = destination; if (TryComp(destination, out var destComp)) - _appearance.SetData(uid, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto); + _appearance.SetData(ent.Owner, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto.Id); } - if (component.ExpressDeliveryDuration > TimeSpan.Zero) + if (ent.Comp.ExpressDeliveryDuration > TimeSpan.Zero) { - component.ExpressDeliveryTime = _timing.CurTime + component.ExpressDeliveryDuration; - _appearance.SetData(uid, TradeCrateVisuals.IsPriority, true); + ent.Comp.ExpressDeliveryTime = _timing.CurTime + ent.Comp.ExpressDeliveryDuration; + _appearance.SetData(ent.Owner, TradeCrateVisuals.IsPriority, true); - component.PriorityCancelToken = new CancellationTokenSource(); - Timer.Spawn((int)component.ExpressDeliveryDuration.TotalMilliseconds, - () => DisableTradeCratePriority(uid, component), - component.PriorityCancelToken.Token); + ent.Comp.ExpressCancelToken = new CancellationTokenSource(); + Timer.Spawn((int)ent.Comp.ExpressDeliveryDuration.TotalMilliseconds, + () => DisableTradeCratePriority(ent.Owner), + ent.Comp.ExpressCancelToken.Token); } } - private void OnTradeCrateRemove(EntityUid uid, TradeCrateComponent component, ref ComponentRemove ev) + private void OnTradeCrateRemove(Entity ent, ref ComponentRemove ev) { - component.PriorityCancelToken?.Cancel(); + ent.Comp.ExpressCancelToken?.Cancel(); } - private void OnTradeCrateExamined(EntityUid uid, TradeCrateComponent component, ref ExaminedEvent ev) + private void OnTradeCrateExamined(Entity ent, ref ExaminedEvent ev) { - if (!TryComp(component.DestinationStation, out MetaDataComponent? metadata)) + if (!TryComp(ent.Comp.DestinationStation, out MetaDataComponent? metadata)) return; ev.PushMarkup(Loc.GetString("trade-crate-destination-station", ("destination", metadata.EntityName))); - if (component.ExpressDeliveryTime != null) + if (ent.Comp.ExpressDeliveryTime != null) { - if (component.ExpressDeliveryTime >= _timing.CurTime) + if (ent.Comp.ExpressDeliveryTime >= _timing.CurTime) ev.PushMarkup(Loc.GetString("trade-crate-priority-active")); else ev.PushMarkup(Loc.GetString("trade-crate-priority-inactive")); } } - private void DisableTradeCratePriority(EntityUid uid, TradeCrateComponent component) + private void DisableTradeCratePriority(EntityUid uid) { _appearance.SetData(uid, TradeCrateVisuals.IsPriorityInactive, true); } - private void OnDestinationInit(EntityUid uid, TradeCrateDestinationComponent component, ref ComponentInit ev) + private void OnDestinationInit(Entity ent, ref ComponentInit ev) { - if (!_destinations.Contains(uid)) - _destinations.Add(uid); + if (!_destinations.Contains(ent.Owner)) + _destinations.Add(ent.Owner); } - private void OnDestinationRemove(EntityUid uid, TradeCrateDestinationComponent component, ref ComponentRemove ev) + private void OnDestinationRemove(Entity ent, ref ComponentRemove ev) { - _destinations.Remove(uid); + _destinations.Remove(ent.Owner); } - private void CleanupTradeCrateDestinations(RoundRestartCleanupEvent ev) + private void CleanupTradeCrateDestinations() { _destinations.Clear(); } diff --git a/Content.Server/_NF/Trade/TradeCrateComponent.cs b/Content.Server/_NF/Trade/TradeCrateComponent.cs deleted file mode 100644 index 6223b917a8a..00000000000 --- a/Content.Server/_NF/Trade/TradeCrateComponent.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Threading; -using Content.Shared._NF.Trade; - -namespace Content.Server._NF.Trade; - -/// -/// This is used to mark an entity to be used as a trade crate -/// -[RegisterComponent] -public sealed partial class TradeCrateComponent : SharedTradeCrateComponent -{ - /// - /// The value of the crate, in spesos, when at its destination. - /// - [DataField] - public int ValueAtDestination; - - /// - /// The value of the crate, in spesos, when delivered elsewhere. - /// - [DataField] - public int ValueElsewhere; - - /// - /// If non-zero, this crate will be an express delivery. - /// - [DataField] - public TimeSpan ExpressDeliveryDuration = TimeSpan.Zero; - - /// - /// If non-null, the package must be redeemed before this time to arrive unpenalized. - /// - [ViewVariables] - public TimeSpan? ExpressDeliveryTime; - /// - /// The bonus this package will receive if delivered on-time. - /// - [DataField] - public int ExpressOnTimeBonus; - /// - /// The penalty this package will receive if delivered late. - /// - [DataField] - public int ExpressLatePenalty; - - /// - /// This crate's destination. - /// - [ViewVariables] - public EntityUid DestinationStation; - - /// - /// Cancellation token used to disable the priority marker on - /// - public CancellationTokenSource? PriorityCancelToken; -} diff --git a/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs index f6909b2b80b..07f7a9f9d76 100644 --- a/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs +++ b/Content.Server/_NF/Trade/TradeCrateDestinationComponent.cs @@ -1,14 +1,14 @@ using Content.Shared._NF.Trade; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Prototypes; namespace Content.Server._NF.Trade; /// -/// This is used to mark an entity to be used in a trade crates +/// This is used to mark an entity to be used as a destination for trade crates. /// [RegisterComponent] public sealed partial class TradeCrateDestinationComponent : Component { - [DataField(customTypeSerializer: typeof(PrototypeIdSerializer))] - public string DestinationProto; + [DataField(required: true)] + public ProtoId DestinationProto; } diff --git a/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs b/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs index b78a3ba4c39..a2055eb51d4 100644 --- a/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs +++ b/Content.Server/_NF/Trade/TradeCrateWildcardDestinationComponent.cs @@ -5,4 +5,4 @@ namespace Content.Server._NF.Trade; /// Useful, for example, for black market stations or pirate coves. /// [RegisterComponent] -public sealed partial class TradeCrateWildcardDestinationComponent : Component; \ No newline at end of file +public sealed partial class TradeCrateWildcardDestinationComponent : Component; diff --git a/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs b/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs index 079afea2473..157a02d5154 100644 --- a/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs +++ b/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs @@ -1,8 +1,57 @@ +using System.Threading; +using Content.Shared.Cargo; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; + namespace Content.Shared._NF.Trade; /// /// This is used to mark an entity to be used as a trade crate /// -public abstract partial class SharedTradeCrateComponent : Component +[RegisterComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedCargoSystem))] +public sealed partial class TradeCrateComponent : Component { + /// + /// The value of the crate, in spesos, when at its destination. + /// + [DataField(serverOnly: true)] + public int ValueAtDestination; + + /// + /// The value of the crate, in spesos, when delivered elsewhere. + /// + [DataField(serverOnly: true)] + public int ValueElsewhere; + + /// + /// If non-zero, this crate will be an express delivery. + /// + [DataField(serverOnly: true, customTypeSerializer: typeof(TimeOffsetSerializer))] + public TimeSpan ExpressDeliveryDuration = TimeSpan.Zero; + + /// + /// If non-null, the package must be redeemed before this time to arrive unpenalized. + /// + [ViewVariables, AutoNetworkedField, AutoPausedField] + public TimeSpan? ExpressDeliveryTime; + /// + /// The bonus this package will receive if delivered on-time. + /// + [DataField(serverOnly: true)] + public int ExpressOnTimeBonus; + /// + /// The penalty this package will receive if delivered late. + /// + [DataField(serverOnly: true)] + public int ExpressLatePenalty; + + /// + /// This crate's destination. + /// + [ViewVariables] + public EntityUid DestinationStation; + + /// + /// Cancellation token used to disable the express marker on the crate. + /// + public CancellationTokenSource? ExpressCancelToken; } diff --git a/Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs b/Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs index 283668e5e96..085a37038f7 100644 --- a/Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs +++ b/Content.Shared/_NF/Trade/TradeCrateDestinationPrototype.cs @@ -7,12 +7,10 @@ namespace Content.Shared._NF.Trade; /// A data structure that holds relevant /// information for trade crates (status icons). /// -[DataDefinition, Prototype("tradeCrateDestination")] +[Prototype] public sealed partial class TradeCrateDestinationPrototype : IPrototype { - /// - /// The identifier of this prototype - /// + /// [IdDataField] public string ID { get; private set; } = default!; From 912eb9745ae1a71b8ff726066e2680e06269bb05 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 26 Dec 2024 15:00:06 -0500 Subject: [PATCH 22/31] Clean CargoSystem.Shuttle.cs imports --- Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs index cd32994f004..d77a409f6cc 100644 --- a/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs +++ b/Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs @@ -1,15 +1,16 @@ using Content.Server.Cargo.Components; using Content.Shared.Stacks; -using Content.Shared.Bank.Components; using Content.Shared.Cargo; using Content.Shared.Cargo.BUI; using Content.Shared.Cargo.Components; using Content.Shared.Cargo.Events; using Content.Shared.GameTicking; -using Content.Shared.Mobs; using Robust.Shared.Map; +using Robust.Shared.Random; using Robust.Shared.Audio; using Content.Server._NF.Cargo.Components; // Frontier +using Content.Shared.Bank.Components; // Frontier +using Content.Shared.Mobs; // Frontier namespace Content.Server.Cargo.Systems; From 4632f797d1f19d4198038a47c175981ee9fb54f3 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 26 Dec 2024 15:03:57 -0500 Subject: [PATCH 23/31] examine text cleanup --- .../_NF/Cargo/Systems/CargoSystem.TradeCrates.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 6a6a32ae131..238faffd512 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -78,13 +78,13 @@ private void OnTradeCrateExamined(Entity ent, ref ExaminedE return; ev.PushMarkup(Loc.GetString("trade-crate-destination-station", ("destination", metadata.EntityName))); - if (ent.Comp.ExpressDeliveryTime != null) - { - if (ent.Comp.ExpressDeliveryTime >= _timing.CurTime) - ev.PushMarkup(Loc.GetString("trade-crate-priority-active")); - else - ev.PushMarkup(Loc.GetString("trade-crate-priority-inactive")); - } + + if (ent.Comp.ExpressDeliveryTime == null) + return; + + ev.PushMarkup(ent.Comp.ExpressDeliveryTime >= _timing.CurTime ? + Loc.GetString("trade-crate-priority-active") : + Loc.GetString("trade-crate-priority-inactive")); } private void DisableTradeCratePriority(EntityUid uid) From add6762d3500168cac08823a7bc68a06d2aae78b Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 26 Dec 2024 15:05:15 -0500 Subject: [PATCH 24/31] Rename TradeCrateComponent file --- .../{SharedTradeCrateComponent.cs => TradeCrateComponent.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Content.Shared/_NF/Trade/{SharedTradeCrateComponent.cs => TradeCrateComponent.cs} (100%) diff --git a/Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs b/Content.Shared/_NF/Trade/TradeCrateComponent.cs similarity index 100% rename from Content.Shared/_NF/Trade/SharedTradeCrateComponent.cs rename to Content.Shared/_NF/Trade/TradeCrateComponent.cs From 5bb6bc09d1d80c38877aa4bc947a857587636220 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Thu, 26 Dec 2024 15:07:31 -0500 Subject: [PATCH 25/31] Add NetworkedComponent attribute to TradeCrateComp --- Content.Shared/_NF/Trade/TradeCrateComponent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Shared/_NF/Trade/TradeCrateComponent.cs b/Content.Shared/_NF/Trade/TradeCrateComponent.cs index 157a02d5154..25f13345431 100644 --- a/Content.Shared/_NF/Trade/TradeCrateComponent.cs +++ b/Content.Shared/_NF/Trade/TradeCrateComponent.cs @@ -1,5 +1,6 @@ using System.Threading; using Content.Shared.Cargo; +using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared._NF.Trade; @@ -7,7 +8,7 @@ namespace Content.Shared._NF.Trade; /// /// This is used to mark an entity to be used as a trade crate /// -[RegisterComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedCargoSystem))] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedCargoSystem))] public sealed partial class TradeCrateComponent : Component { /// From 5cce28bc1e71f01ffdb29a1c7652a65635bef4eb Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 14:17:43 -0500 Subject: [PATCH 26/31] Milon's suggestions, round 2 --- .../_NF/Cargo/Systems/CargoSystem.TradeCrates.cs | 11 ++++++----- Content.Shared/_NF/Trade/TradeCrateComponent.cs | 8 +++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 238faffd512..23005dc4d87 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -23,7 +23,7 @@ private void InitializeTradeCrates() private void OnTradeCrateGetPriceEvent(Entity ent, ref PriceCalculationEvent ev) { - var owningStation = _station.GetOwningStation(ent.Owner); + var owningStation = _station.GetOwningStation(ent); var atDestination = ent.Comp.DestinationStation != EntityUid.Invalid && owningStation == ent.Comp.DestinationStation || HasComp(owningStation); @@ -45,24 +45,24 @@ private void OnTradeCrateInit(Entity ent, ref ComponentInit { var randomIndex = _random.Next(_destinations.Count); // Better have more than one destination. - if (_station.GetOwningStation(ent.Owner) == _destinations[randomIndex]) + if (_station.GetOwningStation(ent) == _destinations[randomIndex]) { randomIndex = (randomIndex + 1 + _random.Next(_destinations.Count - 1)) % _destinations.Count; } var destination = _destinations[randomIndex]; ent.Comp.DestinationStation = destination; if (TryComp(destination, out var destComp)) - _appearance.SetData(ent.Owner, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto.Id); + _appearance.SetData(ent, TradeCrateVisuals.DestinationIcon, destComp.DestinationProto.Id); } if (ent.Comp.ExpressDeliveryDuration > TimeSpan.Zero) { ent.Comp.ExpressDeliveryTime = _timing.CurTime + ent.Comp.ExpressDeliveryDuration; - _appearance.SetData(ent.Owner, TradeCrateVisuals.IsPriority, true); + _appearance.SetData(ent, TradeCrateVisuals.IsPriority, true); ent.Comp.ExpressCancelToken = new CancellationTokenSource(); Timer.Spawn((int)ent.Comp.ExpressDeliveryDuration.TotalMilliseconds, - () => DisableTradeCratePriority(ent.Owner), + () => DisableTradeCratePriority(ent), ent.Comp.ExpressCancelToken.Token); } } @@ -72,6 +72,7 @@ private void OnTradeCrateRemove(Entity ent, ref ComponentRe ent.Comp.ExpressCancelToken?.Cancel(); } + // TODO: move to shared, share delivery time? private void OnTradeCrateExamined(Entity ent, ref ExaminedEvent ev) { if (!TryComp(ent.Comp.DestinationStation, out MetaDataComponent? metadata)) diff --git a/Content.Shared/_NF/Trade/TradeCrateComponent.cs b/Content.Shared/_NF/Trade/TradeCrateComponent.cs index 25f13345431..e55b8ca1e5e 100644 --- a/Content.Shared/_NF/Trade/TradeCrateComponent.cs +++ b/Content.Shared/_NF/Trade/TradeCrateComponent.cs @@ -8,11 +8,11 @@ namespace Content.Shared._NF.Trade; /// /// This is used to mark an entity to be used as a trade crate /// -[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause, Access(typeof(SharedCargoSystem))] +[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause, Access(typeof(SharedCargoSystem))] public sealed partial class TradeCrateComponent : Component { /// - /// The value of the crate, in spesos, when at its destination. + /// The value of the crate, in spesos, when delivered to its destination. /// [DataField(serverOnly: true)] public int ValueAtDestination; @@ -32,13 +32,15 @@ public sealed partial class TradeCrateComponent : Component /// /// If non-null, the package must be redeemed before this time to arrive unpenalized. /// - [ViewVariables, AutoNetworkedField, AutoPausedField] + [ViewVariables, AutoPausedField] public TimeSpan? ExpressDeliveryTime; + /// /// The bonus this package will receive if delivered on-time. /// [DataField(serverOnly: true)] public int ExpressOnTimeBonus; + /// /// The penalty this package will receive if delivered late. /// From 1dd80a0a58397a1532f3f96fc2bc8acdff59c19b Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 14:49:34 -0500 Subject: [PATCH 27/31] emphasize trade crate express status --- Resources/Locale/en-US/_NF/cargo/trade-crate.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl b/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl index 9f6b025af84..07f805082a4 100644 --- a/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl +++ b/Resources/Locale/en-US/_NF/cargo/trade-crate.ftl @@ -1,3 +1,3 @@ trade-crate-destination-station = This crate's destination is [color=springgreen]{$destination}[/color]. -trade-crate-priority-active = This crate is an [color=yellow]express delivery[/color]. It's still on time! -trade-crate-priority-inactive = This crate is an [color=#886600]express delivery[/color]. It's late. +trade-crate-priority-active = This crate is an [color=yellow]express delivery[/color]. It's [bold]still on time[/bold]! +trade-crate-priority-inactive = This crate is an [color=#886600]express delivery[/color]. It's [bold]late[/bold]. From a27193fa5bb5fde249587800a44acdf1692db2a6 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 14:51:29 -0500 Subject: [PATCH 28/31] Downcast Entity to EntityUid --- Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs index 23005dc4d87..54c259ef5dd 100644 --- a/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs +++ b/Content.Server/_NF/Cargo/Systems/CargoSystem.TradeCrates.cs @@ -95,13 +95,13 @@ private void DisableTradeCratePriority(EntityUid uid) private void OnDestinationInit(Entity ent, ref ComponentInit ev) { - if (!_destinations.Contains(ent.Owner)) - _destinations.Add(ent.Owner); + if (!_destinations.Contains(ent)) + _destinations.Add(ent); } private void OnDestinationRemove(Entity ent, ref ComponentRemove ev) { - _destinations.Remove(ent.Owner); + _destinations.Remove(ent); } private void CleanupTradeCrateDestinations() From 9f6bf919ec150f7c377f9d98acdb6911fe884d97 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 16:20:30 -0500 Subject: [PATCH 29/31] No serializer, missing space --- Content.Shared/_NF/Trade/TradeCrateComponent.cs | 3 +-- Content.Shared/_NF/Trade/TradeCrateVisuals.cs | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Shared/_NF/Trade/TradeCrateComponent.cs b/Content.Shared/_NF/Trade/TradeCrateComponent.cs index e55b8ca1e5e..01dbf1f7816 100644 --- a/Content.Shared/_NF/Trade/TradeCrateComponent.cs +++ b/Content.Shared/_NF/Trade/TradeCrateComponent.cs @@ -1,7 +1,6 @@ using System.Threading; using Content.Shared.Cargo; using Robust.Shared.GameStates; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared._NF.Trade; @@ -26,7 +25,7 @@ public sealed partial class TradeCrateComponent : Component /// /// If non-zero, this crate will be an express delivery. /// - [DataField(serverOnly: true, customTypeSerializer: typeof(TimeOffsetSerializer))] + [DataField(serverOnly: true)] public TimeSpan ExpressDeliveryDuration = TimeSpan.Zero; /// diff --git a/Content.Shared/_NF/Trade/TradeCrateVisuals.cs b/Content.Shared/_NF/Trade/TradeCrateVisuals.cs index d4b7af8294f..d4986b3d0c9 100644 --- a/Content.Shared/_NF/Trade/TradeCrateVisuals.cs +++ b/Content.Shared/_NF/Trade/TradeCrateVisuals.cs @@ -1,6 +1,7 @@ using Robust.Shared.Serialization; namespace Content.Shared._NF.Trade; + /// /// Stores the visuals for trade crates. /// From 12c09fef890e9ef457a80cab17f8d73887330fda Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 21:40:23 -0500 Subject: [PATCH 30/31] Consolidate NF14 guidebook, add cargo hauling TODO: move cargo hauling out into some cargo, mining & salvage section --- Resources/Prototypes/_NF/Guidebook/bank.yml | 5 --- Resources/Prototypes/_NF/Guidebook/hiring.yml | 5 --- Resources/Prototypes/_NF/Guidebook/nf14.yml | 27 ++++++++++++++- .../Prototypes/_NF/Guidebook/piloting.yml | 5 --- .../Prototypes/_NF/Guidebook/shipyard.yml | 2 +- .../ServerInfo/_NF/Guidebook/CargoHauling.xml | 33 +++++++++++++++++++ 6 files changed, 60 insertions(+), 17 deletions(-) delete mode 100644 Resources/Prototypes/_NF/Guidebook/bank.yml delete mode 100644 Resources/Prototypes/_NF/Guidebook/hiring.yml delete mode 100644 Resources/Prototypes/_NF/Guidebook/piloting.yml create mode 100644 Resources/ServerInfo/_NF/Guidebook/CargoHauling.xml diff --git a/Resources/Prototypes/_NF/Guidebook/bank.yml b/Resources/Prototypes/_NF/Guidebook/bank.yml deleted file mode 100644 index f762438eae1..00000000000 --- a/Resources/Prototypes/_NF/Guidebook/bank.yml +++ /dev/null @@ -1,5 +0,0 @@ -- type: guideEntry - id: Bank - name: guide-entry-bank - text: "/ServerInfo/_NF/Guidebook/Bank.xml" - priority: 0 diff --git a/Resources/Prototypes/_NF/Guidebook/hiring.yml b/Resources/Prototypes/_NF/Guidebook/hiring.yml deleted file mode 100644 index 38b679e7172..00000000000 --- a/Resources/Prototypes/_NF/Guidebook/hiring.yml +++ /dev/null @@ -1,5 +0,0 @@ -- type: guideEntry - id: Hiring - name: guide-entry-hiring - text: "/ServerInfo/_NF/Guidebook/Hiring.xml" - priority: 1 diff --git a/Resources/Prototypes/_NF/Guidebook/nf14.yml b/Resources/Prototypes/_NF/Guidebook/nf14.yml index 32bf719d14a..e2a507b6efc 100644 --- a/Resources/Prototypes/_NF/Guidebook/nf14.yml +++ b/Resources/Prototypes/_NF/Guidebook/nf14.yml @@ -7,6 +7,31 @@ - Bank - Hiring - Piloting - - Survival # Moved out from Station and Shifts section + - Survival # Moved out from Station and Shifts section (upstream file) - Expeditions + - CargoHauling # TODO: separate this out along with salvage and mining into some NF_Cargo section - Shipyard + +- type: guideEntry + id: Bank + name: guide-entry-bank + text: "/ServerInfo/_NF/Guidebook/Bank.xml" + priority: 0 + +- type: guideEntry + id: Hiring + name: guide-entry-hiring + text: "/ServerInfo/_NF/Guidebook/Hiring.xml" + priority: 1 + +- type: guideEntry + id: Piloting + name: guide-entry-piloting + text: "/ServerInfo/_NF/Guidebook/Piloting.xml" + priority: 2 + +- type: guideEntry + id: CargoHauling + name: guide-entry-cargo-hauling + text: "/ServerInfo/_NF/Guidebook/CargoHauling.xml" + priority: 5 diff --git a/Resources/Prototypes/_NF/Guidebook/piloting.yml b/Resources/Prototypes/_NF/Guidebook/piloting.yml deleted file mode 100644 index 915418da943..00000000000 --- a/Resources/Prototypes/_NF/Guidebook/piloting.yml +++ /dev/null @@ -1,5 +0,0 @@ -- type: guideEntry - id: Piloting - name: guide-entry-piloting - text: "/ServerInfo/_NF/Guidebook/Piloting.xml" - priority: 2 diff --git a/Resources/Prototypes/_NF/Guidebook/shipyard.yml b/Resources/Prototypes/_NF/Guidebook/shipyard.yml index 5dec78ace72..4a8f067aae9 100644 --- a/Resources/Prototypes/_NF/Guidebook/shipyard.yml +++ b/Resources/Prototypes/_NF/Guidebook/shipyard.yml @@ -2,7 +2,7 @@ id: Shipyard name: guide-entry-shipyard text: "/ServerInfo/_NF/Guidebook/Shipyard.xml" - priority: 5 + priority: 6 children: - ShipyardAkupara - ShipyardAmbition diff --git a/Resources/ServerInfo/_NF/Guidebook/CargoHauling.xml b/Resources/ServerInfo/_NF/Guidebook/CargoHauling.xml new file mode 100644 index 00000000000..41cec1fc0d3 --- /dev/null +++ b/Resources/ServerInfo/_NF/Guidebook/CargoHauling.xml @@ -0,0 +1,33 @@ + + # Cargo Hauling + +One of the ways you can make money on the Frontier is by moving shipments of [color=peru]trading crates[/color]. + + + + + + +You can find these by: + * Buying them at [color=peru]cargo request computers[/color] at the [color=darkgreen]Trade Outpost[/color] + * Salvaging them from [color=#88b0d1]space wrecks[/color] + * Finding [color=#c83737]contraband crates[/color] to be smuggled (ask around to find out how) + +Each trading crate will have a destination symbol on the right side of the crate. Examining the crate (Shift+Click) shows the name of the station it should be delivered to. + +Selling a crate at its destination station will result in receiving more money than the crate's worth, while selling it at other stations will result in less. + +## Express Deliveries + +Some crates are labelled as [color=yellow]express deliveries[/color]. These provide a bonus if delivered [italic]to the destination[/italic] on time. + + + + + + +To make deliveries in time, make sure to keep your cargo bay organized so the crates for each destination can be removed from the cargo bay in order. + +Remember, more hands make light work, so crew up to help deliveries run smoothly! + + From 675d9331db64516f7015cf128174882f8a07f389 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Fri, 27 Dec 2024 21:41:20 -0500 Subject: [PATCH 31/31] Add missing cargo hauling fluent entry --- Resources/Locale/en-US/_NF/guidebook/guides.ftl | 1 + 1 file changed, 1 insertion(+) diff --git a/Resources/Locale/en-US/_NF/guidebook/guides.ftl b/Resources/Locale/en-US/_NF/guidebook/guides.ftl index 5a008481981..1fd6c35fe9b 100644 --- a/Resources/Locale/en-US/_NF/guidebook/guides.ftl +++ b/Resources/Locale/en-US/_NF/guidebook/guides.ftl @@ -4,6 +4,7 @@ guide-entry-bank = NT Galactic Bank guide-entry-piloting = Piloting guide-entry-hiring = Hiring Crew guide-entry-expeditions = Expeditions +guide-entry-cargo-hauling = Cargo Hauling guide-entry-shipyard = Shipyard guide-entry-frontier-rules = Server Rules