diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index 4bc2f1701b..f720b77f4f 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -467,7 +467,7 @@ public sealed partial class AdminVerbSystem Act = () => { // 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); }); @@ -485,7 +485,7 @@ public sealed partial class AdminVerbSystem IconTexture = "/Textures/Interface/AdminActions/fill-stack.png", Act = () => { - _stackSystem.SetCount(args.Target, stack.MaxCount, stack); + _stackSystem.SetCount(args.Target, _stackSystem.GetMaxCount(stack), stack); }, Impact = LogImpact.Medium, Message = Loc.GetString("admin-trick-fill-stack-description"), diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index 211d5811f6..6f78746255 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -97,7 +97,7 @@ namespace Content.Server.Cloning.Systems 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) @@ -149,7 +149,7 @@ namespace Content.Server.Cloning.Systems if (!args.IsInDetailsRange || !_powerReceiverSystem.IsPowered(uid)) 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) @@ -193,7 +193,7 @@ namespace Content.Server.Cloning.Systems cloningCost = (int) Math.Round(cloningCost * EasyModeCloningCost); // biomass checks - var biomassAmount = _material.GetMaterialAmount(uid, "Biomass"); + var biomassAmount = _material.GetMaterialAmount(uid, clonePod.RequiredMaterial); if (biomassAmount < cloningCost) { @@ -202,7 +202,7 @@ namespace Content.Server.Cloning.Systems return false; } - _material.TryChangeMaterialAmount(uid, "Biomass", -cloningCost); + _material.TryChangeMaterialAmount(uid, clonePod.RequiredMaterial, -cloningCost); clonePod.UsedBiomass = cloningCost; // end of biomass checks @@ -319,7 +319,7 @@ namespace Content.Server.Cloning.Systems } _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))); clonePod.UsedBiomass = 0; diff --git a/Content.Server/Cloning/Components/CloningPodComponent.cs b/Content.Server/Cloning/Components/CloningPodComponent.cs index 7e7ccbcfb1..1f564509e6 100644 --- a/Content.Server/Cloning/Components/CloningPodComponent.cs +++ b/Content.Server/Cloning/Components/CloningPodComponent.cs @@ -1,6 +1,8 @@ using Content.Shared.Cloning; using Content.Shared.Construction.Prototypes; +using Content.Shared.Materials; using Robust.Shared.Containers; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.Cloning.Components @@ -25,6 +27,18 @@ namespace Content.Server.Cloning.Components [ViewVariables] public bool FailedClone = false; + /// + /// The material that is used to clone entities. + /// + [DataField("requiredMaterial", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] + public string RequiredMaterial = "Biomass"; + + /// + /// The entity that is spawned on machine deconstruct as well as failed cloning. + /// + [DataField("materialCloningOutput", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] + public string MaterialCloningOutput = "MaterialBiomass"; + /// /// The base amount of time it takes to clone a body /// diff --git a/Content.Server/Construction/MachineFrameSystem.cs b/Content.Server/Construction/MachineFrameSystem.cs index ef904ce784..651ecfb311 100644 --- a/Content.Server/Construction/MachineFrameSystem.cs +++ b/Content.Server/Construction/MachineFrameSystem.cs @@ -85,6 +85,8 @@ public sealed class MachineFrameSystem : EntitySystem if (TryComp(args.Used, out var stack)) { var type = stack.StackTypeId; + if (type == null) + return; if (!component.MaterialRequirements.ContainsKey(type)) return; @@ -262,6 +264,8 @@ public sealed class MachineFrameSystem : EntitySystem { var type = stack.StackTypeId; // Check this is part of the requirements... + if (type == null) + continue; if (!component.MaterialRequirements.ContainsKey(type)) continue; diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs index 5a2fc7d8da..8d2b20f5b5 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerComponent.cs @@ -1,6 +1,7 @@ using Content.Shared.Storage; using System.Threading; using Content.Shared.Construction.Prototypes; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.Medical.BiomassReclaimer @@ -35,7 +36,7 @@ namespace Content.Server.Medical.BiomassReclaimer /// This is calculated from the YieldPerUnitMass. /// [ViewVariables] - public uint CurrentExpectedYield = default; + public int CurrentExpectedYield = default; /// /// The reagent that will be spilled while processing a mob. @@ -54,6 +55,12 @@ namespace Content.Server.Medical.BiomassReclaimer [ViewVariables(VVAccess.ReadWrite)] public float YieldPerUnitMass = default; + /// + /// The entity that is output by the reclaimer + /// + [DataField("outputEntityId", customTypeSerializer: typeof(PrototypeIdSerializer)), ViewVariables(VVAccess.ReadWrite)] + public string OutputEntityId = "MaterialBiomass"; + /// /// The base yield per mass unit when no components are upgraded. /// diff --git a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs index 0f0c9d2e51..ae8288d962 100644 --- a/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs +++ b/Content.Server/Medical/BiomassReclaimer/BiomassReclaimerSystem.cs @@ -78,7 +78,7 @@ namespace Content.Server.Medical.BiomassReclaimer 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.SpawnedEntities.Clear(); @@ -234,7 +234,7 @@ namespace Content.Server.Medical.BiomassReclaimer 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; QueueDel(toProcess); } diff --git a/Content.Server/Stack/StackSystem.cs b/Content.Server/Stack/StackSystem.cs index f77ea99f67..e13ea803b9 100644 --- a/Content.Server/Stack/StackSystem.cs +++ b/Content.Server/Stack/StackSystem.cs @@ -28,7 +28,7 @@ namespace Content.Server.Stack public override void SetCount(EntityUid uid, int amount, SharedStackComponent? component = null) { - if (!Resolve(uid, ref component)) + if (!Resolve(uid, ref component, false)) return; base.SetCount(uid, amount, component); @@ -46,6 +46,9 @@ namespace Content.Server.Stack if (!Resolve(uid, ref stack)) 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... var prototype = _prototypeManager.TryIndex(stack.StackTypeId, out var stackType) ? 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. /// This would spawn 3 stacks of 30 and 1 stack of 7. /// - public void SpawnMultiple(int amount, int maxCountPerStack, StackPrototype prototype, EntityCoordinates spawnPosition) + public List SpawnMultiple(string entityPrototype, int amount, EntityCoordinates spawnPosition) { + var proto = _prototypeManager.Index(entityPrototype); + proto.TryGetComponent(out var stack); + var maxCountPerStack = GetMaxCount(stack); + var spawnedEnts = new List(); while (amount > 0) { - if (amount > maxCountPerStack) - { - var entity = Spawn("MaterialBiomass", spawnPosition); - var stack = Comp(entity); - - SetCount(entity, maxCountPerStack, stack); - amount -= maxCountPerStack; - } - else - { - var entity = Spawn("MaterialBiomass", spawnPosition); - var stack = Comp(entity); - - SetCount(entity, amount, stack); - amount = 0; - } + var entity = Spawn(entityPrototype, spawnPosition); + spawnedEnts.Add(entity); + var countAmount = Math.Min(maxCountPerStack, amount); + SetCount(entity, countAmount); + amount -= countAmount; } - } - - public void SpawnMultiple(int amount, int maxCountPerStack, string prototype, EntityCoordinates spawnPosition) - { - if (!_prototypeManager.TryIndex(prototype, out var stackType)) - { - Logger.Error("Failed to index stack prototype " + prototype); - return; - } - - SpawnMultiple(amount, maxCountPerStack, stackType, spawnPosition); + return spawnedEnts; } private void OnStackAlternativeInteract(EntityUid uid, StackComponent stack, GetVerbsEvent args) diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index 7d03fc19b7..4b5fc7981b 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -10,9 +10,7 @@ using Content.Shared.Database; using Robust.Server.GameObjects; using System.Linq; using Content.Server.Stack; -using Content.Shared.Prototypes; using Robust.Shared.Player; -using Robust.Shared.Prototypes; namespace Content.Server.Store.Systems; @@ -133,7 +131,9 @@ public sealed partial class StoreSystem : EntitySystem } //subtract the cash foreach (var currency in listing.Cost) + { component.Balance[currency.Key] -= currency.Value; + } //spawn entity if (listing.ProductEntity != null) @@ -191,7 +191,7 @@ public sealed partial class StoreSystem : EntitySystem if (msg.Session.AttachedEntity is not { Valid: true} buyer) return; - + FixedPoint2 amountRemaining = msg.Amount; var coordinates = Transform(buyer).Coordinates; @@ -199,35 +199,9 @@ public sealed partial class StoreSystem : EntitySystem foreach (var value in sortedCashValues) { var cashId = proto.Cash[value]; - - if (!_proto.TryIndex(cashId, out var cashProto)) - continue; - - //how many times this subdivision fits in the amount remaining - var amountToSpawn = (int) Math.Floor((double) (amountRemaining / value)); - if (cashProto.HasComponent()) - { - 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(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); - } - } + var amountToSpawn = (int) MathF.Floor((float) (amountRemaining / value)); + var ents = _stack.SpawnMultiple(cashId, amountToSpawn, coordinates); + _hands.PickupOrDrop(buyer, ents.First()); amountRemaining -= value * amountToSpawn; } diff --git a/Content.Shared/Materials/MaterialStorageComponent.cs b/Content.Shared/Materials/MaterialStorageComponent.cs index 0f955aaf57..35e9307faf 100644 --- a/Content.Shared/Materials/MaterialStorageComponent.cs +++ b/Content.Shared/Materials/MaterialStorageComponent.cs @@ -2,6 +2,7 @@ using Content.Shared.Whitelist; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; namespace Content.Shared.Materials; @@ -10,7 +11,7 @@ namespace Content.Shared.Materials; [RegisterComponent, NetworkedComponent] public sealed class MaterialStorageComponent : Component { - [ViewVariables] + [DataField("storage", customTypeSerializer: typeof(PrototypeIdDictionarySerializer)), ViewVariables] public Dictionary Storage { get; set; } = new(); /// diff --git a/Content.Shared/Materials/SharedMaterialStorageSystem.cs b/Content.Shared/Materials/SharedMaterialStorageSystem.cs index 3a02410d6f..166af76275 100644 --- a/Content.Shared/Materials/SharedMaterialStorageSystem.cs +++ b/Content.Shared/Materials/SharedMaterialStorageSystem.cs @@ -166,7 +166,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem } var multiplier = TryComp(toInsert, out var stackComponent) ? stackComponent.Count : 1; - var totalVolume = 0; foreach (var (mat, vol) in component.Storage) { diff --git a/Content.Shared/Stacks/SharedStackComponent.cs b/Content.Shared/Stacks/SharedStackComponent.cs index 44b12572cf..0a243027fe 100644 --- a/Content.Shared/Stacks/SharedStackComponent.cs +++ b/Content.Shared/Stacks/SharedStackComponent.cs @@ -8,8 +8,8 @@ namespace Content.Shared.Stacks public abstract class SharedStackComponent : Component { [ViewVariables(VVAccess.ReadWrite)] - [DataField("stackType", required:true, customTypeSerializer:typeof(PrototypeIdSerializer))] - public string StackTypeId { get; private set; } = string.Empty; + [DataField("stackType", required: true, customTypeSerializer: typeof(PrototypeIdSerializer))] + public string? StackTypeId { get; private set; } /// /// Current stack count. @@ -20,10 +20,11 @@ namespace Content.Shared.Stacks /// /// Max amount of things that can be in the stack. + /// Overrides the max defined on the stack prototype. /// [ViewVariables(VVAccess.ReadOnly)] - [DataField("max")] - public int MaxCount { get; set; } = 30; + [DataField("maxCountOverride")] + public int? MaxCountOverride { get; set; } /// /// Set to true to not reduce the count when used. @@ -31,9 +32,6 @@ namespace Content.Shared.Stacks [DataField("unlimited")] [ViewVariables(VVAccess.ReadOnly)] public bool Unlimited { get; set; } - - [ViewVariables] - public int AvailableSpace => MaxCount - Count; } [Serializable, NetSerializable] diff --git a/Content.Shared/Stacks/SharedStackSystem.cs b/Content.Shared/Stacks/SharedStackSystem.cs index 8465b8706c..46e9155956 100644 --- a/Content.Shared/Stacks/SharedStackSystem.cs +++ b/Content.Shared/Stacks/SharedStackSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.Popups; using JetBrains.Annotations; using Robust.Shared.GameStates; using Robust.Shared.Player; +using Robust.Shared.Prototypes; using Robust.Shared.Timing; namespace Content.Shared.Stacks @@ -13,6 +14,7 @@ namespace Content.Shared.Stacks [UsedImplicitly] public abstract class SharedStackSystem : EntitySystem { + [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] protected readonly SharedAppearanceSystem Appearance = default!; [Dependency] protected readonly SharedPopupSystem PopupSystem = default!; [Dependency] protected readonly SharedHandsSystem HandsSystem = default!; @@ -72,7 +74,7 @@ namespace Content.Shared.Stacks case > 0: PopupSystem.PopupCoordinates($"+{transfered}", popupPos, Filter.Local()); - if (recipientStack.AvailableSpace == 0) + if (GetAvailableSpace(recipientStack) == 0) { PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-becomes-full"), popupPos.Offset(new Vector2(0, -0.5f)), Filter.Local()); @@ -80,7 +82,7 @@ namespace Content.Shared.Stacks break; - case 0 when recipientStack.AvailableSpace == 0: + case 0 when GetAvailableSpace(recipientStack) == 0: PopupSystem.PopupCoordinates(Loc.GetString("comp-stack-already-full"), popupPos, Filter.Local()); break; } @@ -97,10 +99,10 @@ namespace Content.Shared.Stacks if (!Resolve(recipient, ref recipientStack, false) || !Resolve(donor, ref donorStack, false)) return false; - if (!recipientStack.StackTypeId.Equals(donorStack.StackTypeId)) + if (recipientStack.StackTypeId == null || !recipientStack.StackTypeId.Equals(donorStack.StackTypeId)) return false; - transfered = Math.Min(donorStack.Count, recipientStack.AvailableSpace); + transfered = Math.Min(donorStack.Count, GetAvailableSpace(recipientStack)); SetCount(donor, donorStack.Count - transfered, donorStack); SetCount(recipient, recipientStack.Count + transfered, recipientStack); return true; @@ -154,21 +156,14 @@ namespace Content.Shared.Stacks var old = component.Count; // Clamp the value. - if (amount > component.MaxCount) - { - amount = component.MaxCount; - } - - if (amount < 0) - { - amount = 0; - } + amount = Math.Min(amount, GetMaxCount(component)); + amount = Math.Max(amount, 0); component.Count = amount; Dirty(component); Appearance.SetData(uid, StackVisuals.Actual, component.Count); - RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count), false); + RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count)); } /// @@ -195,19 +190,83 @@ namespace Content.Shared.Stacks return true; } + /// + /// Gets the max count for a given entity prototype + /// + /// + /// + [PublicAPI] + public int GetMaxCount(string entityId) + { + var entProto = _prototype.Index(entityId); + entProto.TryGetComponent(out var stackComp); + return GetMaxCount(stackComp); + } + + /// + /// Gets the max count for a given entity + /// + /// + /// + [PublicAPI] + public int GetMaxCount(EntityUid uid) + { + return GetMaxCount(CompOrNull(uid)); + } + + /// + /// Gets the maximum amount that can be fit on a stack. + /// + /// + ///

+ /// 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). + ///

+ ///
+ /// + /// + 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(component.StackTypeId); + + return stackProto.MaxCount ?? int.MaxValue; + } + + /// + /// Gets the remaining space in a stack. + /// + /// + /// + [PublicAPI] + public int GetAvailableSpace(SharedStackComponent component) + { + return GetMaxCount(component) - component.Count; + } + private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args) { if (!TryComp(uid, out AppearanceComponent? appearance)) return; 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); } 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) @@ -215,7 +274,7 @@ namespace Content.Shared.Stacks if (args.Current is not StackComponentState cast) return; - component.MaxCount = cast.MaxCount; + component.MaxCountOverride = cast.MaxCount; // This will change the count and call events. SetCount(uid, cast.Count, component); } @@ -242,12 +301,12 @@ namespace Content.Shared.Stacks /// /// The old stack count. /// - public int OldCount { get; } + public int OldCount; /// /// The new stack count. /// - public int NewCount { get; } + public int NewCount; public StackCountChangedEvent(int oldCount, int newCount) { diff --git a/Content.Shared/Stacks/StackPrototype.cs b/Content.Shared/Stacks/StackPrototype.cs index 4d4423af11..6e7c00ea0e 100644 --- a/Content.Shared/Stacks/StackPrototype.cs +++ b/Content.Shared/Stacks/StackPrototype.cs @@ -22,12 +22,20 @@ namespace Content.Shared.Stacks /// An icon that will be used to represent this stack type. ///
[DataField("icon")] - public SpriteSpecifier? Icon { get; } = null; + public SpriteSpecifier? Icon { get; } /// /// The entity id that will be spawned by default from this stack. /// [DataField("spawn", required: true, customTypeSerializer:typeof(PrototypeIdSerializer))] public string Spawn { get; } = string.Empty; + + /// + /// The maximum amount of things that can be in a stack. + /// Can be overriden on + /// if null, simply has unlimited max count. + /// + [DataField("maxCount")] + public int? MaxCount { get; } } } diff --git a/Resources/Prototypes/Entities/Objects/Materials/materials.yml b/Resources/Prototypes/Entities/Objects/Materials/materials.yml index a01f8336d9..32805c14d6 100644 --- a/Resources/Prototypes/Entities/Objects/Materials/materials.yml +++ b/Resources/Prototypes/Entities/Objects/Materials/materials.yml @@ -131,7 +131,6 @@ - type: Stack stackType: Biomass count: 100 - max: 100 - type: Sprite sprite: /Textures/Objects/Misc/monkeycube.rsi state: cube diff --git a/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml b/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml index 0d8afb6578..9273cfc09d 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/space_cash.yml @@ -11,7 +11,6 @@ price: 0 - type: Stack stackType: Credit - max: 1000000 # if you somehow get this rich consider buying a second station count: 1 - type: Sprite sprite: Objects/Economy/cash.rsi diff --git a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/leaves.yml b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/leaves.yml index bf2a4127c3..04286dc3a4 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/leaves.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/leaves.yml @@ -26,7 +26,6 @@ components: - type: Stack stackType: LeavesCannabisDried - max: 5 count: 1 - type: SolutionContainerManager solutions: @@ -46,7 +45,6 @@ components: - type: Stack stackType: GroundCannabis - max: 5 count: 1 - type: SolutionContainerManager solutions: @@ -84,7 +82,6 @@ components: - type: Stack stackType: LeavesTobaccoDried - max: 5 count: 1 - type: SolutionContainerManager solutions: @@ -104,7 +101,6 @@ components: - type: Stack stackType: GroundTobacco - max: 5 count: 1 - type: SolutionContainerManager solutions: diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml index 8111288894..fe7f548bd6 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml @@ -36,7 +36,6 @@ path: "/Audio/Items/Medical/ointment_end.ogg" - type: Stack stackType: Ointment - max: 10 count: 10 - type: StackPrice price: 10 @@ -64,7 +63,6 @@ path: "/Audio/Items/Medical/brutepack_end.ogg" - type: Stack stackType: Brutepack - max: 10 count: 10 - type: StackPrice price: 10 @@ -96,7 +94,6 @@ path: "/Audio/Items/Medical/brutepack_end.ogg" - type: Stack stackType: Gauze - max: 10 count: 10 - type: StackPrice price: 10 @@ -120,7 +117,6 @@ state: cream - type: Stack stackType: AloeCream - max: 10 count: 10 # Pills diff --git a/Resources/Prototypes/Entities/Objects/Specific/syndicate.yml b/Resources/Prototypes/Entities/Objects/Specific/syndicate.yml index 762a2e051f..97efd2f8cb 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/syndicate.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/syndicate.yml @@ -13,7 +13,6 @@ sprite: Objects/Specific/Syndicate/telecrystal.rsi - type: Stack count: 20 - max: 999999 # todo: add support for unlimited stacks stackType: Telecrystal - type: StackPrice price: 200 diff --git a/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml b/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml index b7c5c51c36..beb0747665 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/inflatable_wall.yml @@ -8,7 +8,6 @@ - type: Stack stackType: InflatableWall count: 10 - max: 10 - type: Sprite sprite: Objects/Misc/inflatable_wall.rsi state: item_wall @@ -42,7 +41,6 @@ - type: Stack stackType: InflatableDoor count: 4 - max: 4 - type: Sprite sprite: Objects/Misc/inflatable_door.rsi state: item_door diff --git a/Resources/Prototypes/Stacks/Materials/Sheets/glass.yml b/Resources/Prototypes/Stacks/Materials/Sheets/glass.yml index bfdb7f6d21..5d79f2f88a 100644 --- a/Resources/Prototypes/Stacks/Materials/Sheets/glass.yml +++ b/Resources/Prototypes/Stacks/Materials/Sheets/glass.yml @@ -3,22 +3,26 @@ name: glass icon: /Textures/Objects/Materials/Sheets/glass.rsi/glass.png spawn: SheetGlass1 + maxCount: 30 - type: stack id: ReinforcedGlass name: reinforced glass icon: /Textures/Objects/Materials/Sheets/glass.rsi/rglass.png spawn: SheetRGlass1 + maxCount: 30 - type: stack id: PlasmaGlass name: plasma glass icon: /Textures/Objects/Materials/Sheets/glass.rsi/pglass.png spawn: SheetPGlass1 + maxCount: 30 - type: stack id: ReinforcedPlasmaGlass name: reinforced plasma glass icon: /Textures/Objects/Materials/Sheets/glass.rsi/rpglass.png spawn: SheetRPGlass1 + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/Materials/Sheets/metal.yml b/Resources/Prototypes/Stacks/Materials/Sheets/metal.yml index 8387892770..3ea31affc5 100644 --- a/Resources/Prototypes/Stacks/Materials/Sheets/metal.yml +++ b/Resources/Prototypes/Stacks/Materials/Sheets/metal.yml @@ -3,9 +3,11 @@ name: steel icon: /Textures/Objects/Materials/Sheets/metal.rsi/steel.png spawn: SheetSteel1 + maxCount: 30 - type: stack id: Plasteel name: plasteel icon: /Textures/Objects/Materials/Sheets/metal.rsi/plasteel.png spawn: SheetPlasteel1 + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/Materials/Sheets/other.yml b/Resources/Prototypes/Stacks/Materials/Sheets/other.yml index cea9d6c804..9210d884da 100644 --- a/Resources/Prototypes/Stacks/Materials/Sheets/other.yml +++ b/Resources/Prototypes/Stacks/Materials/Sheets/other.yml @@ -3,21 +3,25 @@ name: paper icon: /Textures/Objects/Materials/Sheets/other.rsi/paper.png spawn: SheetPaper1 + maxCount: 30 - type: stack id: Plasma name: plasma icon: /Textures/Objects/Materials/Sheets/other.rsi/plasma.png spawn: SheetPlasma1 + maxCount: 30 - type: stack id: Plastic name: plastic icon: /Textures/Objects/Materials/Sheets/other.rsi/plastic.png spawn: SheetPlastic1 + maxCount: 30 - type: stack id: Uranium name: uranium icon: /Textures/Objects/Materials/Sheets/other.rsi/uranium.png - spawn: SheetUranium1 \ No newline at end of file + spawn: SheetUranium1 + maxCount: 30 \ No newline at end of file diff --git a/Resources/Prototypes/Stacks/Materials/ingots.yml b/Resources/Prototypes/Stacks/Materials/ingots.yml index 3a26afa8cf..cff9c70f47 100644 --- a/Resources/Prototypes/Stacks/Materials/ingots.yml +++ b/Resources/Prototypes/Stacks/Materials/ingots.yml @@ -3,9 +3,11 @@ name: gold icon: "/Textures/Objects/Materials/ingots.rsi/gold.png" spawn: IngotGold1 + maxCount: 30 - type: stack id: Silver name: silver icon: "/Textures/Objects/Materials/ingots.rsi/silver.png" spawn: IngotSilver1 + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/Materials/materials.yml b/Resources/Prototypes/Stacks/Materials/materials.yml index b36f76fd85..78daf420b8 100644 --- a/Resources/Prototypes/Stacks/Materials/materials.yml +++ b/Resources/Prototypes/Stacks/Materials/materials.yml @@ -3,33 +3,39 @@ name: biomass icon: /Textures/Objects/Misc/monkeycube.rsi/cube.png spawn: MaterialBiomass1 + maxCount: 100 - type: stack id: WoodPlank name: wood plank icon: /Textures/Objects/Materials/materials.rsi/wood.png spawn: MaterialWoodPlank1 + maxCount: 30 - type: stack id: Cloth name: cloth icon: /Textures/Objects/Materials/materials.rsi/cloth.png spawn: MaterialCloth1 + maxCount: 30 - type: stack id: Durathread name: durathread icon: /Textures/Objects/Materials/materials.rsi/durathread.png spawn: MaterialDurathread1 + maxCount: 30 - type: stack id: Diamond name: diamond icon: /Textures/Objects/Materials/materials.rsi/diamond.png spawn: MaterialDiamond1 + maxCount: 30 - type: stack id: Cotton name: cotton icon: /Textures/Objects/Materials/materials.rsi/cotton.png spawn: MaterialCotton1 + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/Materials/ore.yml b/Resources/Prototypes/Stacks/Materials/ore.yml index 5634b1fcaf..37f8d60263 100644 --- a/Resources/Prototypes/Stacks/Materials/ore.yml +++ b/Resources/Prototypes/Stacks/Materials/ore.yml @@ -3,33 +3,39 @@ name: gold ore icon: /Textures/Objects/Materials/ore.rsi/gold.png spawn: GoldOre1 + maxCount: 30 - type: stack id: SteelOre name: steel ore icon: /Textures/Objects/Materials/ore.rsi/iron.png spawn: SteelOre1 + maxCount: 30 - type: stack id: PlasmaOre name: plasma ore icon: /Textures/Objects/Materials/ore.rsi/plasma.png spawn: PlasmaOre1 + maxCount: 30 - type: stack id: SilverOre name: silver ore icon: /Textures/Objects/Materials/ore.rsi/silver.png spawn: SilverOre1 + maxCount: 30 - type: stack id: SpaceQuartz name: space quartz icon: /Textures/Objects/Materials/ore.rsi/spacequartz.png spawn: SpaceQuartz1 + maxCount: 30 - type: stack id: UraniumOre name: uranium ore icon: /Textures/Objects/Materials/ore.rsi/uranium.png - spawn: UraniumOre1 \ No newline at end of file + spawn: UraniumOre1 + maxCount: 30 \ No newline at end of file diff --git a/Resources/Prototypes/Stacks/Materials/parts.yml b/Resources/Prototypes/Stacks/Materials/parts.yml index f8aa08aa2c..6f82a13276 100644 --- a/Resources/Prototypes/Stacks/Materials/parts.yml +++ b/Resources/Prototypes/Stacks/Materials/parts.yml @@ -3,3 +3,4 @@ name: rods icon: /Textures/Objects/Materials/parts.rsi/rods.png spawn: PartRodMetal1 + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/consumable_stacks.yml b/Resources/Prototypes/Stacks/consumable_stacks.yml index ddacbfa5e9..eaeab3b6ef 100644 --- a/Resources/Prototypes/Stacks/consumable_stacks.yml +++ b/Resources/Prototypes/Stacks/consumable_stacks.yml @@ -4,6 +4,7 @@ id: Pancake name: pancake spawn: FoodBakedPancake + maxCount: 30 # Food Containers @@ -12,6 +13,7 @@ name: pizza box icon: Objects/Consumable/Food/Baked/pizza.rsi/box.png spawn: FoodBoxPizza + maxCount: 30 # Smokeables @@ -20,33 +22,39 @@ name: rolling paper icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigpaper.png spawn: PaperRolling + maxCount: 30 - type: stack id: CigaretteFilter name: cigarette filter icon: /Textures/Objects/Consumable/Smokeables/Cigarettes/paper.rsi/cigfilter.png spawn: CigaretteFilter + maxCount: 30 - type: stack id: GroundTobacco name: ground tobacco icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png spawn: GroundTobacco + maxCount: 5 - type: stack id: GroundCannabis name: ground cannabis icon: /Textures/Objects/Misc/reagent_fillings.rsi/powderpile.png spawn: GroundCannabis + maxCount: 5 - type: stack id: LeavesTobaccoDried name: dried tobacco leaves icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png spawn: LeavesTobaccoDried + maxCount: 5 - type: stack id: LeavesCannabisDried name: dried cannabis leaves icon: /Textures/Objects/Specific/Hydroponics/tobacco.rsi/dried.png spawn: LeavesCannabisDried + maxCount: 5 diff --git a/Resources/Prototypes/Stacks/engineering_stacks.yml b/Resources/Prototypes/Stacks/engineering_stacks.yml index 849d6bd04d..9972b3d741 100644 --- a/Resources/Prototypes/Stacks/engineering_stacks.yml +++ b/Resources/Prototypes/Stacks/engineering_stacks.yml @@ -2,8 +2,10 @@ id: InflatableWall name: inflatable wall spawn: InflatableWallStack1 + maxCount: 10 - type: stack id: InflatableDoor name: inflatable door spawn: InflatableDoorStack1 + maxCount: 4 diff --git a/Resources/Prototypes/Stacks/floor_tile_stacks.yml b/Resources/Prototypes/Stacks/floor_tile_stacks.yml index 28ac3b9c40..d90d04f9cf 100644 --- a/Resources/Prototypes/Stacks/floor_tile_stacks.yml +++ b/Resources/Prototypes/Stacks/floor_tile_stacks.yml @@ -2,258 +2,316 @@ id: FloorTileSteel name: steel tile spawn: FloorTileItemSteel + maxCount: 30 - type: stack id: FloorTileMetalDiamond name: steel tile spawn: FloorTileItemMetalDiamond + maxCount: 30 - type: stack id: FloorTileWood name: wood floor spawn: FloorTileItemWood + maxCount: 30 - type: stack id: FloorTileWhite name: white tile spawn: FloorTileItemWhite + maxCount: 30 - type: stack id: FloorTileDark name: dark tile spawn: FloorTileItemDark + maxCount: 30 - type: stack id: FloorTileTechmaint name: techmaint floor spawn: FloorTileItemTechmaint + maxCount: 30 - type: stack id: FloorTileFreezer name: freezer tile spawn: FloorTileItemFreezer + maxCount: 30 - type: stack id: FloorTileShowroom name: showroom tile spawn: FloorTileItemShowroom + maxCount: 30 - type: stack id: FloorTileGCircuit name: green-circuit floor spawn: FloorTileItemGCircuit + maxCount: 30 - type: stack id: FloorTileGold name: gold floor spawn: FloorTileItemGold + maxCount: 30 - type: stack id: FloorTileReinforced name: reinforced tile spawn: FloorTileItemReinforced + maxCount: 30 - type: stack id: FloorTileMono name: mono tile spawn: FloorTileItemMono + maxCount: 30 - type: stack id: FloorTileLino name: linoleum floor spawn: FloorTileItemLino + maxCount: 30 - type: stack id: FloorTileHydro name: hydro tile spawn: FloorTileItemHydro + maxCount: 30 - type: stack id: FloorTileDirty name: dirty tile spawn: FloorTileItemDirty + maxCount: 30 - type: stack id: FloorTileStackShuttleWhite name: white shuttle tile spawn: FloorTileItemShuttleWhite + maxCount: 30 - type: stack id: FloorTileStackShuttleBlue name: blue shuttle tile spawn: FloorTileItemShuttleBlue + maxCount: 30 - type: stack id: FloorTileStackShuttleOrange name: orange shuttle tile spawn: FloorTileItemShuttleOrange + maxCount: 30 - type: stack id: FloorTileStackShuttlePurple name: purple shuttle tile spawn: FloorTileItemShuttlePurple + maxCount: 30 - type: stack id: FloorTileStackShuttleRed name: red shuttle tile spawn: FloorTileItemShuttleRed + maxCount: 30 - type: stack id: FloorTileStackEighties name: eighties floor tile spawn: FloorTileItemEighties + maxCount: 30 - type: stack id: FloorTileStackArcadeBlue name: blue arcade tile spawn: FloorTileItemArcadeBlue + maxCount: 30 - type: stack id: FloorTileStackArcadeBlue2 name: blue arcade tile spawn: FloorTileItemArcadeBlue2 + maxCount: 30 - type: stack id: FloorTileStackArcadeRed name: red arcade tile spawn: FloorTileItemArcadeRed + maxCount: 30 - type: stack id: FloorCarpetRed name: red carpet tile spawn: FloorCarpetItemRed + maxCount: 30 - type: stack id: FloorCarpetBlack name: block carpet tile spawn: FloorCarpetItemBlack + maxCount: 30 - type: stack id: FloorCarpetBlue name: blue carpet tile spawn: FloorCarpetItemBlue + maxCount: 30 - type: stack id: FloorCarpetGreen name: green carpet tile spawn: FloorCarpetItemGreen + maxCount: 30 - type: stack id: FloorCarpetOrange name: orange carpet tile spawn: FloorCarpetItemOrange + maxCount: 30 - type: stack id: FloorCarpetSkyBlue name: skyblue carpet tile spawn: FloorCarpetItemSkyBlue + maxCount: 30 - type: stack id: FloorCarpetPurple name: purple carpet tile spawn: FloorCarpetItemPurple + maxCount: 30 - type: stack id: FloorCarpetPink name: pink carpet tile spawn: FloorCarpetItemPink + maxCount: 30 - type: stack id: FloorTileStackCarpetClown name: clown carpet tile spawn: FloorTileItemCarpetClown + maxCount: 30 - type: stack id: FloorTileStackCarpetOffice name: office carpet tile spawn: FloorTileItemCarpetOffice + maxCount: 30 - type: stack id: FloorTileStackBoxing name: boxing ring tile spawn: FloorTileItemBoxing + maxCount: 30 - type: stack id: FloorTileStackGym name: gym floor tile spawn: FloorTileItemGym + maxCount: 30 - type: stack id: FloorTileElevatorShaft name: elevator shaft tile spawn: FloorTileItemElevatorShaft + maxCount: 30 - type: stack id: FloorTileRockVault name: rock vault tile spawn: FloorTileItemRockVault + maxCount: 30 - type: stack id: FloorTileBlue name: blue floor tile spawn: FloorTileItemBlue + maxCount: 30 - type: stack id: FloorTileBar name: item bar floor tile spawn: FloorTileItemBar + maxCount: 30 - type: stack id: FloorTileClown name: clown floor tile spawn: FloorTileItemClown + maxCount: 30 - type: stack id: FloorTileMime name: mime floor tile spawn: FloorTileItemMime + maxCount: 30 - type: stack id: FloorTileKitchen name: kitchen floor tile spawn: FloorTileItemKitchen + maxCount: 30 - type: stack id: FloorTileLaundry name: laundry floor tile spawn: FloorTileItemLaundry + maxCount: 30 - type: stack id: FloorTileSilver name: silver floor tile spawn: FloorTileItemSilver + maxCount: 30 + +- type: stack + id: FloorTileGCircuit + name: gcircuit floor tile + spawn: FloorTileItemGCircuit + maxCount: 30 - type: stack id: FloorTileBCircuit name: bcircuit floor tile spawn: FloorTileItemBCircuit + maxCount: 30 - type: stack id: FloorTileGrass name: grass floor tile spawn: FloorTileItemGrass + maxCount: 30 - type: stack id: FloorTileGrassJungle name: grass jungle floor tile spawn: FloorTileItemGrassJungle + maxCount: 30 - type: stack id: FloorTileSnow name: snow floor tile spawn: FloorTileItemSnow + maxCount: 30 - type: stack id: FloorTileWoodPattern name: wood pattern floor spawn: FloorTileItemWoodPattern + maxCount: 30 - type: stack id: FloorTileSteelMaint name: steel maint floor spawn: FloorTileItemSteelMaint + maxCount: 30 - type: stack id: FloorTileGratingMaint name: grating maint floor spawn: FloorTileItemGratingMaint + maxCount: 30 diff --git a/Resources/Prototypes/Stacks/medical_stacks.yml b/Resources/Prototypes/Stacks/medical_stacks.yml index 6683fadade..f5096b3480 100644 --- a/Resources/Prototypes/Stacks/medical_stacks.yml +++ b/Resources/Prototypes/Stacks/medical_stacks.yml @@ -3,21 +3,25 @@ name: ointment icon: "/Textures/Objects/Specific/Medical/medical.rsi/ointment.png" spawn: Ointment + maxCount: 10 - type: stack id: AloeCream name: aloe cream icon: "/Textures/Objects/Specific/Hydroponics/aloe.rsi/cream.png" spawn: AloeCream + maxCount: 10 - type: stack id: Gauze name: gauze icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png" spawn: Gauze + maxCount: 10 - type: stack id: Brutepack name: brutepack icon: "/Textures/Objects/Specific/Medical/medical.rsi/gauze.png" spawn: Brutepack + maxCount: 10 diff --git a/Resources/Prototypes/Stacks/power_stacks.yml b/Resources/Prototypes/Stacks/power_stacks.yml index a06961be4b..a548536a03 100644 --- a/Resources/Prototypes/Stacks/power_stacks.yml +++ b/Resources/Prototypes/Stacks/power_stacks.yml @@ -3,15 +3,18 @@ name: lv cable icon: "/Textures/Objects/Tools/cable-coils.rsi/coil-30.png" spawn: CableApcStack1 + maxCount: 30 - type: stack id: CableMV name: mv cable icon: "/Textures/Objects/Tools/cable-coils.rsi/coilmv-30.png" spawn: CableMVStack1 + maxCount: 30 - type: stack id: CableHV name: hv cable icon: "/Textures/Objects/Tools/cable-coils.rsi/coilhv-30.png" spawn: CableHVStack1 + maxCount: 30