Convert suicide to ecs (#8091)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
39
Content.Shared/Interaction/Events/SuicideEvent.cs
Normal file
39
Content.Shared/Interaction/Events/SuicideEvent.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
namespace Content.Shared.Interaction.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Raised Directed at an entity to check whether they will handle the suicide.
|
||||
/// </summary>
|
||||
public sealed class SuicideEvent : EntityEventArgs
|
||||
{
|
||||
public SuicideEvent(EntityUid victim)
|
||||
{
|
||||
Victim = victim;
|
||||
}
|
||||
public void SetHandled(SuicideKind kind)
|
||||
{
|
||||
if (Handled) throw new InvalidOperationException("Suicide was already handled");
|
||||
Kind = kind;
|
||||
}
|
||||
|
||||
public SuicideKind? Kind { get; private set; }
|
||||
public EntityUid Victim { get; private set; }
|
||||
public bool Handled => Kind != null;
|
||||
}
|
||||
|
||||
public enum SuicideKind
|
||||
{
|
||||
Special, //Doesn't damage the mob, used for "weird" suicides like gibbing
|
||||
|
||||
//Damage type suicides
|
||||
Blunt,
|
||||
Slash,
|
||||
Piercing,
|
||||
Heat,
|
||||
Shock,
|
||||
Cold,
|
||||
Poison,
|
||||
Radiation,
|
||||
Asphyxiation,
|
||||
Bloodloss
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user