From e0ad8c0da022cdf62dd7ffca2f7e7aa717f32e43 Mon Sep 17 00:00:00 2001 From: chromiumboy <50505512+chromiumboy@users.noreply.github.com> Date: Tue, 19 Mar 2024 23:16:27 -0500 Subject: [PATCH] Syndicate traitors can now purchase nuke codes (#26280) --- .../Store/Systems/StoreSystem.Refund.cs | 15 ++++++++++++++- .../Locale/en-US/store/uplink-catalog.ftl | 3 +++ .../Prototypes/Catalog/uplink_catalog.yml | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Content.Server/Store/Systems/StoreSystem.Refund.cs b/Content.Server/Store/Systems/StoreSystem.Refund.cs index d59ee75e3e..719e785764 100644 --- a/Content.Server/Store/Systems/StoreSystem.Refund.cs +++ b/Content.Server/Store/Systems/StoreSystem.Refund.cs @@ -1,4 +1,6 @@ -using Content.Server.Store.Components; +using Content.Server.Paper; +using Content.Server.Store.Components; +using Content.Shared.UserInterface; using Robust.Shared.Containers; namespace Content.Server.Store.Systems; @@ -11,6 +13,17 @@ public sealed partial class StoreSystem SubscribeLocalEvent(OnRefundTerminating); SubscribeLocalEvent(OnEntityRemoved); SubscribeLocalEvent(OnEntityInserted); + SubscribeLocalEvent(BeforeUIOpen); + } + private void BeforeUIOpen(EntityUid uid, StoreRefundComponent component, BeforeActivatableUIOpenEvent args) + { + if (component.StoreEntity == null || _actions.TryGetActionData(uid, out _) || !TryComp(component.StoreEntity.Value, out var storeComp)) + return; + + if (!TryComp(uid, out var paper) || string.IsNullOrEmpty(paper.Content)) + return; + + DisableRefund(component.StoreEntity.Value, storeComp); } private void OnEntityRemoved(EntityUid uid, StoreRefundComponent component, EntRemovedFromContainerMessage args) diff --git a/Resources/Locale/en-US/store/uplink-catalog.ftl b/Resources/Locale/en-US/store/uplink-catalog.ftl index 592cf59d2f..3b29225ae5 100644 --- a/Resources/Locale/en-US/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/store/uplink-catalog.ftl @@ -160,6 +160,9 @@ uplink-syndicate-weapon-module-desc = This module will give a cyborg advanced la uplink-singularity-beacon-name = Singularity Beacon uplink-singularity-beacon-desc = A device that attracts singularities. Has to be anchored and powered. Causes singularities to grow when consumed. +uplink-nuke-code-paper-name = Stolen nuclear authentication codes +uplink-nuke-code-paper-desc = A slip of paper with the authentication codes for a nearby nuclear fission explosive device. + # Implants uplink-storage-implanter-name = Storage Implanter uplink-storage-implanter-desc = Hide goodies inside of yourself with new bluespace technology! diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 7753c31e92..758a53d9a8 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -860,6 +860,25 @@ categories: - UplinkDisruption +- type: listing + id: UplinkNukeCodePaper + name: uplink-nuke-code-paper-name + description: uplink-nuke-code-paper-desc + productEntity: NukeCodePaper + cost: + Telecrystal: 2 + categories: + - UplinkDisruption + conditions: + - !type:StoreWhitelistCondition + blacklist: + tags: + - NukeOpsUplink + - !type:BuyerWhitelistCondition + blacklist: + components: + - SurplusBundle + # Allies #- type: listing