Steal the mail thieving objective (#35746)

* mail theft

* networked
This commit is contained in:
slarticodefast
2025-03-09 20:41:53 +01:00
committed by GitHub
parent bcf3390c88
commit 7a6b947e60
9 changed files with 47 additions and 22 deletions

View File

@@ -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;
}

View 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;

View 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));

View File

@@ -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;
}

View 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

View File

@@ -39,6 +39,8 @@
- type: ContainerContainer
containers:
delivery: !type:Container
- type: StealTarget
stealGroup: Mail
- type: entity
parent: BaseDelivery

View File

@@ -62,7 +62,8 @@
HeadBedsheetStealCollectionObjective: 1
StampStealCollectionObjective: 1
DoorRemoteStealCollectionObjective: 1
TechnologyDiskStealCollectionObjective: 1 #rnd
TechnologyDiskStealCollectionObjective: 1 #sci
MailStealCollectionObjective: 1 #cargo
IDCardsStealCollectionObjective: 1
LAMPStealCollectionObjective: 2 #only for moth

View File

@@ -128,6 +128,13 @@
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

View File

@@ -111,6 +111,20 @@
- 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