2024-09-27 10:22:17 +03:00
|
|
|
using Robust.Shared.GameStates;
|
2022-07-29 14:13:12 +12:00
|
|
|
using Robust.Shared.Audio;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
namespace Content.Shared.Electrocution;
|
2023-04-29 23:05:10 +03:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Component for things that shock users on touch.
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class ElectrifiedComponent : Component
|
2021-10-25 16:21:56 +02:00
|
|
|
{
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool Enabled = true;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should player get damage on collide
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool OnBump = true;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should player get damage on attack
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool OnAttacked = true;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// When true - disables power if a window is present in the same tile
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool NoWindowInTile = false;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should player get damage on interact with empty hand
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool OnHandInteract = true;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Should player get damage on interact while holding an object in their hand
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool OnInteractUsing = true;
|
2021-12-04 01:59:09 -08:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Indicates if the entity requires power to function
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool RequirePower = true;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Indicates if the entity uses APC power
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool UsesApcPower = false;
|
2022-04-15 14:21:11 -07:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Identifier for the high voltage node.
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public string? HighVoltageNode;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Identifier for the medium voltage node.
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public string? MediumVoltageNode;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-07-05 15:01:39 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Identifier for the low voltage node.
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public string? LowVoltageNode;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-03-28 16:44:44 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Damage multiplier for HV electrocution
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-03-28 16:44:44 -04:00
|
|
|
public float HighVoltageDamageMultiplier = 3f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shock time multiplier for HV electrocution
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-03-28 16:44:44 -04:00
|
|
|
public float HighVoltageTimeMultiplier = 1.5f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Damage multiplier for MV electrocution
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-03-28 16:44:44 -04:00
|
|
|
public float MediumVoltageDamageMultiplier = 2f;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Shock time multiplier for MV electrocution
|
|
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-03-28 16:44:44 -04:00
|
|
|
public float MediumVoltageTimeMultiplier = 1.25f;
|
|
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-03-28 16:44:44 -04:00
|
|
|
public float ShockDamage = 7.5f;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2023-04-29 23:05:10 +03:00
|
|
|
/// <summary>
|
2024-07-05 15:01:39 +02:00
|
|
|
/// Shock time, in seconds.
|
2023-04-29 23:05:10 +03:00
|
|
|
/// </summary>
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public float ShockTime = 8f;
|
2021-10-25 16:21:56 +02:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public float SiemensCoefficient = 1f;
|
2022-05-09 18:40:15 -07:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public SoundSpecifier ShockNoises = new SoundCollectionSpecifier("sparks");
|
2022-05-09 18:40:15 -07:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
public SoundPathSpecifier AirlockElectrifyDisabled = new("/Audio/Machines/airlock_electrify_on.ogg");
|
|
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
public SoundPathSpecifier AirlockElectrifyEnabled = new("/Audio/Machines/airlock_electrify_off.ogg");
|
|
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public bool PlaySoundOnShock = true;
|
2022-05-09 18:40:15 -07:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2023-04-29 23:05:10 +03:00
|
|
|
public float ShockVolume = 20;
|
2024-04-18 03:08:42 +03:00
|
|
|
|
2024-09-27 10:22:17 +03:00
|
|
|
[DataField, AutoNetworkedField]
|
2024-04-18 03:08:42 +03:00
|
|
|
public float Probability = 1f;
|
2024-09-27 10:22:17 +03:00
|
|
|
|
|
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
public bool IsWireCut = false;
|
2021-10-25 16:21:56 +02:00
|
|
|
}
|