Rip out remaining machine upgrades (#24413)
* Rip out remaining machine upgrades * eek
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using Content.Server.Nutrition.EntitySystems;
|
||||
using Content.Shared.Construction.Prototypes;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Prototypes;
|
||||
@@ -26,26 +25,6 @@ public sealed partial class FatExtractorComponent : Component
|
||||
[DataField("nutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int NutritionPerSecond = 10;
|
||||
|
||||
/// <summary>
|
||||
/// The base rate of extraction
|
||||
/// </summary>
|
||||
[DataField("baseNutritionPerSecond"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int BaseNutritionPerSecond = 10;
|
||||
|
||||
#region Machine Upgrade
|
||||
/// <summary>
|
||||
/// Which machine part affects the nutrition rate
|
||||
/// </summary>
|
||||
[DataField("machinePartNutritionRate", customTypeSerializer: typeof(PrototypeIdSerializer<MachinePartPrototype>))]
|
||||
public string MachinePartNutritionRate = "Manipulator";
|
||||
|
||||
/// <summary>
|
||||
/// The increase in rate per each rating above 1.
|
||||
/// </summary>
|
||||
[DataField("partRatingRateMultiplier")]
|
||||
public float PartRatingRateMultiplier = 10;
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// An accumulator which tracks extracted nutrition to determine
|
||||
/// when to spawn a meat.
|
||||
@@ -57,7 +36,7 @@ public sealed partial class FatExtractorComponent : Component
|
||||
/// How high <see cref="NutrientAccumulator"/> has to be to spawn meat
|
||||
/// </summary>
|
||||
[DataField("nutrientPerMeat"), ViewVariables(VVAccess.ReadWrite)]
|
||||
public int NutrientPerMeat = 60;
|
||||
public int NutrientPerMeat = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Meat spawned by the extractor.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.Nutrition.Components;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
@@ -10,7 +9,6 @@ using Content.Shared.Emag.Systems;
|
||||
using Content.Shared.Nutrition.Components;
|
||||
using Content.Shared.Nutrition.EntitySystems;
|
||||
using Content.Shared.Storage.Components;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -29,8 +27,6 @@ public sealed class FatExtractorSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<FatExtractorComponent, RefreshPartsEvent>(OnRefreshParts);
|
||||
SubscribeLocalEvent<FatExtractorComponent, UpgradeExamineEvent>(OnUpgradeExamine);
|
||||
SubscribeLocalEvent<FatExtractorComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged);
|
||||
SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed);
|
||||
@@ -38,17 +34,6 @@ public sealed class FatExtractorSystem : EntitySystem
|
||||
SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
}
|
||||
|
||||
private void OnRefreshParts(EntityUid uid, FatExtractorComponent component, RefreshPartsEvent args)
|
||||
{
|
||||
var rating = args.PartRatings[component.MachinePartNutritionRate] - 1;
|
||||
component.NutritionPerSecond = component.BaseNutritionPerSecond + (int) (component.PartRatingRateMultiplier * rating);
|
||||
}
|
||||
|
||||
private void OnUpgradeExamine(EntityUid uid, FatExtractorComponent component, UpgradeExamineEvent args)
|
||||
{
|
||||
args.AddPercentageUpgrade("fat-extractor-component-rate", (float) component.NutritionPerSecond / component.BaseNutritionPerSecond);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, FatExtractorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdate += args.PausedTime;
|
||||
|
||||
Reference in New Issue
Block a user