Anchorable attempt events now have an optional extra delay field.
This commit is contained in:
@@ -58,7 +58,7 @@ namespace Content.Server.GameObjects.Components
|
|||||||
if (attempt.Cancelled)
|
if (attempt.Cancelled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return utilizing.TryGetComponent(out ToolComponent? tool) && await tool.UseTool(user, Owner, 0.5f, Tool);
|
return utilizing.TryGetComponent(out ToolComponent? tool) && await tool.UseTool(user, Owner, 0.5f + attempt.Delay, Tool);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -154,6 +154,13 @@ namespace Content.Server.GameObjects.Components
|
|||||||
public IEntity User { get; }
|
public IEntity User { get; }
|
||||||
public IEntity Tool { get; }
|
public IEntity Tool { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Extra delay to add to the do_after.
|
||||||
|
/// Add to this, don't replace it.
|
||||||
|
/// Output parameter.
|
||||||
|
/// </summary>
|
||||||
|
public float Delay { get; set; } = 0f;
|
||||||
|
|
||||||
protected BaseAnchoredAttemptEvent(IEntity user, IEntity tool)
|
protected BaseAnchoredAttemptEvent(IEntity user, IEntity tool)
|
||||||
{
|
{
|
||||||
User = user;
|
User = user;
|
||||||
|
|||||||
Reference in New Issue
Block a user