* Refactoring of antagonist roles and notifications about antagonist role assignment. Refactoring of traitor assignment methods and bug fixing. * Announcement files moved, code is adjusted to new revision * Play to entity changed to play to global cause of mono audio restrictions. * Path to audio files changed to sound specifiers, unique alerts for each role. * Uncommited changes * New alert sounds for each antag role. * PR review fixes * Antagonist role assignment sound notifications moved to Systems, sounds moved to Components. * License update * Fixed naming and redundant parameters --------- Co-authored-by: Титов Вячеслав Витальевич <rincew1nd@yandex.ru>
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using Content.Server.Roles;
|
|
using Content.Shared.Preferences;
|
|
using Content.Shared.Roles;
|
|
using Robust.Server.Player;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Server.GameTicking.Rules.Components;
|
|
|
|
[RegisterComponent, Access(typeof(TraitorRuleSystem))]
|
|
public sealed class TraitorRuleComponent : Component
|
|
{
|
|
public List<TraitorRole> Traitors = new();
|
|
|
|
[DataField("traitorPrototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
|
|
public string TraitorPrototypeId = "Traitor";
|
|
|
|
public int TotalTraitors => Traitors.Count;
|
|
public string[] Codewords = new string[3];
|
|
|
|
public enum SelectionState
|
|
{
|
|
WaitingForSpawn = 0,
|
|
ReadyToSelect = 1,
|
|
SelectionMade = 2,
|
|
}
|
|
|
|
public SelectionState SelectionStatus = SelectionState.WaitingForSpawn;
|
|
public TimeSpan AnnounceAt = TimeSpan.Zero;
|
|
public Dictionary<IPlayerSession, HumanoidCharacterProfile> StartCandidates = new();
|
|
|
|
/// <summary>
|
|
/// Path to antagonist alert sound.
|
|
/// </summary>
|
|
[DataField("greetSoundNotification")]
|
|
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/traitor_start.ogg");
|
|
}
|