Skip to content

Commit

Permalink
Split Emag in half (Simple-Station#1426)
Browse files Browse the repository at this point in the history
* make changes

* fix yaml linter bug

* locales

* consolidations

* fix DeltaV comment appearing in uplink

* e

* Update emag.yml

Signed-off-by: WarMechanic <[email protected]>

* 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 <[email protected]>
Signed-off-by: WarMechanic <[email protected]>

* Update Resources/Locale/en-US/store/uplink-catalog.ftl

Co-authored-by: DEATHB4DEFEAT <[email protected]>
Signed-off-by: WarMechanic <[email protected]>

* Update Resources/Locale/en-US/emag/emag.ftl

Co-authored-by: DEATHB4DEFEAT <[email protected]>
Signed-off-by: WarMechanic <[email protected]>

* Update Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml

Co-authored-by: DEATHB4DEFEAT <[email protected]>
Signed-off-by: WarMechanic <[email protected]>

* Update Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml

Co-authored-by: DEATHB4DEFEAT <[email protected]>
Signed-off-by: WarMechanic <[email protected]>

* deltanedas

---------

Signed-off-by: WarMechanic <[email protected]>
Co-authored-by: DEATHB4DEFEAT <[email protected]>
  • Loading branch information
2 people authored and angelofallars committed Feb 1, 2025
1 parent c1aa5b8 commit ed0e9f0
Show file tree
Hide file tree
Showing 13 changed files with 97 additions and 4 deletions.
15 changes: 15 additions & 0 deletions Content.Shared/Emag/Components/EmagComponent.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -17,4 +18,18 @@ public sealed partial class EmagComponent : Component
[DataField("emagImmuneTag", customTypeSerializer: typeof(PrototypeIdSerializer<TagPrototype>)), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public string EmagImmuneTag = "EmagImmune";

// DeltaV - Add a whitelist/blacklist to the Emag
/// <summary>
/// Whitelist that entities must be on to work.
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;

/// <summary>
/// Blacklist that entities must be off to work.
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
// End of DeltaV code
}
11 changes: 11 additions & 0 deletions Content.Shared/Emag/Systems/EmagSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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()
{
Expand Down Expand Up @@ -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<LimitedChargesComponent>(uid, out var charges);
if (_charges.IsEmpty(uid, charges))
{
Expand Down
12 changes: 12 additions & 0 deletions Resources/Locale/en-US/deltav/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@ uplink-reinforcement-radio-nukie-mouse-desc = Calls in a specially trained mouse
# Implants
uplink-bionic-syrinx-implanter-name = Bionic Syrinx Implanter
uplink-bionic-syrinx-implanter-desc = An implant that enhances a harpy's natural talent for mimicry to let you adjust your voice to whoever you can think of.
uplink-syndicate-radio-implanter-name = Syndicate Radio Implanter
uplink-syndicate-radio-implanter-desc = A cranial implant that lets you talk on the Syndicate radio channel (use :t).
uplink-syndicate-radio-implanter-bundle-name = Syndicate Radio Implanter Bundle
uplink-syndicate-radio-implanter-bundle-desc = Two implanters for the price of one and a half! Share one with your Syndicate friend.
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.
2 changes: 2 additions & 0 deletions Resources/Locale/en-US/emag/emag.ftl
Original file line number Diff line number Diff line change
@@ -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)}.
5 changes: 3 additions & 2 deletions Resources/Locale/en-US/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,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.
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,9 @@
productEntity: Emag
discountCategory: veryRareDiscounts
discountDownTo:
Telecrystal: 5
Telecrystal: 2 # DV
cost:
Telecrystal: 8
Telecrystal: 4 # DV was 8, can no longer emag doors
categories:
- UplinkDisruption

Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/DeltaV/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@
blacklist:
components:
- SurplusBundle

- type: listing
id: UplinkDoorjack
name: uplink-doorjack-name
description: uplink-doorjack-desc
productEntity: Doorjack
cost:
Telecrystal: 6
categories:
- UplinkDisruption
17 changes: 17 additions & 0 deletions Resources/Prototypes/DeltaV/Entities/Objects/Tools/emag.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/Objects/Tools/emag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions Resources/Textures/DeltaV/Objects/Tools/doorjack.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}

0 comments on commit ed0e9f0

Please sign in to comment.