using Content.Server.Tesla.EntitySystems;
using Content.Shared.Explosion;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
namespace Content.Server.Lightning.Components;
///
/// This component allows the lightning system to select a given entity as the target of a lightning strike.
/// It also determines the priority of selecting this target, and the behavior of the explosion. Used for tesla.
///
[RegisterComponent, Access(typeof(LightningSystem), typeof(LightningTargetSystem))]
public sealed partial class LightningTargetComponent : Component
{
///
/// The probability that this target will not be ignored by a lightning strike. This is necessary for Tesla's balance.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float HitProbability = 1f;
///
/// Priority level for selecting a lightning target.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int Priority;
///
/// Lightning has a number of bounces into neighboring targets.
/// This number controls how many bounces the lightning bolt has left after hitting that target.
/// At high values, the lightning will not travel farther than that entity.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public int LightningResistance = 1; //by default, reduces the number of bounces from this target by 1
// BOOM PART
///
/// Will the entity explode after being struck by lightning?
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool LightningExplode = true;
///
/// The explosion prototype to spawn
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public ProtoId ExplosionPrototype = "Default";
///
/// The total amount of intensity an explosion can achieve
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float TotalIntensity = 25f;
///
/// How quickly does the explosion's power slope? Higher = smaller area and more concentrated damage, lower = larger area and more spread out damage
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float Dropoff = 2f;
///
/// How much intensity can be applied per tile?
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxTileIntensity = 5f;
///
/// how much structural damage the object takes from a lightning strike
///
[DataField]
public FixedPoint2 DamageFromLightning = 1;
}