#nullable enable using System.Collections.Generic; using Content.Shared.Damage; using Content.Shared.GameObjects.EntitySystems; using Robust.Shared.GameObjects; namespace Content.Shared.GameObjects.Components.Damage { public interface IDamageableComponent : IComponent, IExAct { /// /// Sum of all damages taken. /// int TotalDamage { get; } /// /// Enables Godmode when set to true. /// bool Godmode { get; set; } /// /// The amount of damage mapped by . /// IReadOnlyDictionary DamageClasses { get; } /// /// The amount of damage mapped by . /// IReadOnlyDictionary DamageTypes { get; } /// /// Get a specific DamageType Prototype via an ID. /// /// DamageTypePrototype GetDamageType(string ID); bool SupportsDamageClass(DamageGroupPrototype damageGroup); bool SupportsDamageType(DamageTypePrototype type); /// /// Gets the amount of damage of a type. /// /// The type to get the damage of. /// The amount of damage of that type. /// /// True if the given is supported, false otherwise. /// bool TryGetDamage(DamageTypePrototype type, out int damage); /// /// Gets the amount of damage of a class. /// /// The class to get the damage of. /// The amount of damage of that class. /// /// True if the given is supported, false otherwise. /// bool TryGetDamage(DamageGroupPrototype damageGroup, out int damage); /// /// Changes the specified , applying /// resistance values only if it is damage. /// /// Type of damage being changed. /// /// Amount of damage being received (positive for damage, negative for heals). /// /// /// Whether or not to ignore resistances. /// Healing always ignores resistances, regardless of this input. /// /// /// The entity that dealt or healed the damage, if any. /// /// /// Extra parameters that some components may require, such as a specific limb to target. /// /// /// False if the given type is not supported or improper /// were provided; true otherwise. /// bool ChangeDamage( DamageTypePrototype type, int amount, bool ignoreResistances, IEntity? source = null, DamageChangeParams? extraParams = null); /// /// Changes the specified , applying /// resistance values only if it is damage. /// Spreads amount evenly between the s /// represented by that class. /// /// Class of damage being changed. /// /// Amount of damage being received (positive for damage, negative for heals). /// /// /// Whether to ignore resistances. /// Healing always ignores resistances, regardless of this input. /// /// Entity that dealt or healed the damage, if any. /// /// Extra parameters that some components may require, /// such as a specific limb to target. /// /// /// Returns false if the given class is not supported or improper /// were provided; true otherwise. /// bool ChangeDamage( DamageGroupPrototype damageGroup, int amount, bool ignoreResistances, IEntity? source = null, DamageChangeParams? extraParams = null); /// /// Forcefully sets the specified to the given /// value, ignoring resistance values. /// /// Type of damage being changed. /// New damage value to be set. /// Entity that set the new damage value. /// /// Extra parameters that some components may require, /// such as a specific limb to target. /// /// /// Returns false if the given type is not supported or improper /// were provided; true otherwise. /// bool SetDamage( DamageTypePrototype type, int newValue, IEntity? source = null, DamageChangeParams? extraParams = null); /// /// Sets all damage values to zero. /// void Heal(); /// /// Invokes the HealthChangedEvent with the current values of health. /// void ForceHealthChangedEvent(); } }