Use Delay Component (#540)

* use delay timer

* remove accidental using

* and remove accidental newline because i don't proofread my code

* compatibility with HUD cooldown
suggested changes

* get out of here

* suggested changes

* change to seconds from milliseconds

* remove redundancy
This commit is contained in:
L.E.D
2020-01-22 17:08:14 -05:00
committed by Pieter-Jan Briers
parent 2260d19364
commit 8f04ce894f
3 changed files with 91 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
using System;
using System.Linq;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Timing;
using Content.Server.Interfaces.GameObjects;
using Content.Shared.Input;
using JetBrains.Annotations;
@@ -560,6 +561,12 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
public void UseInteraction(IEntity user, IEntity used)
{
if (used.TryGetComponent<UseDelayComponent>(out var delayComponent))
{
delayComponent.BeginDelay();
}
var useMsg = new UseInHandMessage(user, used);
RaiseEvent(useMsg);
if (useMsg.Handled)