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.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)
|
||||
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// Spawns a stack of a specified type given an amount.
|
||||
/// </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>();
|
||||
|
||||
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!");
|
||||
}
|
||||
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>();
|
||||
|
||||
stackComponent.Count = Math.Min(amount, stackComponent.MaxCount);
|
||||
|
||||
@@ -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<MachinePart, int> _requirements;
|
||||
|
||||
[ViewVariables]
|
||||
private Dictionary<StackType, int> _materialRequirements;
|
||||
private Dictionary<string, int> _materialIdRequirements;
|
||||
|
||||
[ViewVariables]
|
||||
private Dictionary<string, ComponentPartInfo> _componentRequirements;
|
||||
@@ -28,7 +34,20 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public string Prototype { get; private set; }
|
||||
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 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<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>());
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
||||
@@ -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<MachinePart, int> _progress;
|
||||
|
||||
[ViewVariables]
|
||||
private Dictionary<StackType, int> _materialProgress;
|
||||
private Dictionary<string, int> _materialProgress;
|
||||
|
||||
[ViewVariables]
|
||||
private Dictionary<string, int> _componentProgress;
|
||||
@@ -75,13 +74,13 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
public IReadOnlyDictionary<MachinePart, int> Requirements { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyDictionary<StackType, int> MaterialRequirements { get; private set; }
|
||||
public IReadOnlyDictionary<string, int> MaterialRequirements { get; private set; }
|
||||
|
||||
[ViewVariables]
|
||||
public IReadOnlyDictionary<string, ComponentPartInfo> ComponentRequirements { get; private set; }
|
||||
|
||||
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 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<MachinePart, int>();
|
||||
_materialProgress = new Dictionary<StackType, int>();
|
||||
_materialProgress = new Dictionary<string, int>();
|
||||
_componentProgress = new Dictionary<string, int>();
|
||||
|
||||
foreach (var (machinePart, _) in Requirements)
|
||||
@@ -179,7 +178,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
|
||||
if (part.TryGetComponent<StackComponent>(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<StackComponent>(out var stack))
|
||||
{
|
||||
var type = (StackType) stack.StackType;
|
||||
var type = stack.StackTypeId;
|
||||
if (!MaterialRequirements.ContainsKey(type))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -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<StackComponent>(out var stack))
|
||||
return false;
|
||||
|
||||
if (!stack.StackType.Equals(StackType))
|
||||
if (!stack.StackTypeId.Equals(StackTypeId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -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<IPrototypeManager>().Index<StackPrototype>(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;
|
||||
|
||||
@@ -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<StackPrototype>(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))
|
||||
serializer.DataFieldCached(ref stackType, "stackType", string.Empty);
|
||||
|
||||
if (!string.IsNullOrEmpty(stackType))
|
||||
{
|
||||
var refl = IoCManager.Resolve<IReflectionManager>();
|
||||
if (refl.TryParseEnumReference(raw, out var @enum))
|
||||
{
|
||||
stackType = @enum;
|
||||
serializer.SetCacheData(SerializationCache, stackType);
|
||||
StackTypeId = stackType;
|
||||
}
|
||||
else
|
||||
{
|
||||
stackType = raw;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stackType = Owner.Prototype.ID;
|
||||
}
|
||||
|
||||
serializer.SetCacheData(SerializationCache, stackType);
|
||||
StackType = 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)
|
||||
@@ -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
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -54,6 +54,7 @@
|
||||
- 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
edges:
|
||||
- to: apc
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 3
|
||||
|
||||
- node: apc
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
- !type:SetAnchor
|
||||
value: false
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 5
|
||||
|
||||
- node: frameUnsecured
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
completed:
|
||||
- !type:SnapToGrid {}
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 1
|
||||
- node: lever
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
completed:
|
||||
- !type:SnapToGrid { }
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 3
|
||||
doAfter: 1
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
edges:
|
||||
- to: bulbLight
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 1
|
||||
doAfter: 2.0
|
||||
- to: tubeLight
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 2.0
|
||||
- node: tubeLight
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
edges:
|
||||
- to: lowWall
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 3
|
||||
doAfter: 5
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
- !type:SetAnchor
|
||||
value: false
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 5
|
||||
doAfter: 2.5
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
- !type:SetStackCount
|
||||
amount: 2
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 1
|
||||
|
||||
- node: MetalRod
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
edges:
|
||||
- to: spear
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 2
|
||||
- material: Glass
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
- to: MetalTable
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 1
|
||||
doAfter: 1
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
completed:
|
||||
- !type:SnapToGrid { }
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 5
|
||||
doAfter: 1
|
||||
- node: toilet
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
edges:
|
||||
- to: plasmaWindow
|
||||
steps:
|
||||
- material: Metal
|
||||
- material: Steel
|
||||
amount: 2
|
||||
doAfter: 2
|
||||
- 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