stack cleanup and mild refactoring (#11717)

* stack cleanup

* fix tests and ulong

* somehow did half a commit

* ulong got usmall. (it's ints now)

* sussy baka cleanup

* mirror's review

* make da tests pass again

* shadowcommander review

* sloth por favor

* Update StoreSystem.Ui.cs
This commit is contained in:
Nemanja
2022-11-08 21:24:23 -05:00
committed by GitHub
parent eebb31493c
commit 9428d4b341
31 changed files with 252 additions and 115 deletions

View File

@@ -467,7 +467,7 @@ public sealed partial class AdminVerbSystem
Act = () => Act = () =>
{ {
// Unbounded intentionally. // Unbounded intentionally.
_quickDialog.OpenDialog(player, "Adjust stack", $"Amount (max {stack.MaxCount})", (int newAmount) => _quickDialog.OpenDialog(player, "Adjust stack", $"Amount (max {_stackSystem.GetMaxCount(stack)})", (int newAmount) =>
{ {
_stackSystem.SetCount(args.Target, newAmount, stack); _stackSystem.SetCount(args.Target, newAmount, stack);
}); });
@@ -485,7 +485,7 @@ public sealed partial class AdminVerbSystem
IconTexture = "/Textures/Interface/AdminActions/fill-stack.png", IconTexture = "/Textures/Interface/AdminActions/fill-stack.png",
Act = () => Act = () =>
{ {
_stackSystem.SetCount(args.Target, stack.MaxCount, stack); _stackSystem.SetCount(args.Target, _stackSystem.GetMaxCount(stack), stack);
}, },
Impact = LogImpact.Medium, Impact = LogImpact.Medium,
Message = Loc.GetString("admin-trick-fill-stack-description"), Message = Loc.GetString("admin-trick-fill-stack-description"),

View File

@@ -97,7 +97,7 @@ namespace Content.Server.Cloning.Systems
private void OnDeconstruct(EntityUid uid, CloningPodComponent component, MachineDeconstructedEvent args) private void OnDeconstruct(EntityUid uid, CloningPodComponent component, MachineDeconstructedEvent args)
{ {
_serverStackSystem.SpawnMultiple(_material.GetMaterialAmount(uid, "Biomass"), 100, "Biomass", Transform(uid).Coordinates); _serverStackSystem.SpawnMultiple(component.MaterialCloningOutput, _material.GetMaterialAmount(uid, component.RequiredMaterial), Transform(uid).Coordinates);
} }
internal void TransferMindToClone(Mind.Mind mind) internal void TransferMindToClone(Mind.Mind mind)
@@ -149,7 +149,7 @@ namespace Content.Server.Cloning.Systems
if (!args.IsInDetailsRange || !_powerReceiverSystem.IsPowered(uid)) if (!args.IsInDetailsRange || !_powerReceiverSystem.IsPowered(uid))
return; return;
args.PushMarkup(Loc.GetString("cloning-pod-biomass", ("number", _material.GetMaterialAmount(uid, "Biomass")))); args.PushMarkup(Loc.GetString("cloning-pod-biomass", ("number", _material.GetMaterialAmount(uid, component.RequiredMaterial))));
} }
public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Mind.Mind mind, CloningPodComponent? clonePod) public bool TryCloning(EntityUid uid, EntityUid bodyToClone, Mind.Mind mind, CloningPodComponent? clonePod)
@@ -193,7 +193,7 @@ namespace Content.Server.Cloning.Systems
cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost); cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost);
// biomass checks // biomass checks
var biomassAmount = _material.GetMaterialAmount(uid, "Biomass"); var biomassAmount = _material.GetMaterialAmount(uid, clonePod.RequiredMaterial);
if (biomassAmount < cloningCost) if (biomassAmount < cloningCost)
{ {
@@ -202,7 +202,7 @@ namespace Content.Server.Cloning.Systems
return false; return false;
} }
_material.TryChangeMaterialAmount(uid, "Biomass", -cloningCost); _material.TryChangeMaterialAmount(uid, clonePod.RequiredMaterial, -cloningCost);
clonePod.UsedBiomass = cloningCost; clonePod.UsedBiomass = cloningCost;
// end of biomass checks // end of biomass checks
@@ -319,7 +319,7 @@ namespace Content.Server.Cloning.Systems
} }
_spillableSystem.SpillAt(uid, bloodSolution, "PuddleBlood"); _spillableSystem.SpillAt(uid, bloodSolution, "PuddleBlood");
var biomassStack = Spawn("MaterialBiomass", transform.Coordinates); var biomassStack = Spawn(clonePod.MaterialCloningOutput, transform.Coordinates);
_stackSystem.SetCount(biomassStack, _robustRandom.Next(1, (int) (clonePod.UsedBiomass / 2.5))); _stackSystem.SetCount(biomassStack, _robustRandom.Next(1, (int) (clonePod.UsedBiomass / 2.5)));
clonePod.UsedBiomass = 0; clonePod.UsedBiomass = 0;

View File

@@ -1,6 +1,8 @@
using Content.Shared.Cloning; using Content.Shared.Cloning;
using Content.Shared.Construction.Prototypes; using Content.Shared.Construction.Prototypes;
using Content.Shared.Materials;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Cloning.Components namespace Content.Server.Cloning.Components
@@ -25,6 +27,18 @@ namespace Content.Server.Cloning.Components
[ViewVariables] [ViewVariables]
public bool FailedClone = false; public bool FailedClone = false;
/// <summary>
/// The material that is used to clone entities.
/// </summary>
[DataField("requiredMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string RequiredMaterial = "Biomass";
/// <summary>
/// The entity that is spawned on machine deconstruct as well as failed cloning.
/// </summary>
[DataField("materialCloningOutput", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string MaterialCloningOutput = "MaterialBiomass";
/// <summary> /// <summary>
/// The base amount of time it takes to clone a body /// The base amount of time it takes to clone a body
/// </summary> /// </summary>

View File

@@ -85,6 +85,8 @@ public sealed class MachineFrameSystem : EntitySystem
if (TryComp<StackComponent?>(args.Used, out var stack)) if (TryComp<StackComponent?>(args.Used, out var stack))
{ {
var type = stack.StackTypeId; var type = stack.StackTypeId;
if (type == null)
return;
if (!component.MaterialRequirements.ContainsKey(type)) if (!component.MaterialRequirements.ContainsKey(type))
return; return;
@@ -262,6 +264,8 @@ public sealed class MachineFrameSystem : EntitySystem
{ {
var type = stack.StackTypeId; var type = stack.StackTypeId;
// Check this is part of the requirements... // Check this is part of the requirements...
if (type == null)
continue;
if (!component.MaterialRequirements.ContainsKey(type)) if (!component.MaterialRequirements.ContainsKey(type))
continue; continue;

View File

@@ -1,6 +1,7 @@
using Content.Shared.Storage; using Content.Shared.Storage;
using System.Threading; using System.Threading;
using Content.Shared.Construction.Prototypes; using Content.Shared.Construction.Prototypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.Medical.BiomassReclaimer namespace Content.Server.Medical.BiomassReclaimer
@@ -35,7 +36,7 @@ namespace Content.Server.Medical.BiomassReclaimer
/// This is calculated from the YieldPerUnitMass. /// This is calculated from the YieldPerUnitMass.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables]
public uint CurrentExpectedYield = default; public int CurrentExpectedYield = default;
/// <summary> /// <summary>
/// The reagent that will be spilled while processing a mob. /// The reagent that will be spilled while processing a mob.
@@ -54,6 +55,12 @@ namespace Content.Server.Medical.BiomassReclaimer
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public float YieldPerUnitMass = default; public float YieldPerUnitMass = default;
/// <summary>
/// The entity that is output by the reclaimer
/// </summary>
[DataField("outputEntityId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string OutputEntityId = "MaterialBiomass";
/// <summary> /// <summary>
/// The base yield per mass unit when no components are upgraded. /// The base yield per mass unit when no components are upgraded.
/// </summary> /// </summary>

View File

@@ -78,7 +78,7 @@ namespace Content.Server.Medical.BiomassReclaimer
continue; continue;
} }
_stackSystem.SpawnMultiple((int) reclaimer.CurrentExpectedYield, 100, "Biomass", Transform(reclaimer.Owner).Coordinates); _stackSystem.SpawnMultiple(reclaimer.OutputEntityId, reclaimer.CurrentExpectedYield, Transform(reclaimer.Owner).Coordinates);
reclaimer.BloodReagent = null; reclaimer.BloodReagent = null;
reclaimer.SpawnedEntities.Clear(); reclaimer.SpawnedEntities.Clear();
@@ -234,7 +234,7 @@ namespace Content.Server.Medical.BiomassReclaimer
component.SpawnedEntities = butcherableComponent.SpawnedEntities; component.SpawnedEntities = butcherableComponent.SpawnedEntities;
} }
component.CurrentExpectedYield = (uint) Math.Max(0, physics.FixturesMass * component.YieldPerUnitMass); component.CurrentExpectedYield = (int) Math.Max(0, physics.FixturesMass * component.YieldPerUnitMass);
component.ProcessingTimer = physics.FixturesMass * component.ProcessingTimePerUnitMass; component.ProcessingTimer = physics.FixturesMass * component.ProcessingTimePerUnitMass;
QueueDel(toProcess); QueueDel(toProcess);
} }

View File

@@ -28,7 +28,7 @@ namespace Content.Server.Stack
public override void SetCount(EntityUid uid, int amount, SharedStackComponent? component = null) public override void SetCount(EntityUid uid, int amount, SharedStackComponent? component = null)
{ {
if (!Resolve(uid, ref component)) if (!Resolve(uid, ref component, false))
return; return;
base.SetCount(uid, amount, component); base.SetCount(uid, amount, component);
@@ -46,6 +46,9 @@ namespace Content.Server.Stack
if (!Resolve(uid, ref stack)) if (!Resolve(uid, ref stack))
return null; return null;
if (stack.StackTypeId == null)
return null;
// Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked... // Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked...
var prototype = _prototypeManager.TryIndex<StackPrototype>(stack.StackTypeId, out var stackType) var prototype = _prototypeManager.TryIndex<StackPrototype>(stack.StackTypeId, out var stackType)
? stackType.Spawn ? stackType.Spawn
@@ -87,38 +90,21 @@ namespace Content.Server.Stack
/// Say you want to spawn 97 stacks of something that has a max stack count of 30. /// Say you want to spawn 97 stacks of something that has a max stack count of 30.
/// This would spawn 3 stacks of 30 and 1 stack of 7. /// This would spawn 3 stacks of 30 and 1 stack of 7.
/// </summary> /// </summary>
public void SpawnMultiple(int amount, int maxCountPerStack, StackPrototype prototype, EntityCoordinates spawnPosition) public List<EntityUid> SpawnMultiple(string entityPrototype, int amount, EntityCoordinates spawnPosition)
{ {
var proto = _prototypeManager.Index<EntityPrototype>(entityPrototype);
proto.TryGetComponent<StackComponent>(out var stack);
var maxCountPerStack = GetMaxCount(stack);
var spawnedEnts = new List<EntityUid>();
while (amount > 0) while (amount > 0)
{ {
if (amount > maxCountPerStack) var entity = Spawn(entityPrototype, spawnPosition);
{ spawnedEnts.Add(entity);
var entity = Spawn("MaterialBiomass", spawnPosition); var countAmount = Math.Min(maxCountPerStack, amount);
var stack = Comp<StackComponent>(entity); SetCount(entity, countAmount);
amount -= countAmount;
SetCount(entity, maxCountPerStack, stack);
amount -= maxCountPerStack;
} }
else return spawnedEnts;
{
var entity = Spawn("MaterialBiomass", spawnPosition);
var stack = Comp<StackComponent>(entity);
SetCount(entity, amount, stack);
amount = 0;
}
}
}
public void SpawnMultiple(int amount, int maxCountPerStack, string prototype, EntityCoordinates spawnPosition)
{
if (!_prototypeManager.TryIndex<StackPrototype>(prototype, out var stackType))
{
Logger.Error("Failed to index stack prototype " + prototype);
return;
}
SpawnMultiple(amount, maxCountPerStack, stackType, spawnPosition);
} }
private void OnStackAlternativeInteract(EntityUid uid, StackComponent stack, GetVerbsEvent<AlternativeVerb> args) private void OnStackAlternativeInteract(EntityUid uid, StackComponent stack, GetVerbsEvent<AlternativeVerb> args)

View File

@@ -10,9 +10,7 @@ using Content.Shared.Database;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using System.Linq; using System.Linq;
using Content.Server.Stack; using Content.Server.Stack;
using Content.Shared.Prototypes;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Server.Store.Systems; namespace Content.Server.Store.Systems;
@@ -133,7 +131,9 @@ public sealed partial class StoreSystem : EntitySystem
} }
//subtract the cash //subtract the cash
foreach (var currency in listing.Cost) foreach (var currency in listing.Cost)
{
component.Balance[currency.Key] -= currency.Value; component.Balance[currency.Key] -= currency.Value;
}
//spawn entity //spawn entity
if (listing.ProductEntity != null) if (listing.ProductEntity != null)
@@ -199,35 +199,9 @@ public sealed partial class StoreSystem : EntitySystem
foreach (var value in sortedCashValues) foreach (var value in sortedCashValues)
{ {
var cashId = proto.Cash[value]; var cashId = proto.Cash[value];
var amountToSpawn = (int) MathF.Floor((float) (amountRemaining / value));
if (!_proto.TryIndex<EntityPrototype>(cashId, out var cashProto)) var ents = _stack.SpawnMultiple(cashId, amountToSpawn, coordinates);
continue; _hands.PickupOrDrop(buyer, ents.First());
//how many times this subdivision fits in the amount remaining
var amountToSpawn = (int) Math.Floor((double) (amountRemaining / value));
if (cashProto.HasComponent<StackComponent>())
{
var amountToRemove = amountToSpawn; //we don't want to modify amountToSpawn, as we use it for calculations
while (amountToRemove > 0)
{
var ent = Spawn(cashId, coordinates);
if (!TryComp<StackComponent>(ent, out var stack))
return; //you really fucked up if you got here
var maxAmount = Math.Min(amountToRemove, stack.MaxCount); //limit it based on max stack amount
_stack.SetCount(ent, maxAmount, stack);
_hands.PickupOrDrop(buyer, ent);
amountToRemove -= maxAmount;
}
}
else //please for the love of christ give your currency stack component
{
for (var i = 0; i < amountToSpawn; i++)
{
var ent = Spawn(cashId, coordinates);
_hands.PickupOrDrop(buyer, ent);
}
}
amountRemaining -= value * amountToSpawn; amountRemaining -= value * amountToSpawn;
} }

View File

@@ -2,6 +2,7 @@ using Content.Shared.Whitelist;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Materials; namespace Content.Shared.Materials;
@@ -10,7 +11,7 @@ namespace Content.Shared.Materials;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed class MaterialStorageComponent : Component public sealed class MaterialStorageComponent : Component
{ {
[ViewVariables] [DataField("storage", customTypeSerializer: typeof(PrototypeIdDictionarySerializer<int, MaterialPrototype>)), ViewVariables]
public Dictionary<string, int> Storage { get; set; } = new(); public Dictionary<string, int> Storage { get; set; } = new();
/// <summary> /// <summary>

View File

@@ -166,7 +166,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
} }
var multiplier = TryComp<SharedStackComponent>(toInsert, out var stackComponent) ? stackComponent.Count : 1; var multiplier = TryComp<SharedStackComponent>(toInsert, out var stackComponent) ? stackComponent.Count : 1;
var totalVolume = 0; var totalVolume = 0;
foreach (var (mat, vol) in component.Storage) foreach (var (mat, vol) in component.Storage)
{ {

View File

@@ -8,8 +8,8 @@ namespace Content.Shared.Stacks
public abstract class SharedStackComponent : Component public abstract class SharedStackComponent : Component
{ {
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer<StackPrototype>))] [DataField("stackType", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<StackPrototype>))]
public string StackTypeId { get; private set; } = string.Empty; public string? StackTypeId { get; private set; }
/// <summary> /// <summary>
/// Current stack count. /// Current stack count.
@@ -20,10 +20,11 @@ namespace Content.Shared.Stacks
/// <summary> /// <summary>
/// Max amount of things that can be in the stack. /// Max amount of things that can be in the stack.
/// Overrides the max defined on the stack prototype.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadOnly)] [ViewVariables(VVAccess.ReadOnly)]
[DataField("max")] [DataField("maxCountOverride")]
public int MaxCount { get; set; } = 30; public int? MaxCountOverride { get; set; }
/// <summary> /// <summary>
/// Set to true to not reduce the count when used. /// Set to true to not reduce the count when used.
@@ -31,9 +32,6 @@ namespace Content.Shared.Stacks
[DataField("unlimited")] [DataField("unlimited")]
[ViewVariables(VVAccess.ReadOnly)] [ViewVariables(VVAccess.ReadOnly)]
public bool Unlimited { get; set; } public bool Unlimited { get; set; }
[ViewVariables]
public int AvailableSpace => MaxCount - Count;
} }
[Serializable, NetSerializable] [Serializable, NetSerializable]

View File

@@ -6,6 +6,7 @@ using Content.Shared.Popups;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing; using Robust.Shared.Timing;
namespace Content.Shared.Stacks namespace Content.Shared.Stacks
@@ -13,6 +14,7 @@ namespace Content.Shared.Stacks
[UsedImplicitly] [UsedImplicitly]
public abstract class SharedStackSystem : EntitySystem public abstract class SharedStackSystem : EntitySystem
{ {
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!; [Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!; [Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
[Dependency] protected readonly SharedHandsSystem HandsSystem = default!; [Dependency] protected readonly SharedHandsSystem HandsSystem = default!;
@@ -72,7 +74,7 @@ namespace Content.Shared.Stacks
case > 0: case > 0:
PopupSystem.PopupCoordinates($"+{transfered}", popupPos, Filter.Local()); PopupSystem.PopupCoordinates($"+{transfered}", popupPos, Filter.Local());
if (recipientStack.AvailableSpace == 0) if (GetAvailableSpace(recipientStack) == 0)
{ {
PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-becomes-full"), PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-becomes-full"),
popupPos.Offset(new Vector2(0, -0.5f)), Filter.Local()); popupPos.Offset(new Vector2(0, -0.5f)), Filter.Local());
@@ -80,7 +82,7 @@ namespace Content.Shared.Stacks
break; break;
case 0 when recipientStack.AvailableSpace == 0: case 0 when GetAvailableSpace(recipientStack) == 0:
PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-already-full"), popupPos, Filter.Local()); PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-already-full"), popupPos, Filter.Local());
break; break;
} }
@@ -97,10 +99,10 @@ namespace Content.Shared.Stacks
if (!Resolve(recipient, ref recipientStack, false) || !Resolve(donor, ref donorStack, false)) if (!Resolve(recipient, ref recipientStack, false) || !Resolve(donor, ref donorStack, false))
return false; return false;
if (!recipientStack.StackTypeId.Equals(donorStack.StackTypeId)) if (recipientStack.StackTypeId == null || !recipientStack.StackTypeId.Equals(donorStack.StackTypeId))
return false; return false;
transfered = Math.Min(donorStack.Count, recipientStack.AvailableSpace); transfered = Math.Min(donorStack.Count, GetAvailableSpace(recipientStack));
SetCount(donor, donorStack.Count - transfered, donorStack); SetCount(donor, donorStack.Count - transfered, donorStack);
SetCount(recipient, recipientStack.Count + transfered, recipientStack); SetCount(recipient, recipientStack.Count + transfered, recipientStack);
return true; return true;
@@ -154,21 +156,14 @@ namespace Content.Shared.Stacks
var old = component.Count; var old = component.Count;
// Clamp the value. // Clamp the value.
if (amount > component.MaxCount) amount = Math.Min(amount, GetMaxCount(component));
{ amount = Math.Max(amount, 0);
amount = component.MaxCount;
}
if (amount < 0)
{
amount = 0;
}
component.Count = amount; component.Count = amount;
Dirty(component); Dirty(component);
Appearance.SetData(uid, StackVisuals.Actual, component.Count); Appearance.SetData(uid, StackVisuals.Actual, component.Count);
RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count), false); RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count));
} }
/// <summary> /// <summary>
@@ -195,19 +190,83 @@ namespace Content.Shared.Stacks
return true; return true;
} }
/// <summary>
/// Gets the max count for a given entity prototype
/// </summary>
/// <param name="entityId"></param>
/// <returns></returns>
[PublicAPI]
public int GetMaxCount(string entityId)
{
var entProto = _prototype.Index<EntityPrototype>(entityId);
entProto.TryGetComponent<SharedStackComponent>(out var stackComp);
return GetMaxCount(stackComp);
}
/// <summary>
/// Gets the max count for a given entity
/// </summary>
/// <param name="uid"></param>
/// <returns></returns>
[PublicAPI]
public int GetMaxCount(EntityUid uid)
{
return GetMaxCount(CompOrNull<SharedStackComponent>(uid));
}
/// <summary>
/// Gets the maximum amount that can be fit on a stack.
/// </summary>
/// <remarks>
/// <p>
/// if there's no stackcomp, this equals 1. Otherwise, if there's a max
/// count override, it equals that. It then checks for a max count value
/// on the prototype. If there isn't one, it defaults to the max integer
/// value (unlimimted).
/// </p>
/// </remarks>
/// <param name="component"></param>
/// <returns></returns>
public int GetMaxCount(SharedStackComponent? component)
{
if (component == null)
return 1;
if (component.MaxCountOverride != null)
return component.MaxCountOverride.Value;
if (component.StackTypeId == null)
return 1;
var stackProto = _prototype.Index<StackPrototype>(component.StackTypeId);
return stackProto.MaxCount ?? int.MaxValue;
}
/// <summary>
/// Gets the remaining space in a stack.
/// </summary>
/// <param name="component"></param>
/// <returns></returns>
[PublicAPI]
public int GetAvailableSpace(SharedStackComponent component)
{
return GetMaxCount(component) - component.Count;
}
private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args) private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args)
{ {
if (!TryComp(uid, out AppearanceComponent? appearance)) if (!TryComp(uid, out AppearanceComponent? appearance))
return; return;
Appearance.SetData(uid, StackVisuals.Actual, component.Count, appearance); Appearance.SetData(uid, StackVisuals.Actual, component.Count, appearance);
Appearance.SetData(uid, StackVisuals.MaxCount, component.MaxCount, appearance); Appearance.SetData(uid, StackVisuals.MaxCount, GetMaxCount(component), appearance);
Appearance.SetData(uid, StackVisuals.Hide, false, appearance); Appearance.SetData(uid, StackVisuals.Hide, false, appearance);
} }
private void OnStackGetState(EntityUid uid, SharedStackComponent component, ref ComponentGetState args) private void OnStackGetState(EntityUid uid, SharedStackComponent component, ref ComponentGetState args)
{ {
args.State = new StackComponentState(component.Count, component.MaxCount); args.State = new StackComponentState(component.Count, GetMaxCount(component));
} }
private void OnStackHandleState(EntityUid uid, SharedStackComponent component, ref ComponentHandleState args) private void OnStackHandleState(EntityUid uid, SharedStackComponent component, ref ComponentHandleState args)
@@ -215,7 +274,7 @@ namespace Content.Shared.Stacks
if (args.Current is not StackComponentState cast) if (args.Current is not StackComponentState cast)
return; return;
component.MaxCount = cast.MaxCount; component.MaxCountOverride = cast.MaxCount;
// This will change the count and call events. // This will change the count and call events.
SetCount(uid, cast.Count, component); SetCount(uid, cast.Count, component);
} }
@@ -242,12 +301,12 @@ namespace Content.Shared.Stacks
/// <summary> /// <summary>
/// The old stack count. /// The old stack count.
/// </summary> /// </summary>
public int OldCount { get; } public int OldCount;
/// <summary> /// <summary>
/// The new stack count. /// The new stack count.
/// </summary> /// </summary>
public int NewCount { get; } public int NewCount;
public StackCountChangedEvent(int oldCount, int newCount) public StackCountChangedEvent(int oldCount, int newCount)
{ {

View File

@@ -22,12 +22,20 @@ namespace Content.Shared.Stacks
/// An icon that will be used to represent this stack type. /// An icon that will be used to represent this stack type.
/// </summary> /// </summary>
[DataField("icon")] [DataField("icon")]
public SpriteSpecifier? Icon { get; } = null; public SpriteSpecifier? Icon { get; }
/// <summary> /// <summary>
/// The entity id that will be spawned by default from this stack. /// The entity id that will be spawned by default from this stack.
/// </summary> /// </summary>
[DataField("spawn", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))] [DataField("spawn", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string Spawn { get; } = string.Empty; public string Spawn { get; } = string.Empty;
/// <summary>
/// The maximum amount of things that can be in a stack.
/// Can be overriden on <see cref="SharedStackComponent"/>
/// if null, simply has unlimited max count.
/// </summary>
[DataField("maxCount")]
public int? MaxCount { get; }
} }
} }

View File

@@ -131,7 +131,6 @@
- type: Stack - type: Stack
stackType: Biomass stackType: Biomass
count: 100 count: 100
max: 100
- type: Sprite - type: Sprite
sprite: /Textures/Objects/Misc/monkeycube.rsi sprite: /Textures/Objects/Misc/monkeycube.rsi
state: cube state: cube

View File

@@ -11,7 +11,6 @@
price: 0 price: 0
- type: Stack - type: Stack
stackType: Credit stackType: Credit
max: 1000000 # if you somehow get this rich consider buying a second station
count: 1 count: 1
- type: Sprite - type: Sprite
sprite: Objects/Economy/cash.rsi sprite: Objects/Economy/cash.rsi

View File

@@ -26,7 +26,6 @@
components: components:
- type: Stack - type: Stack
stackType: LeavesCannabisDried stackType: LeavesCannabisDried
max: 5
count: 1 count: 1
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:
@@ -46,7 +45,6 @@
components: components:
- type: Stack - type: Stack
stackType: GroundCannabis stackType: GroundCannabis
max: 5
count: 1 count: 1
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:
@@ -84,7 +82,6 @@
components: components:
- type: Stack - type: Stack
stackType: LeavesTobaccoDried stackType: LeavesTobaccoDried
max: 5
count: 1 count: 1
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:
@@ -104,7 +101,6 @@
components: components:
- type: Stack - type: Stack
stackType: GroundTobacco stackType: GroundTobacco
max: 5
count: 1 count: 1
- type: SolutionContainerManager - type: SolutionContainerManager
solutions: solutions:

View File

@@ -36,7 +36,6 @@
path: "/Audio/Items/Medical/ointment_end.ogg" path: "/Audio/Items/Medical/ointment_end.ogg"
- type: Stack - type: Stack
stackType: Ointment stackType: Ointment
max: 10
count: 10 count: 10
- type: StackPrice - type: StackPrice
price: 10 price: 10
@@ -64,7 +63,6 @@
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
- type: Stack - type: Stack
stackType: Brutepack stackType: Brutepack
max: 10
count: 10 count: 10
- type: StackPrice - type: StackPrice
price: 10 price: 10
@@ -96,7 +94,6 @@
path: "/Audio/Items/Medical/brutepack_end.ogg" path: "/Audio/Items/Medical/brutepack_end.ogg"
- type: Stack - type: Stack
stackType: Gauze stackType: Gauze
max: 10
count: 10 count: 10
- type: StackPrice - type: StackPrice
price: 10 price: 10
@@ -120,7 +117,6 @@
state: cream state: cream
- type: Stack - type: Stack
stackType: AloeCream stackType: AloeCream
max: 10
count: 10 count: 10
# Pills # Pills

View File

@@ -13,7 +13,6 @@
sprite: Objects/Specific/Syndicate/telecrystal.rsi sprite: Objects/Specific/Syndicate/telecrystal.rsi
- type: Stack - type: Stack
count: 20 count: 20
max: 999999 # todo: add support for unlimited stacks
stackType: Telecrystal stackType: Telecrystal
- type: StackPrice - type: StackPrice
price: 200 price: 200

View File

@@ -8,7 +8,6 @@
- type: Stack - type: Stack
stackType: InflatableWall stackType: InflatableWall
count: 10 count: 10
max: 10
- type: Sprite - type: Sprite
sprite: Objects/Misc/inflatable_wall.rsi sprite: Objects/Misc/inflatable_wall.rsi
state: item_wall state: item_wall
@@ -42,7 +41,6 @@
- type: Stack - type: Stack
stackType: InflatableDoor stackType: InflatableDoor
count: 4 count: 4
max: 4
- type: Sprite - type: Sprite
sprite: Objects/Misc/inflatable_door.rsi sprite: Objects/Misc/inflatable_door.rsi
state: item_door state: item_door

View File

@@ -3,22 +3,26 @@
name: glass name: glass
icon: /Textures/Objects/Materials/Sheets/glass.rsi/glass.png icon: /Textures/Objects/Materials/Sheets/glass.rsi/glass.png
spawn: SheetGlass1 spawn: SheetGlass1
maxCount: 30
- type: stack - type: stack
id: ReinforcedGlass id: ReinforcedGlass
name: reinforced glass name: reinforced glass
icon: /Textures/Objects/Materials/Sheets/glass.rsi/rglass.png icon: /Textures/Objects/Materials/Sheets/glass.rsi/rglass.png
spawn: SheetRGlass1 spawn: SheetRGlass1
maxCount: 30
- type: stack - type: stack
id: PlasmaGlass id: PlasmaGlass
name: plasma glass name: plasma glass
icon: /Textures/Objects/Materials/Sheets/glass.rsi/pglass.png icon: /Textures/Objects/Materials/Sheets/glass.rsi/pglass.png
spawn: SheetPGlass1 spawn: SheetPGlass1
maxCount: 30
- type: stack - type: stack
id: ReinforcedPlasmaGlass id: ReinforcedPlasmaGlass
name: reinforced plasma glass name: reinforced plasma glass
icon: /Textures/Objects/Materials/Sheets/glass.rsi/rpglass.png icon: /Textures/Objects/Materials/Sheets/glass.rsi/rpglass.png
spawn: SheetRPGlass1 spawn: SheetRPGlass1
maxCount: 30

View File

@@ -3,9 +3,11 @@
name: steel name: steel
icon: /Textures/Objects/Materials/Sheets/metal.rsi/steel.png icon: /Textures/Objects/Materials/Sheets/metal.rsi/steel.png
spawn: SheetSteel1 spawn: SheetSteel1
maxCount: 30
- type: stack - type: stack
id: Plasteel id: Plasteel
name: plasteel name: plasteel
icon: /Textures/Objects/Materials/Sheets/metal.rsi/plasteel.png icon: /Textures/Objects/Materials/Sheets/metal.rsi/plasteel.png
spawn: SheetPlasteel1 spawn: SheetPlasteel1
maxCount: 30

View File

@@ -3,21 +3,25 @@
name: paper name: paper
icon: /Textures/Objects/Materials/Sheets/other.rsi/paper.png icon: /Textures/Objects/Materials/Sheets/other.rsi/paper.png
spawn: SheetPaper1 spawn: SheetPaper1
maxCount: 30
- type: stack - type: stack
id: Plasma id: Plasma
name: plasma name: plasma
icon: /Textures/Objects/Materials/Sheets/other.rsi/plasma.png icon: /Textures/Objects/Materials/Sheets/other.rsi/plasma.png
spawn: SheetPlasma1 spawn: SheetPlasma1
maxCount: 30
- type: stack - type: stack
id: Plastic id: Plastic
name: plastic name: plastic
icon: /Textures/Objects/Materials/Sheets/other.rsi/plastic.png icon: /Textures/Objects/Materials/Sheets/other.rsi/plastic.png
spawn: SheetPlastic1 spawn: SheetPlastic1
maxCount: 30
- type: stack - type: stack
id: Uranium id: Uranium
name: uranium name: uranium
icon: /Textures/Objects/Materials/Sheets/other.rsi/uranium.png icon: /Textures/Objects/Materials/Sheets/other.rsi/uranium.png
spawn: SheetUranium1 spawn: SheetUranium1
maxCount: 30

View File

@@ -3,9 +3,11 @@
name: gold name: gold
icon: "/Textures/Objects/Materials/ingots.rsi/gold.png" icon: "/Textures/Objects/Materials/ingots.rsi/gold.png"
spawn: IngotGold1 spawn: IngotGold1
maxCount: 30
- type: stack - type: stack
id: Silver id: Silver
name: silver name: silver
icon: "/Textures/Objects/Materials/ingots.rsi/silver.png" icon: "/Textures/Objects/Materials/ingots.rsi/silver.png"
spawn: IngotSilver1 spawn: IngotSilver1
maxCount: 30

View File

@@ -3,33 +3,39 @@
name: biomass name: biomass
icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png
spawn: MaterialBiomass1 spawn: MaterialBiomass1
maxCount: 100
- type: stack - type: stack
id: WoodPlank id: WoodPlank
name: wood plank name: wood plank
icon: /Textures/Objects/Materials/materials.rsi/wood.png icon: /Textures/Objects/Materials/materials.rsi/wood.png
spawn: MaterialWoodPlank1 spawn: MaterialWoodPlank1
maxCount: 30
- type: stack - type: stack
id: Cloth id: Cloth
name: cloth name: cloth
icon: /Textures/Objects/Materials/materials.rsi/cloth.png icon: /Textures/Objects/Materials/materials.rsi/cloth.png
spawn: MaterialCloth1 spawn: MaterialCloth1
maxCount: 30
- type: stack - type: stack
id: Durathread id: Durathread
name: durathread name: durathread
icon: /Textures/Objects/Materials/materials.rsi/durathread.png icon: /Textures/Objects/Materials/materials.rsi/durathread.png
spawn: MaterialDurathread1 spawn: MaterialDurathread1
maxCount: 30
- type: stack - type: stack
id: Diamond id: Diamond
name: diamond name: diamond
icon: /Textures/Objects/Materials/materials.rsi/diamond.png icon: /Textures/Objects/Materials/materials.rsi/diamond.png
spawn: MaterialDiamond1 spawn: MaterialDiamond1
maxCount: 30
- type: stack - type: stack
id: Cotton id: Cotton
name: cotton name: cotton
icon: /Textures/Objects/Materials/materials.rsi/cotton.png icon: /Textures/Objects/Materials/materials.rsi/cotton.png
spawn: MaterialCotton1 spawn: MaterialCotton1
maxCount: 30

View File

@@ -3,33 +3,39 @@
name: gold ore name: gold ore
icon: /Textures/Objects/Materials/ore.rsi/gold.png icon: /Textures/Objects/Materials/ore.rsi/gold.png
spawn: GoldOre1 spawn: GoldOre1
maxCount: 30
- type: stack - type: stack
id: SteelOre id: SteelOre
name: steel ore name: steel ore
icon: /Textures/Objects/Materials/ore.rsi/iron.png icon: /Textures/Objects/Materials/ore.rsi/iron.png
spawn: SteelOre1 spawn: SteelOre1
maxCount: 30
- type: stack - type: stack
id: PlasmaOre id: PlasmaOre
name: plasma ore name: plasma ore
icon: /Textures/Objects/Materials/ore.rsi/plasma.png icon: /Textures/Objects/Materials/ore.rsi/plasma.png
spawn: PlasmaOre1 spawn: PlasmaOre1
maxCount: 30
- type: stack - type: stack
id: SilverOre id: SilverOre
name: silver ore name: silver ore
icon: /Textures/Objects/Materials/ore.rsi/silver.png icon: /Textures/Objects/Materials/ore.rsi/silver.png
spawn: SilverOre1 spawn: SilverOre1
maxCount: 30
- type: stack - type: stack
id: SpaceQuartz id: SpaceQuartz
name: space quartz name: space quartz
icon: /Textures/Objects/Materials/ore.rsi/spacequartz.png icon: /Textures/Objects/Materials/ore.rsi/spacequartz.png
spawn: SpaceQuartz1 spawn: SpaceQuartz1
maxCount: 30
- type: stack - type: stack
id: UraniumOre id: UraniumOre
name: uranium ore name: uranium ore
icon: /Textures/Objects/Materials/ore.rsi/uranium.png icon: /Textures/Objects/Materials/ore.rsi/uranium.png
spawn: UraniumOre1 spawn: UraniumOre1
maxCount: 30

View File

@@ -3,3 +3,4 @@
name: rods name: rods
icon: /Textures/Objects/Materials/parts.rsi/rods.png icon: /Textures/Objects/Materials/parts.rsi/rods.png
spawn: PartRodMetal1 spawn: PartRodMetal1
maxCount: 30

View File

@@ -4,6 +4,7 @@
id: Pancake id: Pancake
name: pancake name: pancake
spawn: FoodBakedPancake spawn: FoodBakedPancake
maxCount: 30
# Food Containers # Food Containers
@@ -12,6 +13,7 @@
name: pizza box name: pizza box
icon: Objects/Consumable/Food/Baked/pizza.rsi/box.png icon: Objects/Consumable/Food/Baked/pizza.rsi/box.png
spawn: FoodBoxPizza spawn: FoodBoxPizza
maxCount: 30
# Smokeables # Smokeables
@@ -20,33 +22,39 @@
name: rolling paper name: rolling paper
icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigpaper.png icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigpaper.png
spawn: PaperRolling spawn: PaperRolling
maxCount: 30
- type: stack - type: stack
id: CigaretteFilter id: CigaretteFilter
name: cigarette filter name: cigarette filter
icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigfilter.png icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigfilter.png
spawn: CigaretteFilter spawn: CigaretteFilter
maxCount: 30
- type: stack - type: stack
id: GroundTobacco id: GroundTobacco
name: ground tobacco name: ground tobacco
icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png
spawn: GroundTobacco spawn: GroundTobacco
maxCount: 5
- type: stack - type: stack
id: GroundCannabis id: GroundCannabis
name: ground cannabis name: ground cannabis
icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png
spawn: GroundCannabis spawn: GroundCannabis
maxCount: 5
- type: stack - type: stack
id: LeavesTobaccoDried id: LeavesTobaccoDried
name: dried tobacco leaves name: dried tobacco leaves
icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png
spawn: LeavesTobaccoDried spawn: LeavesTobaccoDried
maxCount: 5
- type: stack - type: stack
id: LeavesCannabisDried id: LeavesCannabisDried
name: dried cannabis leaves name: dried cannabis leaves
icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png
spawn: LeavesCannabisDried spawn: LeavesCannabisDried
maxCount: 5

View File

@@ -2,8 +2,10 @@
id: InflatableWall id: InflatableWall
name: inflatable wall name: inflatable wall
spawn: InflatableWallStack1 spawn: InflatableWallStack1
maxCount: 10
- type: stack - type: stack
id: InflatableDoor id: InflatableDoor
name: inflatable door name: inflatable door
spawn: InflatableDoorStack1 spawn: InflatableDoorStack1
maxCount: 4

View File

@@ -2,258 +2,316 @@
id: FloorTileSteel id: FloorTileSteel
name: steel tile name: steel tile
spawn: FloorTileItemSteel spawn: FloorTileItemSteel
maxCount: 30
- type: stack - type: stack
id: FloorTileMetalDiamond id: FloorTileMetalDiamond
name: steel tile name: steel tile
spawn: FloorTileItemMetalDiamond spawn: FloorTileItemMetalDiamond
maxCount: 30
- type: stack - type: stack
id: FloorTileWood id: FloorTileWood
name: wood floor name: wood floor
spawn: FloorTileItemWood spawn: FloorTileItemWood
maxCount: 30
- type: stack - type: stack
id: FloorTileWhite id: FloorTileWhite
name: white tile name: white tile
spawn: FloorTileItemWhite spawn: FloorTileItemWhite
maxCount: 30
- type: stack - type: stack
id: FloorTileDark id: FloorTileDark
name: dark tile name: dark tile
spawn: FloorTileItemDark spawn: FloorTileItemDark
maxCount: 30
- type: stack - type: stack
id: FloorTileTechmaint id: FloorTileTechmaint
name: techmaint floor name: techmaint floor
spawn: FloorTileItemTechmaint spawn: FloorTileItemTechmaint
maxCount: 30
- type: stack - type: stack
id: FloorTileFreezer id: FloorTileFreezer
name: freezer tile name: freezer tile
spawn: FloorTileItemFreezer spawn: FloorTileItemFreezer
maxCount: 30
- type: stack - type: stack
id: FloorTileShowroom id: FloorTileShowroom
name: showroom tile name: showroom tile
spawn: FloorTileItemShowroom spawn: FloorTileItemShowroom
maxCount: 30
- type: stack - type: stack
id: FloorTileGCircuit id: FloorTileGCircuit
name: green-circuit floor name: green-circuit floor
spawn: FloorTileItemGCircuit spawn: FloorTileItemGCircuit
maxCount: 30
- type: stack - type: stack
id: FloorTileGold id: FloorTileGold
name: gold floor name: gold floor
spawn: FloorTileItemGold spawn: FloorTileItemGold
maxCount: 30
- type: stack - type: stack
id: FloorTileReinforced id: FloorTileReinforced
name: reinforced tile name: reinforced tile
spawn: FloorTileItemReinforced spawn: FloorTileItemReinforced
maxCount: 30
- type: stack - type: stack
id: FloorTileMono id: FloorTileMono
name: mono tile name: mono tile
spawn: FloorTileItemMono spawn: FloorTileItemMono
maxCount: 30
- type: stack - type: stack
id: FloorTileLino id: FloorTileLino
name: linoleum floor name: linoleum floor
spawn: FloorTileItemLino spawn: FloorTileItemLino
maxCount: 30
- type: stack - type: stack
id: FloorTileHydro id: FloorTileHydro
name: hydro tile name: hydro tile
spawn: FloorTileItemHydro spawn: FloorTileItemHydro
maxCount: 30
- type: stack - type: stack
id: FloorTileDirty id: FloorTileDirty
name: dirty tile name: dirty tile
spawn: FloorTileItemDirty spawn: FloorTileItemDirty
maxCount: 30
- type: stack - type: stack
id: FloorTileStackShuttleWhite id: FloorTileStackShuttleWhite
name: white shuttle tile name: white shuttle tile
spawn: FloorTileItemShuttleWhite spawn: FloorTileItemShuttleWhite
maxCount: 30
- type: stack - type: stack
id: FloorTileStackShuttleBlue id: FloorTileStackShuttleBlue
name: blue shuttle tile name: blue shuttle tile
spawn: FloorTileItemShuttleBlue spawn: FloorTileItemShuttleBlue
maxCount: 30
- type: stack - type: stack
id: FloorTileStackShuttleOrange id: FloorTileStackShuttleOrange
name: orange shuttle tile name: orange shuttle tile
spawn: FloorTileItemShuttleOrange spawn: FloorTileItemShuttleOrange
maxCount: 30
- type: stack - type: stack
id: FloorTileStackShuttlePurple id: FloorTileStackShuttlePurple
name: purple shuttle tile name: purple shuttle tile
spawn: FloorTileItemShuttlePurple spawn: FloorTileItemShuttlePurple
maxCount: 30
- type: stack - type: stack
id: FloorTileStackShuttleRed id: FloorTileStackShuttleRed
name: red shuttle tile name: red shuttle tile
spawn: FloorTileItemShuttleRed spawn: FloorTileItemShuttleRed
maxCount: 30
- type: stack - type: stack
id: FloorTileStackEighties id: FloorTileStackEighties
name: eighties floor tile name: eighties floor tile
spawn: FloorTileItemEighties spawn: FloorTileItemEighties
maxCount: 30
- type: stack - type: stack
id: FloorTileStackArcadeBlue id: FloorTileStackArcadeBlue
name: blue arcade tile name: blue arcade tile
spawn: FloorTileItemArcadeBlue spawn: FloorTileItemArcadeBlue
maxCount: 30
- type: stack - type: stack
id: FloorTileStackArcadeBlue2 id: FloorTileStackArcadeBlue2
name: blue arcade tile name: blue arcade tile
spawn: FloorTileItemArcadeBlue2 spawn: FloorTileItemArcadeBlue2
maxCount: 30
- type: stack - type: stack
id: FloorTileStackArcadeRed id: FloorTileStackArcadeRed
name: red arcade tile name: red arcade tile
spawn: FloorTileItemArcadeRed spawn: FloorTileItemArcadeRed
maxCount: 30
- type: stack - type: stack
id: FloorCarpetRed id: FloorCarpetRed
name: red carpet tile name: red carpet tile
spawn: FloorCarpetItemRed spawn: FloorCarpetItemRed
maxCount: 30
- type: stack - type: stack
id: FloorCarpetBlack id: FloorCarpetBlack
name: block carpet tile name: block carpet tile
spawn: FloorCarpetItemBlack spawn: FloorCarpetItemBlack
maxCount: 30
- type: stack - type: stack
id: FloorCarpetBlue id: FloorCarpetBlue
name: blue carpet tile name: blue carpet tile
spawn: FloorCarpetItemBlue spawn: FloorCarpetItemBlue
maxCount: 30
- type: stack - type: stack
id: FloorCarpetGreen id: FloorCarpetGreen
name: green carpet tile name: green carpet tile
spawn: FloorCarpetItemGreen spawn: FloorCarpetItemGreen
maxCount: 30
- type: stack - type: stack
id: FloorCarpetOrange id: FloorCarpetOrange
name: orange carpet tile name: orange carpet tile
spawn: FloorCarpetItemOrange spawn: FloorCarpetItemOrange
maxCount: 30
- type: stack - type: stack
id: FloorCarpetSkyBlue id: FloorCarpetSkyBlue
name: skyblue carpet tile name: skyblue carpet tile
spawn: FloorCarpetItemSkyBlue spawn: FloorCarpetItemSkyBlue
maxCount: 30
- type: stack - type: stack
id: FloorCarpetPurple id: FloorCarpetPurple
name: purple carpet tile name: purple carpet tile
spawn: FloorCarpetItemPurple spawn: FloorCarpetItemPurple
maxCount: 30
- type: stack - type: stack
id: FloorCarpetPink id: FloorCarpetPink
name: pink carpet tile name: pink carpet tile
spawn: FloorCarpetItemPink spawn: FloorCarpetItemPink
maxCount: 30
- type: stack - type: stack
id: FloorTileStackCarpetClown id: FloorTileStackCarpetClown
name: clown carpet tile name: clown carpet tile
spawn: FloorTileItemCarpetClown spawn: FloorTileItemCarpetClown
maxCount: 30
- type: stack - type: stack
id: FloorTileStackCarpetOffice id: FloorTileStackCarpetOffice
name: office carpet tile name: office carpet tile
spawn: FloorTileItemCarpetOffice spawn: FloorTileItemCarpetOffice
maxCount: 30
- type: stack - type: stack
id: FloorTileStackBoxing id: FloorTileStackBoxing
name: boxing ring tile name: boxing ring tile
spawn: FloorTileItemBoxing spawn: FloorTileItemBoxing
maxCount: 30
- type: stack - type: stack
id: FloorTileStackGym id: FloorTileStackGym
name: gym floor tile name: gym floor tile
spawn: FloorTileItemGym spawn: FloorTileItemGym
maxCount: 30
- type: stack - type: stack
id: FloorTileElevatorShaft id: FloorTileElevatorShaft
name: elevator shaft tile name: elevator shaft tile
spawn: FloorTileItemElevatorShaft spawn: FloorTileItemElevatorShaft
maxCount: 30
- type: stack - type: stack
id: FloorTileRockVault id: FloorTileRockVault
name: rock vault tile name: rock vault tile
spawn: FloorTileItemRockVault spawn: FloorTileItemRockVault
maxCount: 30
- type: stack - type: stack
id: FloorTileBlue id: FloorTileBlue
name: blue floor tile name: blue floor tile
spawn: FloorTileItemBlue spawn: FloorTileItemBlue
maxCount: 30
- type: stack - type: stack
id: FloorTileBar id: FloorTileBar
name: item bar floor tile name: item bar floor tile
spawn: FloorTileItemBar spawn: FloorTileItemBar
maxCount: 30
- type: stack - type: stack
id: FloorTileClown id: FloorTileClown
name: clown floor tile name: clown floor tile
spawn: FloorTileItemClown spawn: FloorTileItemClown
maxCount: 30
- type: stack - type: stack
id: FloorTileMime id: FloorTileMime
name: mime floor tile name: mime floor tile
spawn: FloorTileItemMime spawn: FloorTileItemMime
maxCount: 30
- type: stack - type: stack
id: FloorTileKitchen id: FloorTileKitchen
name: kitchen floor tile name: kitchen floor tile
spawn: FloorTileItemKitchen spawn: FloorTileItemKitchen
maxCount: 30
- type: stack - type: stack
id: FloorTileLaundry id: FloorTileLaundry
name: laundry floor tile name: laundry floor tile
spawn: FloorTileItemLaundry spawn: FloorTileItemLaundry
maxCount: 30
- type: stack - type: stack
id: FloorTileSilver id: FloorTileSilver
name: silver floor tile name: silver floor tile
spawn: FloorTileItemSilver spawn: FloorTileItemSilver
maxCount: 30
- type: stack
id: FloorTileGCircuit
name: gcircuit floor tile
spawn: FloorTileItemGCircuit
maxCount: 30
- type: stack - type: stack
id: FloorTileBCircuit id: FloorTileBCircuit
name: bcircuit floor tile name: bcircuit floor tile
spawn: FloorTileItemBCircuit spawn: FloorTileItemBCircuit
maxCount: 30
- type: stack - type: stack
id: FloorTileGrass id: FloorTileGrass
name: grass floor tile name: grass floor tile
spawn: FloorTileItemGrass spawn: FloorTileItemGrass
maxCount: 30
- type: stack - type: stack
id: FloorTileGrassJungle id: FloorTileGrassJungle
name: grass jungle floor tile name: grass jungle floor tile
spawn: FloorTileItemGrassJungle spawn: FloorTileItemGrassJungle
maxCount: 30
- type: stack - type: stack
id: FloorTileSnow id: FloorTileSnow
name: snow floor tile name: snow floor tile
spawn: FloorTileItemSnow spawn: FloorTileItemSnow
maxCount: 30
- type: stack - type: stack
id: FloorTileWoodPattern id: FloorTileWoodPattern
name: wood pattern floor name: wood pattern floor
spawn: FloorTileItemWoodPattern spawn: FloorTileItemWoodPattern
maxCount: 30
- type: stack - type: stack
id: FloorTileSteelMaint id: FloorTileSteelMaint
name: steel maint floor name: steel maint floor
spawn: FloorTileItemSteelMaint spawn: FloorTileItemSteelMaint
maxCount: 30
- type: stack - type: stack
id: FloorTileGratingMaint id: FloorTileGratingMaint
name: grating maint floor name: grating maint floor
spawn: FloorTileItemGratingMaint spawn: FloorTileItemGratingMaint
maxCount: 30

View File

@@ -3,21 +3,25 @@
name: ointment name: ointment
icon: "/Textures/Objects/Specific/Medical/medical.rsi/ointment.png" icon: "/Textures/Objects/Specific/Medical/medical.rsi/ointment.png"
spawn: Ointment spawn: Ointment
maxCount: 10
- type: stack - type: stack
id: AloeCream id: AloeCream
name: aloe cream name: aloe cream
icon: "/Textures/Objects/Specific/Hydroponics/aloe.rsi/cream.png" icon: "/Textures/Objects/Specific/Hydroponics/aloe.rsi/cream.png"
spawn: AloeCream spawn: AloeCream
maxCount: 10
- type: stack - type: stack
id: Gauze id: Gauze
name: gauze name: gauze
icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png" icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png"
spawn: Gauze spawn: Gauze
maxCount: 10
- type: stack - type: stack
id: Brutepack id: Brutepack
name: brutepack name: brutepack
icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png" icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png"
spawn: Brutepack spawn: Brutepack
maxCount: 10

View File

@@ -3,15 +3,18 @@
name: lv cable name: lv cable
icon: "/Textures/Objects/Tools/cable-coils.rsi/coil-30.png" icon: "/Textures/Objects/Tools/cable-coils.rsi/coil-30.png"
spawn: CableApcStack1 spawn: CableApcStack1
maxCount: 30
- type: stack - type: stack
id: CableMV id: CableMV
name: mv cable name: mv cable
icon: "/Textures/Objects/Tools/cable-coils.rsi/coilmv-30.png" icon: "/Textures/Objects/Tools/cable-coils.rsi/coilmv-30.png"
spawn: CableMVStack1 spawn: CableMVStack1
maxCount: 30
- type: stack - type: stack
id: CableHV id: CableHV
name: hv cable name: hv cable
icon: "/Textures/Objects/Tools/cable-coils.rsi/coilhv-30.png" icon: "/Textures/Objects/Tools/cable-coils.rsi/coilhv-30.png"
spawn: CableHVStack1 spawn: CableHVStack1
maxCount: 30