CatStation/Content.Shared/Radio/Components/RadioJammerComponent.cs
phönix da8bf6df00
Predict intercom examine. (#43107)
* radiosystem is funny

* review

Co-authored-by: slarticodefast <slarticodefast@users.noreply.github.com>
Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>

* dont forget your tests

* dont forget your loc

* networking

Co-authored-by: Tayrtahn <Tayrtahn@users.noreply.github.com>

* dont return because its breaks

* uh

* review

Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>

* more predictions and cleanup

* refactor: just me, being picky about whitespaces and commetns formatting

---------

Co-authored-by: slarticodefast <slarticodefast@users.noreply.github.com>
Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
Co-authored-by: Tayrtahn <Tayrtahn@users.noreply.github.com>
Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
Co-authored-by: Fildrance <fildrance@gmail.com>
2026-08-10 07:59:08 +00:00

83 lines
2 KiB
C#

using Content.Shared.FixedPoint;
using Robust.Shared.Serialization;
using Robust.Shared.GameStates;
namespace Content.Shared.Radio.Components;
/// <summary>
/// When activated (<see cref="ActiveRadioJammerComponent"/>) prevents from sending messages in range
/// Suit sensors will also stop working.
/// </summary>
[NetworkedComponent, RegisterComponent]
[AutoGenerateComponentState]
public sealed partial class RadioJammerComponent : Component
{
[DataDefinition]
public partial struct RadioJamSetting
{
/// <summary>
/// Power usage per second when enabled.
/// </summary>
[DataField(required: true)]
public float Wattage;
/// <summary>
/// Range of the jammer.
/// </summary>
[DataField(required: true)]
public float Range;
/// <summary>
/// The message that is displayed when switched.
/// to this setting.
/// </summary>
[DataField(required: true)]
public LocId Message = string.Empty;
/// <summary>
/// Name of the setting.
/// </summary>
[DataField(required: true)]
public LocId Name = string.Empty;
}
/// <summary>
/// List of all the settings for the radio jammer.
/// </summary>
[DataField(required: true), ViewVariables(VVAccess.ReadOnly)]
public RadioJamSetting[] Settings;
/// <summary>
/// Frequencies that are NOT jammed by this jammer.
/// </summary>
[DataField]
public HashSet<FixedPoint2> FrequenciesExcluded = [];
/// <summary>
/// Index of the currently selected setting.
/// </summary>
[DataField]
[AutoNetworkedField]
public int SelectedPowerLevel = 1;
}
[Serializable, NetSerializable]
public enum RadioJammerChargeLevel : byte
{
Low,
Medium,
High
}
[Serializable, NetSerializable]
public enum RadioJammerLayers : byte
{
LED
}
[Serializable, NetSerializable]
public enum RadioJammerVisuals : byte
{
ChargeLevel,
LEDOn
}