using Content.Shared.Explosion.EntitySystems;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.GameStates;
namespace Content.Shared.Explosion.Components;
///
/// Component that provides entities with explosion resistance.
/// By default this is applied when worn, but to solely protect the entity itself and
/// not the wearer use worn: false.
///
///
/// This is desirable over just using damage modifier sets, given that equipment like bomb-suits need to
/// significantly reduce the damage, but shouldn't be silly overpowered in regular combat.
///
[NetworkedComponent, RegisterComponent]
[Access(typeof(SharedExplosionSystem))]
public sealed partial class ExplosionResistanceComponent : Component
{
///
/// The explosive resistance coefficient, This fraction is multiplied into the total resistance.
///
[DataField("damageCoefficient")]
public float DamageCoefficient = 1;
///
/// When true, resistances will be applied to the entity wearing this item.
/// When false, only this entity will get th resistance.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool Worn = true;
///
/// Examine string for explosion resistance.
/// Passed value from 0 to 100.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public LocId Examine = "explosion-resistance-coefficient-value";
///
/// Modifiers specific to each explosion type for more customizability.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("modifiers", customTypeSerializer: typeof(PrototypeIdDictionarySerializer))]
public Dictionary Modifiers = new();
}