using Content.Shared.Random;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Communications;
///
/// Component for hacking a communications console to call in a threat.
/// Can only be done once, the component is remove afterwards.
///
[RegisterComponent, NetworkedComponent, Access(typeof(SharedCommsHackerSystem))]
public sealed partial class CommsHackerComponent : Component
{
///
/// Time taken to hack the console
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan Delay = TimeSpan.FromSeconds(20);
///
/// Weighted random for the possible threats to choose from.
///
[DataField(required: true)]
public ProtoId Threats = string.Empty;
}
///
/// A threat that can be called in to the station by a ninja hacking a communications console.
/// Generally some kind of mid-round minor antag, though you could make it call in scrubber backflow if you wanted to.
/// You wouldn't do that, right?
///
[Prototype("ninjaHackingThreat")]
public sealed class NinjaHackingThreatPrototype : IPrototype
{
[IdDataField]
public string ID { get; private set; } = default!;
///
/// Locale id for the announcement to be made from CentCom.
///
[DataField(required: true)]
public LocId Announcement;
///
/// The game rule for the threat to be added, it should be able to work when added mid-round otherwise this will do nothing.
///
[DataField(required: true)]
public EntProtoId Rule;
}