using Content.Shared.Armor;
using Content.Shared.Explosion.Components;
namespace Content.Shared.Explosion.EntitySystems;
///
/// Lets code in shared trigger explosions and handles explosion resistance examining.
/// All processing is still done clientside.
///
public abstract class SharedExplosionSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(OnArmorExamine);
}
private void OnArmorExamine(Entity ent, ref ArmorExamineEvent args)
{
var value = MathF.Round((1f - ent.Comp.DamageCoefficient) * 100, 1);
if (value == 0)
return;
args.Msg.PushNewline();
args.Msg.AddMarkupOrThrow(Loc.GetString(ent.Comp.Examine, ("value", value)));
}
///
/// Given an entity with an explosive component, spawn the appropriate explosion.
///
///
/// Also accepts radius or intensity arguments. This is useful for explosives where the intensity is not
/// specified in the yaml / by the component, but determined dynamically (e.g., by the quantity of a
/// solution in a reaction).
///
public virtual void TriggerExplosive(EntityUid uid, ExplosiveComponent? explosive = null, bool delete = true, float? totalIntensity = null, float? radius = null, EntityUid? user = null)
{
}
}