2019-11-13 17:37:46 -05:00
|
|
|
|
using System;
|
|
|
|
|
|
using Content.Server.GameObjects;
|
2018-12-13 07:47:19 -06:00
|
|
|
|
using Content.Shared.GameObjects;
|
2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
2017-10-07 15:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Interfaces.GameObjects
|
|
|
|
|
|
{
|
|
|
|
|
|
public interface IDamageableComponent : IComponent
|
|
|
|
|
|
{
|
|
|
|
|
|
event EventHandler<DamageThresholdPassedEventArgs> DamageThresholdPassed;
|
|
|
|
|
|
ResistanceSet Resistances { get; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The function that handles receiving damage.
|
|
|
|
|
|
/// Converts damage via the resistance set then applies it
|
|
|
|
|
|
/// and informs components of thresholds passed as necessary.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="damageType">Type of damage being received.</param>
|
|
|
|
|
|
/// <param name="amount">Amount of damage being received.</param>
|
2020-02-13 15:57:40 +01:00
|
|
|
|
/// <param name="source">Entity that damaged this entity.</param>
|
|
|
|
|
|
/// <param name="sourceMob">Mob that damaged this entity.</param>
|
|
|
|
|
|
void TakeDamage(DamageType damageType, int amount, IEntity source, IEntity sourceMob);
|
2017-10-07 15:15:29 +02:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Handles receiving healing.
|
|
|
|
|
|
/// Converts healing via the resistance set then applies it
|
|
|
|
|
|
/// and informs components of thresholds passed as necessary.
|
|
|
|
|
|
/// </summary>
|
2020-02-13 15:57:40 +01:00
|
|
|
|
/// <param name="damageType">Type of healing being received.</param>
|
|
|
|
|
|
/// <param name="amount">Amount of healing being received.</param>
|
|
|
|
|
|
/// <param name="source">Entity that healed this entity.</param>
|
|
|
|
|
|
/// <param name="sourceMob">Mob that healed this entity.</param>
|
|
|
|
|
|
void TakeHealing(DamageType damageType, int amount, IEntity source, IEntity sourceMob);
|
2017-10-07 15:15:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|