Emaggable protolathe (#18456)

This commit is contained in:
ubis1
2023-08-07 17:21:04 +03:00
committed by GitHub
parent 1c476731ed
commit e203423665
5 changed files with 101 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Materials;
using Content.Shared.Emag.Systems;
using Content.Shared.Materials;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
using Robust.Shared.GameStates;
@@ -22,6 +23,7 @@ public abstract class SharedLatheSystem : EntitySystem
SubscribeLocalEvent<LatheComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<LatheComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<EmagLatheRecipesComponent, GotEmaggedEvent>(OnEmagged);
}
private void OnGetState(EntityUid uid, LatheComponent component, ref ComponentGetState args)
@@ -59,6 +61,11 @@ public abstract class SharedLatheSystem : EntitySystem
return true;
}
private void OnEmagged(EntityUid uid, EmagLatheRecipesComponent component, ref GotEmaggedEvent args)
{
args.Handled = true;
}
public static int AdjustMaterial(int original, bool reduce, float multiplier)
=> reduce ? (int) MathF.Ceiling(original * multiplier) : original;