diff --git a/Content.Client/Lobby/LobbyUIController.cs b/Content.Client/Lobby/LobbyUIController.cs index 7060f294b6e..d7c9fefc5a1 100644 --- a/Content.Client/Lobby/LobbyUIController.cs +++ b/Content.Client/Lobby/LobbyUIController.cs @@ -6,6 +6,7 @@ using Content.Client.Lobby.UI; using Content.Client.Players.PlayTimeTracking; using Content.Client.Station; +using Content.Shared._RMC14.Armor; using Content.Shared.CCVar; using Content.Shared.Clothing; using Content.Shared.GameTicking; @@ -46,6 +47,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered(item, out var variantComponent)) + { + var variantItemProtoId = _armorSystem.GetArmorVariant((item, variantComponent), profile.ArmorPreference); + var variantItem = EntityManager.SpawnEntity(variantItemProtoId, MapCoordinates.Nullspace); + _inventory.TryEquip(dummy, variantItem, slot.Name, true, true); + EntityManager.QueueDeleteEntity(item); + + continue; + } + _inventory.TryEquip(dummy, item, slot.Name, true, true); } } diff --git a/Content.Server/_RMC14/Armor/RMCArmorSystem.cs b/Content.Server/_RMC14/Armor/RMCArmorSystem.cs index c66b1c52dfc..8b5df4d24e6 100644 --- a/Content.Server/_RMC14/Armor/RMCArmorSystem.cs +++ b/Content.Server/_RMC14/Armor/RMCArmorSystem.cs @@ -14,6 +14,7 @@ public sealed class RMCArmorSystem : EntitySystem [Dependency] private readonly IServerPreferencesManager _prefs = default!; [Dependency] protected readonly InventorySystem InventorySystem = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; + [Dependency] private readonly CMArmorSystem _armorSystem = default!; private EntityQuery _armorVariantQuery; @@ -39,19 +40,7 @@ private void OnAutomatedVenderUser(Entity ent, ref RMCAutomated if (profile == null) return; - var armorType = profile.ArmorPreference; - var equipmentEntityID = armor.DefaultType; - - if (armor.Types.TryGetValue(armorType.ToString(), out var equipment)) - equipmentEntityID = equipment; - - if (armorType == ArmorPreference.Random) - { - var random = new Random(); - var randomType = armor.Types.ElementAt(random.Next(0, armor.Types.Count)).Value; - equipmentEntityID = randomType; - } - + var equipmentEntityID = _armorSystem.GetArmorVariant((args.Item, armor), profile.ArmorPreference); var equipmentEntity = Spawn(equipmentEntityID, _transform.GetMapCoordinates(ent)); InventorySystem.TryEquip(ent, equipmentEntity, "outerClothing", force: true, predicted: false); diff --git a/Content.Shared/_RMC14/Armor/CMArmorSystem.cs b/Content.Shared/_RMC14/Armor/CMArmorSystem.cs index 6287cf0b1b6..c68c297f149 100644 --- a/Content.Shared/_RMC14/Armor/CMArmorSystem.cs +++ b/Content.Shared/_RMC14/Armor/CMArmorSystem.cs @@ -1,4 +1,5 @@ -using Content.Shared._RMC14.Medical.Surgery; +using System.Linq; +using Content.Shared._RMC14.Medical.Surgery; using Content.Shared._RMC14.Medical.Surgery.Steps; using Content.Shared._RMC14.Xenonids; using Content.Shared._RMC14.Xenonids.Projectile.Spit.Slowing; @@ -10,6 +11,7 @@ using Content.Shared.FixedPoint; using Content.Shared.Inventory; using Content.Shared.Inventory.Events; +using Content.Shared.Preferences; using Robust.Shared.Prototypes; namespace Content.Shared._RMC14.Armor; @@ -257,4 +259,22 @@ public void SetArmorPiercing(Entity ent, int amount) ent.Comp.Amount = amount; Dirty(ent); } + + public EntProtoId GetArmorVariant(Entity ent, ArmorPreference preference) + { + var comp = ent.Comp; + var equipmentEntityID = comp.DefaultType; + + if (comp.Types.TryGetValue(preference.ToString(), out var equipment)) + equipmentEntityID = equipment; + + if (preference == ArmorPreference.Random) + { + var random = new System.Random(); + var randomType = comp.Types.ElementAt(random.Next(0, comp.Types.Count)).Value; + equipmentEntityID = randomType; + } + + return equipmentEntityID; + } } diff --git a/Content.Shared/_RMC14/Marines/Roles/JobPrototype.cs b/Content.Shared/_RMC14/Marines/Roles/JobPrototype.cs index 3c4b2c6143e..1add7613a6d 100644 --- a/Content.Shared/_RMC14/Marines/Roles/JobPrototype.cs +++ b/Content.Shared/_RMC14/Marines/Roles/JobPrototype.cs @@ -45,4 +45,7 @@ public sealed partial class JobPrototype : IInheritingPrototype, ICMSpecific [DataField] public float RoleWeight; + + [DataField] + public ProtoId? DummyStartingGear { get; private set; } } diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/combat_tech.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/combat_tech.yml index 2eb1d83452c..585f550c728 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/combat_tech.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/combat_tech.yml @@ -9,6 +9,7 @@ department: CMSquad time: 3600 # 1 hour startingGear: CMGearCombatTech + dummyStartingGear: CMGearCombatTechEquipped icon: "CMJobIconCombatTech" joinNotifyCrew: false supervisors: cm-job-supervisors-sl @@ -49,9 +50,8 @@ jumpsuit: CMJumpsuitMarineEngineer back: CMSatchelMarineTech shoes: CMBootsBlackFilled - eyes: ClothingEyesGlassesMeson head: CMArmorHelmetM10Tech - outerClothing: CMArmorM3Medium + outerClothing: RMCArmorM3MediumVariants gloves: CMHandsInsulated id: CMDogtagCombatTech ears: CMHeadsetAlphaEngineer diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/fireteam_leader.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/fireteam_leader.yml index 7ef1ab4d446..3a5e5fa4c31 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/fireteam_leader.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/fireteam_leader.yml @@ -9,6 +9,7 @@ department: CMSquad time: 28800 # 8 hours startingGear: CMGearFireteamLeader + dummyStartingGear: CMGearFireteamLeaderEquipped icon: "CMJobIconFireteamLeader" joinNotifyCrew: false supervisors: cm-job-supervisors-sl diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/hospital_corpsman.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/hospital_corpsman.yml index 9e56bb46782..75cfc47e1fe 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/hospital_corpsman.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/hospital_corpsman.yml @@ -12,6 +12,7 @@ department: CMSquad time: 3600 # 1 hour startingGear: CMGearHospitalCorpsman + dummyStartingGear: CMGearHospitalCorpsmanEquipped icon: "CMJobIconHospitalCorpsman" joinNotifyCrew: false supervisors: cm-job-supervisors-sl @@ -51,10 +52,9 @@ jumpsuit: CMJumpsuitMarineMedic back: CMSatchelMarineMedic shoes: CMBootsBlackFilled - gloves: CMHandsBlackMarine - eyes: RMCGlassesMedicalHUDGlasses + gloves: RMCHandsLatexMarine head: CMArmorHelmetM10Medic - outerClothing: CMArmorM3Medium + outerClothing: RMCArmorM3MediumVariants id: CMDogtagHospitalCorpsman ears: CMHeadsetAlphaMedic belt: CMBeltMedicBagFilled diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/rifleman.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/rifleman.yml index df9c8778d53..ba843cc44c4 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/rifleman.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/rifleman.yml @@ -5,6 +5,7 @@ description: cm-job-description-rifleman playTimeTracker: CMJobRifleman startingGear: CMGearRifleman + dummyStartingGear: CMGearRiflemanEquipped icon: "CMJobIconEmpty" joinNotifyCrew: false supervisors: cm-job-supervisors-sl @@ -40,7 +41,7 @@ back: CMSatchelMarine shoes: CMBootsBlackFilled head: ArmorHelmetM10 - outerClothing: CMArmorM3Medium + outerClothing: RMCArmorM3MediumVariants gloves: CMHandsBlackMarine id: CMDogtagRifleman ears: CMHeadsetAlpha diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/smart_gun_operator.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/smart_gun_operator.yml index 40b1aec52eb..8cdd83f59fc 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/smart_gun_operator.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/smart_gun_operator.yml @@ -9,6 +9,7 @@ department: CMSquad time: 18000 # 5 hours startingGear: CMGearSmartGunOperator + dummyStartingGear: CMGearSmartGunOperatorEquipped icon: "CMJobIconSmartGunOperator" joinNotifyCrew: false supervisors: cm-job-supervisors-sl @@ -48,7 +49,7 @@ back: CMSatchelMarine shoes: CMBootsBlackFilled head: ArmorHelmetM10 - outerClothing: CMArmorM3Medium + outerClothing: CMArmorSmartGunCombatHarness gloves: CMHandsBlackMarine id: CMDogtagSmartGunOperator ears: CMHeadsetAlpha diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/squad_leader.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/squad_leader.yml index 4d93a7e45b1..173d0b01387 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/squad_leader.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/squad_leader.yml @@ -9,6 +9,7 @@ department: CMSquad time: 36000 # 10 hours startingGear: CMGearSquadLeader + dummyStartingGear: CMGearSquadLeaderEquipped icon: "CMJobIconSquadLeader" joinNotifyCrew: false supervisors: cm-job-supervisors-co @@ -60,7 +61,7 @@ back: CMSatchelMarine shoes: CMBootsBlackFilled head: CMArmorHelmetM11 - outerClothing: CMArmorM3Medium + outerClothing: CMArmorB12 gloves: CMHandsBlackMarine id: CMDogtagSquadLeader ears: CMHeadsetAlphaLeader diff --git a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/weapons_specialist.yml b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/weapons_specialist.yml index 43c92f7a61b..b6b4986c083 100644 --- a/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/weapons_specialist.yml +++ b/Resources/Prototypes/_RMC14/Roles/Jobs/Marines/weapons_specialist.yml @@ -9,6 +9,7 @@ department: CMSquad time: 18000 # 5 hours startingGear: CMGearWeaponsSpecialist + dummyStartingGear: CMGearWeaponsSpecialistEquipped icon: "CMJobIconWeaponsSpecialist" joinNotifyCrew: false supervisors: cm-job-supervisors-sl @@ -56,7 +57,6 @@ back: CMSatchelMarine shoes: CMBootsBlackFilled head: ArmorHelmetM10 - outerClothing: CMArmorM3Medium gloves: CMHandsBlackMarine id: CMDogtagWeaponsSpecialist ears: CMHeadsetAlpha