From f82eee75b088c49125807aa28fd5fafa09730cd5 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:20:05 +0000 Subject: [PATCH] Thief stuff (#480) * - add: Thief stuff. * - fix: Implants. * - add: Jammer. --- .../Implants/SubdermalImplantSystem.cs | 3 ++ .../Implants/Mindslave/MindslaveSystem.cs | 15 ++++++++-- .../Emag/Components/EmagComponent.cs | 4 +++ Content.Shared/Emag/Systems/EmagSystem.cs | 3 ++ Resources/Locale/ru-RU/implant/implant.ftl | 2 +- Resources/Locale/ru-RU/thief/backpack.ftl | 14 ++++++++- .../Prototypes/Catalog/thief_toolbox_sets.yml | 28 ++++++++++++++++++ .../Entities/Objects/Tools/toolbox.yml | 4 ++- .../Closets/Lockers/base_structurelockers.yml | 3 ++ .../Storage/Closets/base_structureclosets.yml | 3 ++ .../Storage/Crates/base_structurecrates.yml | 3 ++ .../Entities/Objects/Tools/doorjack.yml | 21 +++++++++++++ Resources/Prototypes/_White/tags.yml | 3 ++ .../White/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 ++++++++++++++ 17 files changed, 122 insertions(+), 6 deletions(-) create mode 100644 Resources/Prototypes/_White/Entities/Objects/Tools/doorjack.yml create mode 100644 Resources/Textures/White/Objects/Tools/doorjack.rsi/icon.png create mode 100644 Resources/Textures/White/Objects/Tools/doorjack.rsi/inhand-left.png create mode 100644 Resources/Textures/White/Objects/Tools/doorjack.rsi/inhand-right.png create mode 100644 Resources/Textures/White/Objects/Tools/doorjack.rsi/meta.json diff --git a/Content.Server/Implants/SubdermalImplantSystem.cs b/Content.Server/Implants/SubdermalImplantSystem.cs index e8af08b2eb..05550e2f4b 100644 --- a/Content.Server/Implants/SubdermalImplantSystem.cs +++ b/Content.Server/Implants/SubdermalImplantSystem.cs @@ -18,6 +18,7 @@ using Robust.Shared.Physics; using Robust.Shared.Physics.Components; using Robust.Shared.Random; using System.Numerics; +using Content.Server.IdentityManagement; using Content.Shared.Movement.Pulling.Components; using Content.Shared.Movement.Pulling.Systems; using Robust.Shared.Collections; @@ -39,6 +40,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem [Dependency] private readonly PullingSystem _pullingSystem = default!; [Dependency] private readonly EntityLookupSystem _lookupSystem = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!; + [Dependency] private readonly IdentitySystem _identity = default!; // WD private EntityQuery _physicsQuery; private HashSet> _targetGrids = []; @@ -208,6 +210,7 @@ public sealed class SubdermalImplantSystem : SharedSubdermalImplantSystem var newProfile = HumanoidCharacterProfile.RandomWithSpecies(humanoid.Species); _humanoidAppearance.LoadProfile(ent, newProfile, humanoid); _metaData.SetEntityName(ent, newProfile.Name); + _identity.QueueIdentityUpdate(ent); // WD if (TryComp(ent, out var dna)) { dna.DNA = _forensicsSystem.GenerateDNA(); diff --git a/Content.Server/_White/Implants/Mindslave/MindslaveSystem.cs b/Content.Server/_White/Implants/Mindslave/MindslaveSystem.cs index 80838ba8ae..0a2810d017 100644 --- a/Content.Server/_White/Implants/Mindslave/MindslaveSystem.cs +++ b/Content.Server/_White/Implants/Mindslave/MindslaveSystem.cs @@ -37,7 +37,8 @@ public sealed class MindslaveSystem : SharedMindslaveSystem masterComponent.Slaves.Add(GetNetEntity(args.Target)); masterComponent.Master = GetNetEntity(args.User); - Dirty(args.Target, masterComponent); + Dirty(args.User, masterComponent); + Dirty(args.Target, slaveComponent); if (!Mind.TryGetMind(args.Target, out var targetMindId, out var targetMind) || targetMind.Session is null) { @@ -73,7 +74,7 @@ public sealed class MindslaveSystem : SharedMindslaveSystem { return; } - + if (!TryComp(args.Target, out MindSlaveComponent? mindslave)) { return; @@ -85,6 +86,14 @@ public sealed class MindslaveSystem : SharedMindslaveSystem Popup.PopupEntity(Loc.GetString("mindslave-freed", ("player", mindslave.Master)), args.Target, args.Target); } + var master = GetEntity(mindslave.Master); + if (TryComp(master, out MindSlaveComponent? masterMindslave)) + { + masterMindslave.Slaves.Remove(GetNetEntity(args.Target)); + if (masterMindslave.Slaves.Count == 0) + RemComp(master); + } + RemComp(args.Target); } -} \ No newline at end of file +} diff --git a/Content.Shared/Emag/Components/EmagComponent.cs b/Content.Shared/Emag/Components/EmagComponent.cs index 235cf0c744..09bc8a80d4 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,7 @@ public sealed partial class EmagComponent : Component [DataField("emagImmuneTag", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] [AutoNetworkedField] public string EmagImmuneTag = "EmagImmune"; + + [DataField] + public EntityWhitelist? Whitelist; } diff --git a/Content.Shared/Emag/Systems/EmagSystem.cs b/Content.Shared/Emag/Systems/EmagSystem.cs index 4d3bbcbb8e..62010a7697 100644 --- a/Content.Shared/Emag/Systems/EmagSystem.cs +++ b/Content.Shared/Emag/Systems/EmagSystem.cs @@ -50,6 +50,9 @@ public sealed class EmagSystem : EntitySystem if (_tag.HasTag(target, comp.EmagImmuneTag)) return false; + if (comp.Whitelist?.IsValid(target, EntityManager) is false) + return false; + TryComp(uid, out var charges); if (_charges.IsEmpty(uid, charges)) { diff --git a/Resources/Locale/ru-RU/implant/implant.ftl b/Resources/Locale/ru-RU/implant/implant.ftl index 766b4cc49f..f79a2f79a7 100644 --- a/Resources/Locale/ru-RU/implant/implant.ftl +++ b/Resources/Locale/ru-RU/implant/implant.ftl @@ -18,7 +18,7 @@ implanter-contained-implant-text = [color=green]{ $desc }[/color] ## Implant Popups -scramble-implant-activated-popup = Вы превратились в { $identity } +scramble-implant-activated-popup = Ваша внешность меняется! ## Implanter Actions diff --git a/Resources/Locale/ru-RU/thief/backpack.ftl b/Resources/Locale/ru-RU/thief/backpack.ftl index 6ff25fa3c5..566e2ce90c 100644 --- a/Resources/Locale/ru-RU/thief/backpack.ftl +++ b/Resources/Locale/ru-RU/thief/backpack.ftl @@ -15,7 +15,7 @@ thief-backpack-button-deselect = Выбрать [X] thief-backpack-category-chameleon-name = набор хамелеона thief-backpack-category-chameleon-description = - Включает в себя полный комплект одежды-хамелеона, + Включает в себя айди карту агента, а также полный комплект одежды-хамелеона, позволяющую вам маскироваться под практически любую вещь на станции. thief-backpack-category-tools-name = набор медвежатника @@ -53,3 +53,15 @@ thief-backpack-category-smuggler-description = и ящик-невидимка. В них нельзя передвигаться, но вы можете быстро спрятать или унести ценную добычу. К этому набору также прилагается крутой плащ пустоты. + +thief-backpack-category-slavery-name = набор рабовладельца +thief-backpack-category-slavery-description = + Набор, состоящий из трёх имплантеров подчинения + и стильной одежды рабовладельца. + Собери собственную армию послушных рабов! + +thief-backpack-category-hitech-name = высокотехнологичный набор +thief-backpack-category-hitech-description = + Набор для любителей технологий. + Включает в себя устройство для взлома шлюзов и шкафов, + временной маяк, глушитель радио и хамелеон проектор. diff --git a/Resources/Prototypes/Catalog/thief_toolbox_sets.yml b/Resources/Prototypes/Catalog/thief_toolbox_sets.yml index d0fbd277c8..ba4ece9cfa 100644 --- a/Resources/Prototypes/Catalog/thief_toolbox_sets.yml +++ b/Resources/Prototypes/Catalog/thief_toolbox_sets.yml @@ -14,6 +14,7 @@ - ClothingEyesChameleon - ClothingHeadsetChameleon - ClothingShoesChameleon + - AgentIDCard # WD - type: thiefBackpackSet id: ToolsSet @@ -108,3 +109,30 @@ - SmokeGrenade - SmokeGrenade - SmokeGrenade + +- type: thiefBackpackSet + id: SlaverySet + name: thief-backpack-category-slavery-name + description: thief-backpack-category-slavery-description + sprite: + sprite: /Textures/Clothing/Head/Hats/syndiecap_maa.rsi + state: icon + content: + - MindSlaveImplanter + - MindSlaveImplanter + - MindSlaveImplanter + - ClothingOuterCoatSyndieCap + - ClothingHeadHatSyndieMAA + +- type: thiefBackpackSet + id: HiTechSet + name: thief-backpack-category-hitech-name + description: thief-backpack-category-hitech-description + sprite: + sprite: /Textures/White/Objects/Tools/doorjack.rsi + state: icon + content: + - ChameleonProjector + - Doorjack + - TimeBeacon + - RadioJammer diff --git a/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml b/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml index 800c0add54..d4abe6847e 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml @@ -170,10 +170,12 @@ - ChemistrySet - ToolsSet - ChameleonSet # - TO DO Chameleon stump PR needed - - SyndieSet + # - SyndieSet - SleeperSet - CommunicatorSet - SmugglerSet + - SlaverySet # WD + - HiTechSet # WD - type: ActivatableUI key: enum.ThiefBackpackUIKey.Key - type: UserInterface diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml index 69e63b6c6e..45d464e6a1 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml @@ -54,6 +54,9 @@ radius: 1.15 energy: 0.45 - type: PointLightLocker + - type: Tag + tags: + - DoorjackUsable - type: entity id: LockerBaseSecure diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml index 96b008eb02..90fd36eac2 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml @@ -291,3 +291,6 @@ stateDoorOpen: base stateDoorClosed: door - type: LockVisuals + - type: Tag + tags: + - DoorjackUsable diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml index 95580292d9..c742caaf20 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -148,3 +148,6 @@ - Energy reflectProb: 0.2 spread: 90 + - type: Tag + tags: + - DoorjackUsable diff --git a/Resources/Prototypes/_White/Entities/Objects/Tools/doorjack.yml b/Resources/Prototypes/_White/Entities/Objects/Tools/doorjack.yml new file mode 100644 index 0000000000..9c589e1c07 --- /dev/null +++ b/Resources/Prototypes/_White/Entities/Objects/Tools/doorjack.yml @@ -0,0 +1,21 @@ +- type: entity + parent: Emag + id: Doorjack + name: взломщик замков + description: Специальное устройство, предназначенное для обхода доступа в замках шлюзов и шкафов. + components: + - type: LimitedCharges + - type: AutoRecharge + - type: Sprite + sprite: White/Objects/Tools/doorjack.rsi + state: icon + scale: 0.8, 0.8 + - type: Item + sprite: White/Objects/Tools/doorjack.rsi + storedRotation: -90 + - type: Emag + whitelist: + tags: + - DoorjackUsable + components: + - Airlock diff --git a/Resources/Prototypes/_White/tags.yml b/Resources/Prototypes/_White/tags.yml index 3a54188103..a2cefb74dc 100644 --- a/Resources/Prototypes/_White/tags.yml +++ b/Resources/Prototypes/_White/tags.yml @@ -78,3 +78,6 @@ - type: Tag id: BaseAimModule + +- type: Tag + id: DoorjackUsable diff --git a/Resources/Textures/White/Objects/Tools/doorjack.rsi/icon.png b/Resources/Textures/White/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/White/Objects/Tools/doorjack.rsi/inhand-left.png b/Resources/Textures/White/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/White/Objects/Tools/doorjack.rsi/meta.json b/Resources/Textures/White/Objects/Tools/doorjack.rsi/meta.json new file mode 100644 index 0000000000..ce906d3c74 --- /dev/null +++ b/Resources/Textures/White/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" + } + ] +}