]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Steal the mail thieving objective (#35746)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Sun, 9 Mar 2025 19:41:53 +0000 (20:41 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Mar 2025 19:41:53 +0000 (20:41 +0100)
* mail theft

* networked

Content.Server/Objectives/Components/StealTargetComponent.cs [deleted file]
Content.Server/Objectives/Systems/StealConditionSystem.cs
Content.Shared/Delivery/SharedDeliverySystem.cs
Content.Shared/Objectives/Components/StealTargetComponent.cs [new file with mode: 0644]
Resources/Locale/en-US/objectives/conditions/steal-target-groups.ftl
Resources/Prototypes/Entities/Objects/Deliveries/deliveries.yml
Resources/Prototypes/Objectives/objectiveGroups.yml
Resources/Prototypes/Objectives/stealTargetGroups.yml
Resources/Prototypes/Objectives/thief.yml

diff --git a/Content.Server/Objectives/Components/StealTargetComponent.cs b/Content.Server/Objectives/Components/StealTargetComponent.cs
deleted file mode 100644 (file)
index 25fb9d3..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-using Content.Server.Objectives.Systems;
-using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
-
-namespace Content.Server.Objectives.Components.Targets;
-
-/// <summary>
-/// Allows an object to become the target of a StealCollection  objection
-/// </summary>
-[RegisterComponent]
-public sealed partial class StealTargetComponent : Component
-{
-    /// <summary>
-    /// The theft group to which this item belongs.
-    /// </summary>
-    [DataField(required: true), ViewVariables(VVAccess.ReadWrite)]
-    public string StealGroup;
-}
index d61b796e42e431285eff552c9ba5111ef56939e7..7dc628c46f7b9b9cd1c4a0f2349bb2e1c0d2efd3 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Server.Objectives.Components;
-using Content.Server.Objectives.Components.Targets;
 using Content.Shared.CartridgeLoader;
 using Content.Shared.Interaction;
 using Content.Shared.Mind;
index 0f8ceb73fc357532aaaadcee917b7d5e2ea34a4f..52c9db40a1fc0b426f0395645b81aaec6ba48453 100644 (file)
@@ -6,6 +6,7 @@ using Content.Shared.Hands.EntitySystems;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction.Events;
 using Content.Shared.NameModifier.EntitySystems;
+using Content.Shared.Objectives.Components;
 using Content.Shared.Popups;
 using Content.Shared.Tag;
 using Content.Shared.Verbs;
@@ -130,6 +131,7 @@ public abstract class SharedDeliverySystem : EntitySystem
 
         _tag.AddTags(ent, "Trash", "Recyclable");
         EnsureComp<SpaceGarbageComponent>(ent);
+        RemComp<StealTargetComponent>(ent); // opened mail should not count for the objective
 
         DirtyField(ent.Owner, ent.Comp, nameof(DeliveryComponent.IsOpened));
 
diff --git a/Content.Shared/Objectives/Components/StealTargetComponent.cs b/Content.Shared/Objectives/Components/StealTargetComponent.cs
new file mode 100644 (file)
index 0000000..f286b0a
--- /dev/null
@@ -0,0 +1,17 @@
+using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Objectives.Components;
+
+/// <summary>
+/// Allows an object to become the target of a steal objective
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class StealTargetComponent : Component
+{
+    /// <summary>
+    /// The theft group to which this item belongs.
+    /// </summary>
+    [DataField(required: true)]
+    public ProtoId<StealTargetGroupPrototype> StealGroup;
+}
index 689e2e7808eb9867159f6a4247cc4a05c3cb38a6..6fc6ad850a6bdc4d51a9554196e038b4d9331fd5 100644 (file)
@@ -20,6 +20,7 @@ steal-target-groups-stamps = stamp
 steal-target-groups-door-remotes = door remote
 steal-target-groups-encryption-keys = encryption key
 steal-target-groups-technology-disks = technology disk
+steal-target-groups-mail = mail
 steal-target-groups-id-cards = ID Card
 steal-target-groups-lamps = LAMP
 
index ffa9a5791a11f8f0da130749d7daf696ab41d166..203d4f577ecbe73824874a40e0881337dc6e671c 100644 (file)
@@ -39,6 +39,8 @@
   - type: ContainerContainer
     containers:
       delivery: !type:Container
+  - type: StealTarget
+    stealGroup: Mail
 
 - type: entity
   parent: BaseDelivery
index 3c59ab9a1830cfe0bfeb6e39c93cb4e47081b773..b75fcb72c283afb164d54fa3014ebd119fd84ddc 100644 (file)
 - type: weightedRandom
   id: ThiefObjectiveGroupCollection
   weights:
-    HeadCloakStealCollectionObjective: 1           #command
+    HeadCloakStealCollectionObjective: 1                #command
     HeadBedsheetStealCollectionObjective: 1
     StampStealCollectionObjective: 1
     DoorRemoteStealCollectionObjective: 1
-    TechnologyDiskStealCollectionObjective: 1        #rnd
+    TechnologyDiskStealCollectionObjective: 1           #sci
+    MailStealCollectionObjective: 1                     #cargo
     IDCardsStealCollectionObjective: 1
-    LAMPStealCollectionObjective: 2 #only for moth
+    LAMPStealCollectionObjective: 2                     #only for moth
 
 - type: weightedRandom
   id: ThiefObjectiveGroupItem
index b21e0dc2dea421b344d677376b03598fc434055f..43d8101b73d26d4780e1a8d7ca9f1fd7330705bd 100644 (file)
     sprite: Objects/Misc/module.rsi
     state: datadisk_base
 
+- type: stealTargetGroup
+  id: Mail
+  name: steal-target-groups-mail
+  sprite:
+    sprite: Objects/Specific/Cargo/mail.rsi
+    state: icon
+
 - type: stealTargetGroup
   id: IDCard
   name: steal-target-groups-id-cards
index c36b5f3192126744830db24d108367912e12c9bb..b5d0141cb76e8eef64642c01810ad77c5e3ab694 100644 (file)
   - type: Objective
     difficulty: 0.8
 
+- type: entity
+  parent: BaseThiefStealCollectionObjective
+  id: MailStealCollectionObjective
+  components:
+  - type: NotJobRequirement
+    job: CargoTechnician
+  - type: StealCondition
+    stealGroup: Mail
+    minCollectionSize: 4
+    maxCollectionSize: 8
+    verifyMapExistence: false
+  - type: Objective
+    difficulty: 0.8
+
 - type: entity
   parent: BaseThiefStealCollectionObjective
   id: IDCardsStealCollectionObjective