]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add multi-job exclusion support to objectives, and add more appropriate job restricti...
authorSuper <84590915+SuperGDPWYL@users.noreply.github.com>
Fri, 31 Oct 2025 09:26:25 +0000 (09:26 +0000)
committerGitHub <noreply@github.com>
Fri, 31 Oct 2025 09:26:25 +0000 (09:26 +0000)
* multi exclusion!

* quick correction

* migrate all job: fields to jobs fields to avoid test fails. breaking change!!!

Content.Server/Objectives/Components/NotJobRequirementComponent.cs
Content.Server/Objectives/Systems/NotJobRequirementSystem.cs
Resources/Prototypes/Objectives/thief.yml
Resources/Prototypes/Objectives/traitor.yml

index 6f6619da2b193e1eba8451ba674c606e55067c65..cfc007e1e16750cb20a4db3c2ec6ce5d384bdd62 100644 (file)
@@ -2,6 +2,7 @@ using Content.Server.Objectives.Systems;
 using Content.Shared.Roles;
 using Content.Shared.Roles.Jobs;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+using Robust.Shared.Prototypes;
 
 /// <summary>
 /// Requires that the player not have a certain job to have this objective.
@@ -9,9 +10,10 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
 [RegisterComponent, Access(typeof(NotJobRequirementSystem))]
 public sealed partial class NotJobRequirementComponent : Component
 {
+
     /// <summary>
-    /// ID of the job to ban from having this objective.
+    /// List of job prototype IDs to ban from having this objective.
     /// </summary>
-    [DataField(required: true, customTypeSerializer: typeof(PrototypeIdSerializer<JobPrototype>))]
-    public string Job = string.Empty;
+    [DataField]
+    public List<ProtoId<JobPrototype>> Jobs = new List<ProtoId<JobPrototype>>();
 }
index ac7e579c38047e125643eff10aaa75bb3394e85e..4c88bf03f38b5d8638627dd16c3625317df26897 100644 (file)
@@ -25,7 +25,7 @@ public sealed class NotJobRequirementSystem : EntitySystem
         _jobs.MindTryGetJob(args.MindId, out var proto);
 
         // if player has no job then don't care
-        if (proto is not null && proto.ID == comp.Job)
+        if (proto is not null && comp.Jobs.Contains(proto.ID))
             args.Cancelled = true;
     }
 }
index fde0779151d1a391bc6514ba163b2b241b62fc22..7c8dc9d85a1e53003eb0ce041c953ed8a4752ad6 100644 (file)
   id: TechnologyDiskStealCollectionObjective
   components:
   - type: NotJobRequirement
-    job: Scientist
+    jobs: [ Scientist ]
   - type: StealCondition
     stealGroup: TechnologyDisk
     minCollectionSize: 5
   id: MailStealCollectionObjective
   components:
   - type: NotJobRequirement
-    job: CargoTechnician
+    jobs: [ CargoTechnician, SalvageSpecialist ]
   - type: StealCondition
     stealGroup: Mail
     minCollectionSize: 4
   id: IDCardsStealCollectionObjective
   components:
   - type: NotJobRequirement #Here cause you can buy a personnel crate from cargo which is 8 ID cards. Meaning the ID you start with is number nine and you only need to steal one.
-    job: CargoTechnician #TODO: add salvage specialist
+    jobs: [ CargoTechnician, SalvageSpecialist ]
   - type: StealCondition
     stealGroup: IDCard
     minCollectionSize: 5
   id: OfficerHandgunsStealCollectionObjective
   components:
   - type: NotJobRequirement
-    job: SecurityOfficer #TODO: Add HoS, Detective, and Warden
+    jobs: [ SecurityOfficer, HeadOfSecurity, Detective, Warden ]
   - type: StealCondition
     stealGroup: OfficerHandgun
     minCollectionSize: 2
   id: ForensicScannerStealObjective
   components:
   - type: NotJobRequirement
-    job: Detective
+    jobs: [ Detective ]
   - type: StealCondition
     stealGroup: ForensicScanner
   - type: Objective
   id: FlippoEngravedLighterStealObjective
   components:
   - type: NotJobRequirement
-    job: Detective
+    jobs: [ Detective ]
   - type: StealCondition
     stealGroup: FlippoEngravedLighter
   - type: Objective
   id: ClothingOuterHardsuitVoidParamedStealObjective
   components:
   - type: NotJobRequirement
-    job: Paramedic #TODO: make it so this also includes Medical Doctor, Chemist and Psychologist
+    jobs: [ MedicalDoctor, Paramedic, Chemist, Psychologist ]
   - type: StealCondition
     stealGroup: ClothingOuterHardsuitVoidParamed
   - type: Objective
   id: MedicalTechFabCircuitboardStealObjective
   components:
   - type: NotJobRequirement
-    job: MedicalDoctor #TODO: make it so this also includes Chemist, Paramedic and Psychologist
+    jobs: [ MedicalDoctor, Paramedic, Chemist, Psychologist ]
   - type: StealCondition
     stealGroup: MedicalTechFabCircuitboard
   - type: Objective
   id: ClothingHeadsetAltMedicalStealObjective
   components:
   - type: NotJobRequirement
-    job: ChiefMedicalOfficer
+    jobs: [ ChiefMedicalOfficer ]
   - type: StealCondition
     stealGroup: ClothingHeadsetAltMedical
   - type: Objective
   id: FireAxeStealObjective
   components:
   - type: NotJobRequirement
-    job: AtmosphericTechnician
+    jobs: [ AtmosphericTechnician ]
   - type: StealCondition
     stealGroup: FireAxe
   - type: Objective
   id: AmePartFlatpackStealObjective
   components:
   - type: NotJobRequirement
-    job: StationEngineer #TODO: make it so this also includes Atmos technician
+    jobs: [ StationEngineer, AtmosphericTechnician ]
   - type: StealCondition
     stealGroup: AmePartFlatpack
   - type: Objective
   id: ChiefEngineerToolbeltStealObjective
   components:
   #- type: NotJobRequirement                      Is this really necessary? it's a pickpocket objective. Only thing is that it would be easier to get to CE
-  #  Job: StationEngineer, AtmosphericTechnician
+  #  jobs: [ StationEngineer, AtmosphericTechnician ]
   - type: StealCondition
     stealGroup: ChiefEngineerToolBelt
   - type: Objective
   id: ExpeditionsCircuitboardStealObjective
   components:
   - type: NotJobRequirement
-    job: SalvageSpecialist
+    jobs: [ SalvageSpecialist ]
   - type: StealCondition
     stealGroup: SalvageExpeditionsComputerCircuitboard
   - type: Objective
   id: CargoShuttleCircuitboardStealObjective
   components:
   - type: NotJobRequirement
-    job: CargoTechnician #TODO: make it so this also includes Salvage Specialist
+    jobs: [ CargoTechnician, SalvageSpecialist ]
   - type: StealCondition
     stealGroup: CargoShuttleConsoleCircuitboard
   - type: Objective
   id: ClothingEyesHudBeerStealObjective
   components:
   - type: NotJobRequirement
-    job: Bartender #TODO: make it so this also includes Service worker
+    jobs: [ Bartender, ServiceWorker ]
   - type: StealCondition
     stealGroup: ClothingEyesHudBeer
   - type: Objective
   id: BibleStealObjective
   components:
   - type: NotJobRequirement
-    job: Chaplain
+    jobs: [ Chaplain ]
   - type: StealCondition
     stealGroup: Bible
   - type: Objective
   id: ClothingNeckGoldmedalStealObjective
   components:
   - type: NotJobRequirement
-    job: HeadOfPersonnel
+    jobs: [ HeadOfPersonnel ]
   - type: StealCondition
     stealGroup: ClothingNeckGoldmedal
   - type: Objective
   id: ClothingNeckClownmedalStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: ClothingNeckClownmedal
   - type: Objective
   id: CaptainSwordStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: CaptainSword
   - type: Objective
   id: NuclearBombStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: NuclearBomb
   - type: Objective
   id: FaxMachineCaptainStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: FaxMachineCaptain
   - type: Objective
   id: ChemDispenserStealObjective
   components:
   - type: NotJobRequirement
-    job: Chemist #TODO: make it so this also includes Scientist. It's a roundstart circuit they can construct.
+    jobs: [ Chemist, Scientist ]
   - type: StealCondition
     stealGroup: ChemDispenser
   - type: Objective
   id: XenoArtifactStealObjective
   components:
   - type: NotJobRequirement
-    job: Scientist
+    jobs: [ Scientist ]
   - type: StealCondition
     stealGroup: XenoArtifact
   - type: Objective
   id: FreezerHeaterStealObjective
   components:
   - type: NotJobRequirement
-    job: AtmosphericTechnician #TODO: make it so this also includes Engineer, Medical doctor, chemist and maybe also scientist. Medical doc and chemist cause cryogenics, scientist cause it can be built and is sometimes mapped in artisci
+    jobs: [ AtmosphericTechnician, MedicalDoctor, Chemist, Paramedic, Psychologist, Scientist, Chef ]
   - type: StealCondition
     stealGroup: FreezerHeater
   - type: Objective
   id: TegStealObjective
   components:
   - type: NotJobRequirement
-    job: AtmosphericTechnician #TODO: make it so this also includes Engineer, Several TEG only maps have TEG accessible by standard Engineers
+    jobs: [ AtmosphericTechnician, StationEngineer ]
   - type: StealCondition
     stealGroup: Teg
   - type: Objective
   id: BoozeDispenserStealObjective
   components:
   - type: NotJobRequirement
-    job: Bartender #TODO: make it so this also includes Service worker
+    jobs: [ Bartender, ServiceWorker ]
   - type: StealCondition
     stealGroup: BoozeDispenser
   - type: Objective
   id: AltarNanotrasenStealObjective
   components:
   - type: NotJobRequirement
-    job: Chaplain
+    jobs: [ Chaplain ]
   - type: StealCondition
     stealGroup: AltarNanotrasen
   - type: Objective
   id: PlantRDStealObjective
   components:
   - type: NotJobRequirement
-    job: Scientist
+    jobs: [ Scientist ]
   - type: StealCondition
     stealGroup: PlantRD
   - type: Objective
   id: ToiletGoldenStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: ToiletGoldenDirtyWater
   - type: Objective
   id: IanStealObjective
   components:
   - type: NotJobRequirement
-    job: HeadOfPersonnel
+    jobs: [ HeadOfPersonnel ]
   - type: StealCondition
     stealGroup: AnimalIan
   - type: Objective
   id: McGriffStealObjective
   components:
   - type: NotJobRequirement
-    job: Detective
+    jobs: [ Detective ]
   - type: StealCondition
     stealGroup: AnimalMcGriff
   - type: Objective
   id: WalterStealObjective
   components:
   - type: NotJobRequirement
-    job: Chemist
+    jobs: [ Chemist ]
   - type: StealCondition
     stealGroup: AnimalWalter
   - type: Objective
   id: RenaultStealObjective
   components:
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
   - type: StealCondition
     stealGroup: AnimalRenault
   - type: Objective
   id: ShivaStealObjective
   components:
   - type: NotJobRequirement
-    job: SecurityOfficer
+    jobs: [ SecurityOfficer ]
   - type: StealCondition
     stealGroup: AnimalShiva
   - type: Objective
   id: TropicoStealObjective
   components:
   - type: NotJobRequirement
-    job: AtmosphericTechnician
+    jobs: [ AtmosphericTechnician ]
   - type: StealCondition
     stealGroup: AnimalTropico
   - type: Objective
index 26a4db42a07ff663115b4a29269fbf99eafd6409..1d6fab6998335d10f492341720810c4b65788b75 100644 (file)
   id: BaseCMOStealObjective
   components:
   - type: NotJobRequirement
-    job: ChiefMedicalOfficer
+    jobs: [ ChiefMedicalOfficer ]
   - type: StealCondition
     owner: job-name-cmo
 
   id: BaseRDStealObjective
   components:
   - type: NotJobRequirement
-    job: ResearchDirector
+    jobs: [ ResearchDirector ]
   - type: StealCondition
     owner: job-name-rd
 
     # HoS will have this on them a lot of the time so..
     difficulty: 3
   - type: NotJobRequirement
-    job: HeadOfSecurity
+    jobs: [ HeadOfSecurity ]
   - type: StealCondition
     stealGroup: WeaponEnergyMagnum
     owner: job-name-hos
   id: MagbootsStealObjective
   components:
   - type: NotJobRequirement
-    job: ChiefEngineer
+    jobs: [ ChiefEngineer ]
   - type: StealCondition
     stealGroup: ClothingShoesBootsMagAdv
     owner: job-name-ce
   id: ClipboardStealObjective
   components:
   - type: NotJobRequirement
-    job: Quartermaster
+    jobs: [ Quartermaster ]
   - type: StealCondition
     stealGroup: BoxFolderQmClipboard
     owner: job-name-qm
   id: KnuckleDustersStealObjective
   components:
   - type: NotJobRequirement
-    job: Quartermaster
+    jobs: [ Quartermaster ]
   - type: StealCondition
     stealGroup: ClothingHandsKnuckleDustersQM
     owner: job-name-qm
   id: CorgiMeatStealObjective
   components:
   - type: NotJobRequirement
-    job: HeadOfPersonnel
+    jobs: [ HeadOfPersonnel ]
   - type: ObjectiveLimit
     limit: 3 # ian only has 2 slices, 3 obj for drama
   - type: StealCondition
     # sorry ce but your jordans are not as high security as the caps gear
     difficulty: 3.5
   - type: NotJobRequirement
-    job: Captain
+    jobs: [ Captain ]
 
 - type: entity
   parent: BaseCaptainObjective