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

@@ -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.
/// </summary>
[ViewVariables]
public uint CurrentExpectedYield = default;
public int CurrentExpectedYield = default;
/// <summary>
/// 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;
/// <summary>
/// The entity that is output by the reclaimer
/// </summary>
[DataField("outputEntityId", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string OutputEntityId = "MaterialBiomass";
/// <summary>
/// The base yield per mass unit when no components are upgraded.
/// </summary>

View File

@@ -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);
}