This commit is contained in:
Clyybber
2020-05-23 17:23:25 +02:00
committed by GitHub
parent 05b910d9db
commit 1ad9a10050
40 changed files with 200 additions and 199 deletions

View File

@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Research
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
public class LatheComponent : SharedLatheComponent, IAttackBy, IActivate
public class LatheComponent : SharedLatheComponent, IInteractUsing, IActivate
{
public const int VolumePerSheet = 3750;
@@ -154,14 +154,14 @@ namespace Content.Server.GameObjects.Components.Research
OpenUserInterface(actor.playerSession);
}
bool IAttackBy.AttackBy(AttackByEventArgs eventArgs)
bool IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
{
if (!Owner.TryGetComponent(out MaterialStorageComponent storage)
|| !eventArgs.AttackWith.TryGetComponent(out MaterialComponent material)) return false;
|| !eventArgs.Using.TryGetComponent(out MaterialComponent material)) return false;
var multiplier = 1;
if (eventArgs.AttackWith.TryGetComponent(out StackComponent stack)) multiplier = stack.Count;
if (eventArgs.Using.TryGetComponent(out StackComponent stack)) multiplier = stack.Count;
var totalAmount = 0;
@@ -198,7 +198,7 @@ namespace Content.Server.GameObjects.Components.Research
SetAppearance(LatheVisualState.Idle);
});
eventArgs.AttackWith.Delete();
eventArgs.Using.Delete();
return false;
}