Makes electrocution damage based on the voltage of the wire and bring down the damage to a sane level. It's no longer primarily based on the power being received. LV Cable -> 10 damage MV Cable -> 20 damage HV Cable -> 30 damage Having a primarily power-based damage system causes there to be massive fluctuations in damage based on things outside of a regular player's control, like the station power output. This removes a lot of player agency and turns grilles into a risky gamble where they can either do no damage or instantly fry the player due to simply being hooked up to the engine. While this may be a more accurate simulation in some regards, the reality of the gameplay is that it's often just frustrating, resulting in constant death traps as players brushing against electrified grilles and punching wires take absurd amounts of damage. By making them flat rates, it's possible to actually balance the damage output.
89 lines
2.1 KiB
C#
89 lines
2.1 KiB
C#
using Robust.Shared.Audio;
|
|
|
|
namespace Content.Server.Electrocution;
|
|
|
|
/// <summary>
|
|
/// Component for things that shock users on touch.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
public sealed partial class ElectrifiedComponent : Component
|
|
{
|
|
[DataField("enabled")]
|
|
public bool Enabled = true;
|
|
|
|
[DataField("onBump")]
|
|
public bool OnBump = true;
|
|
|
|
[DataField("onAttacked")]
|
|
public bool OnAttacked = true;
|
|
|
|
[DataField("noWindowInTile")]
|
|
public bool NoWindowInTile = false;
|
|
|
|
[DataField("onHandInteract")]
|
|
public bool OnHandInteract = true;
|
|
|
|
[DataField("onInteractUsing")]
|
|
public bool OnInteractUsing = true;
|
|
|
|
[DataField("requirePower")]
|
|
public bool RequirePower = true;
|
|
|
|
[DataField("usesApcPower")]
|
|
public bool UsesApcPower = false;
|
|
|
|
[DataField("highVoltageNode")]
|
|
public string? HighVoltageNode;
|
|
|
|
[DataField("mediumVoltageNode")]
|
|
public string? MediumVoltageNode;
|
|
|
|
[DataField("lowVoltageNode")]
|
|
public string? LowVoltageNode;
|
|
|
|
/// <summary>
|
|
/// Damage multiplier for HV electrocution
|
|
/// </summary>
|
|
[DataField]
|
|
public float HighVoltageDamageMultiplier = 3f;
|
|
|
|
/// <summary>
|
|
/// Shock time multiplier for HV electrocution
|
|
/// </summary>
|
|
[DataField]
|
|
public float HighVoltageTimeMultiplier = 1.5f;
|
|
|
|
/// <summary>
|
|
/// Damage multiplier for MV electrocution
|
|
/// </summary>
|
|
[DataField]
|
|
public float MediumVoltageDamageMultiplier = 2f;
|
|
|
|
/// <summary>
|
|
/// Shock time multiplier for MV electrocution
|
|
/// </summary>
|
|
[DataField]
|
|
public float MediumVoltageTimeMultiplier = 1.25f;
|
|
|
|
[DataField("shockDamage")]
|
|
public float ShockDamage = 7.5f;
|
|
|
|
/// <summary>
|
|
/// Shock time, in seconds.
|
|
/// </summary>
|
|
[DataField("shockTime")]
|
|
public float ShockTime = 8f;
|
|
|
|
[DataField("siemensCoefficient")]
|
|
public float SiemensCoefficient = 1f;
|
|
|
|
[DataField("shockNoises")]
|
|
public SoundSpecifier ShockNoises = new SoundCollectionSpecifier("sparks");
|
|
|
|
[DataField("playSoundOnShock")]
|
|
public bool PlaySoundOnShock = true;
|
|
|
|
[DataField("shockVolume")]
|
|
public float ShockVolume = 20;
|
|
}
|