Skip to content

Commit

Permalink
Split Emag in half (DeltaV-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
WarMechanic and DEATHB4DEFEAT authored Jul 9, 2024
1 parent 85939f4 commit 4227c24
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 3 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
3 changes: 3 additions & 0 deletions Resources/Locale/en-US/deltav/store/uplink-catalog.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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 @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Catalog/uplink_catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 @@ -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
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 4227c24

Please sign in to comment.