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:
24
Content.Server/Roles/AntagonistRole.cs
Normal file
24
Content.Server/Roles/AntagonistRole.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Roles;
|
||||
|
||||
public abstract class AntagonistRole : Role
|
||||
{
|
||||
public AntagPrototype Prototype { get; }
|
||||
|
||||
public override string Name { get; }
|
||||
|
||||
public override bool Antagonist { get; }
|
||||
|
||||
/// <summary>
|
||||
/// .ctor
|
||||
/// </summary>
|
||||
/// <param name="mind">A mind (player)</param>
|
||||
/// <param name="antagPrototype">Antagonist prototype</param>
|
||||
protected AntagonistRole(Mind.Mind mind, AntagPrototype antagPrototype) : base(mind)
|
||||
{
|
||||
Prototype = antagPrototype;
|
||||
Name = Loc.GetString(antagPrototype.Name);
|
||||
Antagonist = antagPrototype.Antagonist;
|
||||
}
|
||||
}
|
||||
8
Content.Server/Roles/NukeopsRole.cs
Normal file
8
Content.Server/Roles/NukeopsRole.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Roles;
|
||||
|
||||
public sealed class NukeopsRole : AntagonistRole
|
||||
{
|
||||
public NukeopsRole(Mind.Mind mind, AntagPrototype antagPrototype) : base(mind, antagPrototype) { }
|
||||
}
|
||||
10
Content.Server/Roles/TraitorRole.cs
Normal file
10
Content.Server/Roles/TraitorRole.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Content.Server.Chat.Managers;
|
||||
using Content.Shared.PDA;
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Roles;
|
||||
|
||||
public sealed class TraitorRole : AntagonistRole
|
||||
{
|
||||
public TraitorRole(Mind.Mind mind, AntagPrototype antagPrototype) : base(mind, antagPrototype) { }
|
||||
}
|
||||
8
Content.Server/Roles/ZombieRole.cs
Normal file
8
Content.Server/Roles/ZombieRole.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Content.Shared.Roles;
|
||||
|
||||
namespace Content.Server.Roles;
|
||||
|
||||
public sealed class ZombieRole : AntagonistRole
|
||||
{
|
||||
public ZombieRole(Mind.Mind mind, AntagPrototype antagPrototype) : base(mind, antagPrototype) { }
|
||||
}
|
||||
Reference in New Issue
Block a user