Major Tesla tweaks (#23235)

* add ignore chance

* twekas

* add damaging and repairing

* grounding rod undestructable by tesla
This commit is contained in:
Ed
2024-01-01 10:33:48 +03:00
committed by GitHub
parent 2b01899d63
commit 5e1fcfc63e
14 changed files with 135 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
using Content.Server.Tesla.EntitySystems;
using Content.Shared.Explosion;
using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes;
namespace Content.Server.Lightning.Components;
@@ -11,6 +12,12 @@ namespace Content.Server.Lightning.Components;
[RegisterComponent, Access(typeof(LightningSystem), typeof(LightningTargetSystem))]
public sealed partial class LightningTargetComponent : Component
{
/// <summary>
/// The probability that this target will not be ignored by a lightning strike. This is necessary for Tesla's balance.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float HitProbability = 1f;
/// <summary>
/// Priority level for selecting a lightning target.
/// </summary>
@@ -56,4 +63,10 @@ public sealed partial class LightningTargetComponent : Component
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MaxTileIntensity = 5f;
/// <summary>
/// how much structural damage the object takes from a lightning strike
/// </summary>
[DataField]
public FixedPoint2 DamageFromLightning = 1;
}