Adds disarm action (#2950)
* Adds disarming * Disarm acts * yaml * much better icon for disarm * Apply Remie's suggestions, improve code!
This commit is contained in:
committed by
GitHub
parent
1fe25049a3
commit
d81a5faac4
42
Content.Server/Interfaces/GameObjects/IDisarmedAct.cs
Normal file
42
Content.Server/Interfaces/GameObjects/IDisarmedAct.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.Interfaces.GameObjects
|
||||
{
|
||||
/// <summary>
|
||||
/// Implements behavior when an entity is disarmed.
|
||||
/// </summary>
|
||||
public interface IDisarmedAct
|
||||
{
|
||||
/// <summary>
|
||||
/// Behavior when the entity is disarmed.
|
||||
/// Return true to prevent the default disarm behavior,
|
||||
/// or rest of IDisarmAct behaviors that come after this one from happening.
|
||||
/// </summary>
|
||||
bool Disarmed(DisarmedActEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// Priority for this disarm act.
|
||||
/// Used to determine act execution order.
|
||||
/// </summary>
|
||||
int Priority => 0;
|
||||
}
|
||||
|
||||
public class DisarmedActEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// The entity being disarmed.
|
||||
/// </summary>
|
||||
public IEntity Target { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The entity performing the disarm.
|
||||
/// </summary>
|
||||
public IEntity Source { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Probability for push/knockdown.
|
||||
/// </summary>
|
||||
public float PushProbability { get; init; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user