From 4227c24454be11fab40f38ea3f2d5a264f1cb721 Mon Sep 17 00:00:00 2001 From: WarMechanic <69510347+WarMechanic@users.noreply.github.com> Date: Tue, 9 Jul 2024 20:47:18 +1000 Subject: [PATCH] Split Emag in half (#1426) * make changes * fix yaml linter bug * locales * consolidations * fix DeltaV comment appearing in uplink * e * Update emag.yml Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * emag invalid target locale * change id 'airlockaccessoverride' to 'doorjack' * name consolidations + doorjack sprite * Update Resources/Locale/en-US/deltav/store/uplink-catalog.ftl Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * Update Resources/Locale/en-US/store/uplink-catalog.ftl Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * Update Resources/Locale/en-US/emag/emag.ftl Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * Update Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * Update Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> * deltanedas --------- Signed-off-by: WarMechanic <69510347+WarMechanic@users.noreply.github.com> Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> --- .../Emag/Components/EmagComponent.cs | 15 ++++++++++++ Content.Shared/Emag/Systems/EmagSystem.cs | 11 +++++++++ .../en-US/deltav/store/uplink-catalog.ftl | 3 +++ Resources/Locale/en-US/emag/emag.ftl | 2 ++ .../Locale/en-US/store/uplink-catalog.ftl | 5 ++-- .../Prototypes/Catalog/uplink_catalog.yml | 2 +- .../DeltaV/Catalog/uplink_catalog.yml | 10 ++++++++ .../DeltaV/Entities/Objects/Tools/emag.yml | 17 ++++++++++++++ .../Entities/Objects/Tools/emag.yml | 3 +++ .../Objects/Tools/doorjack.rsi/icon.png | Bin 0 -> 369 bytes .../Tools/doorjack.rsi/inhand-left.png | Bin 0 -> 261 bytes .../Tools/doorjack.rsi/inhand-right.png | Bin 0 -> 262 bytes .../Objects/Tools/doorjack.rsi/meta.json | 22 ++++++++++++++++++ 13 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml create mode 100644 Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/icon.png create mode 100644 Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/inhand-left.png create mode 100644 Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/inhand-right.png create mode 100644 Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/meta.json diff --git a/Content.Shared/Emag/Components/EmagComponent.cs b/Content.Shared/Emag/Components/EmagComponent.cs index 235cf0c7444..69115c3be65 100644 --- a/Content.Shared/Emag/Components/EmagComponent.cs +++ b/Content.Shared/Emag/Components/EmagComponent.cs @@ -1,5 +1,6 @@ using Content.Shared.Emag.Systems; using Content.Shared.Tag; +using Content.Shared.Whitelist; using Robust.Shared.GameStates; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization; @@ -17,4 +18,18 @@ public sealed partial class EmagComponent : Component [DataField("emagImmuneTag", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] [AutoNetworkedField] public string EmagImmuneTag = "EmagImmune"; + + // DeltaV - Add a whitelist/blacklist to the Emag + /// + /// Whitelist that entities must be on to work. + /// + [DataField] + public EntityWhitelist? Whitelist; + + /// + /// Blacklist that entities must be off to work. + /// + [DataField] + public EntityWhitelist? Blacklist; + // End of DeltaV code } diff --git a/Content.Shared/Emag/Systems/EmagSystem.cs b/Content.Shared/Emag/Systems/EmagSystem.cs index 4d3bbcbb8e9..18a28f4f5bd 100644 --- a/Content.Shared/Emag/Systems/EmagSystem.cs +++ b/Content.Shared/Emag/Systems/EmagSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.Popups; using Content.Shared.Silicons.Laws.Components; using Content.Shared.Tag; +using Content.Shared.Whitelist; namespace Content.Shared.Emag.Systems; @@ -23,6 +24,7 @@ public sealed class EmagSystem : EntitySystem [Dependency] private readonly SharedChargesSystem _charges = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly TagSystem _tag = default!; + [Dependency] private readonly EntityWhitelistSystem _whitelist = default!; // DeltaV - Add a whitelist/blacklist to the Emag public override void Initialize() { @@ -50,6 +52,15 @@ public bool TryUseEmag(EntityUid uid, EntityUid user, EntityUid target, EmagComp if (_tag.HasTag(target, comp.EmagImmuneTag)) return false; + // DeltaV - Add a whitelist / blacklist to the Emag + if (_whitelist.IsWhitelistFail(comp.Whitelist, target) + || _whitelist.IsBlacklistPass(comp.Blacklist, target)) + { + _popup.PopupClient(Loc.GetString("emag-invalid-target", ("emag", uid), ("target", target)), user, user); + return false; + } + // End of DeltaV code + TryComp(uid, out var charges); if (_charges.IsEmpty(uid, charges)) { diff --git a/Resources/Locale/en-US/deltav/store/uplink-catalog.ftl b/Resources/Locale/en-US/deltav/store/uplink-catalog.ftl index b1c6b34953a..aed51cb9e69 100644 --- a/Resources/Locale/en-US/deltav/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/deltav/store/uplink-catalog.ftl @@ -13,3 +13,6 @@ uplink-syndicate-radio-implanter-bundle-desc = Two implanters for the price of o uplink-generic-radio-implanter-name = Generic Radio Implanter uplink-generic-radio-implanter-desc = A cranial implant with a bluespace compartment for a single encryption key (not included). Put in a key of your choice, and you can talk using it like you would with any headset. + +uplink-doorjack-name = Airlock Access Override +uplink-doorjack-desc = A specialized cryptographic sequencer, designed solely to doorjack NanoTrasen's updated airlocks. Does not tamper with anything else. diff --git a/Resources/Locale/en-US/emag/emag.ftl b/Resources/Locale/en-US/emag/emag.ftl index b4679870b52..ce7b5c5b24a 100644 --- a/Resources/Locale/en-US/emag/emag.ftl +++ b/Resources/Locale/en-US/emag/emag.ftl @@ -1,2 +1,4 @@ emag-success = The card zaps something in {THE($target)}. emag-no-charges = No charges left! +# DeltaV +emag-invalid-target = {$emag} has no effect on {THE($target)}. diff --git a/Resources/Locale/en-US/store/uplink-catalog.ftl b/Resources/Locale/en-US/store/uplink-catalog.ftl index 52c66727f03..83e36dba34f 100644 --- a/Resources/Locale/en-US/store/uplink-catalog.ftl +++ b/Resources/Locale/en-US/store/uplink-catalog.ftl @@ -112,8 +112,9 @@ uplink-holster-desc = A deep shoulder holster capable of holding many types of b uplink-chest-rig-name = Chest Rig uplink-chest-rig-desc = Explosion-resistant tactical webbing used for holding traitor goods. -uplink-emag-name = Emag -uplink-emag-desc = The business card of the syndicate, this sequencer is able to break open airlocks and tamper with a variety of station devices. Recharges automatically. +# DeltaV - Correct Emag name, Emag no longer breaks doors +uplink-emag-name = Cryptographic Sequencer +uplink-emag-desc = The business card of the Syndicate, this sequencer is able to tamper with a variety of station devices. Rendered obsolete against airlocks. uplink-agent-id-card-name = Agent ID Card uplink-agent-id-card-desc = A modified ID card that can copy accesses from other cards and change its name and job title at-will. diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml index 534a4137401..c7f7c531950 100644 --- a/Resources/Prototypes/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Catalog/uplink_catalog.yml @@ -734,7 +734,7 @@ description: uplink-emag-desc productEntity: Emag cost: - Telecrystal: 10 # DV was 8, rebalanced after discussion + Telecrystal: 4 # DV was 8, can no longer emag doors categories: - UplinkDisruption diff --git a/Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml b/Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml index d28941f1070..1f8970bfc0f 100644 --- a/Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml @@ -71,3 +71,13 @@ Telecrystal: 4 categories: - UplinkImplants + +- type: listing + id: UplinkDoorjack + name: uplink-doorjack-name + description: uplink-doorjack-desc + productEntity: Doorjack + cost: + Telecrystal: 6 + categories: + - UplinkDisruption diff --git a/Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml b/Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml new file mode 100644 index 00000000000..ee7b267bcdf --- /dev/null +++ b/Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml @@ -0,0 +1,17 @@ +- type: entity + parent: Emag + id: Doorjack + name: airlock access override + description: A specialized cryptographic sequencer with a distinctive battery tray, specifically designed to override station airlock access codes. + components: + - type: Emag + blacklist: + whitelist: + components: + - Airlock + - type: Sprite + sprite: DeltaV/Objects/Tools/doorjack.rsi + state: icon + - type: Item + sprite: DeltaV/Objects/Tools/doorjack.rsi + storedRotation: -90 diff --git a/Resources/Prototypes/Entities/Objects/Tools/emag.yml b/Resources/Prototypes/Entities/Objects/Tools/emag.yml index 0117d44d6d7..802a5b81581 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/emag.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/emag.yml @@ -6,6 +6,9 @@ description: The all-in-one hacking solution. The thinking man's lockpick. The iconic EMAG. components: - type: Emag + blacklist: # DeltaV - Split Emag into 2 items, this one cannot emag doors + components: + - Airlock - type: Sprite sprite: Objects/Tools/emag.rsi state: icon diff --git a/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/icon.png b/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f244ac00b45610002bbab5366912b32a7df00ebc GIT binary patch literal 369 zcmV-%0gnEOP)Ne=&4f$7RWYSBUG7gIh(OL| zR}mp^2~zbuYt_;MWvb*Xooa$a8eF;v|?avY2KJEZ3 P00000NkvXXu0mjf>D-Y~ literal 0 HcmV?d00001 diff --git a/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/inhand-left.png b/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..f273903cb6e4e932f35cf110a23aa03c9b906467 GIT binary patch literal 261 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!C9Uzjv*CsZ*OhnJ!Bxj8o+;u=ZwQk#g~_s zx+ke@GuU-v;){=-W_!X__4MxVKPw8$Pk0?Gm>7pvy*eh`-nW#ccW3Z) zfrqy~Uz2-UHN`;dO=Q-Y-k+DJeb^P>S0Jfq|NL0_ua7n7gnqpaxEwDBGKGQRQ|jNo z=tKA8?Xu+)s|tVi)V8Fiyi?XuE|zCxsEgCg4=qS}{vr3-F_2nMS3j3^P6xDPi5QZ5C^;fLF zJblCAxs4)*U--(|f{tETeP7a}{MAFogz}{|40+d6o-bUU!~;_9>FVdQ&MBb@04s4} A$p8QV literal 0 HcmV?d00001 diff --git a/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/meta.json b/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/meta.json new file mode 100644 index 00000000000..ce906d3c743 --- /dev/null +++ b/Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/meta.json @@ -0,0 +1,22 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation from commit https://github.com/tgstation/tgstation/commit/d917f4c2a088419d5c3aec7656b7ff8cebd1822e, inhand sprites modified from tgstation at commit https://github.com/tgstation/tgstation/commit/d917f4c2a088419d5c3aec7656b7ff8cebd1822e", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + }, + { + "name": "icon" + } + ] +}