make lube speed up lathes (#25515)

* add LatheGetSpeedEvent

* add LatheLube system

* make typical lathes accept lube

* spill

* :trollface:

* rework to generic ReagentSpeedSystem

* hyperlathe ops

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2024-05-07 18:20:43 +00:00
committed by GitHub
parent 6301e94390
commit 262b9698cf
4 changed files with 116 additions and 18 deletions

View File

@@ -14,6 +14,7 @@ using Content.Shared.Database;
using Content.Shared.Emag.Components;
using Content.Shared.Lathe;
using Content.Shared.Materials;
using Content.Shared.ReagentSpeed;
using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
@@ -35,6 +36,7 @@ namespace Content.Server.Lathe
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UserInterfaceSystem _uiSys = default!;
[Dependency] private readonly MaterialStorageSystem _materialStorage = default!;
[Dependency] private readonly ReagentSpeedSystem _reagentSpeed = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly TransformSystem _transform = default!;
@@ -186,9 +188,11 @@ namespace Content.Server.Lathe
var recipe = component.Queue.First();
component.Queue.RemoveAt(0);
var time = _reagentSpeed.ApplySpeed(uid, recipe.CompleteTime);
var lathe = EnsureComp<LatheProducingComponent>(uid);
lathe.StartTime = _timing.CurTime;
lathe.ProductionLength = recipe.CompleteTime * component.TimeMultiplier;
lathe.ProductionLength = time * component.TimeMultiplier;
component.CurrentRecipe = recipe;
var ev = new LatheStartPrintingEvent(recipe);