Add OnDamaged method to IOnDamageBehavior (#685)
* Add OnDamaged method to IOnDamageBehavior * Adds Source, SourceMob to OnDamage.
This commit is contained in:
committed by
GitHub
parent
3292939756
commit
934f6fb7e2
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Content.Shared.GameObjects;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Server.GameObjects
|
||||
{
|
||||
@@ -60,5 +62,38 @@ namespace Content.Server.GameObjects
|
||||
ExcessDamage = excess;
|
||||
}
|
||||
}
|
||||
|
||||
public class DamageEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Type of damage.
|
||||
/// </summary>
|
||||
public DamageType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Change in damage.
|
||||
/// </summary>
|
||||
public int Damage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The entity that damaged this one.
|
||||
/// Could be null.
|
||||
/// </summary>
|
||||
public IEntity Source { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The mob entity that damaged this one.
|
||||
/// Could be null.
|
||||
/// </summary>
|
||||
public IEntity SourceMob { get; }
|
||||
|
||||
public DamageEventArgs(DamageType type, int damage, IEntity source, IEntity sourceMob)
|
||||
{
|
||||
Type = type;
|
||||
Damage = damage;
|
||||
Source = source;
|
||||
SourceMob = sourceMob;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user