From 37d6ca556fed1c1a6831e7c40768aae69aff1f71 Mon Sep 17 00:00:00 2001 From: Paul Ritter Date: Mon, 21 Sep 2020 12:47:52 +0200 Subject: [PATCH] Storagefill component refactor (#2093) * refactored storagefill component to allow for random items, amount, and conditional exclusion * i fudged it * yaml for the already deleted filler components * ignoredcomponents & janifill * remainder of toolboxes done * emergencyclosetfill * really makes you think * it DOES really make you think * orGroup * exp111 suggestions * last touches * isNullOrEmpty --- Content.Client/IgnoredComponents.cs | 8 -- .../Items/Storage/Fill/CustodialClosetFill.cs | 29 ------ .../Fill/EmergencyClosetFillComponent.cs | 65 -------------- .../Items/Storage/Fill/MedkitFillComponent.cs | 32 ------- .../Storage/Fill/StorageFillComponent.cs | 48 ---------- .../Storage/Fill/ToolLockerFillComponent.cs | 88 ------------------- .../Fill/ToolboxElectricalFillComponent.cs | 35 -------- .../Fill/ToolboxEmergencyFillComponent.cs | 36 -------- .../Storage/Fill/ToolboxGoldFillComponent.cs | 36 -------- .../Fill/UtilityBeltClothingFillComponent.cs | 33 ------- .../Items/Storage/StorageFillComponent.cs | 79 +++++++++++++++++ .../Prototypes/Catalog/Fills/backpack.yml | 20 ++--- Resources/Prototypes/Catalog/Fills/belt.yml | 10 ++- Resources/Prototypes/Catalog/Fills/crate.yml | 58 ++++-------- .../Prototypes/Catalog/Fills/lockers.yml | 58 +++++++++++- .../Entities/Clothing/Back/duffel.yml | 12 +-- .../Entities/Objects/Boxes/boxes_food.yml | 8 +- .../Entities/Objects/Boxes/boxes_general.yml | 59 +++---------- .../Entities/Objects/Boxes/boxes_medical.yml | 20 ++--- .../Entities/Objects/Boxes/boxes_science.yml | 10 +-- .../Entities/Objects/Boxes/boxes_security.yml | 20 ++--- .../Entities/Objects/Specific/medical.yml | 9 +- .../Entities/Objects/Tools/toolbox.yml | 36 +++++++- 23 files changed, 247 insertions(+), 562 deletions(-) delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/CustodialClosetFill.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/EmergencyClosetFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs delete mode 100644 Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs create mode 100644 Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs diff --git a/Content.Client/IgnoredComponents.cs b/Content.Client/IgnoredComponents.cs index 15022f8874..4c284fb026 100644 --- a/Content.Client/IgnoredComponents.cs +++ b/Content.Client/IgnoredComponents.cs @@ -15,11 +15,7 @@ "AtmosExposed", "Explosive", "OnUseTimerTrigger", - "ToolboxElectricalFill", - "ToolboxEmergencyFill", "WarpPoint", - "ToolboxGoldFill", - "ToolLockerFill", "EmitSoundOnUse", "FootstepModifier", "HeatResistance", @@ -67,10 +63,8 @@ "Stomach", "Rotatable", "MagicMirror", - "MedkitFill", "FloorTile", "FootstepSound", - "UtilityBeltClothingFill", "ShuttleController", "HumanInventoryController", "UseDelay", @@ -97,7 +91,6 @@ "SolarPanel", "BodyScanner", "Stunbaton", - "EmergencyClosetFill", "Tool", "TilePrying", "RandomSpriteColor", @@ -127,7 +120,6 @@ "EmitSoundOnThrow", "Flash", "DamageOnToolInteract", - "CustodialClosetFill", "NoSlip", "TrashSpawner", "Pill", diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/CustodialClosetFill.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/CustodialClosetFill.cs deleted file mode 100644 index 16180b57aa..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/CustodialClosetFill.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class CustodialClosetFillComponent : Component, IMapInit - { - public override string Name => "CustodialClosetFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - - void Spawn(string prototype) - { - storage.Insert(Owner.EntityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("MopItem"); - Spawn("MopBucket"); - Spawn("WetFloorSign"); - Spawn("WetFloorSign"); - Spawn("WetFloorSign"); - Spawn("TrashBag"); - Spawn("TrashBag"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/EmergencyClosetFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/EmergencyClosetFillComponent.cs deleted file mode 100644 index 08f2cbdaa9..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/EmergencyClosetFillComponent.cs +++ /dev/null @@ -1,65 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Random; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class EmergencyClosetFillComponent : Component, IMapInit - { - public override string Name => "EmergencyClosetFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - var random = IoCManager.Resolve(); - - void Spawn(string prototype) - { - storage.Insert(Owner.EntityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - if (random.Prob(0.4f)) - { - Spawn("ToolboxEmergencyFilled"); - } - - var pick = random.Next(0, 100); - if (pick < 40) // 40% - { - // TODO: uncomment when we actually have these items. - // Spawn("TankOxygenSmallFilled"); - // Spawn("TankOxygenSmallFilled"); - Spawn("BreathMaskClothing"); - Spawn("BreathMaskClothing"); - } - else if (pick < 65) // 25% - { - // Spawn("TankOxygenSmallFilled"); - // Spawn("MedkitOxygenFilled"); - Spawn("BreathMaskClothing"); - } - else if (pick < 85) // 20% - { - // Spawn("TankOxygenFilled"); - Spawn("BreathMaskClothing"); - } - else if (pick < 95) // 10% - { - // Spawn("TankOxygenSmallFilled"); - Spawn("BreathMaskClothing"); - } - else if (pick < 99) // 4% - { - // nothing, doot - } - else // 1% - { - // teehee - Owner.Delete(); - } - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs deleted file mode 100644 index 283a6976b5..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/MedkitFillComponent.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.IoC; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class MedkitFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "MedkitFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("Brutepack"); - Spawn("Brutepack"); - Spawn("Brutepack"); - Spawn("Ointment"); - Spawn("Ointment"); - Spawn("Ointment"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs deleted file mode 100644 index b17a5235f5..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/StorageFillComponent.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Generic; -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Serialization; -using Robust.Shared.ViewVariables; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class StorageFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "StorageFill"; - - [ViewVariables] - private List _contents = new List(); - - public override void ExposeData(ObjectSerializer serializer) - { - base.ExposeData(serializer); - - serializer.DataField(ref _contents, "contents", new List()); - } - - void IMapInit.MapInit() - { - if (_contents.Count == 0) - { - return; - } - - var storage = Owner.GetComponent(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - foreach (var prototype in _contents) - { - Spawn(prototype); - } - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs deleted file mode 100644 index 6d6c6ecb68..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolLockerFillComponent.cs +++ /dev/null @@ -1,88 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Random; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class ToolLockerFillComponent : Component, IMapInit - { - public override string Name => "ToolLockerFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - var random = IoCManager.Resolve(); - - void Spawn(string prototype) - { - storage.Insert(Owner.EntityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - if (random.Prob(0.4f)) - { - Spawn("OuterclothingHazard"); - } - - if (random.Prob(0.7f)) - { - Spawn("FlashlightLantern"); - } - - if (random.Prob(0.7f)) - { - Spawn("Screwdriver"); - } - - if (random.Prob(0.7f)) - { - Spawn("Wrench"); - } - - if (random.Prob(0.7f)) - { - Spawn("Welder"); - } - - if (random.Prob(0.7f)) - { - Spawn("Crowbar"); - } - - if (random.Prob(0.7f)) - { - Spawn("Wirecutter"); - } - - if (random.Prob(0.2f)) - { - Spawn("Multitool"); - } - - if (random.Prob(0.2f)) - { - Spawn("UtilityBeltClothing"); - } - - if (random.Prob(0.05f)) - { - Spawn("GlovesYellow"); - } - - if (random.Prob(0.4f)) - { - Spawn("HatHardhatRed"); - } - - for (var i = 0; i < 3; i++) - { - if (random.Prob(0.3f)) - { - Spawn("ApcExtensionCableStack"); - } - } - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs deleted file mode 100644 index 9e76c505ed..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxElectricalFillComponent.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Random; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class ToolboxElectricalFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "ToolboxElectricalFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - var random = IoCManager.Resolve(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("Screwdriver"); - Spawn("Crowbar"); - Spawn("Wirecutter"); - Spawn("ApcExtensionCableStack"); - Spawn("MVWireStack"); - Spawn(random.Prob(0.05f) ? "GlovesYellow" : "HVWireStack"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs deleted file mode 100644 index 3748d42ce3..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxEmergencyFillComponent.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Random; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class ToolboxEmergencyFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "ToolboxEmergencyFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - var random = IoCManager.Resolve(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("BreathMaskClothing"); - Spawn("BreathMaskClothing"); - Spawn("FoodChocolateBar"); - Spawn("FlashlightLantern"); - Spawn("FlashlightLantern"); - - Spawn(random.Prob(0.15f) ? "HarmonicaInstrument" : "FoodChocolateBar"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs deleted file mode 100644 index 5fbbb069d2..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/ToolboxGoldFillComponent.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Random; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class ToolboxGoldFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "ToolboxGoldFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - var random = IoCManager.Resolve(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("GoldStack"); - Spawn("GoldStack"); - Spawn("GoldStack"); - Spawn("GoldStack"); - Spawn("GoldStack"); - - Spawn(random.Prob(0.05f) ? "DrinkGoldenCup" : "GoldStack"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs deleted file mode 100644 index a304d84425..0000000000 --- a/Content.Server/GameObjects/Components/Items/Storage/Fill/UtilityBeltClothingFillComponent.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Robust.Server.Interfaces.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.IoC; - -namespace Content.Server.GameObjects.Components.Items.Storage.Fill -{ - [RegisterComponent] - internal sealed class UtilityBeltClothingFillComponent : Component, IMapInit - { - [Dependency] private readonly IEntityManager _entityManager = default!; - - public override string Name => "UtilityBeltClothingFill"; - - void IMapInit.MapInit() - { - var storage = Owner.GetComponent(); - - void Spawn(string prototype) - { - storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.Coordinates)); - } - - Spawn("Crowbar"); - Spawn("Wrench"); - Spawn("Screwdriver"); - Spawn("Wirecutter"); - Spawn("Welder"); - Spawn("Multitool"); - Spawn("ApcExtensionCableStack"); - } - } -} diff --git a/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs b/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs new file mode 100644 index 0000000000..0323fe730c --- /dev/null +++ b/Content.Server/GameObjects/Components/Items/Storage/StorageFillComponent.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Robust.Server.Interfaces.GameObjects; +using Robust.Shared.GameObjects; +using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Random; +using Robust.Shared.Interfaces.Serialization; +using Robust.Shared.IoC; +using Robust.Shared.Random; +using Robust.Shared.Serialization; +using Logger = Robust.Shared.Log.Logger; + +namespace Content.Server.GameObjects.Components.Items.Storage +{ + [RegisterComponent] + internal sealed class StorageFillComponent : Component, IMapInit + { + [Dependency] private readonly IEntityManager _entityManager; + + public override string Name => "StorageFill"; + + private List _contents; + + public override void ExposeData(ObjectSerializer serializer) + { + base.ExposeData(serializer); + + serializer.DataField(ref _contents, "contents", new List()); + } + + void IMapInit.MapInit() + { + if (_contents.Count == 0) + { + return; + } + + if (!Owner.TryGetComponent(out IStorageComponent storage)) + { + Logger.Error($"StorageFillComponent couldn't find any StorageComponent ({Owner})"); + return; + } + var random = IoCManager.Resolve(); + + var alreadySpawnedGroups = new List(); + foreach (var storageItem in _contents) + { + if (string.IsNullOrEmpty(storageItem.PrototypeName)) continue; + if (string.IsNullOrEmpty(storageItem.GroupId) && alreadySpawnedGroups.Contains(storageItem.GroupId)) continue; + + if (storageItem.SpawnProbability != 1f && + !random.Prob(storageItem.SpawnProbability)) + { + continue; + } + + storage.Insert(_entityManager.SpawnEntity(storageItem.PrototypeName, Owner.Transform.Coordinates)); + if(string.IsNullOrEmpty(storageItem.GroupId)) alreadySpawnedGroups.Add(storageItem.GroupId); + } + } + + [Serializable] + private struct PrototypeItemData : IExposeData + { + public string PrototypeName; + public float SpawnProbability; + public string GroupId; + public int Amount; + + public void ExposeData(ObjectSerializer serializer) + { + serializer.DataField(ref PrototypeName, "name", null); + serializer.DataField(ref Amount, "amount", 1); + serializer.DataField(ref SpawnProbability, "prob", 1f); + serializer.DataField(ref GroupId, "orGroup", null); + } + } + } +} diff --git a/Resources/Prototypes/Catalog/Fills/backpack.yml b/Resources/Prototypes/Catalog/Fills/backpack.yml index f6ddfd31de..d97dc2c03e 100644 --- a/Resources/Prototypes/Catalog/Fills/backpack.yml +++ b/Resources/Prototypes/Catalog/Fills/backpack.yml @@ -5,7 +5,7 @@ components: - type: StorageFill contents: - - BoxSurvival + - name: BoxSurvival - type: entity abstract: true @@ -14,7 +14,7 @@ components: - type: StorageFill contents: - - BoxSurvival + - name: BoxSurvival - type: entity abstract: true @@ -23,9 +23,9 @@ components: - type: StorageFill contents: - - BoxSurvival - - Stunbaton - - Flash + - name: BoxSurvival + - name: Stunbaton + - name: Flash - type: entity abstract: true @@ -34,7 +34,7 @@ components: - type: StorageFill contents: - - BoxSurvival + - name: BoxSurvival - type: entity abstract: true @@ -43,9 +43,9 @@ components: - type: StorageFill contents: - - BoxSurvival - #- StationCharter - #- TelescopicBaton + - name: BoxSurvival + #- name: StationCharter + #- name: TelescopicBaton - type: entity abstract: true @@ -54,4 +54,4 @@ components: - type: StorageFill contents: - - BoxSurvival + - name: BoxSurvival diff --git a/Resources/Prototypes/Catalog/Fills/belt.yml b/Resources/Prototypes/Catalog/Fills/belt.yml index 80a0e508af..f2f7350d40 100644 --- a/Resources/Prototypes/Catalog/Fills/belt.yml +++ b/Resources/Prototypes/Catalog/Fills/belt.yml @@ -3,4 +3,12 @@ parent: UtilityBeltClothing suffix: Filled components: - - type: UtilityBeltClothingFill + - type: StorageFill + contents: + - name: Crowbar + - name: Wrench + - name: Screwdriver + - name: Wirecutter + - name: Welder + - name: Multitool + - name: ApcExtensionCableStack diff --git a/Resources/Prototypes/Catalog/Fills/crate.yml b/Resources/Prototypes/Catalog/Fills/crate.yml index 3c05a463b9..9bc3d24ea5 100644 --- a/Resources/Prototypes/Catalog/Fills/crate.yml +++ b/Resources/Prototypes/Catalog/Fills/crate.yml @@ -5,11 +5,8 @@ components: - type: StorageFill contents: - - FlashlightLantern - - FlashlightLantern - - FlashlightLantern - - FlashlightLantern - - FlashlightLantern + - name: FlashlightLantern + amount: 5 - type: entity id: CrateLightBulb @@ -18,16 +15,8 @@ components: - type: StorageFill contents: - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb + - name: LightBulb + amount: 10 - type: entity id: CrateFireExtinguisher @@ -36,9 +25,8 @@ components: - type: StorageFill contents: - - FireExtinguisher - - FireExtinguisher - - FireExtinguisher + - name: FireExtinguisher + amount: 3 - type: entity id: CratePen @@ -47,16 +35,8 @@ components: - type: StorageFill contents: - - Pen - - Pen - - Pen - - Pen - - Pen - - Pen - - Pen - - Pen - - Pen - - Pen + - name: Pen + amount: 10 - type: entity id: CrateBikeHorn @@ -65,11 +45,8 @@ components: - type: StorageFill contents: - - BikeHorn - - BikeHorn - - BikeHorn - - BikeHorn - - BikeHorn + - name: BikeHorn + amount: 5 - type: entity id: CrateCleaver @@ -78,11 +55,8 @@ components: - type: StorageFill contents: - - ButchCleaver - - ButchCleaver - - ButchCleaver - - ButchCleaver - - ButchCleaver + - name: ButchCleaver + amount: 5 - type: entity id: CrateFuelTank @@ -91,7 +65,7 @@ components: - type: StorageFill contents: - - WeldingFuelTank + - name: WeldingFuelTank - type: entity id: CrateMedicalScanner @@ -100,7 +74,7 @@ components: - type: StorageFill contents: - - MedicalScanner + - name: MedicalScanner - type: entity id: CrateGlass @@ -109,7 +83,7 @@ components: - type: StorageFill contents: - - GlassStack + - name: GlassStack - type: entity id: CrateCable @@ -118,4 +92,4 @@ components: - type: StorageFill contents: - - CableStack1 + - name: CableStack1 diff --git a/Resources/Prototypes/Catalog/Fills/lockers.yml b/Resources/Prototypes/Catalog/Fills/lockers.yml index ebeb1040ba..8367991eb7 100644 --- a/Resources/Prototypes/Catalog/Fills/lockers.yml +++ b/Resources/Prototypes/Catalog/Fills/lockers.yml @@ -4,21 +4,73 @@ name: "custodial closet" description: "It's a storage unit for janitorial clothes and gear." components: - - type: CustodialClosetFill + - type: StorageFill + contents: + - name: MopItem + - name: MopBucket + - name: WetFloorSign + amount: 3 + - name: TrashBag + amount: 2 - type: entity id: LockerToolFilled parent: LockerTool suffix: Filled components: - - type: ToolLockerFill + - type: StorageFill + contents: + - name: OuterclothingHazard + prob: 0.4 + - name: FlashlightLantern + prob: 0.7 + - name: Screwdriver + prob: 0.7 + - name: Wrench + prob: 0.7 + - name: Welder + prob: 0.7 + - name: Crowbar + prob: 0.7 + - name: Wirecutter + prob: 0.7 + - name: Multitool + prob: 0.2 + - name: UtilityBeltClothing + prob: 0.2 + - name: GlovesYellow + prob: 0.05 + - name: HatHardhatRed + prob: 0.4 + - name: ApcExtensionCableStack + prob: 0.3 + - name: ApcExtensionCableStack + prob: 0.3 + - name: ApcExtensionCableStack + prob: 0.3 - type: entity id: LockerEmergencyFilledRandom parent: LockerEmergency suffix: Filled, Random components: - - type: EmergencyClosetFill + - type: StorageFill + contents: + - name: ToolboxEmergencyFilled + prob: 0.4 + - name: BreathMaskClothing + prob: 0.4 + - name: BreathMaskClothing + prob: 0.25 + # TODO: uncomment when we actually have these items. + #- name: TankOxygenSmallFilled + # prob: 0.4s + #- name: TankOxygenSmallFilled + # prob: 0.25 + #- name: MedkitOxygenFilled + # prob: 0.25 + #- name: TankOxygenFilled + # prob: 0.2 - type: entity id: LockerBoozeFilled diff --git a/Resources/Prototypes/Entities/Clothing/Back/duffel.yml b/Resources/Prototypes/Entities/Clothing/Back/duffel.yml index 8dc7431db2..2ae7bce918 100644 --- a/Resources/Prototypes/Entities/Clothing/Back/duffel.yml +++ b/Resources/Prototypes/Entities/Clothing/Back/duffel.yml @@ -127,11 +127,11 @@ sprite: Clothing/Back/Duffels/duffel_med.rsi - type: StorageFill contents: - - Hemostat - - BoneSaw - - Drill - - Cautery - - Retractor - - Scalpel + - name: Hemostat + - name: BoneSaw + - name: Drill + - name: Cautery + - name: Retractor + - name: Scalpel - type: Storage capacity: 30 diff --git a/Resources/Prototypes/Entities/Objects/Boxes/boxes_food.yml b/Resources/Prototypes/Entities/Objects/Boxes/boxes_food.yml index 29a21b0c4c..776d5e485b 100644 --- a/Resources/Prototypes/Entities/Objects/Boxes/boxes_food.yml +++ b/Resources/Prototypes/Entities/Objects/Boxes/boxes_food.yml @@ -6,12 +6,8 @@ components: - type: StorageFill contents: - - FoodDonkPocket - - FoodDonkPocket - - FoodDonkPocket - - FoodDonkPocket - - FoodDonkPocket - - FoodDonkPocket + - name: FoodDonkPocket + amount: 6 - type: Sprite sprite: Objects/Storage/donkpocket.rsi state: icon diff --git a/Resources/Prototypes/Entities/Objects/Boxes/boxes_general.yml b/Resources/Prototypes/Entities/Objects/Boxes/boxes_general.yml index ab23c1689d..8d8b0eba0b 100644 --- a/Resources/Prototypes/Entities/Objects/Boxes/boxes_general.yml +++ b/Resources/Prototypes/Entities/Objects/Boxes/boxes_general.yml @@ -6,18 +6,8 @@ components: - type: StorageFill contents: - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb + - name: LightBulb + amount: 12 - type: Sprite layers: - state: box @@ -34,18 +24,8 @@ components: - type: StorageFill contents: - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube + - name: LightTube + amount: 12 - type: Sprite layers: - state: box @@ -62,18 +42,8 @@ components: - type: StorageFill contents: - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightTube - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb - - LightBulb + - name: LightTube + amount: 12 - type: Sprite layers: - state: box @@ -90,9 +60,8 @@ components: - type: StorageFill contents: - - AssistantPDA - - AssistantPDA - - AssistantPDA + - name: AssistantPDA + amount: 3 - type: Sprite layers: - state: box @@ -111,10 +80,8 @@ components: - type: StorageFill contents: - - MesonGlasses - - MesonGlasses - - MesonGlasses - - MesonGlasses + - name: MesonGlasses + amount: 4 - type: Sprite layers: - state: box @@ -133,9 +100,9 @@ components: - type: StorageFill contents: - - BreathMaskClothing - #- O2 Canister - #- Injector + - name: BreathMaskClothing + #- name: O2 Canister + #- name: Injector - type: Sprite layers: - state: box diff --git a/Resources/Prototypes/Entities/Objects/Boxes/boxes_medical.yml b/Resources/Prototypes/Entities/Objects/Boxes/boxes_medical.yml index 09d5699b22..9ea6abe5c6 100644 --- a/Resources/Prototypes/Entities/Objects/Boxes/boxes_medical.yml +++ b/Resources/Prototypes/Entities/Objects/Boxes/boxes_medical.yml @@ -6,12 +6,8 @@ components: - type: StorageFill contents: - - Syringe - - Syringe - - Syringe - - Syringe - - Syringe - - Syringe + - name: Syringe + amount: 6 - type: Sprite layers: - state: box @@ -30,10 +26,8 @@ components: - type: StorageFill contents: - - MaskSterile - - MaskSterile - - MaskSterile - - MaskSterile + - name: MaskSterile + amount: 4 - type: Sprite layers: - state: box @@ -52,10 +46,8 @@ components: - type: StorageFill contents: - - GlovesLatex - - GlovesLatex - - GlovesLatex - - GlovesLatex + - name: GlovesLatex + amount: 4 - type: Sprite layers: - state: box diff --git a/Resources/Prototypes/Entities/Objects/Boxes/boxes_science.yml b/Resources/Prototypes/Entities/Objects/Boxes/boxes_science.yml index b52f00a68b..f40c51dd69 100644 --- a/Resources/Prototypes/Entities/Objects/Boxes/boxes_science.yml +++ b/Resources/Prototypes/Entities/Objects/Boxes/boxes_science.yml @@ -6,12 +6,10 @@ components: - type: StorageFill contents: - - Beaker - - Beaker - - Beaker - - LargeBeaker - - LargeBeaker - - LargeBeaker + - name: Beaker + amount: 3 + - name: LargeBeaker + amount: 3 - type: Sprite layers: - state: box diff --git a/Resources/Prototypes/Entities/Objects/Boxes/boxes_security.yml b/Resources/Prototypes/Entities/Objects/Boxes/boxes_security.yml index 1308c376eb..2ac2493050 100644 --- a/Resources/Prototypes/Entities/Objects/Boxes/boxes_security.yml +++ b/Resources/Prototypes/Entities/Objects/Boxes/boxes_security.yml @@ -6,12 +6,8 @@ components: - type: StorageFill contents: - - Handcuffs - - Handcuffs - - Handcuffs - - Handcuffs - - Handcuffs - - Handcuffs + - name: Handcuffs + amount: 6 - type: Sprite layers: - state: box_security @@ -30,10 +26,8 @@ components: - type: StorageFill contents: - - GrenadeFlashBang - - GrenadeFlashBang - - GrenadeFlashBang - - GrenadeFlashBang + - name: GrenadeFlashBang + amount: 4 - type: Sprite layers: - state: box_security @@ -52,10 +46,8 @@ components: - type: StorageFill contents: - - SecGlasses - - SecGlasses - - SecGlasses - - SecGlasses + - name: SecGlasses + amount: 4 - type: Sprite layers: - state: box_security diff --git a/Resources/Prototypes/Entities/Objects/Specific/medical.yml b/Resources/Prototypes/Entities/Objects/Specific/medical.yml index cda45f9d67..4c33d8180d 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/medical.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/medical.yml @@ -15,9 +15,16 @@ - type: entity id: MedkitFilled + suffix: Filled parent: Medkit components: - - type: MedkitFill # 3 Ointment, 3 Roll of Gauze. TODO 1 Health Analyzer once it exists + - type: StorageFill + contents: + - name: Brutepack + amount: 3 + - name: Ointment + amount: 3 + # todo 1 Health Analyzer once it exists - type: entity name: medical stack diff --git a/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml b/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml index 47d3a433ca..d64a4d4420 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/toolbox.yml @@ -32,7 +32,18 @@ parent: ToolboxEmergency suffix: Filled components: - - type: ToolboxEmergencyFill + - type: StorageFill + contents: + - name: BreathMaskClothing + amount: 2 + - name: FoodChocolateBar + - name: FlashlightLantern + amount: 2 + - name: HarmonicaInstrument + prob: 0.15 + orGroup: HarmonicaOrChocolate + - name: FoodChocolateBar + orGroup: HarmonicaOrChocolate - type: entity name: mechanical toolbox @@ -70,7 +81,18 @@ suffix: Filled parent: ToolboxElectrical components: - - type: ToolboxElectricalFill + - type: StorageFill + contents: + - name: Screwdriver + - name: Crowbar + - name: Wirecutter + - name: ApcExtensionCableStack + - name: MVWireStack + - name: GlovesYellow + prob: 0.05 + orGroup: GlovesOrWires + - name: HVWireStack + orGroup: GlovesOrWires - type: entity name: artistic toolbox @@ -123,4 +145,12 @@ parent: ToolboxGolden suffix: Filled components: - - type: ToolboxGoldFill + - type: StorageFill + contents: + - name: GoldStack + amount: 5 + - name: DrinkGoldenCup + prob: 0.05 + orGroup: CupOrGold + - name: GoldStack + orGroup: CupOrGold