diff --git a/Content.Client/Construction/ConstructionMenuPresenter.cs b/Content.Client/Construction/ConstructionMenuPresenter.cs
index 3ae7345782..39e9ea67d6 100644
--- a/Content.Client/Construction/ConstructionMenuPresenter.cs
+++ b/Content.Client/Construction/ConstructionMenuPresenter.cs
@@ -18,6 +18,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
namespace Content.Client.Construction
{
@@ -250,8 +251,8 @@ namespace Content.Client.Construction
stepList.AddItem(
!firstNode
? Loc.GetString(
- "{0}. Add {1}x {2}.", stepNumber++, materialStep.Amount, materialStep.Material)
- : Loc.GetString(" {0}x {1}", materialStep.Amount, materialStep.Material), icon);
+ "{0}. Add {1}x {2}.", stepNumber++, materialStep.Amount, materialStep.MaterialPrototype.Name)
+ : Loc.GetString(" {0}x {1}", materialStep.Amount, materialStep.MaterialPrototype.Name), icon);
break;
@@ -278,8 +279,7 @@ namespace Content.Client.Construction
switch (subStep)
{
case MaterialConstructionGraphStep materialStep:
- if (prototype.Type != ConstructionType.Item)
- stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}x {4}.", stepNumber, parallelNumber, subStepNumber++, materialStep.Amount, materialStep.Material), icon);
+ if (prototype.Type != ConstructionType.Item) stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}x {4}.", stepNumber, parallelNumber, subStepNumber++, materialStep.Amount, materialStep.MaterialPrototype.Name), icon);
break;
case ToolConstructionGraphStep toolStep:
@@ -308,28 +308,7 @@ namespace Content.Client.Construction
switch (step)
{
case MaterialConstructionGraphStep materialStep:
- switch (materialStep.Material)
- {
- case StackType.Metal:
- return resourceCache.GetTexture("/Textures/Objects/Materials/sheets.rsi/metal.png");
-
- case StackType.Glass:
- return resourceCache.GetTexture("/Textures/Objects/Materials/sheets.rsi/glass.png");
-
- case StackType.Plasteel:
- return resourceCache.GetTexture("/Textures/Objects/Materials/sheets.rsi/plasteel.png");
-
- case StackType.Plasma:
- return resourceCache.GetTexture("/Textures/Objects/Materials/sheets.rsi/phoron.png");
-
- case StackType.Cable:
- return resourceCache.GetTexture("/Textures/Objects/Tools/cables.rsi/coil-30.png");
-
- case StackType.MetalRod:
- return resourceCache.GetTexture("/Textures/Objects/Materials/materials.rsi/rods.png");
- }
-
- break;
+ return materialStep.MaterialPrototype.Icon?.Frame0();
case ToolConstructionGraphStep toolStep:
switch (toolStep.Tool)
diff --git a/Content.Server/Construction/StackHelpers.cs b/Content.Server/Construction/StackHelpers.cs
index 3edbdcb3e4..990ecdf1d3 100644
--- a/Content.Server/Construction/StackHelpers.cs
+++ b/Content.Server/Construction/StackHelpers.cs
@@ -2,6 +2,7 @@
using System;
using Content.Server.GameObjects.Components.Stack;
using Content.Shared.GameObjects.Components;
+using Content.Shared.Stacks;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
@@ -13,46 +14,15 @@ namespace Content.Server.Construction
///
/// Spawns a stack of a specified type given an amount.
///
- public static IEntity SpawnStack(StackType stack, int amount, EntityCoordinates coordinates, IEntityManager? entityManager = null)
+ public static IEntity SpawnStack(StackPrototype stack, int amount, EntityCoordinates coordinates, IEntityManager? entityManager = null)
{
entityManager ??= IoCManager.Resolve();
- string prototype;
-
- switch (stack)
- {
- case StackType.Metal:
- prototype = "SteelSheet1";
- break;
-
- case StackType.Glass:
- prototype = "GlassSheet1";
- break;
-
- case StackType.MetalRod:
- prototype = "MetalRodStack1";
- break;
-
- case StackType.Plasma:
- prototype = "PlasmaStack1";
- break;
-
- case StackType.Plasteel:
- prototype = "PlasteelSheet1";
- break;
-
- case StackType.Cable:
- prototype = "ApcExtensionCableStack1";
- break;
-
- // TODO: Add more.
-
- default:
- throw new ArgumentOutOfRangeException(nameof(stack),"Stack type doesn't have a prototype specified yet!");
- }
+ // TODO: Add more.
+ string prototype = stack.Spawn ?? throw new ArgumentOutOfRangeException(nameof(stack),
+ "Stack type doesn't have a prototype specified yet!");
var ent = entityManager.SpawnEntity(prototype, coordinates);
-
var stackComponent = ent.GetComponent();
stackComponent.Count = Math.Min(amount, stackComponent.MaxCount);
diff --git a/Content.Server/GameObjects/Components/Construction/MachineBoardComponent.cs b/Content.Server/GameObjects/Components/Construction/MachineBoardComponent.cs
index 5b6d1c6b22..feadfabc69 100644
--- a/Content.Server/GameObjects/Components/Construction/MachineBoardComponent.cs
+++ b/Content.Server/GameObjects/Components/Construction/MachineBoardComponent.cs
@@ -1,10 +1,14 @@
using System;
using System.Collections.Generic;
using Content.Server.Construction;
-using Content.Shared.GameObjects.Components;
using Content.Shared.GameObjects.EntitySystems;
+using Content.Shared.Stacks;
+using Microsoft.Extensions.Logging;
using Robust.Shared.GameObjects;
+using Robust.Shared.IoC;
using Robust.Shared.Localization;
+using Robust.Shared.Log;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -14,13 +18,15 @@ namespace Content.Server.GameObjects.Components.Construction
[RegisterComponent]
public class MachineBoardComponent : Component, IExamine
{
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
public override string Name => "MachineBoard";
[ViewVariables]
private Dictionary _requirements;
[ViewVariables]
- private Dictionary _materialRequirements;
+ private Dictionary _materialIdRequirements;
[ViewVariables]
private Dictionary _componentRequirements;
@@ -28,7 +34,20 @@ namespace Content.Server.GameObjects.Components.Construction
[ViewVariables(VVAccess.ReadWrite)]
public string Prototype { get; private set; }
public IReadOnlyDictionary Requirements => _requirements;
- public IReadOnlyDictionary MaterialRequirements => _materialRequirements;
+ public IReadOnlyDictionary MaterialIdRequirements => _materialIdRequirements;
+
+ public IEnumerable> MaterialRequirements
+ {
+ get
+ {
+ foreach (var (materialId, amount) in MaterialIdRequirements)
+ {
+ var material = _prototypeManager.Index(materialId);
+ yield return new KeyValuePair(material, amount);
+ }
+ }
+ }
+
public IReadOnlyDictionary ComponentRequirements => _componentRequirements;
public override void ExposeData(ObjectSerializer serializer)
@@ -36,10 +55,23 @@ namespace Content.Server.GameObjects.Components.Construction
base.ExposeData(serializer);
serializer.DataField(this, x => x.Prototype, "prototype", null);
serializer.DataField(ref _requirements, "requirements", new Dictionary());
- serializer.DataField(ref _materialRequirements, "materialRequirements", new Dictionary());
+ serializer.DataField(ref _materialIdRequirements, "materialRequirements", new Dictionary());
serializer.DataField(ref _componentRequirements, "componentRequirements", new Dictionary());
}
+ protected override void Startup()
+ {
+ base.Startup();
+
+ foreach (var material in _materialIdRequirements.Keys)
+ {
+ if (!_prototypeManager.HasIndex(material))
+ {
+ Logger.Error($"No {nameof(StackPrototype)} found with id {material}");
+ }
+ }
+ }
+
public void Examine(FormattedMessage message, bool inDetailsRange)
{
message.AddMarkup(Loc.GetString("Requires:\n"));
@@ -50,7 +82,7 @@ namespace Content.Server.GameObjects.Components.Construction
foreach (var (material, amount) in MaterialRequirements)
{
- message.AddMarkup(Loc.GetString("[color=yellow]{0}x[/color] [color=green]{1}[/color]\n", amount, Loc.GetString(material.ToString())));
+ message.AddMarkup(Loc.GetString("[color=yellow]{0}x[/color] [color=green]{1}[/color]\n", amount, Loc.GetString(material.Name)));
}
foreach (var (_, info) in ComponentRequirements)
diff --git a/Content.Server/GameObjects/Components/Construction/MachineFrameComponent.cs b/Content.Server/GameObjects/Components/Construction/MachineFrameComponent.cs
index 2fdd994d2d..e8321c2bbd 100644
--- a/Content.Server/GameObjects/Components/Construction/MachineFrameComponent.cs
+++ b/Content.Server/GameObjects/Components/Construction/MachineFrameComponent.cs
@@ -2,7 +2,6 @@
using System.Threading.Tasks;
using Content.Server.Construction;
using Content.Server.GameObjects.Components.Stack;
-using Content.Shared.GameObjects.Components;
using Content.Shared.GameObjects.Components.Construction;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
@@ -16,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Construction
[RegisterComponent]
public class MachineFrameComponent : Component, IInteractUsing
{
- [Dependency] private IComponentFactory _componentFactory = default!;
+ [Dependency] private readonly IComponentFactory _componentFactory = default!;
public const string PartContainer = "machine_parts";
public const string BoardContainer = "machine_board";
@@ -60,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Construction
private Dictionary _progress;
[ViewVariables]
- private Dictionary _materialProgress;
+ private Dictionary _materialProgress;
[ViewVariables]
private Dictionary _componentProgress;
@@ -75,13 +74,13 @@ namespace Content.Server.GameObjects.Components.Construction
public IReadOnlyDictionary Requirements { get; private set; }
[ViewVariables]
- public IReadOnlyDictionary MaterialRequirements { get; private set; }
+ public IReadOnlyDictionary MaterialRequirements { get; private set; }
[ViewVariables]
public IReadOnlyDictionary ComponentRequirements { get; private set; }
public IReadOnlyDictionary Progress => _progress;
- public IReadOnlyDictionary MaterialProgress => _materialProgress;
+ public IReadOnlyDictionary MaterialProgress => _materialProgress;
public IReadOnlyDictionary ComponentProgress => _componentProgress;
public override void Initialize()
@@ -108,10 +107,10 @@ namespace Content.Server.GameObjects.Components.Construction
private void ResetProgressAndRequirements(MachineBoardComponent machineBoard)
{
Requirements = machineBoard.Requirements;
- MaterialRequirements = machineBoard.MaterialRequirements;
+ MaterialRequirements = machineBoard.MaterialIdRequirements;
ComponentRequirements = machineBoard.ComponentRequirements;
_progress = new Dictionary();
- _materialProgress = new Dictionary();
+ _materialProgress = new Dictionary();
_componentProgress = new Dictionary();
foreach (var (machinePart, _) in Requirements)
@@ -179,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Construction
if (part.TryGetComponent(out var stack))
{
- var type = (StackType) stack.StackType;
+ var type = stack.StackTypeId;
// Check this is part of the requirements...
if (!MaterialRequirements.ContainsKey(type))
continue;
@@ -249,7 +248,7 @@ namespace Content.Server.GameObjects.Components.Construction
if (eventArgs.Using.TryGetComponent(out var stack))
{
- var type = (StackType) stack.StackType;
+ var type = stack.StackTypeId;
if (!MaterialRequirements.ContainsKey(type))
return false;
diff --git a/Content.Server/GameObjects/Components/Stack/StackComponent.cs b/Content.Server/GameObjects/Components/Stack/StackComponent.cs
index 7dfb71f549..6b144fbbac 100644
--- a/Content.Server/GameObjects/Components/Stack/StackComponent.cs
+++ b/Content.Server/GameObjects/Components/Stack/StackComponent.cs
@@ -14,7 +14,6 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Stack
{
-
// TODO: Naming and presentation and such could use some improvement.
[RegisterComponent]
[ComponentReference(typeof(SharedStackComponent))]
@@ -85,7 +84,7 @@ namespace Content.Server.GameObjects.Components.Stack
if (!eventArgs.Using.TryGetComponent(out var stack))
return false;
- if (!stack.StackType.Equals(StackType))
+ if (!stack.StackTypeId.Equals(StackTypeId))
{
return false;
}
diff --git a/Content.Shared/Construction/MaterialConstructionGraphStep.cs b/Content.Shared/Construction/MaterialConstructionGraphStep.cs
index 9ca17db587..ecdc86af81 100644
--- a/Content.Shared/Construction/MaterialConstructionGraphStep.cs
+++ b/Content.Shared/Construction/MaterialConstructionGraphStep.cs
@@ -1,8 +1,13 @@
#nullable enable
using System.Diagnostics.CodeAnalysis;
using Content.Shared.GameObjects.Components;
+using Content.Shared.Materials;
+using Content.Shared.Stacks;
+using JetBrains.Annotations;
using Robust.Shared.GameObjects;
+using Robust.Shared.IoC;
using Robust.Shared.Localization;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
@@ -12,30 +17,34 @@ namespace Content.Shared.Construction
{
// TODO: Make this use the material system.
// TODO TODO: Make the material system not shit.
- public StackType Material { get; private set; }
+ private string MaterialPrototypeId { get; [UsedImplicitly] set; } = default!;
+
+ public StackPrototype MaterialPrototype =>
+ IoCManager.Resolve().Index(MaterialPrototypeId);
+
public int Amount { get; private set; }
public override void ExposeData(ObjectSerializer serializer)
{
base.ExposeData(serializer);
- serializer.DataField(this, x => x.Material, "material", StackType.Metal);
+ serializer.DataField(this, x => x.MaterialPrototypeId, "material", "Steel");
serializer.DataField(this, x => x.Amount, "amount", 1);
}
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
{
- message.AddMarkup(Loc.GetString("Next, add [color=yellow]{0}x[/color] [color=cyan]{1}[/color].", Amount, Material));
+ message.AddMarkup(Loc.GetString("Next, add [color=yellow]{0}x[/color] [color=cyan]{1}[/color].", Amount, MaterialPrototype.Name));
}
public override bool EntityValid(IEntity entity)
{
- return entity.TryGetComponent(out SharedStackComponent? stack) && stack.StackType.Equals(Material);
+ return entity.TryGetComponent(out SharedStackComponent? stack) && stack.StackTypeId.Equals(MaterialPrototypeId);
}
public bool EntityValid(IEntity entity, [NotNullWhen(true)] out SharedStackComponent? stack)
{
- if(entity.TryGetComponent(out SharedStackComponent? otherStack) && otherStack.StackType.Equals(Material))
+ if (entity.TryGetComponent(out SharedStackComponent? otherStack) && otherStack.StackTypeId.Equals(MaterialPrototypeId))
stack = otherStack;
else
stack = null;
diff --git a/Content.Shared/GameObjects/Components/SharedStackComponent.cs b/Content.Shared/GameObjects/Components/SharedStackComponent.cs
index 56ec14217c..357c5e064d 100644
--- a/Content.Shared/GameObjects/Components/SharedStackComponent.cs
+++ b/Content.Shared/GameObjects/Components/SharedStackComponent.cs
@@ -1,8 +1,10 @@
using System;
+using Content.Shared.Stacks;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
+using Robust.Shared.Log;
using Robust.Shared.Players;
-using Robust.Shared.Reflection;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -10,6 +12,8 @@ namespace Content.Shared.GameObjects.Components
{
public abstract class SharedStackComponent : Component
{
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
private const string SerializationCache = "stack";
public sealed override string Name => "Stack";
@@ -47,7 +51,9 @@ namespace Content.Shared.GameObjects.Components
[ViewVariables] public int AvailableSpace => MaxCount - Count;
- [ViewVariables] public object StackType { get; private set; }
+ [ViewVariables] public string StackTypeId { get; private set; } = string.Empty;
+
+ public StackPrototype StackType => _prototypeManager.Index(StackTypeId);
public override void ExposeData(ObjectSerializer serializer)
{
@@ -59,31 +65,29 @@ namespace Content.Shared.GameObjects.Components
return;
}
- if (serializer.TryGetCacheData(SerializationCache, out object stackType))
+ if (serializer.TryGetCacheData(SerializationCache, out string stackType))
{
- StackType = stackType;
+ StackTypeId = stackType;
return;
}
- if (serializer.TryReadDataFieldCached("stacktype", out string raw))
- {
- var refl = IoCManager.Resolve();
- if (refl.TryParseEnumReference(raw, out var @enum))
- {
- stackType = @enum;
- }
- else
- {
- stackType = raw;
- }
- }
- else
- {
- stackType = Owner.Prototype.ID;
- }
+ serializer.DataFieldCached(ref stackType, "stackType", string.Empty);
- serializer.SetCacheData(SerializationCache, stackType);
- StackType = stackType;
+ if (!string.IsNullOrEmpty(stackType))
+ {
+ serializer.SetCacheData(SerializationCache, stackType);
+ StackTypeId = stackType;
+ }
+ }
+
+ protected override void Startup()
+ {
+ base.Startup();
+
+ if (!_prototypeManager.HasIndex(StackTypeId))
+ {
+ Logger.Error($"No {nameof(StackPrototype)} found with id {StackTypeId}");
+ }
}
public override ComponentState GetComponentState(ICommonSession player)
@@ -116,34 +120,4 @@ namespace Content.Shared.GameObjects.Components
}
}
}
-
- public enum StackType
- {
- Metal,
- Glass,
- ReinforcedGlass,
- Plasteel,
- Cable,
- Wood,
- Plastic,
- MVCable,
- HVCable,
- Gold,
- Plasma,
- Ointment,
- Gauze,
- Brutepack,
- FloorTileSteel,
- FloorTileCarpet,
- FloorTileWhite,
- FloorTileDark,
- FloorTileWood,
- MetalRod,
- PaperRolling,
- CigaretteFilter,
- GroundTobacco,
- GroundCannabis,
- LeavesTobaccoDried,
- LeavesCannabisDried
- }
}
diff --git a/Content.Shared/Stacks/StackPrototype.cs b/Content.Shared/Stacks/StackPrototype.cs
new file mode 100644
index 0000000000..d3d3b06ffa
--- /dev/null
+++ b/Content.Shared/Stacks/StackPrototype.cs
@@ -0,0 +1,33 @@
+#nullable enable
+using Robust.Shared.Prototypes;
+using Robust.Shared.Serialization;
+using Robust.Shared.Utility;
+using YamlDotNet.RepresentationModel;
+
+namespace Content.Shared.Stacks
+{
+ [Prototype("stack")]
+ public class StackPrototype : IPrototype
+ {
+ public string ID { get; private set; } = string.Empty;
+
+ public string Name { get; private set; } = string.Empty;
+
+ public SpriteSpecifier? Icon { get; private set; }
+
+ ///
+ /// The entity id that will be spawned by default from this stack.
+ ///
+ public string? Spawn { get; private set; }
+
+ public void LoadFrom(YamlMappingNode mapping)
+ {
+ var reader = YamlObjectSerializer.NewReader(mapping);
+
+ reader.DataField(this, x => x.ID, "id", string.Empty);
+ reader.DataField(this, x => x.Name, "name", string.Empty);
+ reader.DataField(this, x => x.Icon, "icon", null);
+ reader.DataField(this, x => x.Spawn, "spawn", null);
+ }
+ }
+}
diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Smokeables/Cigarettes/rolling_paper.yml b/Resources/Prototypes/Entities/Objects/Consumable/Smokeables/Cigarettes/rolling_paper.yml
index 800d6a50a5..f83cbb3b68 100644
--- a/Resources/Prototypes/Entities/Objects/Consumable/Smokeables/Cigarettes/rolling_paper.yml
+++ b/Resources/Prototypes/Entities/Objects/Consumable/Smokeables/Cigarettes/rolling_paper.yml
@@ -22,7 +22,7 @@
parent: BaseItem
components:
- type: Stack
- stacktype: enum.StackType.PaperRolling
+ stackType: PaperRolling
max: 5
count: 1
- type: Sprite
@@ -39,7 +39,7 @@
parent: BaseItem
components:
- type: Stack
- stacktype: enum.StackType.CigaretteFilter
+ stackType: CigaretteFilter
max: 5
count: 1
- type: Sprite
diff --git a/Resources/Prototypes/Entities/Objects/Misc/material_stacks.yml b/Resources/Prototypes/Entities/Objects/Misc/material_stacks.yml
index 07473df260..2f79d67d37 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/material_stacks.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/material_stacks.yml
@@ -19,7 +19,7 @@
- key: enum.MaterialKeys.Stack
mat: steel
- type: Stack
- stacktype: enum.StackType.Metal
+ stackType: Steel
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: metal
@@ -37,7 +37,7 @@
suffix: 1
components:
- type: Stack
- stacktype: enum.StackType.Metal
+ stackType: Steel
count: 1
- type: entity
@@ -51,7 +51,7 @@
- key: enum.MaterialKeys.Stack
mat: glass
- type: Stack
- stacktype: enum.StackType.Glass
+ stackType: Glass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: glass
@@ -66,7 +66,7 @@
suffix: 1
components:
- type: Stack
- stacktype: enum.StackType.Glass
+ stackType: Glass
count: 1
- type: entity
@@ -80,7 +80,7 @@
- key: enum.MaterialKeys.Stack
mat: rglass
- type: Stack
- stacktype: enum.StackType.ReinforcedGlass
+ stackType: ReinforcedGlass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: rglass
@@ -95,7 +95,7 @@
suffix: 1
components:
- type: Stack
- StackType: enum.StackType.ReinforcedGlass
+ stackType: ReinforcedGlass
count: 1
@@ -110,7 +110,7 @@
- key: enum.MaterialKeys.Stack
mat: plasteel
- type: Stack
- stacktype: enum.StackType.Plasteel
+ stackType: Plasteel
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plasteel
@@ -125,7 +125,7 @@
suffix: 1
components:
- type: Stack
- stacktype: enum.StackType.Plasteel
+ stackType: Plasteel
count: 1
- type: entity
@@ -139,7 +139,7 @@
- key: enum.MaterialKeys.Stack
mat: gold
- type: Stack
- stacktype: enum.StackType.Gold
+ stackType: Gold
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_30
@@ -162,6 +162,7 @@
sprite: Objects/Materials/materials.rsi
state: goldbar_10
- type: Stack
+ stackType: GoldStack1
count: 1
- type: entity
@@ -184,7 +185,7 @@
- key: enum.MaterialKeys.Stack
mat: plasma
- type: Stack
- stacktype: enum.StackType.Plasma
+ stackType: Plasma
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plasma
@@ -199,6 +200,7 @@
suffix: 1
components:
- type: Stack
+ stackType: PlasmaStack1
count: 1
- type: entity
@@ -212,7 +214,7 @@
- key: enum.MaterialKeys.Stack
mat: wood
- type: Stack
- stacktype: enum.StackType.Wood
+ stackType: Wood
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: wood
@@ -227,6 +229,7 @@
suffix: 1
components:
- type: Stack
+ stackType: WoodPlank1
count: 1
- type: entity
@@ -240,7 +243,7 @@
- key: enum.MaterialKeys.Stack
mat: plastic
- type: Stack
- stacktype: enum.StackType.Plastic
+ stackType: Plastic
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: plastic
@@ -255,4 +258,5 @@
suffix: 1
components:
- type: Stack
+ stackType: PlasticSheet1
count: 1
diff --git a/Resources/Prototypes/Entities/Objects/Misc/metal_rod.yml b/Resources/Prototypes/Entities/Objects/Misc/metal_rod.yml
index 504f771f09..10b5c42426 100644
--- a/Resources/Prototypes/Entities/Objects/Misc/metal_rod.yml
+++ b/Resources/Prototypes/Entities/Objects/Misc/metal_rod.yml
@@ -16,7 +16,7 @@
graph: metalRod
node: MetalRod
- type: Stack
- stacktype: enum.StackType.MetalRod
+ stackType: MetalRod
count: 50
max: 50
- type: FloorTile
@@ -30,6 +30,6 @@
suffix: 1
components:
- type: Stack
- stacktype: enum.StackType.MetalRod
+ stackType: MetalRod
count: 1
max: 50
diff --git a/Resources/Prototypes/Entities/Objects/Power/cable_coils.yml b/Resources/Prototypes/Entities/Objects/Power/cable_coils.yml
index c7a9a2f11c..e1c9a25f01 100644
--- a/Resources/Prototypes/Entities/Objects/Power/cable_coils.yml
+++ b/Resources/Prototypes/Entities/Objects/Power/cable_coils.yml
@@ -10,7 +10,7 @@
suffix: Full
components:
- type: Stack
- stacktype: enum.StackType.Cable
+ stackType: Cable
- type: Sprite
sprite: Objects/Tools/cables.rsi
netsync: false
@@ -27,7 +27,7 @@
suffix: Full
components:
- type: Stack
- stacktype: enum.StackType.HVCable
+ stackType: HVCable
- type: Sprite
state: coilhv-30
- type: Item
@@ -50,10 +50,11 @@
suffix: 1
components:
- type: Sprite
- state: coilhv-10
+ state: coilhv-10
- type: Item
size: 3
- type: Stack
+ stackType: HVWireStack1
count: 1
- type: entity
@@ -89,6 +90,7 @@
- type: Item
size: 3
- type: Stack
+ stackType: ApcExtensionCableStack1
count: 1
- type: entity
@@ -98,7 +100,7 @@
suffix: Full
components:
- type: Stack
- stacktype: enum.StackType.MVCable
+ stackType: MVCable
- type: Sprite
state: coilmv-30
- type: Item
@@ -125,4 +127,5 @@
- type: Item
size: 3
- type: Stack
+ stackType: MVWireStack1
count: 1
diff --git a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/produce.yml b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/produce.yml
index 9441a6e30a..0ed575ed18 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/produce.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/produce.yml
@@ -276,7 +276,7 @@
description: "Dried cannabis leaves, ready to be ground."
components:
- type: Stack
- stacktype: enum.StackType.LeavesCannabisDried
+ stackType: LeavesCannabisDried
max: 5
count: 1
- type: SolutionContainer
@@ -295,7 +295,7 @@
description: "Ground cannabis, ready to take you on a trip."
components:
- type: Stack
- stacktype: enum.StackType.GroundCannabis
+ stackType: GroundCannabis
max: 5
count: 1
- type: SolutionContainer
@@ -329,7 +329,7 @@
description: "Dried tobacco leaves, ready to be ground."
components:
- type: Stack
- stacktype: enum.StackType.LeavesTobaccoDried
+ stackType: LeavesTobaccoDried
max: 5
count: 1
- type: SolutionContainer
@@ -348,7 +348,7 @@
description: "Ground tobacco, perfect for hand-rolled cigarettes."
components:
- type: Stack
- stacktype: enum.StackType.GroundTobacco
+ stackType: GroundTobacco
max: 5
count: 1
- type: SolutionContainer
diff --git a/Resources/Prototypes/Entities/Objects/Specific/medical.yml b/Resources/Prototypes/Entities/Objects/Specific/medical.yml
index 578a550161..bba2da445c 100644
--- a/Resources/Prototypes/Entities/Objects/Specific/medical.yml
+++ b/Resources/Prototypes/Entities/Objects/Specific/medical.yml
@@ -31,7 +31,6 @@
parent: BaseItem
abstract: true
components:
- - type: Stack
- type: Item
- type: Healing
@@ -48,9 +47,9 @@
heal:
Heat: 10
- type: Stack
+ stackType: Ointment
max: 5
count: 5
- stacktype: enum.StackType.Ointment
- type: entity
name: bruise pack
@@ -65,9 +64,9 @@
heal:
Blunt: 10
- type: Stack
+ stackType: Brutepack
max: 5
count: 5
- stacktype: enum.StackType.Brutepack
- type: entity
name: roll of gauze
@@ -82,6 +81,6 @@
# heal:
# Blunt: 10
- type: Stack
+ stackType: Gauze
max: 5
count: 5
- stacktype: enum.StackType.Gauze
diff --git a/Resources/Prototypes/Entities/Objects/tiles.yml b/Resources/Prototypes/Entities/Objects/tiles.yml
index 710426f140..1085ae2360 100644
--- a/Resources/Prototypes/Entities/Objects/tiles.yml
+++ b/Resources/Prototypes/Entities/Objects/tiles.yml
@@ -12,7 +12,7 @@
- plating
- floor_steel
- type: Stack
- stacktype: FloorTileSteel
+ stackType: FloorTileSteel
count: 1
max: 8
@@ -41,7 +41,7 @@
- plating
- floor_wood
- type: Stack
- stacktype: FloorTileWood
+ stackType: FloorTileWood
count: 1
max: 8
@@ -61,7 +61,7 @@
- plating
- floor_white
- type: Stack
- stacktype: FloorTileWhite
+ stackType: FloorTileWhite
count: 1
max: 8
@@ -81,7 +81,7 @@
- plating
- floor_dark
- type: Stack
- stacktype: FloorTileDark
+ stackType: FloorTileDark
count: 1
max: 8
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml b/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml
index b36718ef3c..3e588ac64b 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/APC.yml
@@ -6,7 +6,7 @@
edges:
- to: apc
steps:
- - material: Metal
+ - material: Steel
amount: 3
- node: apc
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/computer.yml b/Resources/Prototypes/Recipes/Construction/Graphs/computer.yml
index cb817aa4dc..c654c6d87b 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/computer.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/computer.yml
@@ -9,7 +9,7 @@
- !type:SetAnchor
value: false
steps:
- - material: Metal
+ - material: Steel
amount: 5
- node: frameUnsecured
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/conveyor.yml b/Resources/Prototypes/Recipes/Construction/Graphs/conveyor.yml
index 4f20a6c032..3a7ee3c6ec 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/conveyor.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/conveyor.yml
@@ -45,7 +45,7 @@
completed:
- !type:SnapToGrid {}
steps:
- - material: Metal
+ - material: Steel
amount: 2
doAfter: 1
- node: lever
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml b/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml
index 2ced5b24c5..f7ec7d64df 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/firelock.yml
@@ -8,7 +8,7 @@
completed:
- !type:SnapToGrid { }
steps:
- - material: Metal
+ - material: Steel
amount: 3
doAfter: 1
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/girder.yml b/Resources/Prototypes/Recipes/Construction/Graphs/girder.yml
index ff840def92..8eba148d1a 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/girder.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/girder.yml
@@ -9,7 +9,7 @@
- !type:SnapToGrid
southRotation: true
steps:
- - material: Metal
+ - material: Steel
amount: 2
doAfter: 1
@@ -41,7 +41,7 @@
conditions:
- !type:EntityAnchored {}
steps:
- - material: Metal
+ - material: Steel
amount: 2
- to: reinforcedGirder
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/lighting.yml b/Resources/Prototypes/Recipes/Construction/Graphs/lighting.yml
index 0d80074446..e7c45c4331 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/lighting.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/lighting.yml
@@ -6,12 +6,12 @@
edges:
- to: bulbLight
steps:
- - material: Metal
+ - material: Steel
amount: 1
- doAfter: 2.0
+ doAfter: 2.0
- to: tubeLight
steps:
- - material: Metal
+ - material: Steel
amount: 2
doAfter: 2.0
- node: tubeLight
@@ -28,7 +28,7 @@
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 2
- - !type:DeleteEntity {}
+ - !type:DeleteEntity {}
- node: bulbLight
entity: PoweredSmallLightEmpty
edges:
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/low_wall.yml b/Resources/Prototypes/Recipes/Construction/Graphs/low_wall.yml
index acf1aa6ddf..9f078dca19 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/low_wall.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/low_wall.yml
@@ -15,7 +15,7 @@
edges:
- to: lowWall
steps:
- - material: Metal
+ - material: Steel
amount: 3
doAfter: 5
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/machine.yml b/Resources/Prototypes/Recipes/Construction/Graphs/machine.yml
index 67e2e26b42..64c6e10ce3 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/machine.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/machine.yml
@@ -13,7 +13,7 @@
- !type:SetAnchor
value: false
steps:
- - material: Metal
+ - material: Steel
amount: 5
doAfter: 2.5
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml b/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml
index 955fb37b43..8b732b8e44 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/metal_rod.yml
@@ -9,7 +9,7 @@
- !type:SetStackCount
amount: 2
steps:
- - material: Metal
+ - material: Steel
amount: 1
- node: MetalRod
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/spear.yml b/Resources/Prototypes/Recipes/Construction/Graphs/spear.yml
index 09f500905f..de2f543f29 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/spear.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/spear.yml
@@ -6,7 +6,7 @@
edges:
- to: spear
steps:
- - material: Metal
+ - material: Steel
amount: 2
doAfter: 2
- material: Glass
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml b/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml
index f94b12ace6..5e099a4fc0 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/tables.yml
@@ -31,7 +31,7 @@
- to: MetalTable
steps:
- - material: Metal
+ - material: Steel
amount: 1
doAfter: 1
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/toilet.yml b/Resources/Prototypes/Recipes/Construction/Graphs/toilet.yml
index faf5cc9f6b..619ba1953f 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/toilet.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/toilet.yml
@@ -8,7 +8,7 @@
completed:
- !type:SnapToGrid { }
steps:
- - material: Metal
+ - material: Steel
amount: 5
doAfter: 1
- node: toilet
@@ -18,12 +18,12 @@
- !type:SpawnPrototype
prototype: SteelSheet1
amount: 5
- - !type:EmptyAllContainers {}
+ - !type:EmptyAllContainers {}
- !type:DeleteEntity {}
conditions:
- !type:EntityAnchored
anchored: false
- - !type:ToiletLidClosed {}
+ - !type:ToiletLidClosed {}
steps:
- tool: Welding
- doAfter: 2
\ No newline at end of file
+ doAfter: 2
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/window.yml b/Resources/Prototypes/Recipes/Construction/Graphs/window.yml
index 130fa28427..c398aef9d2 100644
--- a/Resources/Prototypes/Recipes/Construction/Graphs/window.yml
+++ b/Resources/Prototypes/Recipes/Construction/Graphs/window.yml
@@ -6,7 +6,7 @@
edges:
- to: plasmaWindow
steps:
- - material: Metal
+ - material: Steel
amount: 2
doAfter: 2
- material: Glass
diff --git a/Resources/Prototypes/Stacks/floor_tile_stacks.yml b/Resources/Prototypes/Stacks/floor_tile_stacks.yml
new file mode 100644
index 0000000000..564ed1ccd1
--- /dev/null
+++ b/Resources/Prototypes/Stacks/floor_tile_stacks.yml
@@ -0,0 +1,19 @@
+- type: stack
+ id: FloorTileSteel
+ name: steel tile
+
+- type: stack
+ id: FloorTileCarpet
+ name: carpet tile
+
+- type: stack
+ id: FloorTileWhite
+ name: white tile
+
+- type: stack
+ id: FloorTileDark
+ name: dark tile
+
+- type: stack
+ id: FloorTileWood
+ name: wood tile
diff --git a/Resources/Prototypes/Stacks/material_stacks.yml b/Resources/Prototypes/Stacks/material_stacks.yml
new file mode 100644
index 0000000000..d24a8cbe07
--- /dev/null
+++ b/Resources/Prototypes/Stacks/material_stacks.yml
@@ -0,0 +1,61 @@
+- type: stack
+ id: Steel
+ name: steel
+ icon: "/Textures/Objects/Materials/sheets.rsi/metal.png"
+ spawn: SteelSheet1
+
+- type: stack
+ id: Glass
+ name: glass
+ icon: "/Textures/Objects/Materials/sheets.rsi/glass.png"
+ spawn: GlassSheet1
+
+- type: stack
+ id: ReinforcedGlass
+ name: reinforced glass
+
+- type: stack
+ id: Plasteel
+ name: plasteel
+ icon: "/Textures/Objects/Materials/sheets.rsi/plasteel.png"
+ spawn: PlasteelSheet1
+
+- type: stack
+ id: Wood
+ name: wood
+
+- type: stack
+ id: Plastic
+ name: plastic
+
+- type: stack
+ id: Gold
+ name: gold
+
+- type: stack
+ id: Plasma
+ name: plasma
+ icon: "/Textures/Objects/Materials/sheets.rsi/phoron.png"
+ spawn: PlasmaStack1
+
+- type: stack
+ id: MetalRod
+ name: metal rod
+ icon: "/Textures/Objects/Materials/materials.rsi/rods.png"
+ spawn: MetalRodStack1
+
+- type: stack
+ id: GoldStack1
+ name: gold
+
+- type: stack
+ id: PlasmaStack1
+ name: plasma
+
+- type: stack
+ id: WoodPlank1
+ name: wood
+
+- type: stack
+ id: PlasticSheet1
+ name: plastic
diff --git a/Resources/Prototypes/Stacks/medical_stacks.yml b/Resources/Prototypes/Stacks/medical_stacks.yml
new file mode 100644
index 0000000000..1de2f80231
--- /dev/null
+++ b/Resources/Prototypes/Stacks/medical_stacks.yml
@@ -0,0 +1,11 @@
+- type: stack
+ id: Ointment
+ name: ointment
+
+- type: stack
+ id: Gauze
+ name: gauze
+
+- type: stack
+ id: Brutepack
+ name: brutepack
diff --git a/Resources/Prototypes/Stacks/power_stacks.yml b/Resources/Prototypes/Stacks/power_stacks.yml
new file mode 100644
index 0000000000..9caa19748c
--- /dev/null
+++ b/Resources/Prototypes/Stacks/power_stacks.yml
@@ -0,0 +1,25 @@
+- type: stack
+ id: Cable
+ name: cable
+ icon: "/Textures/Objects/Tools/cables.rsi/coil-30.png"
+ spawn: ApcExtensionCableStack1
+
+- type: stack
+ id: MVCable
+ name: mv cable
+
+- type: stack
+ id: HVCable
+ name: hv cable
+
+- type: stack
+ id: HVWireStack1
+ name: hv wire
+
+- type: stack
+ id: MVWireStack1
+ name: mv wire
+
+- type: stack
+ id: ApcExtensionCableStack1
+ name: apc extension cable
diff --git a/Resources/Prototypes/Stacks/tobacco_stacks.yml b/Resources/Prototypes/Stacks/tobacco_stacks.yml
new file mode 100644
index 0000000000..1c48fd1d2c
--- /dev/null
+++ b/Resources/Prototypes/Stacks/tobacco_stacks.yml
@@ -0,0 +1,23 @@
+- type: stack
+ id: PaperRolling
+ name: paper rolling
+
+- type: stack
+ id: CigaretteFilter
+ name: cigarette filter
+
+- type: stack
+ id: GroundTobacco
+ name: ground tobacco
+
+- type: stack
+ id: GroundCannabis
+ name: ground cannabis
+
+- type: stack
+ id: LeavesTobaccoDried
+ name: dried tobacco leaves
+
+- type: stack
+ id: LeavesCannabisDried
+ name: dried cannabis leaves