diff --git a/Content.Server/Clothing/Components/LoadoutComponent.cs b/Content.Server/Clothing/Components/LoadoutComponent.cs index f224f5718f..6068d0cf4d 100644 --- a/Content.Server/Clothing/Components/LoadoutComponent.cs +++ b/Content.Server/Clothing/Components/LoadoutComponent.cs @@ -1,12 +1,16 @@ using Content.Shared.Roles; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Server.Clothing.Components { [RegisterComponent] public sealed class LoadoutComponent : Component { - [DataField("prototype", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] - public string Prototype = string.Empty; + /// + /// A list of starting gears, of which one will be given. + /// All elements are weighted the same in the list. + /// + [DataField("prototypes", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer))] + public List? Prototypes; } } diff --git a/Content.Server/Clothing/LoadoutSystem.cs b/Content.Server/Clothing/LoadoutSystem.cs index f1f1e9a917..b2cb7d2cb0 100644 --- a/Content.Server/Clothing/LoadoutSystem.cs +++ b/Content.Server/Clothing/LoadoutSystem.cs @@ -2,6 +2,7 @@ using Content.Server.Clothing.Components; using Content.Server.Station.Systems; using Content.Shared.Roles; using Robust.Shared.Prototypes; +using Robust.Shared.Random; namespace Content.Server.Clothing { @@ -12,6 +13,7 @@ namespace Content.Server.Clothing { [Dependency] private readonly StationSpawningSystem _station = default!; [Dependency] private readonly IPrototypeManager _protoMan = default!; + [Dependency] private readonly IRobustRandom _random = default!; public override void Initialize() { @@ -22,10 +24,10 @@ namespace Content.Server.Clothing private void OnStartup(EntityUid uid, LoadoutComponent component, ComponentStartup args) { - if (component.Prototype == string.Empty) + if (component.Prototypes == null) return; - var proto = _protoMan.Index(component.Prototype); + var proto = _protoMan.Index(_random.Pick(component.Prototypes)); _station.EquipStartingGear(uid, proto, null); } } diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/dummy_npcs.yml b/Resources/Prototypes/Entities/Mobs/NPCs/dummy_npcs.yml index 37876c818e..9bdd868a2e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/dummy_npcs.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/dummy_npcs.yml @@ -7,4 +7,4 @@ suffix: AI components: - type: InputMover - - type: MobMover + - type: MobMover \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/human.yml b/Resources/Prototypes/Entities/Mobs/NPCs/human.yml index 6e4970f5d4..6cf9a01e2d 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/human.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/human.yml @@ -7,7 +7,7 @@ - type: InputMover - type: MobMover - type: Loadout - prototype: PassengerGear + prototypes: [PassengerGear] - type: Faction factions: - NanoTrasen @@ -34,7 +34,7 @@ components: - type: RandomHumanoidAppearance - type: Loadout - prototype: CBURNGear + prototypes: [CBURNGear] - type: GhostTakeoverAvailable makeSentient: false name: CBURN Agent diff --git a/Resources/Prototypes/Entities/Mobs/Player/human.yml b/Resources/Prototypes/Entities/Mobs/Player/human.yml index cc2f914a71..3a115b4bde 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/human.yml @@ -46,7 +46,7 @@ name: CentCom official description: Inspect the station, jot down performance reviews for heads of staff, bug the Captain. - type: Loadout - prototype: CentcomGear + prototypes: [CentcomGear] - type: RandomHumanoidAppearance # ERT Leader @@ -62,7 +62,7 @@ name: ERT Leader description: Lead a team of specialists to resolve the stations issues. - type: Loadout - prototype: ERTLeaderGear + prototypes: [ERTLeaderGear] - type: RandomMetadata nameSegments: [NamesFirstMilitaryLeader] - type: RandomHumanoidAppearance @@ -78,7 +78,7 @@ sprite: Markers/jobs.rsi state: ertleadereva - type: Loadout - prototype: ERTLeaderGearEVA + prototypes: [ERTLeaderGearEVA] # ERT Engineer - type: entity @@ -93,7 +93,7 @@ name: ERT Engineer description: Assist with engineering efforts to resolve the stations issues. - type: Loadout - prototype: ERTEngineerGear + prototypes: [ERTEngineerGear] - type: entity name: ERT engineer @@ -105,7 +105,7 @@ sprite: Markers/jobs.rsi state: ertengineereva - type: Loadout - prototype: ERTEngineerGearEVA + prototypes: [ERTEngineerGearEVA] # ERT Security - type: entity @@ -120,7 +120,7 @@ name: ERT Security description: Assist with security efforts to resolve the stations issues. - type: Loadout - prototype: ERTSecurityGear + prototypes: [ERTSecurityGear] - type: entity name: ERT security @@ -132,7 +132,7 @@ sprite: Markers/jobs.rsi state: ertsecurityeva - type: Loadout - prototype: ERTSecurityGearEVA + prototypes: [ERTSecurityGearEVA] # ERT Medical - type: entity @@ -147,7 +147,7 @@ name: ERT Medic description: Assist with medical efforts to resolve the stations issues. - type: Loadout - prototype: ERTMedicalGear + prototypes: [ERTMedicalGear] - type: entity name: ERT medic @@ -159,7 +159,7 @@ sprite: Markers/jobs.rsi state: ertmedicaleva - type: Loadout - prototype: ERTMedicalGearEVA + prototypes: [ERTMedicalGearEVA] # ERT Janitor - type: entity @@ -174,7 +174,7 @@ name: ERT Janitor description: Assist with custodial efforts to resolve the stations issues. - type: Loadout - prototype: ERTJanitorGear + prototypes: [ERTJanitorGear] - type: entity name: ERT janitor @@ -186,7 +186,7 @@ sprite: Markers/jobs.rsi state: ertjanitoreva - type: Loadout - prototype: ERTJanitorGearEVA + prototypes: [ERTJanitorGearEVA] #Syndie - type: entity @@ -195,7 +195,7 @@ name: Syndicate Agent components: - type: Loadout - prototype: SyndicateOperativeGearExtremelyBasic + prototypes: [SyndicateOperativeGearExtremelyBasic] - type: RandomMetadata nameSegments: [names_death_commando]