mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
* add codersprite * add code for upgrade kits * add upgrade kits * add recipes for upgrade kits to industrial engineering * disable funny recipes * remove RE * fuck it make it a warning --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
32 lines
865 B
C#
32 lines
865 B
C#
using Content.Shared.Lathe;
|
|
|
|
namespace Content.Shared._DV.Lathe;
|
|
|
|
/// <summary>
|
|
/// Applies <see cref="LatheUpgradeComponent"/> modifiers when added to a lathe and removes it.
|
|
/// </summary>
|
|
public sealed class LatheUpgradeSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<LatheUpgradeComponent, MapInitEvent>(OnMapInit);
|
|
}
|
|
|
|
private void OnMapInit(Entity<LatheUpgradeComponent> ent, ref MapInitEvent args)
|
|
{
|
|
RemCompDeferred<LatheUpgradeComponent>(ent);
|
|
|
|
if (!TryComp<LatheComponent>(ent, out var lathe))
|
|
return;
|
|
|
|
if (ent.Comp.MaterialUseMultiplier is {} matMul)
|
|
lathe.MaterialUseMultiplier = matMul;
|
|
if (ent.Comp.TimeMultiplier is {} timeMul)
|
|
lathe.TimeMultiplier = timeMul;
|
|
|
|
Dirty(ent, lathe);
|
|
}
|
|
}
|