Refactoring of roles and notifications about antagonist assignment (#16864)

* 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>
This commit is contained in:
Vyacheslav Titov
2023-06-07 10:15:22 +03:00
committed by GitHub
parent f5d2b0e284
commit 2e241691aa
25 changed files with 187 additions and 87 deletions

View File

@@ -1,3 +1,5 @@
using Robust.Shared.Audio;
namespace Content.Server.GameTicking.Rules.Components;
/// <summary>
@@ -6,5 +8,9 @@ namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent]
public sealed class NukeOperativeComponent : Component
{
/// <summary>
/// Path to antagonist alert sound.
/// </summary>
[DataField("greetSoundNotification")]
public SoundSpecifier GreetSoundNotification = new SoundPathSpecifier("/Audio/Ambience/Antag/nukeops_start.ogg");
}

View File

@@ -79,9 +79,6 @@ public sealed class NukeopsRuleComponent : Component
[DataField("shuttleMap", customTypeSerializer: typeof(ResPathSerializer))]
public ResPath NukieShuttleMap = new("/Maps/infiltrator.yml");
[DataField("greetingSound", customTypeSerializer: typeof(SoundSpecifierTypeSerializer))]
public SoundSpecifier? GreetSound = new SoundPathSpecifier("/Audio/Misc/nukeops.ogg");
[DataField("winType")]
public WinType WinType = WinType.Neutral;

View File

@@ -1,4 +1,6 @@
namespace Content.Server.GameTicking.Rules.Components;
using Robust.Shared.Audio;
namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(PiratesRuleSystem))]
public sealed class PiratesRuleComponent : Component
@@ -12,4 +14,11 @@ public sealed class PiratesRuleComponent : Component
[ViewVariables]
public double InitialShipValue;
/// <summary>
/// Path to antagonist alert sound.
/// </summary>
[DataField("pirateAlertSound")]
public readonly SoundSpecifier PirateAlertSound = new SoundPathSpecifier(
"/Audio/Ambience/Antag/pirate_start.ogg",
AudioParams.Default.WithVolume(4));
}

View File

@@ -1,4 +1,4 @@
using Content.Server.Traitor;
using Content.Server.Roles;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Robust.Server.Player;
@@ -10,7 +10,6 @@ namespace Content.Server.GameTicking.Rules.Components;
[RegisterComponent, Access(typeof(TraitorRuleSystem))]
public sealed class TraitorRuleComponent : Component
{
public readonly SoundSpecifier AddedSound = new SoundPathSpecifier("/Audio/Misc/tatoralert.ogg");
public List<TraitorRole> Traitors = new();
[DataField("traitorPrototypeId", customTypeSerializer: typeof(PrototypeIdSerializer<AntagPrototype>))]
@@ -29,4 +28,10 @@ public sealed class TraitorRuleComponent : Component
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");
}