]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Appraisal tools check for cargo bounty completion (#23760)
authorike709 <ike709@users.noreply.github.com>
Tue, 9 Jan 2024 04:18:50 +0000 (21:18 -0700)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2024 04:18:50 +0000 (23:18 -0500)
Co-authored-by: ike709 <ike709@github.com>
Content.Server/Cargo/Systems/PriceGunSystem.cs
Resources/Locale/en-US/cargo/price-gun-component.ftl
Resources/Prototypes/Entities/Objects/Tools/appraisal.yml

index d7d708821c9b2e440bd075c427f143480debf820..7bd49b857ae17fa219a4803a975efcd69767b2c4 100644 (file)
@@ -15,6 +15,7 @@ public sealed class PriceGunSystem : EntitySystem
     [Dependency] private readonly UseDelaySystem _useDelay = default!;
     [Dependency] private readonly PricingSystem _pricingSystem = default!;
     [Dependency] private readonly PopupSystem _popupSystem = default!;
+    [Dependency] private readonly CargoSystem _bountySystem = default!;
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -55,9 +56,17 @@ public sealed class PriceGunSystem : EntitySystem
         if (!TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
             return;
 
-        var price = _pricingSystem.GetPrice(args.Target.Value);
+        // Check if we're scanning a bounty crate
+        if (_bountySystem.IsBountyComplete(args.Target.Value, (EntityUid?) null, out _))
+        {
+            _popupSystem.PopupEntity(Loc.GetString("price-gun-bounty-complete"), args.User, args.User);
+        }
+        else // Otherwise appraise the price
+        {
+            double price = _pricingSystem.GetPrice(args.Target.Value);
+            _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, args.User);
+        }
 
-        _popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(args.Target.Value, EntityManager)), ("price", $"{price:F2}")), args.User, args.User);
         _useDelay.TryResetDelay((uid, useDelay));
         args.Handled = true;
     }
index e266078c5dfe1055ed7701e658199bf67994356b..29a1482d19c0eda424ee9ea54e9c415b5a45f4d5 100644 (file)
@@ -1,3 +1,4 @@
 price-gun-pricing-result = The device deems {THE($object)} to be worth {$price} spesos.
 price-gun-verb-text = Appraisal
 price-gun-verb-message = Appraise {THE($object)}.
+price-gun-bounty-complete = The device confirms that the bounty contained within is completed.
index 539e5a3dc5f86d28cb143a247a4d9c1ecd189e7e..4ec8d288573a90de653f5cbdd81e70a05404c91f 100644 (file)
@@ -2,7 +2,7 @@
   parent: BaseItem
   id: AppraisalTool
   name: appraisal tool
-  description: A beancounter's best friend, with a quantum connection to the galactic market and the ability to appraise even the toughest items.
+  description: A beancounter's best friend, with a quantum connection to the galactic market and the ability to appraise even the toughest items. It will also tell you if a crate contains a completed bounty.
   components:
   - type: Sprite
     sprite: Objects/Tools/appraisal-tool.rsi