Refactor stacks to use prototypes (#3387)
* Refactor stacks to use prototypes * Fix not assigned warning * Add names to stacks * Make machine baords and material constructions use the name as well * Remove defaulting stacks to prototype id * Fix tests Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -18,6 +18,7 @@ using Robust.Shared.GameObjects;
|
|||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Client.Construction
|
namespace Content.Client.Construction
|
||||||
{
|
{
|
||||||
@@ -250,8 +251,8 @@ namespace Content.Client.Construction
|
|||||||
stepList.AddItem(
|
stepList.AddItem(
|
||||||
!firstNode
|
!firstNode
|
||||||
? Loc.GetString(
|
? Loc.GetString(
|
||||||
"{0}. Add {1}x {2}.", stepNumber++, materialStep.Amount, materialStep.Material)
|
"{0}. Add {1}x {2}.", stepNumber++, materialStep.Amount, materialStep.MaterialPrototype.Name)
|
||||||
: Loc.GetString(" {0}x {1}", materialStep.Amount, materialStep.Material), icon);
|
: Loc.GetString(" {0}x {1}", materialStep.Amount, materialStep.MaterialPrototype.Name), icon);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -278,8 +279,7 @@ namespace Content.Client.Construction
|
|||||||
switch (subStep)
|
switch (subStep)
|
||||||
{
|
{
|
||||||
case MaterialConstructionGraphStep materialStep:
|
case MaterialConstructionGraphStep materialStep:
|
||||||
if (prototype.Type != ConstructionType.Item)
|
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);
|
||||||
stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}x {4}.", stepNumber, parallelNumber, subStepNumber++, materialStep.Amount, materialStep.Material), icon);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ToolConstructionGraphStep toolStep:
|
case ToolConstructionGraphStep toolStep:
|
||||||
@@ -308,28 +308,7 @@ namespace Content.Client.Construction
|
|||||||
switch (step)
|
switch (step)
|
||||||
{
|
{
|
||||||
case MaterialConstructionGraphStep materialStep:
|
case MaterialConstructionGraphStep materialStep:
|
||||||
switch (materialStep.Material)
|
return materialStep.MaterialPrototype.Icon?.Frame0();
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|
||||||
case ToolConstructionGraphStep toolStep:
|
case ToolConstructionGraphStep toolStep:
|
||||||
switch (toolStep.Tool)
|
switch (toolStep.Tool)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using Content.Server.GameObjects.Components.Stack;
|
using Content.Server.GameObjects.Components.Stack;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
@@ -13,46 +14,15 @@ namespace Content.Server.Construction
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Spawns a stack of a specified type given an amount.
|
/// Spawns a stack of a specified type given an amount.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
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<IEntityManager>();
|
entityManager ??= IoCManager.Resolve<IEntityManager>();
|
||||||
|
|
||||||
string prototype;
|
// TODO: Add more.
|
||||||
|
string prototype = stack.Spawn ?? throw new ArgumentOutOfRangeException(nameof(stack),
|
||||||
switch (stack)
|
"Stack type doesn't have a prototype specified yet!");
|
||||||
{
|
|
||||||
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!");
|
|
||||||
}
|
|
||||||
|
|
||||||
var ent = entityManager.SpawnEntity(prototype, coordinates);
|
var ent = entityManager.SpawnEntity(prototype, coordinates);
|
||||||
|
|
||||||
var stackComponent = ent.GetComponent<StackComponent>();
|
var stackComponent = ent.GetComponent<StackComponent>();
|
||||||
|
|
||||||
stackComponent.Count = Math.Min(amount, stackComponent.MaxCount);
|
stackComponent.Count = Math.Min(amount, stackComponent.MaxCount);
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Content.Server.Construction;
|
using Content.Server.Construction;
|
||||||
using Content.Shared.GameObjects.Components;
|
|
||||||
using Content.Shared.GameObjects.EntitySystems;
|
using Content.Shared.GameObjects.EntitySystems;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Log;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
@@ -14,13 +18,15 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class MachineBoardComponent : Component, IExamine
|
public class MachineBoardComponent : Component, IExamine
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
|
|
||||||
public override string Name => "MachineBoard";
|
public override string Name => "MachineBoard";
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private Dictionary<MachinePart, int> _requirements;
|
private Dictionary<MachinePart, int> _requirements;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private Dictionary<StackType, int> _materialRequirements;
|
private Dictionary<string, int> _materialIdRequirements;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private Dictionary<string, ComponentPartInfo> _componentRequirements;
|
private Dictionary<string, ComponentPartInfo> _componentRequirements;
|
||||||
@@ -28,7 +34,20 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
public string Prototype { get; private set; }
|
public string Prototype { get; private set; }
|
||||||
public IReadOnlyDictionary<MachinePart, int> Requirements => _requirements;
|
public IReadOnlyDictionary<MachinePart, int> Requirements => _requirements;
|
||||||
public IReadOnlyDictionary<StackType, int> MaterialRequirements => _materialRequirements;
|
public IReadOnlyDictionary<string, int> MaterialIdRequirements => _materialIdRequirements;
|
||||||
|
|
||||||
|
public IEnumerable<KeyValuePair<StackPrototype, int>> MaterialRequirements
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
foreach (var (materialId, amount) in MaterialIdRequirements)
|
||||||
|
{
|
||||||
|
var material = _prototypeManager.Index<StackPrototype>(materialId);
|
||||||
|
yield return new KeyValuePair<StackPrototype, int>(material, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public IReadOnlyDictionary<string, ComponentPartInfo> ComponentRequirements => _componentRequirements;
|
public IReadOnlyDictionary<string, ComponentPartInfo> ComponentRequirements => _componentRequirements;
|
||||||
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
@@ -36,10 +55,23 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
base.ExposeData(serializer);
|
base.ExposeData(serializer);
|
||||||
serializer.DataField(this, x => x.Prototype, "prototype", null);
|
serializer.DataField(this, x => x.Prototype, "prototype", null);
|
||||||
serializer.DataField(ref _requirements, "requirements", new Dictionary<MachinePart, int>());
|
serializer.DataField(ref _requirements, "requirements", new Dictionary<MachinePart, int>());
|
||||||
serializer.DataField(ref _materialRequirements, "materialRequirements", new Dictionary<StackType, int>());
|
serializer.DataField(ref _materialIdRequirements, "materialRequirements", new Dictionary<string, int>());
|
||||||
serializer.DataField(ref _componentRequirements, "componentRequirements", new Dictionary<string, ComponentPartInfo>());
|
serializer.DataField(ref _componentRequirements, "componentRequirements", new Dictionary<string, ComponentPartInfo>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
|
||||||
|
foreach (var material in _materialIdRequirements.Keys)
|
||||||
|
{
|
||||||
|
if (!_prototypeManager.HasIndex<StackPrototype>(material))
|
||||||
|
{
|
||||||
|
Logger.Error($"No {nameof(StackPrototype)} found with id {material}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Examine(FormattedMessage message, bool inDetailsRange)
|
public void Examine(FormattedMessage message, bool inDetailsRange)
|
||||||
{
|
{
|
||||||
message.AddMarkup(Loc.GetString("Requires:\n"));
|
message.AddMarkup(Loc.GetString("Requires:\n"));
|
||||||
@@ -50,7 +82,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
|
|
||||||
foreach (var (material, amount) in MaterialRequirements)
|
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)
|
foreach (var (_, info) in ComponentRequirements)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Construction;
|
using Content.Server.Construction;
|
||||||
using Content.Server.GameObjects.Components.Stack;
|
using Content.Server.GameObjects.Components.Stack;
|
||||||
using Content.Shared.GameObjects.Components;
|
|
||||||
using Content.Shared.GameObjects.Components.Construction;
|
using Content.Shared.GameObjects.Components.Construction;
|
||||||
using Content.Shared.Interfaces.GameObjects.Components;
|
using Content.Shared.Interfaces.GameObjects.Components;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
@@ -16,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public class MachineFrameComponent : Component, IInteractUsing
|
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 PartContainer = "machine_parts";
|
||||||
public const string BoardContainer = "machine_board";
|
public const string BoardContainer = "machine_board";
|
||||||
@@ -60,7 +59,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
private Dictionary<MachinePart, int> _progress;
|
private Dictionary<MachinePart, int> _progress;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private Dictionary<StackType, int> _materialProgress;
|
private Dictionary<string, int> _materialProgress;
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private Dictionary<string, int> _componentProgress;
|
private Dictionary<string, int> _componentProgress;
|
||||||
@@ -75,13 +74,13 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
public IReadOnlyDictionary<MachinePart, int> Requirements { get; private set; }
|
public IReadOnlyDictionary<MachinePart, int> Requirements { get; private set; }
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public IReadOnlyDictionary<StackType, int> MaterialRequirements { get; private set; }
|
public IReadOnlyDictionary<string, int> MaterialRequirements { get; private set; }
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
public IReadOnlyDictionary<string, ComponentPartInfo> ComponentRequirements { get; private set; }
|
public IReadOnlyDictionary<string, ComponentPartInfo> ComponentRequirements { get; private set; }
|
||||||
|
|
||||||
public IReadOnlyDictionary<MachinePart, int> Progress => _progress;
|
public IReadOnlyDictionary<MachinePart, int> Progress => _progress;
|
||||||
public IReadOnlyDictionary<StackType, int> MaterialProgress => _materialProgress;
|
public IReadOnlyDictionary<string, int> MaterialProgress => _materialProgress;
|
||||||
public IReadOnlyDictionary<string, int> ComponentProgress => _componentProgress;
|
public IReadOnlyDictionary<string, int> ComponentProgress => _componentProgress;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -108,10 +107,10 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
private void ResetProgressAndRequirements(MachineBoardComponent machineBoard)
|
private void ResetProgressAndRequirements(MachineBoardComponent machineBoard)
|
||||||
{
|
{
|
||||||
Requirements = machineBoard.Requirements;
|
Requirements = machineBoard.Requirements;
|
||||||
MaterialRequirements = machineBoard.MaterialRequirements;
|
MaterialRequirements = machineBoard.MaterialIdRequirements;
|
||||||
ComponentRequirements = machineBoard.ComponentRequirements;
|
ComponentRequirements = machineBoard.ComponentRequirements;
|
||||||
_progress = new Dictionary<MachinePart, int>();
|
_progress = new Dictionary<MachinePart, int>();
|
||||||
_materialProgress = new Dictionary<StackType, int>();
|
_materialProgress = new Dictionary<string, int>();
|
||||||
_componentProgress = new Dictionary<string, int>();
|
_componentProgress = new Dictionary<string, int>();
|
||||||
|
|
||||||
foreach (var (machinePart, _) in Requirements)
|
foreach (var (machinePart, _) in Requirements)
|
||||||
@@ -179,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
|
|
||||||
if (part.TryGetComponent<StackComponent>(out var stack))
|
if (part.TryGetComponent<StackComponent>(out var stack))
|
||||||
{
|
{
|
||||||
var type = (StackType) stack.StackType;
|
var type = stack.StackTypeId;
|
||||||
// Check this is part of the requirements...
|
// Check this is part of the requirements...
|
||||||
if (!MaterialRequirements.ContainsKey(type))
|
if (!MaterialRequirements.ContainsKey(type))
|
||||||
continue;
|
continue;
|
||||||
@@ -249,7 +248,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
|||||||
|
|
||||||
if (eventArgs.Using.TryGetComponent<StackComponent>(out var stack))
|
if (eventArgs.Using.TryGetComponent<StackComponent>(out var stack))
|
||||||
{
|
{
|
||||||
var type = (StackType) stack.StackType;
|
var type = stack.StackTypeId;
|
||||||
if (!MaterialRequirements.ContainsKey(type))
|
if (!MaterialRequirements.ContainsKey(type))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ using Robust.Shared.ViewVariables;
|
|||||||
|
|
||||||
namespace Content.Server.GameObjects.Components.Stack
|
namespace Content.Server.GameObjects.Components.Stack
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO: Naming and presentation and such could use some improvement.
|
// TODO: Naming and presentation and such could use some improvement.
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[ComponentReference(typeof(SharedStackComponent))]
|
[ComponentReference(typeof(SharedStackComponent))]
|
||||||
@@ -85,7 +84,7 @@ namespace Content.Server.GameObjects.Components.Stack
|
|||||||
if (!eventArgs.Using.TryGetComponent<StackComponent>(out var stack))
|
if (!eventArgs.Using.TryGetComponent<StackComponent>(out var stack))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!stack.StackType.Equals(StackType))
|
if (!stack.StackTypeId.Equals(StackTypeId))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.GameObjects.Components;
|
using Content.Shared.GameObjects.Components;
|
||||||
|
using Content.Shared.Materials;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
@@ -12,30 +17,34 @@ namespace Content.Shared.Construction
|
|||||||
{
|
{
|
||||||
// TODO: Make this use the material system.
|
// TODO: Make this use the material system.
|
||||||
// TODO TODO: Make the material system not shit.
|
// 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<IPrototypeManager>().Index<StackPrototype>(MaterialPrototypeId);
|
||||||
|
|
||||||
public int Amount { get; private set; }
|
public int Amount { get; private set; }
|
||||||
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
{
|
{
|
||||||
base.ExposeData(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);
|
serializer.DataField(this, x => x.Amount, "amount", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DoExamine(FormattedMessage message, bool inDetailsRange)
|
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)
|
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)
|
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;
|
stack = otherStack;
|
||||||
else
|
else
|
||||||
stack = null;
|
stack = null;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Shared.Stacks;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Log;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
using Robust.Shared.Reflection;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Serialization;
|
using Robust.Shared.Serialization;
|
||||||
using Robust.Shared.ViewVariables;
|
using Robust.Shared.ViewVariables;
|
||||||
|
|
||||||
@@ -10,6 +12,8 @@ namespace Content.Shared.GameObjects.Components
|
|||||||
{
|
{
|
||||||
public abstract class SharedStackComponent : Component
|
public abstract class SharedStackComponent : Component
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||||
|
|
||||||
private const string SerializationCache = "stack";
|
private const string SerializationCache = "stack";
|
||||||
|
|
||||||
public sealed override string Name => "Stack";
|
public sealed override string Name => "Stack";
|
||||||
@@ -47,7 +51,9 @@ namespace Content.Shared.GameObjects.Components
|
|||||||
|
|
||||||
[ViewVariables] public int AvailableSpace => MaxCount - Count;
|
[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<StackPrototype>(StackTypeId);
|
||||||
|
|
||||||
public override void ExposeData(ObjectSerializer serializer)
|
public override void ExposeData(ObjectSerializer serializer)
|
||||||
{
|
{
|
||||||
@@ -59,31 +65,29 @@ namespace Content.Shared.GameObjects.Components
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serializer.TryGetCacheData(SerializationCache, out object stackType))
|
if (serializer.TryGetCacheData(SerializationCache, out string stackType))
|
||||||
{
|
{
|
||||||
StackType = stackType;
|
StackTypeId = stackType;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (serializer.TryReadDataFieldCached("stacktype", out string raw))
|
serializer.DataFieldCached(ref stackType, "stackType", string.Empty);
|
||||||
{
|
|
||||||
var refl = IoCManager.Resolve<IReflectionManager>();
|
|
||||||
if (refl.TryParseEnumReference(raw, out var @enum))
|
|
||||||
{
|
|
||||||
stackType = @enum;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
stackType = raw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
stackType = Owner.Prototype.ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
serializer.SetCacheData(SerializationCache, stackType);
|
if (!string.IsNullOrEmpty(stackType))
|
||||||
StackType = stackType;
|
{
|
||||||
|
serializer.SetCacheData(SerializationCache, stackType);
|
||||||
|
StackTypeId = stackType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Startup()
|
||||||
|
{
|
||||||
|
base.Startup();
|
||||||
|
|
||||||
|
if (!_prototypeManager.HasIndex<StackPrototype>(StackTypeId))
|
||||||
|
{
|
||||||
|
Logger.Error($"No {nameof(StackPrototype)} found with id {StackTypeId}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ComponentState GetComponentState(ICommonSession player)
|
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
33
Content.Shared/Stacks/StackPrototype.cs
Normal file
33
Content.Shared/Stacks/StackPrototype.cs
Normal file
@@ -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; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The entity id that will be spawned by default from this stack.
|
||||||
|
/// </summary>
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.PaperRolling
|
stackType: PaperRolling
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.CigaretteFilter
|
stackType: CigaretteFilter
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: steel
|
mat: steel
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Metal
|
stackType: Steel
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: metal
|
state: metal
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Metal
|
stackType: Steel
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: glass
|
mat: glass
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Glass
|
stackType: Glass
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: glass
|
state: glass
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Glass
|
stackType: Glass
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: rglass
|
mat: rglass
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.ReinforcedGlass
|
stackType: ReinforcedGlass
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: rglass
|
state: rglass
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
StackType: enum.StackType.ReinforcedGlass
|
stackType: ReinforcedGlass
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: plasteel
|
mat: plasteel
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Plasteel
|
stackType: Plasteel
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: plasteel
|
state: plasteel
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Plasteel
|
stackType: Plasteel
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: gold
|
mat: gold
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Gold
|
stackType: Gold
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/materials.rsi
|
sprite: Objects/Materials/materials.rsi
|
||||||
state: goldbar_30
|
state: goldbar_30
|
||||||
@@ -162,6 +162,7 @@
|
|||||||
sprite: Objects/Materials/materials.rsi
|
sprite: Objects/Materials/materials.rsi
|
||||||
state: goldbar_10
|
state: goldbar_10
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: GoldStack1
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -184,7 +185,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: plasma
|
mat: plasma
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Plasma
|
stackType: Plasma
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: plasma
|
state: plasma
|
||||||
@@ -199,6 +200,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: PlasmaStack1
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -212,7 +214,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: wood
|
mat: wood
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Wood
|
stackType: Wood
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/materials.rsi
|
sprite: Objects/Materials/materials.rsi
|
||||||
state: wood
|
state: wood
|
||||||
@@ -227,6 +229,7 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: WoodPlank1
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -240,7 +243,7 @@
|
|||||||
- key: enum.MaterialKeys.Stack
|
- key: enum.MaterialKeys.Stack
|
||||||
mat: plastic
|
mat: plastic
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Plastic
|
stackType: Plastic
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Materials/sheets.rsi
|
sprite: Objects/Materials/sheets.rsi
|
||||||
state: plastic
|
state: plastic
|
||||||
@@ -255,4 +258,5 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: PlasticSheet1
|
||||||
count: 1
|
count: 1
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
graph: metalRod
|
graph: metalRod
|
||||||
node: MetalRod
|
node: MetalRod
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.MetalRod
|
stackType: MetalRod
|
||||||
count: 50
|
count: 50
|
||||||
max: 50
|
max: 50
|
||||||
- type: FloorTile
|
- type: FloorTile
|
||||||
@@ -30,6 +30,6 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.MetalRod
|
stackType: MetalRod
|
||||||
count: 1
|
count: 1
|
||||||
max: 50
|
max: 50
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
suffix: Full
|
suffix: Full
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.Cable
|
stackType: Cable
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
sprite: Objects/Tools/cables.rsi
|
sprite: Objects/Tools/cables.rsi
|
||||||
netsync: false
|
netsync: false
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
suffix: Full
|
suffix: Full
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.HVCable
|
stackType: HVCable
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: coilhv-30
|
state: coilhv-30
|
||||||
- type: Item
|
- type: Item
|
||||||
@@ -50,10 +50,11 @@
|
|||||||
suffix: 1
|
suffix: 1
|
||||||
components:
|
components:
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: coilhv-10
|
state: coilhv-10
|
||||||
- type: Item
|
- type: Item
|
||||||
size: 3
|
size: 3
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: HVWireStack1
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -89,6 +90,7 @@
|
|||||||
- type: Item
|
- type: Item
|
||||||
size: 3
|
size: 3
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: ApcExtensionCableStack1
|
||||||
count: 1
|
count: 1
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
@@ -98,7 +100,7 @@
|
|||||||
suffix: Full
|
suffix: Full
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.MVCable
|
stackType: MVCable
|
||||||
- type: Sprite
|
- type: Sprite
|
||||||
state: coilmv-30
|
state: coilmv-30
|
||||||
- type: Item
|
- type: Item
|
||||||
@@ -125,4 +127,5 @@
|
|||||||
- type: Item
|
- type: Item
|
||||||
size: 3
|
size: 3
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: MVWireStack1
|
||||||
count: 1
|
count: 1
|
||||||
|
|||||||
@@ -276,7 +276,7 @@
|
|||||||
description: "Dried cannabis leaves, ready to be ground."
|
description: "Dried cannabis leaves, ready to be ground."
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.LeavesCannabisDried
|
stackType: LeavesCannabisDried
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
description: "Ground cannabis, ready to take you on a trip."
|
description: "Ground cannabis, ready to take you on a trip."
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.GroundCannabis
|
stackType: GroundCannabis
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
@@ -329,7 +329,7 @@
|
|||||||
description: "Dried tobacco leaves, ready to be ground."
|
description: "Dried tobacco leaves, ready to be ground."
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.LeavesTobaccoDried
|
stackType: LeavesTobaccoDried
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
description: "Ground tobacco, perfect for hand-rolled cigarettes."
|
description: "Ground tobacco, perfect for hand-rolled cigarettes."
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: enum.StackType.GroundTobacco
|
stackType: GroundTobacco
|
||||||
max: 5
|
max: 5
|
||||||
count: 1
|
count: 1
|
||||||
- type: SolutionContainer
|
- type: SolutionContainer
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
parent: BaseItem
|
parent: BaseItem
|
||||||
abstract: true
|
abstract: true
|
||||||
components:
|
components:
|
||||||
- type: Stack
|
|
||||||
- type: Item
|
- type: Item
|
||||||
- type: Healing
|
- type: Healing
|
||||||
|
|
||||||
@@ -48,9 +47,9 @@
|
|||||||
heal:
|
heal:
|
||||||
Heat: 10
|
Heat: 10
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: Ointment
|
||||||
max: 5
|
max: 5
|
||||||
count: 5
|
count: 5
|
||||||
stacktype: enum.StackType.Ointment
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: bruise pack
|
name: bruise pack
|
||||||
@@ -65,9 +64,9 @@
|
|||||||
heal:
|
heal:
|
||||||
Blunt: 10
|
Blunt: 10
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: Brutepack
|
||||||
max: 5
|
max: 5
|
||||||
count: 5
|
count: 5
|
||||||
stacktype: enum.StackType.Brutepack
|
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
name: roll of gauze
|
name: roll of gauze
|
||||||
@@ -82,6 +81,6 @@
|
|||||||
# heal:
|
# heal:
|
||||||
# Blunt: 10
|
# Blunt: 10
|
||||||
- type: Stack
|
- type: Stack
|
||||||
|
stackType: Gauze
|
||||||
max: 5
|
max: 5
|
||||||
count: 5
|
count: 5
|
||||||
stacktype: enum.StackType.Gauze
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
- plating
|
- plating
|
||||||
- floor_steel
|
- floor_steel
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: FloorTileSteel
|
stackType: FloorTileSteel
|
||||||
count: 1
|
count: 1
|
||||||
max: 8
|
max: 8
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
- plating
|
- plating
|
||||||
- floor_wood
|
- floor_wood
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: FloorTileWood
|
stackType: FloorTileWood
|
||||||
count: 1
|
count: 1
|
||||||
max: 8
|
max: 8
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
- plating
|
- plating
|
||||||
- floor_white
|
- floor_white
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: FloorTileWhite
|
stackType: FloorTileWhite
|
||||||
count: 1
|
count: 1
|
||||||
max: 8
|
max: 8
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
- plating
|
- plating
|
||||||
- floor_dark
|
- floor_dark
|
||||||
- type: Stack
|
- type: Stack
|
||||||
stacktype: FloorTileDark
|
stackType: FloorTileDark
|
||||||
count: 1
|
count: 1
|
||||||
max: 8
|
max: 8
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: apc
|
- to: apc
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 3
|
amount: 3
|
||||||
|
|
||||||
- node: apc
|
- node: apc
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
- !type:SetAnchor
|
- !type:SetAnchor
|
||||||
value: false
|
value: false
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 5
|
amount: 5
|
||||||
|
|
||||||
- node: frameUnsecured
|
- node: frameUnsecured
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
completed:
|
completed:
|
||||||
- !type:SnapToGrid {}
|
- !type:SnapToGrid {}
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
- node: lever
|
- node: lever
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
completed:
|
completed:
|
||||||
- !type:SnapToGrid { }
|
- !type:SnapToGrid { }
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 3
|
amount: 3
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
- !type:SnapToGrid
|
- !type:SnapToGrid
|
||||||
southRotation: true
|
southRotation: true
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
conditions:
|
conditions:
|
||||||
- !type:EntityAnchored {}
|
- !type:EntityAnchored {}
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
|
|
||||||
- to: reinforcedGirder
|
- to: reinforcedGirder
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: bulbLight
|
- to: bulbLight
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 1
|
amount: 1
|
||||||
doAfter: 2.0
|
doAfter: 2.0
|
||||||
- to: tubeLight
|
- to: tubeLight
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
doAfter: 2.0
|
doAfter: 2.0
|
||||||
- node: tubeLight
|
- node: tubeLight
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SteelSheet1
|
prototype: SteelSheet1
|
||||||
amount: 2
|
amount: 2
|
||||||
- !type:DeleteEntity {}
|
- !type:DeleteEntity {}
|
||||||
- node: bulbLight
|
- node: bulbLight
|
||||||
entity: PoweredSmallLightEmpty
|
entity: PoweredSmallLightEmpty
|
||||||
edges:
|
edges:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: lowWall
|
- to: lowWall
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 3
|
amount: 3
|
||||||
doAfter: 5
|
doAfter: 5
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
- !type:SetAnchor
|
- !type:SetAnchor
|
||||||
value: false
|
value: false
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 2.5
|
doAfter: 2.5
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
- !type:SetStackCount
|
- !type:SetStackCount
|
||||||
amount: 2
|
amount: 2
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 1
|
amount: 1
|
||||||
|
|
||||||
- node: MetalRod
|
- node: MetalRod
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: spear
|
- to: spear
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
doAfter: 2
|
doAfter: 2
|
||||||
- material: Glass
|
- material: Glass
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
- to: MetalTable
|
- to: MetalTable
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 1
|
amount: 1
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
completed:
|
completed:
|
||||||
- !type:SnapToGrid { }
|
- !type:SnapToGrid { }
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 5
|
amount: 5
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
- node: toilet
|
- node: toilet
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
- !type:SpawnPrototype
|
- !type:SpawnPrototype
|
||||||
prototype: SteelSheet1
|
prototype: SteelSheet1
|
||||||
amount: 5
|
amount: 5
|
||||||
- !type:EmptyAllContainers {}
|
- !type:EmptyAllContainers {}
|
||||||
- !type:DeleteEntity {}
|
- !type:DeleteEntity {}
|
||||||
conditions:
|
conditions:
|
||||||
- !type:EntityAnchored
|
- !type:EntityAnchored
|
||||||
anchored: false
|
anchored: false
|
||||||
- !type:ToiletLidClosed {}
|
- !type:ToiletLidClosed {}
|
||||||
steps:
|
steps:
|
||||||
- tool: Welding
|
- tool: Welding
|
||||||
doAfter: 2
|
doAfter: 2
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
edges:
|
edges:
|
||||||
- to: plasmaWindow
|
- to: plasmaWindow
|
||||||
steps:
|
steps:
|
||||||
- material: Metal
|
- material: Steel
|
||||||
amount: 2
|
amount: 2
|
||||||
doAfter: 2
|
doAfter: 2
|
||||||
- material: Glass
|
- material: Glass
|
||||||
|
|||||||
19
Resources/Prototypes/Stacks/floor_tile_stacks.yml
Normal file
19
Resources/Prototypes/Stacks/floor_tile_stacks.yml
Normal file
@@ -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
|
||||||
61
Resources/Prototypes/Stacks/material_stacks.yml
Normal file
61
Resources/Prototypes/Stacks/material_stacks.yml
Normal file
@@ -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
|
||||||
11
Resources/Prototypes/Stacks/medical_stacks.yml
Normal file
11
Resources/Prototypes/Stacks/medical_stacks.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
- type: stack
|
||||||
|
id: Ointment
|
||||||
|
name: ointment
|
||||||
|
|
||||||
|
- type: stack
|
||||||
|
id: Gauze
|
||||||
|
name: gauze
|
||||||
|
|
||||||
|
- type: stack
|
||||||
|
id: Brutepack
|
||||||
|
name: brutepack
|
||||||
25
Resources/Prototypes/Stacks/power_stacks.yml
Normal file
25
Resources/Prototypes/Stacks/power_stacks.yml
Normal file
@@ -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
|
||||||
23
Resources/Prototypes/Stacks/tobacco_stacks.yml
Normal file
23
Resources/Prototypes/Stacks/tobacco_stacks.yml
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user